From 536bb36ef10f8567da2ca2ea6c581f7f2ac941bd Mon Sep 17 00:00:00 2001 From: julianam-w <77252335+julianam-w@users.noreply.github.com> Date: Thu, 25 Jun 2026 16:13:35 +1000 Subject: [PATCH 1/7] refactor(reports): flatten admin reports into standard, standardise names, require root-level name (2.50.11) Brings report structure and naming in line with the convention adopted on 2.45/2.49/2.54 and makes a root-level `name` mandatory. Flatten admin -> standard (config + sql): - move all 14 models/reports/{config,sql}/admin/admin-* reports into standard/, dropping the `admin-` prefix - drop the now-unused reports `admin` tag block from dbt_project.yml (the datasets `admin` tag block is unaffected) Renames (config + sql, standard + sensitive): - (admin) audit-patient-details-edits-line-list -> audit-patient-details-edit - (admin) audit-patient-views-line-list -> audit-patient-views - audit-outpatient-appointments-line-list -> audit-outpatient-appointments - user-audit-report -> user-audit-line-list Report names: - add missing root-level `name` (deceased-patients-line-list, incomplete-referrals, registered-patients-by-dob-line-list, audit-outpatient-appointments) - normalise display names (sentence case; drop "Current"/"report"; "Registered birth" -> "Registered births"); sensitive = "Sensitive " Schema/docs: - report-config-schema.json: root `name` now required (minLength 1); queryOptions.name marked deprecated - tamanu-report-configuration-schema.md: document required root `name`, add Recommended Field Ordering, flag nested name as legacy, fix example - validate_report_configs.py: recurse into standard/sensitive subfolders (rglob) so configs are actually validated Version/deps: - bump 2.50.10 -> 2.50.11 (dbt_project.yml, pyproject.toml) - dbt_utils 1.3.3 -> 1.4.0 list_tamanu_reports.md regenerated; all 58 report configs validate. Compiled assets (compiled/v2.50.11) to be regenerated via the release build. Co-Authored-By: Claude Opus 4.8 (1M context) --- dbt_project.yml | 5 +- .../tamanu-report-configuration-schema.md | 36 ++- list_tamanu_reports.md | 302 +++++++++--------- ...sitive-audit-outpatient-appointments.json} | 2 +- .../sensitive-encounter-diets-line-list.json | 2 +- ...on => sensitive-user-audit-line-list.json} | 0 ...son => audit-outpatient-appointments.json} | 1 + .../audit-patient-details-edit.json} | 2 +- .../audit-patient-views.json} | 2 +- .../deceased-patients-line-list.json} | 1 + .../standard/encounter-diets-line-list.json | 2 +- .../config/standard/incomplete-referrals.json | 1 + .../invoice-products-summary.json} | 0 .../medication-dispensed-summary.json | 2 +- .../ongoing-conditions-line-list.json} | 0 .../program-registry-line-list.json} | 0 ...-registry-removed-patients-line-list.json} | 0 .../registered-births-line-list.json} | 2 +- ...registered-patients-by-dob-line-list.json} | 1 + .../registered-patients-daily-summary.json} | 0 .../registered-patients-line-list.json} | 0 .../upcoming-vaccinations-line-list.json} | 0 ...sage-quality-metrics-patient-details.json} | 0 ...uality-metrics-patient-registrations.json} | 0 ...-report.json => user-audit-line-list.json} | 0 ...nsitive-audit-outpatient-appointments.sql} | 0 ...sql => sensitive-user-audit-line-list.sql} | 0 ....sql => audit-outpatient-appointments.sql} | 0 .../audit-patient-details-edit.sql} | 0 .../audit-patient-views.sql} | 0 .../deceased-patients-line-list.sql} | 0 .../invoice-products-summary.sql} | 0 .../ongoing-conditions-line-list.sql} | 0 .../program-registry-line-list.sql} | 0 ...m-registry-removed-patients-line-list.sql} | 0 .../registered-births-line-list.sql} | 0 .../registered-patients-by-dob-line-list.sql} | 0 .../registered-patients-daily-summary.sql} | 0 .../registered-patients-line-list.sql} | 0 .../upcoming-vaccinations-line-list.sql} | 0 ...usage-quality-metrics-patient-details.sql} | 0 ...quality-metrics-patient-registrations.sql} | 0 ...it-report.sql => user-audit-line-list.sql} | 0 packages.yml | 2 +- pyproject.toml | 2 +- .../report-config-schema.json | 9 +- scripts/validate_report_configs.py | 2 +- 47 files changed, 207 insertions(+), 169 deletions(-) rename models/reports/config/sensitive/{sensitive-audit-outpatient-appointments-line-list.json => sensitive-audit-outpatient-appointments.json} (93%) rename models/reports/config/sensitive/{sensitive-user-audit-report.json => sensitive-user-audit-line-list.json} (100%) rename models/reports/config/standard/{audit-outpatient-appointments-line-list.json => audit-outpatient-appointments.json} (95%) rename models/reports/config/{admin/admin-audit-patient-details-edits-line-list.json => standard/audit-patient-details-edit.json} (96%) rename models/reports/config/{admin/admin-audit-patient-views-line-list.json => standard/audit-patient-views.json} (97%) rename models/reports/config/{admin/admin-deceased-patients-line-list.json => standard/deceased-patients-line-list.json} (98%) rename models/reports/config/{admin/admin-invoice-products-summary.json => standard/invoice-products-summary.json} (100%) rename models/reports/config/{admin/admin-ongoing-conditions-line-list.json => standard/ongoing-conditions-line-list.json} (100%) rename models/reports/config/{admin/admin-program-registry-line-list.json => standard/program-registry-line-list.json} (100%) rename models/reports/config/{admin/admin-program-registry-removed-patients-line-list.json => standard/program-registry-removed-patients-line-list.json} (100%) rename models/reports/config/{admin/admin-registered-births-line-list.json => standard/registered-births-line-list.json} (94%) rename models/reports/config/{admin/admin-registered-patients-by-dob-line-list.json => standard/registered-patients-by-dob-line-list.json} (91%) rename models/reports/config/{admin/admin-registered-patients-daily-summary.json => standard/registered-patients-daily-summary.json} (100%) rename models/reports/config/{admin/admin-registered-patients-line-list.json => standard/registered-patients-line-list.json} (100%) rename models/reports/config/{admin/admin-upcoming-vaccinations-line-list.json => standard/upcoming-vaccinations-line-list.json} (100%) rename models/reports/config/{admin/admin-usage-quality-metrics-patient-details.json => standard/usage-quality-metrics-patient-details.json} (100%) rename models/reports/config/{admin/admin-usage-quality-metrics-patient-registrations.json => standard/usage-quality-metrics-patient-registrations.json} (100%) rename models/reports/config/standard/{user-audit-report.json => user-audit-line-list.json} (100%) rename models/reports/sql/sensitive/{sensitive-audit-outpatient-appointments-line-list.sql => sensitive-audit-outpatient-appointments.sql} (100%) rename models/reports/sql/sensitive/{sensitive-user-audit-report.sql => sensitive-user-audit-line-list.sql} (100%) rename models/reports/sql/standard/{audit-outpatient-appointments-line-list.sql => audit-outpatient-appointments.sql} (100%) rename models/reports/sql/{admin/admin-audit-patient-details-edits-line-list.sql => standard/audit-patient-details-edit.sql} (100%) rename models/reports/sql/{admin/admin-audit-patient-views-line-list.sql => standard/audit-patient-views.sql} (100%) rename models/reports/sql/{admin/admin-deceased-patients-line-list.sql => standard/deceased-patients-line-list.sql} (100%) rename models/reports/sql/{admin/admin-invoice-products-summary.sql => standard/invoice-products-summary.sql} (100%) rename models/reports/sql/{admin/admin-ongoing-conditions-line-list.sql => standard/ongoing-conditions-line-list.sql} (100%) rename models/reports/sql/{admin/admin-program-registry-line-list.sql => standard/program-registry-line-list.sql} (100%) rename models/reports/sql/{admin/admin-program-registry-removed-patients-line-list.sql => standard/program-registry-removed-patients-line-list.sql} (100%) rename models/reports/sql/{admin/admin-registered-births-line-list.sql => standard/registered-births-line-list.sql} (100%) rename models/reports/sql/{admin/admin-registered-patients-by-dob-line-list.sql => standard/registered-patients-by-dob-line-list.sql} (100%) rename models/reports/sql/{admin/admin-registered-patients-daily-summary.sql => standard/registered-patients-daily-summary.sql} (100%) rename models/reports/sql/{admin/admin-registered-patients-line-list.sql => standard/registered-patients-line-list.sql} (100%) rename models/reports/sql/{admin/admin-upcoming-vaccinations-line-list.sql => standard/upcoming-vaccinations-line-list.sql} (100%) rename models/reports/sql/{admin/admin-usage-quality-metrics-patient-details.sql => standard/usage-quality-metrics-patient-details.sql} (100%) rename models/reports/sql/{admin/admin-usage-quality-metrics-patient-registrations.sql => standard/usage-quality-metrics-patient-registrations.sql} (100%) rename models/reports/sql/standard/{user-audit-report.sql => user-audit-line-list.sql} (100%) diff --git a/dbt_project.yml b/dbt_project.yml index 4e82800c..603ca7cd 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: tamanu_source_dbt -version: 2.50.10 +version: 2.50.11 config-version: 2 profile: tamanu_source_dbt @@ -63,9 +63,6 @@ models: sensitive: +tags: - restricted - admin: - +tags: - - admin data_tests: +severity: warn diff --git a/documentations/tamanu-report-configuration-schema.md b/documentations/tamanu-report-configuration-schema.md index 03854286..b01ca8cb 100644 --- a/documentations/tamanu-report-configuration-schema.md +++ b/documentations/tamanu-report-configuration-schema.md @@ -15,6 +15,7 @@ Every report configuration file must be a valid JSON object with the following s #### Required Properties - **`query`** (string): The SQL query or placeholder for the report. Must be at least 1 character long. +- **`name`** (string): Display name of the report as shown in the Tamanu reporting interface. Every report must define a `name` at the **root level**. The JSON schema enforces this as a required root-level property (`minLength: 1`). A legacy `name` under `queryOptions` is still permitted but deprecated. - **`status`** (enum): Publication status of the report. Must be either `"draft"` or `"published"`. - **`dbSchema`** (enum): Database schema to use for the report. Must be either `"raw"` or `"reporting"`. - **`queryOptions`** (object): Configuration options for the report query (see detailed structure below). @@ -25,6 +26,37 @@ Every report configuration file must be a valid JSON object with the following s - **`reportDefinitionId`** (string): Unique identifier for the report definition. - **`dhis2DataSet`** (string): DHIS2 dataset identifier. +### Recommended Field Ordering + +For consistency across all report configuration files, define properties in the following order. This applies to both `standard` and `sensitive` reports. + +**Root level:** + +1. `query` +2. `name` +3. `status` +4. `notes` +5. `dbSchema` +6. `reportDefinitionId` *(if present)* +7. `dhis2DataSet` *(if present)* +8. `queryOptions` + +**Within `queryOptions`:** + +1. `defaultDateRange` +2. `dateRangeLabel` *(if present)* +3. `dataSources` +4. `parameters` + +**Within each parameter object:** + +1. `parameterField` +2. `label` +3. `name` +4. Type-specific properties (e.g. `suggesterEndpoint`, `suggesterOptions`, `options`, `filterBySelectedFacility`) + +Use 2-space indentation throughout. + ### Query Options Structure The `queryOptions` object defines how the report behaves and what parameters it accepts: @@ -58,7 +90,7 @@ For a report generated on **2025-07-01 12:00:00**, the default date ranges would #### Optional Properties - **`dateRangeLabel`** (string): Custom label for the date range input field -- **`name`** (string): Display name of the report +- **`name`** (string): *(legacy)* Display name nested under `queryOptions`. New and existing reports should define the display name as a **root-level** `name` property instead (see [Required Properties](#required-properties)). This nested field is retained only for backwards compatibility and should not be used. ## Parameter Types @@ -230,13 +262,13 @@ Here's a comprehensive example of a valid report configuration: ```json { "query": "SELECT p.display_id, p.first_name, p.last_name, e.start_date FROM patients p JOIN encounters e ON p.id = e.patient_id WHERE e.start_date >= :startDate AND e.start_date <= :endDate AND (:facilityId IS NULL OR e.location_id IN (SELECT id FROM locations WHERE facility_id = :facilityId)) AND (:departmentId IS NULL OR e.department_id = :departmentId)", + "name": "Patient Encounters Report", "status": "published", "notes": "Patient encounter report showing all encounters within the selected date range, with optional filtering by facility and department. Useful for tracking patient flow and departmental activity.", "dbSchema": "reporting", "reportDefinitionId": "patient-encounters-detailed", "dhis2DataSet": "abcdefghijk", "queryOptions": { - "name": "Patient Encounters Report", "defaultDateRange": "30days", "dateRangeLabel": "Encounter date range", "dataSources": ["thisFacility", "allFacilities"], diff --git a/list_tamanu_reports.md b/list_tamanu_reports.md index 9920a579..1984a1bb 100644 --- a/list_tamanu_reports.md +++ b/list_tamanu_reports.md @@ -25,7 +25,7 @@ Facility, Patient billing type, Admitting clinician, Area, Department, Admission --- -### Audit outpatient appointments line list +### Audit outpatient appointments **Report Description** @@ -38,6 +38,54 @@ Facility **Default date range**: 24hours +--- + +### Audit patient details edit + +**Report Description** + +This report lists all of the users that have edited the selected patient's personal details for the selected date range and parameters. Specifically the report tracks edits to the patient 'Details' component where personally identifiable information is recorded such as name, date of birth, contact information and insurance details. +Edits are listed in chronological order. If multiple changes are made to an individual patient's details within a minute, these changes will be grouped together and displayed as a single edit in the report. + +**Filters** + +Patient, User + +**Default date range**: 24hours + + +--- + +### Audit patient views + +**Report Description** + +This report lists all of the users that have viewed the selected patient's record for the selected date range and parameters. A patient 'view' is defined as a single access to a patient record where a patient record can be accessed from a patient listing table such as the 'All patients' table, the 'Active lab requests' table, or the 'Immunisation register'. A patient record can also be accessed via features such as the 'Recently viewed patients' and the scheduling module. +Views are listed in chronological order. If multiple views are made to a patient's record within a logged session, these views will be grouped together and displayed as a single view in the report. + +**Filters** + +Patient, User + +**Default date range**: 24hours + + +--- + +### Deceased patients line list + +**Report Description** + +This report generates a list of all deceased patients within the selected parameters. Patients are listed in chronological order by date and time of death. +The report includes all details documented in the patient death record. + +**Filters** + +Facility, Cause of death, Due to (or as a consequence of), Other contributing condition, Manner of death + +**Default date range**: 7days + + --- ### Encounter diets line list @@ -250,6 +298,17 @@ Village, Doctor/Nurse **Default date range**: allTime +--- + +### Invoice products summary + +**Report Description** + +This report provides a summary of all invoice products, including their insurable status, category, and pricing across all price lists and insurance plans. + +**Default date range**: allTime + + --- ### Lab requests line list @@ -327,6 +386,17 @@ Facility, Drug **Default date range**: 30days +--- + +### Ongoing conditions line list + +**Report Description** + +This report lists all patients with ongoing conditions for the selected parameters. + +**Default date range**: 7days + + --- ### Outpatient appointments line list @@ -389,287 +459,215 @@ Facility, Procedure clinician, Department, Area, Location --- -### Recent diagnoses line list +### Program registry line list **Report Description** -This report lists all patients that have had the specified diagnosis/es recorded. Diagnoses with a certainty of 'Confirmed', 'Suspected', or 'Emergency' are included. Diagnoses with a certainty of 'Disproven' or 'Recorded in error' are excluded. - -**Filters** - -Facility, Village, Diagnosis, Diagnosis 2, Diagnosis 3, Diagnosis 4, Diagnosis 5, Clinician - -**Default date range**: 24hours - - ---- - -### User audit report - -**Report Description** - -This report generates a summary of user activity for all current and discharged inpatient, emergency and outpatient encounters for the selected date range. Encounters are listed in chronological order by encounter start date and time. - -The following details are included for each encounter: -- User name: The user assigned as the supervising clinician at the time of report generation or at time of discharge -- Role: The role of the supervising clinician -- Patient category: Patient billing type -- Triage category: Triage category for the patient if an emergency encounter -- Department: Assigned department at the time of report generation or at time of discharge -- Area: Assigned area at the time of report generation or at time of discharge -- Location: Assigned location at the time of report generation or at time of discharge -- Notes start time: The time first note was completed (excludes system generated notes) -- Notes end time: The time the final note was completed (excludes system generated notes) -- Discharges: Specifies whether or not the patient has been discharged -- Non-discharge by clinicians: If patient is automatically discharged, this column will display the name of the clinician who last authored a note or who the note was written on behalf of - -**Filters** - -Facility, Department, Area - -**Default date range**: 24hours - - ---- - -### Vaccine audit line list - -**Report Description** - -This report generates a list of all patients that have a vaccination record deleted or updated from 'Not given' to 'Given'. Patients are listed alphabetically by last name and date of vaccination in chronological order. - -The report includes the following information in addition to the vaccination date and name: -Vaccination status: Where 'Recorded in error' is the status of a deleted record and 'Historical' is the status of a vaccine recorded as 'Not given' that is now recorded as 'Given' -Vaccine recorded by: The username associated with the person logged into Tamanu at the time the vaccine record was originally created -Given by: The healthcare worker that was recorded as administering the now deleted vaccination record -Record modified by: The username associated with the person logged into Tamanu at the time the vaccine record was deleted -Record modification date: The date the vaccination record was deleted from Tamanu - +This report generates the same data that appears on the Registry page. This report will include all people registered within the date range selected in order of the newest (most recent) registration to the oldest. Any patients removed from the register should not be included in this report (see another report called Program Registry Removed Patients). +Home village: Per patient details +Currently in: Can be village or facility, depends how the register is confugured. Will only be completed if a form associated with the register includes this field. +Related conditions: Lists all related conditions associated with the patient and the register they are on (conditions listed at the time of report generation, any conditions removed previously are not included) +Status: Current status of the patient per the 'status' function within the register. +Date of registration: Date the patient was added to this registry. If patient has been added to this registry more than once (i.e. added, removed, added again), the date listed is the date of the current addition to the register. +Registered by: Name of Tamanu user who added the patient to this registry +Registering facility: Facility selected when patient is first added to the registry **Filters** -Facility, Village, Category, Vaccine, Status +Registry, Subdivision, Division -**Default date range**: 7days +**Default date range**: allTime --- -### Vaccine line list +### Program registry removed patients line list **Report Description** -This report generates a list of all patients that have had a vaccination recorded for the selected parameters. Patients are listed alphabetically by last name and date of vaccination in chronological order. - -The report includes vaccinations with statuses of both 'Given' and 'Not given', and each vaccination recorded is listed on a single row. If a vaccination was initially recorded as 'Not given' and is later marked as 'Given', only the vaccination record with a status of 'Given' will be included in the report. +This report generates a list of all patients who have been removed from the registry. This report will include all people removed via workflow 'patient active -> remove' (i.e. does not include patients who were deleted from the registry using workflow 'patient active -> delete') within the date range selected in order of the newest removal to the oldest. Those still active on the register are not included in this report. +Home village: Per patient details +Registering facility: Facility selected when patient is first added to the registry +Related conditions: Lists all related conditions associated with the patient and the register they are on (conditions listed at the time of removal) +Status: Last status of the patient per the 'status' function within the register at the time of removal from the register. +Registered by: Name of user who added the patient to the registry +Date of registration: Date the patient was added to this registry. If patient has been added to this registry more than once (i.e. added, removed, added again), the date listed is the first addition to the register. +Date of removal: Date the patient was removed from the registry (if patient is added to a registry, removed, later added again and removed again, the report will list the most recent removal) +Removed by: Name of user who removed the patient from the registry **Filters** -Facility, Village, Category, Vaccine +Registry -**Default date range**: 7days +**Default date range**: allTime --- -## Admin - -### Admin audit patient details edits line list +### Recent diagnoses line list **Report Description** -This report lists all of the users that have edited the selected patient's personal details for the selected date range and parameters. Specifically the report tracks edits to the patient 'Details' component where personally identifiable information is recorded such as name, date of birth, contact information and insurance details. -Edits are listed in chronological order. If multiple changes are made to an individual patient's details within a minute, these changes will be grouped together and displayed as a single edit in the report. +This report lists all patients that have had the specified diagnosis/es recorded. Diagnoses with a certainty of 'Confirmed', 'Suspected', or 'Emergency' are included. Diagnoses with a certainty of 'Disproven' or 'Recorded in error' are excluded. **Filters** -Patient, User +Facility, Village, Diagnosis, Diagnosis 2, Diagnosis 3, Diagnosis 4, Diagnosis 5, Clinician **Default date range**: 24hours --- -### Admin audit patient views line list +### Registered births line list **Report Description** -This report lists all of the users that have viewed the selected patient's record for the selected date range and parameters. A patient 'view' is defined as a single access to a patient record where a patient record can be accessed from a patient listing table such as the 'All patients' table, the 'Active lab requests' table, or the 'Immunisation register'. A patient record can also be accessed via features such as the 'Recently viewed patients' and the scheduling module. -Views are listed in chronological order. If multiple views are made to a patient's record within a logged session, these views will be grouped together and displayed as a single view in the report. +This report generates a list of all registered births for the selected parameters. Patients are listed in chronological order by date and time of birth. The report also includes key demographic information and birth details for each patient. **Filters** -Patient, User +Facility, Village -**Default date range**: 24hours +**Default date range**: 7days --- -### Admin deceased patients line list +### Registered patients by dob line list **Report Description** -This report generates a list of all deceased patients within the selected parameters. Patients are listed in chronological order by date and time of death. -The report includes all details documented in the patient death record. - -**Filters** - -Facility, Cause of death, Due to (or as a consequence of), Other contributing condition, Manner of death +This report generates a list of all patients that have been registered, including date of registration and which user completed the registration. Patients are listed in chronological order by date of administration. The report also includes key demographic information for each patient. **Default date range**: 7days --- -### Admin invoice products summary +### Registered patients daily summary **Report Description** -This report provides a summary of all invoice products, including their insurable status, category, and pricing across all price lists and insurance plans. +This report generates a summary of the number of patients that have been registered by date and sex for the selected date range. **Default date range**: allTime --- -### Admin ongoing conditions line list +### Registered patients line list **Report Description** -This report lists all patients with ongoing conditions for the selected parameters. +This report generates a list of all patients that have been registered, including date of registration and which user completed the registration. Patients are listed in chronological order by date of administration. The report also includes key demographic information for each patient. **Default date range**: 7days --- -### Admin program registry line list +### Upcoming vaccinations line list **Report Description** -This report generates the same data that appears on the Registry page. This report will include all people registered within the date range selected in order of the newest (most recent) registration to the oldest. Any patients removed from the register should not be included in this report (see another report called Program Registry Removed Patients). -Home village: Per patient details -Currently in: Can be village or facility, depends how the register is confugured. Will only be completed if a form associated with the register includes this field. -Related conditions: Lists all related conditions associated with the patient and the register they are on (conditions listed at the time of report generation, any conditions removed previously are not included) -Status: Current status of the patient per the 'status' function within the register. -Date of registration: Date the patient was added to this registry. If patient has been added to this registry more than once (i.e. added, removed, added again), the date listed is the date of the current addition to the register. -Registered by: Name of Tamanu user who added the patient to this registry -Registering facility: Facility selected when patient is first added to the registry +This report generates upcoming vaccination schedules for patients up to 18 years old by default or for patients born within the user-selected date range. **Filters** -Registry, Subdivision, Division +Category, Vaccine, Vaccine status, Village -**Default date range**: allTime +**Default date range**: 18years --- -### Admin program registry removed patients line list +### Usage quality metrics patient details **Report Description** -This report generates a list of all patients who have been removed from the registry. This report will include all people removed via workflow 'patient active -> remove' (i.e. does not include patients who were deleted from the registry using workflow 'patient active -> delete') within the date range selected in order of the newest removal to the oldest. Those still active on the register are not included in this report. -Home village: Per patient details -Registering facility: Facility selected when patient is first added to the registry -Related conditions: Lists all related conditions associated with the patient and the register they are on (conditions listed at the time of removal) -Status: Last status of the patient per the 'status' function within the register at the time of removal from the register. -Registered by: Name of user who added the patient to the registry -Date of registration: Date the patient was added to this registry. If patient has been added to this registry more than once (i.e. added, removed, added again), the date listed is the first addition to the register. -Date of removal: Date the patient was removed from the registry (if patient is added to a registry, removed, later added again and removed again, the report will list the most recent removal) -Removed by: Name of user who removed the patient from the registry - -**Filters** - -Registry +This report generates usage quality metrics on patient details. The report provides a summary on the total patients in the database, total with incomplete name, missing date of birth, invalid date of birth, missing location entry, missing contact entry and patients that have been merged. **Default date range**: allTime --- -### Admin registered births line list +### Usage quality metrics patient registrations **Report Description** -This report generates a list of all registered births for the selected parameters. Patients are listed in chronological order by date and time of birth. The report also includes key demographic information and birth details for each patient. - -**Filters** - -Facility, Village +This report generates usage quality metrics on patient registrations. The report provides a summary by selected date range on the total new patient registrations, total birth registrations, and total incorrect registrations (patient instead of birth) for under 6 months old. -**Default date range**: 7days +**Default date range**: 30days --- -### Admin registered patients by dob line list +### User audit line list **Report Description** -This report generates a list of all patients that have been registered, including date of registration and which user completed the registration. Patients are listed in chronological order by date of administration. The report also includes key demographic information for each patient. - -**Default date range**: 7days - - ---- +This report generates a summary of user activity for all current and discharged inpatient, emergency and outpatient encounters for the selected date range. Encounters are listed in chronological order by encounter start date and time. -### Admin registered patients daily summary +The following details are included for each encounter: +- User name: The user assigned as the supervising clinician at the time of report generation or at time of discharge +- Role: The role of the supervising clinician +- Patient category: Patient billing type +- Triage category: Triage category for the patient if an emergency encounter +- Department: Assigned department at the time of report generation or at time of discharge +- Area: Assigned area at the time of report generation or at time of discharge +- Location: Assigned location at the time of report generation or at time of discharge +- Notes start time: The time first note was completed (excludes system generated notes) +- Notes end time: The time the final note was completed (excludes system generated notes) +- Discharges: Specifies whether or not the patient has been discharged +- Non-discharge by clinicians: If patient is automatically discharged, this column will display the name of the clinician who last authored a note or who the note was written on behalf of -**Report Description** +**Filters** -This report generates a summary of the number of patients that have been registered by date and sex for the selected date range. +Facility, Department, Area -**Default date range**: allTime +**Default date range**: 24hours --- -### Admin registered patients line list +### Vaccine audit line list **Report Description** -This report generates a list of all patients that have been registered, including date of registration and which user completed the registration. Patients are listed in chronological order by date of administration. The report also includes key demographic information for each patient. - -**Default date range**: 7days - - ---- - -### Admin upcoming vaccinations line list - -**Report Description** +This report generates a list of all patients that have a vaccination record deleted or updated from 'Not given' to 'Given'. Patients are listed alphabetically by last name and date of vaccination in chronological order. -This report generates upcoming vaccination schedules for patients up to 18 years old by default or for patients born within the user-selected date range. +The report includes the following information in addition to the vaccination date and name: +Vaccination status: Where 'Recorded in error' is the status of a deleted record and 'Historical' is the status of a vaccine recorded as 'Not given' that is now recorded as 'Given' +Vaccine recorded by: The username associated with the person logged into Tamanu at the time the vaccine record was originally created +Given by: The healthcare worker that was recorded as administering the now deleted vaccination record +Record modified by: The username associated with the person logged into Tamanu at the time the vaccine record was deleted +Record modification date: The date the vaccination record was deleted from Tamanu + **Filters** -Category, Vaccine, Vaccine status, Village +Facility, Village, Category, Vaccine, Status -**Default date range**: 18years +**Default date range**: 7days --- -### Admin usage quality metrics patient details +### Vaccine line list **Report Description** -This report generates usage quality metrics on patient details. The report provides a summary on the total patients in the database, total with incomplete name, missing date of birth, invalid date of birth, missing location entry, missing contact entry and patients that have been merged. - -**Default date range**: allTime - - ---- +This report generates a list of all patients that have had a vaccination recorded for the selected parameters. Patients are listed alphabetically by last name and date of vaccination in chronological order. -### Admin usage quality metrics patient registrations +The report includes vaccinations with statuses of both 'Given' and 'Not given', and each vaccination recorded is listed on a single row. If a vaccination was initially recorded as 'Not given' and is later marked as 'Given', only the vaccination record with a status of 'Given' will be included in the report. -**Report Description** +**Filters** -This report generates usage quality metrics on patient registrations. The report provides a summary by selected date range on the total new patient registrations, total birth registrations, and total incorrect registrations (patient instead of birth) for under 6 months old. +Facility, Village, Category, Vaccine -**Default date range**: 30days +**Default date range**: 7days --- diff --git a/models/reports/config/sensitive/sensitive-audit-outpatient-appointments-line-list.json b/models/reports/config/sensitive/sensitive-audit-outpatient-appointments.json similarity index 93% rename from models/reports/config/sensitive/sensitive-audit-outpatient-appointments-line-list.json rename to models/reports/config/sensitive/sensitive-audit-outpatient-appointments.json index e508a66d..da145fb0 100644 --- a/models/reports/config/sensitive/sensitive-audit-outpatient-appointments-line-list.json +++ b/models/reports/config/sensitive/sensitive-audit-outpatient-appointments.json @@ -1,6 +1,6 @@ { "query": "replace this", - "name": "Sensitive outpatient appointments audit line list", + "name": "Sensitive audit - outpatient appointments", "notes": "This report shows an audit log of all modifications and cancellations to outpatient appointments at sensitive facilities. Each row represents a change event, showing both the current appointment details and the previous values before the change. The report is designed to track which Tamanu users are creating and editing appointments. Status-only changes (e.g., Confirmed to Arrived) are excluded unless the status change is to Cancelled. If an appointment is changed multiple times, each modification will appear as a separate line.", "status": "published", "dbSchema": "reporting", diff --git a/models/reports/config/sensitive/sensitive-encounter-diets-line-list.json b/models/reports/config/sensitive/sensitive-encounter-diets-line-list.json index 3fcac19f..824097cd 100644 --- a/models/reports/config/sensitive/sensitive-encounter-diets-line-list.json +++ b/models/reports/config/sensitive/sensitive-encounter-diets-line-list.json @@ -1,6 +1,6 @@ { "query": "replace this", - "name": "Sensitive current encounters diets line list", + "name": "Sensitive encounter diets line list", "notes": "This report generates a list of all active encounters at sensitive facilities with their associated dietary requirements. The report includes:\n- Patient details and current location\n- Dietary requirements and restrictions.", "status": "published", "dbSchema": "reporting", diff --git a/models/reports/config/sensitive/sensitive-user-audit-report.json b/models/reports/config/sensitive/sensitive-user-audit-line-list.json similarity index 100% rename from models/reports/config/sensitive/sensitive-user-audit-report.json rename to models/reports/config/sensitive/sensitive-user-audit-line-list.json diff --git a/models/reports/config/standard/audit-outpatient-appointments-line-list.json b/models/reports/config/standard/audit-outpatient-appointments.json similarity index 95% rename from models/reports/config/standard/audit-outpatient-appointments-line-list.json rename to models/reports/config/standard/audit-outpatient-appointments.json index cc7637ba..df6e78e6 100644 --- a/models/reports/config/standard/audit-outpatient-appointments-line-list.json +++ b/models/reports/config/standard/audit-outpatient-appointments.json @@ -1,5 +1,6 @@ { "query": "replace this", + "name": "Audit - outpatient appointments", "notes": "This report shows an audit log of all modifications and cancellations to outpatient appointments. Each row represents a change event, showing both the current appointment details and the previous values before the change. The report is designed to track which Tamanu users are creating and editing appointments. Status-only changes (e.g., Confirmed to Arrived) are excluded unless the status change is to Cancelled. If an appointment is changed multiple times, each modification will appear as a separate line.", "status": "published", "dbSchema": "reporting", diff --git a/models/reports/config/admin/admin-audit-patient-details-edits-line-list.json b/models/reports/config/standard/audit-patient-details-edit.json similarity index 96% rename from models/reports/config/admin/admin-audit-patient-details-edits-line-list.json rename to models/reports/config/standard/audit-patient-details-edit.json index c29c0ead..1875e685 100644 --- a/models/reports/config/admin/admin-audit-patient-details-edits-line-list.json +++ b/models/reports/config/standard/audit-patient-details-edit.json @@ -1,6 +1,6 @@ { "query": "replace this", - "name": "Audit - Patient details edits", + "name": "Audit - patient details edit", "notes": "This report lists all of the users that have edited the selected patient's personal details for the selected date range and parameters. Specifically the report tracks edits to the patient 'Details' component where personally identifiable information is recorded such as name, date of birth, contact information and insurance details.\nEdits are listed in chronological order. If multiple changes are made to an individual patient's details within a minute, these changes will be grouped together and displayed as a single edit in the report.", "status": "published", "dbSchema": "reporting", diff --git a/models/reports/config/admin/admin-audit-patient-views-line-list.json b/models/reports/config/standard/audit-patient-views.json similarity index 97% rename from models/reports/config/admin/admin-audit-patient-views-line-list.json rename to models/reports/config/standard/audit-patient-views.json index 5355af0f..35c46b29 100644 --- a/models/reports/config/admin/admin-audit-patient-views-line-list.json +++ b/models/reports/config/standard/audit-patient-views.json @@ -1,6 +1,6 @@ { "query": "replace this", - "name": "Audit - Patient views", + "name": "Audit - patient views", "notes": "This report lists all of the users that have viewed the selected patient's record for the selected date range and parameters. A patient 'view' is defined as a single access to a patient record where a patient record can be accessed from a patient listing table such as the 'All patients' table, the 'Active lab requests' table, or the 'Immunisation register'. A patient record can also be accessed via features such as the 'Recently viewed patients' and the scheduling module. \nViews are listed in chronological order. If multiple views are made to a patient's record within a logged session, these views will be grouped together and displayed as a single view in the report.", "status": "published", "dbSchema": "reporting", diff --git a/models/reports/config/admin/admin-deceased-patients-line-list.json b/models/reports/config/standard/deceased-patients-line-list.json similarity index 98% rename from models/reports/config/admin/admin-deceased-patients-line-list.json rename to models/reports/config/standard/deceased-patients-line-list.json index 23d44bc3..3bba7a4f 100644 --- a/models/reports/config/admin/admin-deceased-patients-line-list.json +++ b/models/reports/config/standard/deceased-patients-line-list.json @@ -1,5 +1,6 @@ { "query": "query here", + "name": "Deceased patients line list", "notes": "This report generates a list of all deceased patients within the selected parameters. Patients are listed in chronological order by date and time of death. \nThe report includes all details documented in the patient death record. ", "status": "published", "dbSchema": "reporting", diff --git a/models/reports/config/standard/encounter-diets-line-list.json b/models/reports/config/standard/encounter-diets-line-list.json index f63ce669..fa11ed95 100644 --- a/models/reports/config/standard/encounter-diets-line-list.json +++ b/models/reports/config/standard/encounter-diets-line-list.json @@ -1,6 +1,6 @@ { "query": "replace this", - "name": "Current encounters diets line list", + "name": "Encounter diets line list", "notes": "This report generates a list of all active encounters with their associated dietary requirements. The report includes:\n- Patient details and current location\n- Dietary requirements and restrictions.", "status": "published", "dbSchema": "reporting", diff --git a/models/reports/config/standard/incomplete-referrals.json b/models/reports/config/standard/incomplete-referrals.json index 7a918298..79b81abb 100644 --- a/models/reports/config/standard/incomplete-referrals.json +++ b/models/reports/config/standard/incomplete-referrals.json @@ -1,5 +1,6 @@ { "query": "replace this", + "name": "Incomplete referrals", "status": "published", "notes": "This report lists all patients that have a pending referral for the selected parameters.", "dbSchema": "reporting", diff --git a/models/reports/config/admin/admin-invoice-products-summary.json b/models/reports/config/standard/invoice-products-summary.json similarity index 100% rename from models/reports/config/admin/admin-invoice-products-summary.json rename to models/reports/config/standard/invoice-products-summary.json diff --git a/models/reports/config/standard/medication-dispensed-summary.json b/models/reports/config/standard/medication-dispensed-summary.json index 4eb31e8d..c314fe0a 100644 --- a/models/reports/config/standard/medication-dispensed-summary.json +++ b/models/reports/config/standard/medication-dispensed-summary.json @@ -1,6 +1,6 @@ { "query": "replace this", - "name": "Medication Dispensed summary report", + "name": "Medication dispensed summary", "notes": "This report shows quantity of medication dispensed for a given drug within a specified date range, based on dispense records.", "status": "published", "dbSchema": "reporting", diff --git a/models/reports/config/admin/admin-ongoing-conditions-line-list.json b/models/reports/config/standard/ongoing-conditions-line-list.json similarity index 100% rename from models/reports/config/admin/admin-ongoing-conditions-line-list.json rename to models/reports/config/standard/ongoing-conditions-line-list.json diff --git a/models/reports/config/admin/admin-program-registry-line-list.json b/models/reports/config/standard/program-registry-line-list.json similarity index 100% rename from models/reports/config/admin/admin-program-registry-line-list.json rename to models/reports/config/standard/program-registry-line-list.json diff --git a/models/reports/config/admin/admin-program-registry-removed-patients-line-list.json b/models/reports/config/standard/program-registry-removed-patients-line-list.json similarity index 100% rename from models/reports/config/admin/admin-program-registry-removed-patients-line-list.json rename to models/reports/config/standard/program-registry-removed-patients-line-list.json diff --git a/models/reports/config/admin/admin-registered-births-line-list.json b/models/reports/config/standard/registered-births-line-list.json similarity index 94% rename from models/reports/config/admin/admin-registered-births-line-list.json rename to models/reports/config/standard/registered-births-line-list.json index 0ef5266b..b5df2a05 100644 --- a/models/reports/config/admin/admin-registered-births-line-list.json +++ b/models/reports/config/standard/registered-births-line-list.json @@ -1,6 +1,6 @@ { "query": "replace this", - "name": "Registered birth line list", + "name": "Registered births line list", "notes": "This report generates a list of all registered births for the selected parameters. Patients are listed in chronological order by date and time of birth. The report also includes key demographic information and birth details for each patient.", "status": "published", "dbSchema": "reporting", diff --git a/models/reports/config/admin/admin-registered-patients-by-dob-line-list.json b/models/reports/config/standard/registered-patients-by-dob-line-list.json similarity index 91% rename from models/reports/config/admin/admin-registered-patients-by-dob-line-list.json rename to models/reports/config/standard/registered-patients-by-dob-line-list.json index f52f4acd..4aed2bd2 100644 --- a/models/reports/config/admin/admin-registered-patients-by-dob-line-list.json +++ b/models/reports/config/standard/registered-patients-by-dob-line-list.json @@ -1,5 +1,6 @@ { "query": "replace this", + "name": "Registered patients by DOB line list", "status": "published", "notes": "This report generates a list of all patients that have been registered, including date of registration and which user completed the registration. Patients are listed in chronological order by date of administration. The report also includes key demographic information for each patient. ", "dbSchema": "reporting", diff --git a/models/reports/config/admin/admin-registered-patients-daily-summary.json b/models/reports/config/standard/registered-patients-daily-summary.json similarity index 100% rename from models/reports/config/admin/admin-registered-patients-daily-summary.json rename to models/reports/config/standard/registered-patients-daily-summary.json diff --git a/models/reports/config/admin/admin-registered-patients-line-list.json b/models/reports/config/standard/registered-patients-line-list.json similarity index 100% rename from models/reports/config/admin/admin-registered-patients-line-list.json rename to models/reports/config/standard/registered-patients-line-list.json diff --git a/models/reports/config/admin/admin-upcoming-vaccinations-line-list.json b/models/reports/config/standard/upcoming-vaccinations-line-list.json similarity index 100% rename from models/reports/config/admin/admin-upcoming-vaccinations-line-list.json rename to models/reports/config/standard/upcoming-vaccinations-line-list.json diff --git a/models/reports/config/admin/admin-usage-quality-metrics-patient-details.json b/models/reports/config/standard/usage-quality-metrics-patient-details.json similarity index 100% rename from models/reports/config/admin/admin-usage-quality-metrics-patient-details.json rename to models/reports/config/standard/usage-quality-metrics-patient-details.json diff --git a/models/reports/config/admin/admin-usage-quality-metrics-patient-registrations.json b/models/reports/config/standard/usage-quality-metrics-patient-registrations.json similarity index 100% rename from models/reports/config/admin/admin-usage-quality-metrics-patient-registrations.json rename to models/reports/config/standard/usage-quality-metrics-patient-registrations.json diff --git a/models/reports/config/standard/user-audit-report.json b/models/reports/config/standard/user-audit-line-list.json similarity index 100% rename from models/reports/config/standard/user-audit-report.json rename to models/reports/config/standard/user-audit-line-list.json diff --git a/models/reports/sql/sensitive/sensitive-audit-outpatient-appointments-line-list.sql b/models/reports/sql/sensitive/sensitive-audit-outpatient-appointments.sql similarity index 100% rename from models/reports/sql/sensitive/sensitive-audit-outpatient-appointments-line-list.sql rename to models/reports/sql/sensitive/sensitive-audit-outpatient-appointments.sql diff --git a/models/reports/sql/sensitive/sensitive-user-audit-report.sql b/models/reports/sql/sensitive/sensitive-user-audit-line-list.sql similarity index 100% rename from models/reports/sql/sensitive/sensitive-user-audit-report.sql rename to models/reports/sql/sensitive/sensitive-user-audit-line-list.sql diff --git a/models/reports/sql/standard/audit-outpatient-appointments-line-list.sql b/models/reports/sql/standard/audit-outpatient-appointments.sql similarity index 100% rename from models/reports/sql/standard/audit-outpatient-appointments-line-list.sql rename to models/reports/sql/standard/audit-outpatient-appointments.sql diff --git a/models/reports/sql/admin/admin-audit-patient-details-edits-line-list.sql b/models/reports/sql/standard/audit-patient-details-edit.sql similarity index 100% rename from models/reports/sql/admin/admin-audit-patient-details-edits-line-list.sql rename to models/reports/sql/standard/audit-patient-details-edit.sql diff --git a/models/reports/sql/admin/admin-audit-patient-views-line-list.sql b/models/reports/sql/standard/audit-patient-views.sql similarity index 100% rename from models/reports/sql/admin/admin-audit-patient-views-line-list.sql rename to models/reports/sql/standard/audit-patient-views.sql diff --git a/models/reports/sql/admin/admin-deceased-patients-line-list.sql b/models/reports/sql/standard/deceased-patients-line-list.sql similarity index 100% rename from models/reports/sql/admin/admin-deceased-patients-line-list.sql rename to models/reports/sql/standard/deceased-patients-line-list.sql diff --git a/models/reports/sql/admin/admin-invoice-products-summary.sql b/models/reports/sql/standard/invoice-products-summary.sql similarity index 100% rename from models/reports/sql/admin/admin-invoice-products-summary.sql rename to models/reports/sql/standard/invoice-products-summary.sql diff --git a/models/reports/sql/admin/admin-ongoing-conditions-line-list.sql b/models/reports/sql/standard/ongoing-conditions-line-list.sql similarity index 100% rename from models/reports/sql/admin/admin-ongoing-conditions-line-list.sql rename to models/reports/sql/standard/ongoing-conditions-line-list.sql diff --git a/models/reports/sql/admin/admin-program-registry-line-list.sql b/models/reports/sql/standard/program-registry-line-list.sql similarity index 100% rename from models/reports/sql/admin/admin-program-registry-line-list.sql rename to models/reports/sql/standard/program-registry-line-list.sql diff --git a/models/reports/sql/admin/admin-program-registry-removed-patients-line-list.sql b/models/reports/sql/standard/program-registry-removed-patients-line-list.sql similarity index 100% rename from models/reports/sql/admin/admin-program-registry-removed-patients-line-list.sql rename to models/reports/sql/standard/program-registry-removed-patients-line-list.sql diff --git a/models/reports/sql/admin/admin-registered-births-line-list.sql b/models/reports/sql/standard/registered-births-line-list.sql similarity index 100% rename from models/reports/sql/admin/admin-registered-births-line-list.sql rename to models/reports/sql/standard/registered-births-line-list.sql diff --git a/models/reports/sql/admin/admin-registered-patients-by-dob-line-list.sql b/models/reports/sql/standard/registered-patients-by-dob-line-list.sql similarity index 100% rename from models/reports/sql/admin/admin-registered-patients-by-dob-line-list.sql rename to models/reports/sql/standard/registered-patients-by-dob-line-list.sql diff --git a/models/reports/sql/admin/admin-registered-patients-daily-summary.sql b/models/reports/sql/standard/registered-patients-daily-summary.sql similarity index 100% rename from models/reports/sql/admin/admin-registered-patients-daily-summary.sql rename to models/reports/sql/standard/registered-patients-daily-summary.sql diff --git a/models/reports/sql/admin/admin-registered-patients-line-list.sql b/models/reports/sql/standard/registered-patients-line-list.sql similarity index 100% rename from models/reports/sql/admin/admin-registered-patients-line-list.sql rename to models/reports/sql/standard/registered-patients-line-list.sql diff --git a/models/reports/sql/admin/admin-upcoming-vaccinations-line-list.sql b/models/reports/sql/standard/upcoming-vaccinations-line-list.sql similarity index 100% rename from models/reports/sql/admin/admin-upcoming-vaccinations-line-list.sql rename to models/reports/sql/standard/upcoming-vaccinations-line-list.sql diff --git a/models/reports/sql/admin/admin-usage-quality-metrics-patient-details.sql b/models/reports/sql/standard/usage-quality-metrics-patient-details.sql similarity index 100% rename from models/reports/sql/admin/admin-usage-quality-metrics-patient-details.sql rename to models/reports/sql/standard/usage-quality-metrics-patient-details.sql diff --git a/models/reports/sql/admin/admin-usage-quality-metrics-patient-registrations.sql b/models/reports/sql/standard/usage-quality-metrics-patient-registrations.sql similarity index 100% rename from models/reports/sql/admin/admin-usage-quality-metrics-patient-registrations.sql rename to models/reports/sql/standard/usage-quality-metrics-patient-registrations.sql diff --git a/models/reports/sql/standard/user-audit-report.sql b/models/reports/sql/standard/user-audit-line-list.sql similarity index 100% rename from models/reports/sql/standard/user-audit-report.sql rename to models/reports/sql/standard/user-audit-line-list.sql diff --git a/packages.yml b/packages.yml index 1600223d..775ec4f5 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - package: dbt-labs/dbt_utils - version: 1.3.3 + version: 1.4.0 diff --git a/pyproject.toml b/pyproject.toml index 409202d6..076a87c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "tamanu-source-dbt" -version = "2.50.10" +version = "2.50.11" description = "A dbt project that transforms Tamanu healthcare system data into optimised reporting datasets" readme = "README.md" requires-python = ">=3.12" diff --git a/scripts/report_validation/report-config-schema.json b/scripts/report_validation/report-config-schema.json index c72af272..749b3971 100644 --- a/scripts/report_validation/report-config-schema.json +++ b/scripts/report_validation/report-config-schema.json @@ -6,6 +6,7 @@ "type": "object", "required": [ "query", + "name", "status", "dbSchema", "queryOptions" @@ -16,6 +17,11 @@ "description": "SQL query or placeholder for the report", "minLength": 1 }, + "name": { + "type": "string", + "description": "Display name of the report shown in the Tamanu reporting interface", + "minLength": 1 + }, "status": { "type": "string", "description": "Publication status of the report", @@ -72,7 +78,8 @@ }, "name": { "type": "string", - "description": "Name of the report" + "description": "Deprecated: legacy display name. Use the root-level \"name\" property instead. Retained for backwards compatibility only.", + "deprecated": true }, "parameters": { "type": "array", diff --git a/scripts/validate_report_configs.py b/scripts/validate_report_configs.py index d4dcef11..3d5e6a57 100644 --- a/scripts/validate_report_configs.py +++ b/scripts/validate_report_configs.py @@ -61,7 +61,7 @@ def find_config_files(config_dir: str) -> List[str]: print(" Ensure this script is run from the project root.") sys.exit(1) - json_files = list(config_path.glob("*.json")) + json_files = list(config_path.rglob("*.json")) # Exclude the schema file itself json_files = [f for f in json_files if f.name != "report-config-schema.json"] From 1ea95873ae42a083bb172e5818bbcaac4d31649c Mon Sep 17 00:00:00 2001 From: julianam-w <77252335+julianam-w@users.noreply.github.com> Date: Fri, 26 Jun 2026 00:09:57 +1000 Subject: [PATCH 2/7] Update Co-Authored-By: Claude Opus 4.8 (1M context) Co-Authored-By: github-actions[bot] --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 60c0277e..caeb9d42 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ CLAUDE.md # Python __pycache__ +tamanu_source_dbt.egg-info/ # Dependencies dbt_packages/ From f9e8150b89c0b64cac7c70ec9f42511e974566eb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 25 Jun 2026 14:12:28 +0000 Subject: [PATCH 3/7] chore: update .maui submodule --- .maui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.maui b/.maui index 24608df7..9f724f3b 160000 --- a/.maui +++ b/.maui @@ -1 +1 @@ -Subproject commit 24608df7af9078c3d0e555637dcae6a9a0ad9ae9 +Subproject commit 9f724f3b101501bd838e5e736a98a7668008cbc9 From 23d2c4bf205baa39b88ecad9d60e77cff107fc16 Mon Sep 17 00:00:00 2001 From: julianam-w <77252335+julianam-w@users.noreply.github.com> Date: Fri, 26 Jun 2026 07:26:13 +1000 Subject: [PATCH 4/7] Update Co-Authored-By: Claude Opus 4.8 (1M context) Co-Authored-By: github-actions[bot] --- .../analytics-metadata-v2.50.11-standard.yml | 5191 +++++++++++++++++ .../reporting-docs-v2.50.11-standard.html | 250 + .../reporting-schema-v2.50.11-standard.sql | 4979 ++++++++++++++++ 3 files changed, 10420 insertions(+) create mode 100644 compiled/v2.50.11/analytics-metadata-v2.50.11-standard.yml create mode 100644 compiled/v2.50.11/reporting-docs-v2.50.11-standard.html create mode 100644 compiled/v2.50.11/reporting-schema-v2.50.11-standard.sql diff --git a/compiled/v2.50.11/analytics-metadata-v2.50.11-standard.yml b/compiled/v2.50.11/analytics-metadata-v2.50.11-standard.yml new file mode 100644 index 00000000..bfbd448d --- /dev/null +++ b/compiled/v2.50.11/analytics-metadata-v2.50.11-standard.yml @@ -0,0 +1,5191 @@ +- columns: + condition_id: + data_type: character varying + description: Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = diagnosis`). + name: condition_id + id: + data_type: character varying + description: Tamanu internal identifier (generally a UUID) in contributing_death_causes. + name: id + patient_death_data_id: + data_type: character varying + description: The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) + record. + name: patient_death_data_id + time_after_onset: + data_type: integer + description: Time between onset of recorded cause and death in minutes. + name: time_after_onset + config: + tags: + - base + - clinical + description: Contributing causes recorded with the patient's death data. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: contributing_death_causes + tags: + - base + - clinical +- columns: + code: + data_type: character varying + description: Code for department. + name: code + facility_id: + data_type: character varying + description: Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) + this department is in. + name: facility_id + id: + data_type: character varying + description: Tamanu internal identifier (generally a UUID) in departments. + name: id + name: + data_type: character varying + description: Full readable name for department. + name: name + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in departments." + name: visibility_status + config: + tags: + - base + - reference + description: Basic department info with a reference to parent facility. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: departments + tags: + - base + - reference +- columns: + discharged_by_id: + data_type: character varying + description: The [discharging clinician](#!/source/source.tamanu.tamanu.users). + name: discharged_by_id + disposition_id: + data_type: character varying + description: The discharge disposition or classification of the discharge ([Reference + Data](#!/source/source.tamanu.tamanu.reference_data)). + name: disposition_id + encounter_id: + data_type: character varying + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + this discharge is for. + name: encounter_id + id: + data_type: character varying + description: Tamanu internal identifier (generally a UUID) in discharges. + name: id + note: + data_type: text + description: "Free-form notes about the discharge.\r\n\r\nMay include treatment\ + \ plan and follow-ups, written by the discharging clinician.\r\n\r\nSince\ + \ v2.0, also see the [`notes`](#!/source/source.tamanu.tamanu.notes) table\ + \ for encounter and discharge notes." + name: note + config: + tags: + - base + - clinical + description: "Information about a discharge.\r\n\r\nA discharge is the end of the\ + \ lifecycle for an encounter." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: discharges + tags: + - base + - clinical +- columns: + created_datetime: + data_type: timestamp + description: Timestamp of when record was created in document_metadata. + name: created_datetime + encounter_id: + data_type: character varying(255) + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + the document was uploaded to. + name: encounter_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in document_metadata. + name: id + name: + data_type: character varying(255) + description: "Free-form name of the document.\r\n\r\nOften this is the filename." + name: name + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients) + the document was uploaded to. + name: patient_id + type: + data_type: character varying(255) + description: The [media type](https://en.wikipedia.org/wiki/Media_type) of the + file. + name: type + config: + tags: + - base + - clinical + description: "Information about an uploaded document or file, typically attached\ + \ to an encounter or directly to a patient.\r\n\r\nThe actual file data is stored\ + \ in [`attachments`](#!/source/source.tamanu.tamanu.attachments)." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: document_metadata + tags: + - base + - clinical +- columns: + certainty: + data_type: character varying + description: "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\ + \n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\ + \n\r\n`disproven` and `error` are excluded for reporting" + name: certainty + datetime: + data_type: timestamp + description: Local date for the record in encounter_diagnoses. + name: datetime + diagnosed_by_id: + data_type: character varying + description: Reference to the [clinician](#!/source/source.tamanu.tamanu.users) + recording that diagnosis. + name: diagnosed_by_id + diagnosis_id: + data_type: character varying + description: The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: diagnosis_id + encounter_id: + data_type: character varying + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + this diagnosis is for. + name: encounter_id + id: + data_type: character varying + description: Tamanu internal identifier (generally a UUID) in encounter_diagnoses. + name: id + is_primary: + data_type: boolean + description: A boolean indicating if this is a primary diagnosis + name: is_primary + config: + tags: + - base + - clinical + description: Records diagnoses made during an encounter + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: encounter_diagnoses + tags: + - base + - clinical +- columns: + created_datetime: + data_type: timestamp + description: Timestamp of when record was created in the encounter_diagnoses + table. + name: created_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in encounter_diagnoses. + name: id + updated_datetime: + data_type: timestamp + description: Timestamp of when record was last updated in the encounter_diagnoses + table. + name: updated_datetime + config: + tags: + - base + - clinical + - log + description: Metadata information extracted from the change logs for encounter_diagnoses. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: encounter_diagnoses_metadata + tags: + - base + - clinical + - log +- columns: + diet_id: + data_type: character varying(255) + description: The diet ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = diet`). + name: diet_id + encounter_id: + data_type: character varying(255) + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + this diet is for. + name: encounter_id + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in encounter_diets. + name: id + config: + tags: + - base + - administration + description: "A diet associated with an encounter.\r\n\r\nA patient can be placed\ + \ on a diet for various medical purposes.\r\nDiets are specified in reference\ + \ data." + meta: + classification: confidential + domain: admin + owner: bes-maui + pii: false + tier: silver + name: encounter_diets + tags: + - base + - administration +- columns: + change_type: + data_type: character varying(255) + description: "The field which was changed.\r\n\r\nOne of:\r\n- `encounter_type`\r\ + \n- `location`\r\n- `department`\r\n- `examiner`" + name: change_type + clinician_id: + data_type: character varying(255) + description: Reference to the [examiner](#!/source/source.tamanu.tamanu.users) + for the encounter. + name: clinician_id + date: + data_type: character(19) + description: Local date for the record in encounter_history. + name: date + department_id: + data_type: character varying(255) + description: Reference to the [department](#!/source/source.tamanu.tamanu.departments) + the encounter was in. + name: department_id + encounter_id: + data_type: character varying(255) + description: Reference to the original [encounter](#!/source/source.tamanu.tamanu.encounters) + this history is for. + name: encounter_id + encounter_type: + data_type: character varying(255) + description: "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n\ + - `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\ + \n- `surveyResponse`\r\n- `vaccination`" + name: encounter_type + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in encounter_history. + name: id + location_id: + data_type: character varying(255) + description: Reference to the [location](#!/source/source.tamanu.tamanu.locations) + the encounter was in. + name: location_id + updated_by_id: + data_type: character varying(255) + description: '[Who](#!/source/source.tamanu.tamanu.users) made the change.' + name: updated_by_id + config: + tags: + - base + - clinical + description: Records changes to an encounter's basic details. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: encounter_history + tags: + - base + - clinical +- columns: + encounter_id: + data_type: character varying(255) + description: The [encounter](#!/source/source.tamanu.tamanu.encounters) + name: encounter_id + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in encounter_prescriptions. + name: id + is_selected_for_discharge: + data_type: boolean + description: Whether the prescription is for when the patient is discharged. + name: is_selected_for_discharge + prescription_id: + data_type: character varying(255) + description: The [prescription](#!/source/source.tamanu.tamanu.prescriptions) + name: prescription_id + config: + tags: + - base + - clinical + description: Association of encounter to prescription + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: true + tier: silver + name: encounter_prescriptions + tags: + - base + - clinical +- columns: + clinician_id: + data_type: character varying(255) + description: Reference to the [examiner](#!/source/source.tamanu.tamanu.users). + name: clinician_id + department_id: + data_type: character varying(255) + description: Reference to the [department](#!/source/source.tamanu.tamanu.departments) + this encounter is in. + name: department_id + device_id: + data_type: text + description: "Unique identifier for the device that created the encounter.\r\ + \n\r\nDevice IDs are proper to each device and not globally recorded in e.g.\ + \ a `devices` table." + name: device_id + discharge_draft: + data_type: jsonb + description: Draft data of the encounter + name: discharge_draft + encounter_type: + data_type: character varying(31) + description: "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n\ + - `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\ + \n- `surveyResponse`\r\n- `vaccination`" + name: encounter_type + end_datetime: + data_type: timestamp + description: The date encounter was discharged/ended + name: end_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in encounters. + name: id + location_id: + data_type: character varying(255) + description: Reference to the current [location](#!/source/source.tamanu.tamanu.locations) + this encounter is in. + name: location_id + patient_billing_type_id: + data_type: character varying(255) + description: The billing type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) + of the patient. + name: patient_billing_type_id + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + planned_location_id: + data_type: character varying(255) + description: "The [location](#!/source/source.tamanu.tamanu.locations) that\ + \ the encounter will transfer to at the\r\n`planned_location_start_time`." + name: planned_location_id + planned_location_start_datetime: + data_type: timestamp + description: The time that the encounter will transfer to the planned location. + name: planned_location_start_datetime + reason_for_encounter: + data_type: text + description: "Free-form information about the encounter.\r\n\r\nCan include\ + \ info like type of survey submitted, emergency diagnosis, etc." + name: reason_for_encounter + referral_source_id: + data_type: character varying(255) + description: The referral source ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) + of the patient. + name: referral_source_id + start_datetime: + data_type: timestamp + description: The beginning of the encounter + name: start_datetime + config: + tags: + - base + - clinical + description: Tracks the basic information of the patient encounters within Tamanu + from start to finish + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: encounters + tags: + - base + - clinical +- columns: + created_datetime: + data_type: timestamp + description: Timestamp of when record was created in the encounters table. + name: created_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in encounters. + name: id + updated_datetime: + data_type: timestamp + description: Timestamp of when record was last updated in the encounters table. + name: updated_datetime + config: + tags: + - base + - clinical + - log + description: Metadata information extracted from the change logs for encounters. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: encounters_metadata + tags: + - base + - clinical + - log +- columns: + catchment_id: + data_type: text + description: Catchment area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: catchment_id + city_town: + data_type: character varying + description: City or town of the facility. + name: city_town + code: + data_type: character varying + description: Code (identifier) for the facility. + name: code + contact_number: + data_type: character varying + description: Administrative contact number of the facility. + name: contact_number + division: + data_type: character varying + description: Administrative division this facility lives in. + name: division + email: + data_type: character varying + description: Administrative email address of the facility. + name: email + id: + data_type: character varying + description: Tamanu internal identifier (generally a UUID) in facilities. + name: id + is_sensitive: + data_type: boolean + description: If set to `true`, encounters created on this facility will only + be viewable when logged into this facility + name: is_sensitive + name: + data_type: character varying + description: Full readable name. + name: name + street_address: + data_type: character varying + description: Street address of the facility. + name: street_address + type: + data_type: character varying + description: Type of the facility. + name: type + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in facilities." + name: visibility_status + config: + tags: + - base + - reference + description: "Table of facilities.\r\n\r\nFacilities may be either or both of:\r\ + \n\r\n- Any healthcare facility, like hospitals, clinics, mobile vaccination vans,\ + \ laboratories, etc\r\n- A Tamanu Facility deployment.\r\n\r\nWhen syncing, patient\ + \ and related records are scoped to a facility, according to the\r\n[`patient_facilities`](#!/source/source.tamanu.tamanu.patient_facilities)\ + \ table." + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: facilities + tags: + - base + - reference +- columns: + area_id: + data_type: character varying(255) + description: Reference to the imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: area_id + code: + data_type: text + description: External code. + name: code + description: + data_type: text + description: Human-friendly description for the area/code. + name: description + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in imaging_area_external_codes. + name: id + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_area_external_codes." + name: visibility_status + config: + tags: + - base + - reference + description: "External codes for imaging areas (such as for [PACS](https://en.wikipedia.org/wiki/Picture_archiving_and_communication_system)).\r\ + \n\r\nImaging areas are stored in [Reference Data](#!/source/source.tamanu.tamanu.reference_data),\ + \ this\r\ntable adds additional (external) codes." + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: imaging_area_external_codes + tags: + - base + - reference +- columns: + area_id: + data_type: character varying(255) + description: The imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: area_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in imaging_request_areas. + name: id + imaging_request_id: + data_type: character varying + description: The [imaging request](#!/source/source.tamanu.tamanu.imaging_requests). + name: imaging_request_id + config: + tags: + - base + - clinical + description: Areas to be imaged as part of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests). + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: imaging_request_areas + tags: + - base + - clinical +- columns: + completed_by_id: + data_type: character varying(255) + description: Reference to the [user](#!/source/source.tamanu.tamanu.users) who + completed this imaging. + name: completed_by_id + datetime: + data_type: timestamp + description: When the imaging was requested. + name: datetime + display_id: + data_type: character varying(255) + description: Short unique identifier used on the frontend. + name: display_id + encounter_id: + data_type: character varying(255) + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + this imaging request is a part of. + name: encounter_id + id: + data_type: character varying + description: Tamanu internal identifier (generally a UUID) in imaging_requests. + name: id + imaging_type: + data_type: character varying(31) + description: "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\ + \n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\ + \n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\ + \n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`" + name: imaging_type + location_group_id: + data_type: character varying(255) + description: Reference to the [location group](#!/source/source.tamanu.tamanu.location_groups) + for this imaging request. + name: location_group_id + location_id: + data_type: character varying(255) + description: Reference to the [location](#!/source/source.tamanu.tamanu.locations) + for this imaging request. + name: location_id + priority: + data_type: character varying(255) + description: "Priority of the request.\r\n\r\nThis is a customisable list; by\ + \ default the values are `routine`, `urgent`, `asap`, `stat`." + name: priority + reason_for_cancellation: + data_type: character varying(1024) + description: "If the request is cancelled, why that is.\r\n\r\nThis is a customisable\ + \ list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\ + \nThe 31-character limit was [arbitrary to avoid extremely long values set\ + \ in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113)." + name: reason_for_cancellation + requested_by_id: + data_type: character varying(255) + description: Reference to the [user](#!/source/source.tamanu.tamanu.users) who + requested this imaging. + name: requested_by_id + status: + data_type: character varying(255) + description: "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n-\ + \ `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`" + name: status + config: + tags: + - base + - clinical + description: "Imaging requests are the entrypoint of imaging workflows in Tamanu.\r\ + \n\r\nEach row is a request for radiology to perform one or more imagings on a\ + \ patient.\r\n\r\nImagings can have one or more [request areas](#!/source/source.tamanu.tamanu.imaging_request_areas)\r\ + \nattached, and when completed will have [results](#!/source/source.tamanu.tamanu.imaging_results)." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: imaging_requests + tags: + - base + - clinical +- columns: + completed_by_id: + data_type: character varying(255) + description: Reference to the [user](#!/source/source.tamanu.tamanu.users) who + completed this imaging. + name: completed_by_id + datetime: + data_type: timestamp + description: When this result was completed. + name: datetime + description: + data_type: text + description: Free-form description / notes about this imaging. + name: description + external_code: + data_type: text + description: External code for this result, used with PACS integration (generally + via FHIR). + name: external_code + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in imaging_results. + name: id + imaging_request_id: + data_type: character varying + description: Reference to the [imaging request](#!/source/source.tamanu.tamanu.imaging_requests). + name: imaging_request_id + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_results." + name: visibility_status + config: + tags: + - base + - clinical + description: "Result of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).\r\ + \n\r\nIn practice, there is usually one or two results per request:\r\n- one containing\ + \ a reference to a PACS image, when imaging integrations are enabled;\r\n- one\ + \ containing notes from a doctor who analysed the image.\r\n\r\nHowever there\ + \ is no limit; for example there may be multiple notes from multiple doctors." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: imaging_results + tags: + - base + - clinical +- columns: + coverage_value: + data_type: numeric + description: The amount of coverage (in percentage) of the insurance contract + item. + name: coverage_value + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in invoice_insurance_plan_items. + name: id + invoice_insurance_plan_id: + data_type: text + description: Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans). + name: invoice_insurance_plan_id + invoice_product_id: + data_type: text + description: Reference to the [invoice product](#!/source/source.tamanu.tamanu.invoice_products). + name: invoice_product_id + config: + tags: + - base + - reference + description: Table for insurance contract items used for invoicing. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: invoice_insurance_plan_items + tags: + - base + - reference +- columns: + code: + data_type: character varying(255) + description: Unique identifier code for the insurance contract. + name: code + default_coverage: + data_type: numeric + description: The default coverage (in percentage) of the insurance contract. + name: default_coverage + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in invoice_insurance_plans. + name: id + name: + data_type: character varying(255) + description: Human-readable name of the insurance contract. + name: name + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_insurance_plans." + name: visibility_status + config: + tags: + - base + - reference + description: Table for insurance contracts used for invoicing. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: invoice_insurance_plans + tags: + - base + - reference +- columns: + approved: + data_type: boolean + description: A boolean field that enables clinicians to track the approval status + of individual invoice line items + name: approved + date: + data_type: date + description: When the item was ordered. + name: date + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in invoice_items. + name: id + invoice_id: + data_type: character varying(255) + description: The [invoice](#!/source/source.tamanu.tamanu.invoices). + name: invoice_id + manual_entry_price: + data_type: numeric + description: Manually entered price override for this item, if specified. When + set, this takes precedence over the product's standard price. + name: manual_entry_price + ordered_by_user_id: + data_type: character varying(255) + description: '[Who](#!/source/source.tamanu.tamanu.users) ordered the item.' + name: ordered_by_user_id + price_final: + data_type: numeric + description: The final price per unit for this item on the invoice. This is + determined by the manual_entry_price if provided, otherwise from the product's + price when the invoice is finalised. + name: price_final + product_code_final: + data_type: character varying(255) + description: The final product code used on the invoice. Saved from the product + code field when the invoice is finalised. + name: product_code_final + product_id: + data_type: character varying(255) + description: The [product](#!/source/source.tamanu.tamanu.invoice_products). + name: product_id + product_name_final: + data_type: character varying(255) + description: The final product name used on the invoice. Saved from the product + name field when the invoice is finalised. + name: product_name_final + quantity: + data_type: integer + description: Quantity ordered. + name: quantity + source_record_id: + data_type: character varying(255) + description: Foreign key relation for record type. + name: source_record_id + source_record_type: + data_type: character varying(255) + description: The underlying model that the source record belongs to. + name: source_record_type + config: + tags: + - base + - administration + description: Items (products) on invoices. + name: invoice_items + tags: + - base + - administration +- columns: + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in invoice_price_list_items. + name: id + invoice_price_list_id: + data_type: text + description: Foreign key reference to the invoice_price_lists table. Links this + pricing item to its parent price list. + name: invoice_price_list_id + invoice_product_id: + data_type: text + description: Foreign key reference to the invoice products/services that can + be priced. Identifies which product or service this pricing item applies to. + name: invoice_product_id + is_hidden: + data_type: boolean + description: Determines whether the related invoice product should be hidden + from searches on the frontend and also whether it should be automatically + added to the invoice. + name: is_hidden + price: + data_type: numeric + description: The price amount for this product in the context of this price + list. Stored as a numeric value representing the cost in the system's base + currency. + name: price + config: + tags: + - base + - reference + description: Contains individual pricing entries for specific products within a + price list. Each record defines the price or pricing configuration for a particular + product in the context of a specific price list. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: invoice_price_list_items + tags: + - base + - reference +- columns: + code: + data_type: character varying(255) + description: Unique identifier code for the price list. Used for referencing + the price list in business logic and integrations. + name: code + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in invoice_price_lists. + name: id + name: + data_type: character varying(255) + description: Human-readable name of the price list, displayed in user interfaces + and reports. + name: name + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_price_lists." + name: visibility_status + config: + tags: + - base + - reference + description: Contains price list definitions used for invoice line item pricing. + Each price list represents a set of pricing rules that can be applied to different + types of invoices, patients, or services. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: invoice_price_lists + tags: + - base + - reference +- columns: + category: + data_type: character varying(255) + description: The category of the product. + name: category + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in invoice_products. + name: id + insurable: + data_type: boolean + description: Whether or not discounts can be applied to a product + name: insurable + name: + data_type: text + description: Name of the product. + name: name + source_record_id: + data_type: character varying(255) + description: The id of the source record for the product. + name: source_record_id + visibility_status: + data_type: character varying(255) + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_products." + name: visibility_status + config: + tags: + - base + - reference + description: Products which can be invoiced. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: invoice_products + tags: + - base + - reference +- columns: + datetime: + data_type: timestamp + description: Local date for the record in invoices. + name: datetime + display_id: + data_type: character varying(255) + description: Short unique identifier used on the frontend. + name: display_id + encounter_id: + data_type: character varying(255) + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + this invoice is a part of. + name: encounter_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in invoices. + name: id + insurer_payment_status: + data_type: character varying(255) + description: "Payment status (insurer portion, if applicable).\r\n\r\nOne of:\r\ + \n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`" + name: insurer_payment_status + patient_payment_status: + data_type: character varying(255) + description: "Payment status (patient portion, if applicable).\r\n\r\nOne of:\r\ + \n- `unpaid`\r\n- `paid`\r\n- `partial`" + name: patient_payment_status + status: + data_type: character varying(255) + description: "Status of the invoice.\r\n\r\nOne of:\r\n- `cancelled`\r\n- `in_progress`\r\ + \n- `finalised`" + name: status + config: + tags: + - base + - administration + description: Invoices related to encounters. + name: invoices + tags: + - base + - administration +- columns: + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in lab_request_logs. + name: id + lab_request_id: + data_type: character varying(255) + description: Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests). + name: lab_request_id + status: + data_type: character varying(255) + description: The status the lab request was updated to. + name: status + updated_by_id: + data_type: character varying(255) + description: Reference to the [user](#!/source/source.tamanu.tamanu.users) who + updated this lab request. + name: updated_by_id + config: + tags: + - base + - clinical + - log + description: This is a log of who changed the status of a lab request when. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: lab_request_logs + tags: + - base + - clinical + - log +- columns: + created_datetime: + data_type: timestamp + description: Timestamp of when record was created in the lab_request_logs table. + name: created_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in lab_request_logs. + name: id + updated_datetime: + data_type: timestamp + description: Timestamp of when record was last updated in the lab_request_logs + table. + name: updated_datetime + config: + tags: + - base + - clinical + - log + description: Metadata information extracted from the change logs for lab_request_logs. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: lab_request_logs_metadata + tags: + - base + - clinical + - log +- columns: + collected_by_id: + data_type: character varying(255) + description: Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) + who collected the sample. + name: collected_by_id + collected_datetime: + data_type: timestamp + description: When the sample was collected. + name: collected_datetime + department_id: + data_type: character varying(255) + description: Reference to the [Department](#!/source/source.tamanu.tamanu.departments) + the request comes from. + name: department_id + display_id: + data_type: character varying(255) + description: Short unique identifier used on the frontend. + name: display_id + encounter_id: + data_type: character varying(255) + description: Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) + the request is a part of. + name: encounter_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in lab_requests. + name: id + is_specimen_collected: + data_type: boolean + description: "Whether a specimen is attached.\r\n\r\nThis implies `specimen_type_id`." + name: is_specimen_collected + is_urgent: + data_type: boolean + description: Deprecated. + name: is_urgent + lab_sample_site_id: + data_type: character varying(255) + description: "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\ + \ representing where\r\non the patient the sample was taken." + name: lab_sample_site_id + lab_test_category_id: + data_type: character varying(255) + description: "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\ + \ representing the\r\ncategory of this request's test." + name: lab_test_category_id + lab_test_laboratory_id: + data_type: character varying(255) + description: "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\ + \ representing the\r\nlaboratory fulfilling this request." + name: lab_test_laboratory_id + lab_test_panel_request_id: + data_type: uuid + description: "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\ + \nassociated with this request, if any." + name: lab_test_panel_request_id + lab_test_priority_id: + data_type: character varying(255) + description: "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\ + \ representing the\r\npriority of this request." + name: lab_test_priority_id + published_date: + data_type: character(19) + description: When this lab request's results were published. + name: published_date + reason_for_cancellation: + data_type: character varying(31) + description: "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\ + \n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\ + \n- `patient-refused`" + name: reason_for_cancellation + requested_by_id: + data_type: character varying(255) + description: Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) + who submitted the request. + name: requested_by_id + requested_datetime: + data_type: timestamp + description: When the request was submitted. + name: requested_datetime + specimen_type_id: + data_type: character varying(255) + description: "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\ + \ representing the\r\ntype of the specimen for the request, if specified." + name: specimen_type_id + status: + data_type: character varying(255) + description: "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\ + \n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\ + \n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\ + \n- `entered-in-error`" + name: status + config: + tags: + - base + - clinical + description: "Lab requests are the entrypoint of laboratory workflows in Tamanu.\r\ + \n\r\nEach row is a request for a laboratory to perform a group of tests on a\ + \ sample taken from a patient.\r\n\r\nIt will be updated over the course of the\ + \ workflow to various statuses, starting with\r\n`reception_pending` (lab has\ + \ not received the request yet), up to `published` (lab has completed the\r\n\ + tests and has attached verified results).\r\n\r\nSee also: `lab_request_attachments`,\ + \ `lab_request_logs`, `lab_results`, `lab_tests`,\r\n`lab_test_panels`, and related\ + \ tables to those." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: lab_requests + tags: + - base + - clinical +- columns: + created_datetime: + data_type: timestamp + description: Timestamp of when record was created in the lab_requests table. + name: created_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in lab_requests. + name: id + updated_datetime: + data_type: timestamp + description: Timestamp of when record was last updated in the lab_requests table. + name: updated_datetime + config: + tags: + - base + - clinical + - log + description: Metadata information extracted from the change logs for lab_requests. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: lab_requests_metadata + tags: + - base + - clinical + - log +- columns: + id: + description: Tamanu internal identifier (generally a UUID) in lab_test_panel_lab_test_types. + name: id + lab_test_panel_id: + description: The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels). + name: lab_test_panel_id + lab_test_type_id: + description: The [test type](#!/source/source.tamanu.tamanu.lab_test_types). + name: lab_test_type_id + config: + tags: + - base + - reference + description: "The lab tests contained in a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels)\ + \ for more about lab test\r\npanels, and [`lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_types)\ + \ for the test types." + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: lab_test_panel_lab_test_types + tags: + - base + - reference +- columns: + encounter_id: + data_type: character varying(255) + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + this lab test panel request is a part of. + name: encounter_id + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in lab_test_panel_requests. + name: id + lab_test_panel_id: + data_type: character varying(255) + description: The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels). + name: lab_test_panel_id + config: + tags: + - base + - clinical + description: "A request for a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels)\ + \ for more about those." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: lab_test_panel_requests + tags: + - base + - clinical +- columns: + category_id: + data_type: character varying(255) + description: Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) + of this test panel. + name: category_id + code: + data_type: character varying(255) + description: Internal Tamanu code of the panel. + name: code + external_code: + data_type: text + description: External code, such as for interfacing with LIMS. + name: external_code + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in lab_test_panels. + name: id + name: + data_type: character varying(255) + description: Name of the test panel. + name: name + visibility_status: + data_type: character varying(255) + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_panels." + name: visibility_status + config: + tags: + - base + - reference + description: "A panel is a collection of lab test types, usually standardised.\r\ + \n\r\nFor example the BMP (basic metabolic panel) is a panel of 8 blood tests.\ + \ Instead of ordering all 8\r\ntests individually, a clinician can order the panel\ + \ all at once. This may also used to more\r\nefficiently use samples.\r\n\r\n\ + This table defines the available test panels, and\r\n[`lab_test_panel_lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_panel_lab_test_types)\r\ + \ncontains the actual test types that are part of each panel. See\r\n[`lab_test_panel_requests`](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\ + \ for requesting\r\npanels specifically, and [`lab_test_requests`](#!/source/source.tamanu.tamanu.lab_test_requests)\ + \ for\r\nrequesting lab tests in general." + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: lab_test_panels + tags: + - base + - reference +- columns: + code: + data_type: character varying(255) + description: Internal Tamanu code of the test. + name: code + external_code: + data_type: text + description: External code for the test (such as for LIMS). + name: external_code + female_max: + data_type: double precision + description: Maximum typical range for females. + name: female_max + female_min: + data_type: double precision + description: Minimum typical range for females. + name: female_min + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in lab_test_types. + name: id + is_sensitive: + data_type: boolean + description: Used to indicate if the lab test type is sensitive and should be + hidden accordingly. + name: is_sensitive + lab_test_category_id: + data_type: character varying(255) + description: Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) + of this test. + name: lab_test_category_id + male_max: + data_type: double precision + description: Maximum typical range for males. + name: male_max + male_min: + data_type: double precision + description: Minimum typical range for males. + name: male_min + name: + data_type: character varying(255) + description: Human-friendly name of the test. + name: name + options: + data_type: text + description: Comma-separated list of options. Unused. + name: options + range_text: + data_type: character varying(255) + description: Unused. + name: range_text + result_type: + data_type: character varying(255) + description: "Input type of result.\r\n\r\nOne of:\r\n- `FreeText`\r\n- `Number`\r\ + \n- `Select`" + name: result_type + unit: + data_type: character varying(255) + description: Unit the test result is measured in. + name: unit + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_types." + name: visibility_status + config: + tags: + - base + - reference + description: "A kind of test that's possible to request.\r\n\r\nThis includes information\ + \ about the test itself, and also parameters around result formatting, like\r\n\ + data type, expected ranges, etc." + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: lab_test_types + tags: + - base + - reference +- columns: + completed_datetime: + data_type: timestamp + description: Datetime at which the test was completed. + name: completed_datetime + date: + data_type: date + description: Local date for the record in lab_tests. + name: date + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in lab_tests. + name: id + lab_request_id: + data_type: character varying(255) + description: The [lab request](#!/source/source.tamanu.tamanu.lab_requests) + this test is part of. + name: lab_request_id + lab_test_method_id: + data_type: character varying(255) + description: Reference to the method ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) + of this test. + name: lab_test_method_id + lab_test_type_id: + data_type: character varying(255) + description: The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the + test. + name: lab_test_type_id + laboratory_officer: + data_type: character varying(255) + description: Name of the lab officer performing the test. + name: laboratory_officer + result: + data_type: character varying(255) + description: The result of the test. + name: result + verification: + data_type: character varying(255) + description: "Free-form field for a verification indication.\r\n\r\nMay be a\ + \ verifying or supervising officer's name, a department, lab notes..." + name: verification + config: + tags: + - base + - clinical + description: A single test as part of a [lab request](#!/source/source.tamanu.tamanu.lab_requests). + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: lab_tests + tags: + - base + - clinical +- columns: + booking_type_id: + data_type: character varying(255) + description: "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\ + \n(`type=bookingType`)." + name: booking_type_id + clinician_id: + data_type: character varying(255) + description: Reference to the [clinician](#!/source/source.tamanu.tamanu.users) + recording that appointment. + name: clinician_id + encounter_id: + data_type: character varying(255) + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + linked to this appointment + name: encounter_id + end_datetime: + data_type: timestamp + description: When the appointment ends. + name: end_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in appointments. + name: id + is_high_priority: + data_type: boolean + description: Boolean specify if the appointment is high priority. + name: is_high_priority + location_id: + data_type: character varying(255) + description: The [location](#!/source/source.tamanu.tamanu.locations) where + the appointment will take place. + name: location_id + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + start_datetime: + data_type: timestamp + description: When the appointment starts. + name: start_datetime + status: + data_type: character varying(255) + description: "The current status of the appointment record.\r\n\r\nOne of:\r\ + \n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`" + name: status + config: + tags: + - base + - clinical + description: Table of appointments. (location bookings) + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: location_bookings + tags: + - base + - clinical +- columns: + code: + data_type: character varying(255) + description: Code for location group + name: code + facility_id: + data_type: character varying(255) + description: Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) + this location group is in. + name: facility_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in location_groups. + name: id + name: + data_type: character varying(255) + description: Full readable name for location group + name: name + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in location_groups." + name: visibility_status + config: + tags: + - base + - reference + description: A group of locations managed as a single unit (e.g. a ward in hospital) + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: location_groups + tags: + - base + - reference +- columns: + code: + data_type: character varying(255) + description: Code for location + name: code + facility_id: + data_type: character varying(255) + description: Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) + this location is in. + name: facility_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in locations. + name: id + location_group_id: + data_type: character varying(255) + description: Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) + this location is in. + name: location_group_id + max_occupancy: + data_type: integer + description: The maximum number of patients that can be in this location + name: max_occupancy + name: + data_type: character varying(255) + description: Full readable name for location + name: name + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in locations." + name: visibility_status + config: + tags: + - base + - reference + description: Information on the hospital locations. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: locations + tags: + - base + - reference +- columns: + dispensed_at: + data_type: timestamp + description: The timestamp indicating when the medication was physically dispensed + to the patient. + name: dispensed_at + dispensed_by_user_id: + data_type: character varying(255) + description: Reference to the [user](#!/model/model.public.users) (typically + a pharmacist or pharmacy staff member) who dispensed the medication. + name: dispensed_by_user_id + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in medication_dispenses. + name: id + pharmacy_order_prescription_id: + data_type: uuid + description: Reference to the [pharmacy_order_prescription](#!/source/source.tamanu.tamanu.pharmacy_order_prescriptions) + that this dispense record fulfills. Links this dispensing event to the specific + medication order being filled. + name: pharmacy_order_prescription_id + quantity: + data_type: integer + description: The quantity of medication units dispensed to the patient in each + dispensing. + name: quantity + config: + tags: + - base + - clinical + - reference + description: Records of medication dispensing events, tracking when medications + from pharmacy orders are physically dispensed to patients. Each record represents + a single dispensing event for a specific prescription within a pharmacy order. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: medication_dispenses + tags: + - base + - clinical + - reference +- columns: + authored_by_id: + data_type: character varying(255) + description: Reference to the [user](#!/source/source.tamanu.tamanu.users) who + published this note. + name: authored_by_id + content: + data_type: text + description: The content of the note recorded. + name: content + datetime: + data_type: timestamp + description: Local date for the record in notes. + name: datetime + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in notes. + name: id + note_type_id: + data_type: character varying(255) + description: Reference to the note type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = noteType`). + name: note_type_id + on_behalf_of_id: + data_type: character varying(255) + description: Reference to the [user](#!/source/source.tamanu.tamanu.users) who + wrote this note, if it wasn't the user who published it. + name: on_behalf_of_id + record_id: + data_type: character varying(255) + description: Polymorphic relationship to the record to which the note is attached + (id). + name: record_id + record_type: + data_type: character varying(255) + description: Polymorphic relationship to the record to which the note is attached + (type). + name: record_type + updated_note_id: + data_type: uuid + description: Reference to the [note](#!/source/source.tamanu.tamanu.notes) that + is being revised. + name: updated_note_id + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in notes." + name: visibility_status + config: + tags: + - base + - clinical + description: "Notes recorded by clinicians or system generated.\r\n\r\nAlso see\ + \ the deprecated [`note_items`](#!/source/source.tamanu.tamanu.note_items),\r\n\ + [`note_pages`](#!/source/source.tamanu.tamanu.note_pages), and the even older\r\ + \n[`notes_legacy`](#!/source/source.tamanu.tamanu.notes_legacy).\r\n\r\nThis is\ + \ the current version (3) of the notes system." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: notes + tags: + - base + - clinical +- columns: + appointment_type_id: + data_type: character varying(255) + description: "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\ + \n(`type=appointmentType`)." + name: appointment_type_id + cancelled_at_date: + data_type: character(10) + description: The date from which appointments in a schedule have been cancelled, + this is set when cancelling 'this and all future appointments'. + name: cancelled_at_date + clinician_id: + data_type: character varying(255) + description: Reference to the [clinician](#!/source/source.tamanu.tamanu.users) + recording that appointment. + name: clinician_id + days_of_week: + data_type: array + description: "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY`\ + \ frequency `days_of_week` determines the weekday that the repeated appointment\ + \ occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with\ + \ `nth_weekday` to determine the date in each month that the repeated appointment\ + \ occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n-\ + \ `FR`\r\n- `SA`\r\n- `SU`" + name: days_of_week + encounter_id: + data_type: character varying(255) + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + linked to this appointment + name: encounter_id + end_datetime: + data_type: timestamp + description: When the appointment ends. + name: end_datetime + frequency: + data_type: character varying(255) + description: "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\ + \n- `MONTHLY`" + name: frequency + generated_until_date: + data_type: character(10) + description: The date of the most recent appointment in a schedule, this is + set after generation of the repeated appointment and then updated if it is + necessary to generate further appointments. + name: generated_until_date + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in appointments. + name: id + interval: + data_type: integer + description: "The recurrence interval. For example:\r\n- For a `frequency` of\ + \ `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency`\ + \ of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\"" + name: interval + is_fully_generated: + data_type: boolean + description: Whether or not all repeating appointments have been created for + a schedule + name: is_fully_generated + is_high_priority: + data_type: boolean + description: Boolean specify if the appointment is high priority. + name: is_high_priority + location_group_id: + data_type: character varying(255) + description: The [location group](#!/source/source.tamanu.tamanu.location_groups) + where the appointment will take place. + name: location_group_id + nth_weekday: + data_type: integer + description: "Ordinal weekday for monthly recurrence interpreted with `days_of_week`\ + \ for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the\ + \ month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\ + \n- `-1` with `days_of_week = ['FR']` = Last Friday of the month" + name: nth_weekday + occurrence_count: + data_type: integer + description: "When this value is set, the recurrence ends after generating the\ + \ specified number of occurrences\r\nAt least one of `occurrence_count` or\ + \ `until_date` must be set." + name: occurrence_count + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + schedule_id: + data_type: uuid + description: Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) + in the case of repeating appointments. + name: schedule_id + start_datetime: + data_type: timestamp + description: When the appointment starts. + name: start_datetime + status: + data_type: character varying(255) + description: "The current status of the appointment record.\r\n\r\nOne of:\r\ + \n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`" + name: status + until_date: + data_type: date + description: "The end date for the recurrence. No occurrences will be generated\ + \ beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be\ + \ null at the same time to ensure the recurrence has an end condition." + name: until_date + config: + tags: + - base + - clinical + description: Table of appointments. (outpatient appointment) + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: outpatient_appointments + tags: + - base + - clinical +- columns: + appointment_id: + description: Reference to the [appointment](#!/model/model.tamanu_source_dbt.outpatient_appointments) + that was modified. + name: appointment_id + appointment_type_id: + description: Current [appointment type](#!/model/model.tamanu_source_dbt.reference_data) + ID (after the change). + name: appointment_type_id + change_id: + description: Unique identifier for the change log entry (UUID from logs.changes). + name: change_id + change_sequence: + description: "Sequential number of this change for the appointment.\r\n- 1 =\ + \ initial creation event\r\n- 2+ = subsequent modifications\r\n\r\nUses ROW_NUMBER()\ + \ partitioned by appointment_id and ordered by logged_at." + name: change_sequence + clinician_id: + description: Current [clinician](#!/model/model.tamanu_source_dbt.users) ID + (after the change). + name: clinician_id + created_by_user_id: + description: Reference to the [user](#!/model/model.tamanu_source_dbt.users) + who originally created the appointment. + name: created_by_user_id + end_datetime: + description: Current appointment end date and time (after the change). + name: end_datetime + is_high_priority: + description: Current priority status (after the change). Boolean indicating + if the appointment is high priority. + name: is_high_priority + location_group_id: + description: Current [location group](#!/model/model.tamanu_source_dbt.location_groups)/area + ID (after the change). + name: location_group_id + modified_by_user_id: + description: Reference to the [user](#!/model/model.tamanu_source_dbt.users) + who made the modification. + name: modified_by_user_id + modified_datetime: + description: Timestamp when the change was logged (from logs.changes.logged_at). + name: modified_datetime + patient_id: + description: Reference to the [patient](#!/model/model.tamanu_source_dbt.patients) + associated with the appointment. + name: patient_id + prev_appointment_type_id: + description: Previous appointment type ID (before the change). Null for creation + events (change_sequence = 1). + name: prev_appointment_type_id + prev_clinician_id: + description: Previous clinician ID (before the change). Null for creation events + (change_sequence = 1). + name: prev_clinician_id + prev_end_datetime: + description: Previous appointment end date and time (before the change). Null + for creation events (change_sequence = 1). + name: prev_end_datetime + prev_is_high_priority: + description: Previous priority status (before the change). Null for creation + events (change_sequence = 1). + name: prev_is_high_priority + prev_location_group_id: + description: Previous location group/area ID (before the change). Null for creation + events (change_sequence = 1). + name: prev_location_group_id + prev_start_datetime: + description: Previous appointment start date and time (before the change). Null + for creation events (change_sequence = 1). + name: prev_start_datetime + prev_status: + description: Previous appointment status (before the change). Null for creation + events (change_sequence = 1). + name: prev_status + schedule_id: + description: Current recurring schedule ID (after the change). References appointment_schedules + table. + name: schedule_id + start_datetime: + description: Current appointment start date and time (after the change). + name: start_datetime + status: + description: "Current appointment status (after the change).\r\n\r\nOne of:\r\ + \n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`" + name: status + config: + tags: + - base + - base + - clinical + - audit + description: 'Base model for appointment change logs. Contains all changes to appointments + extracted from the logs.changes table, including the initial creation. Each row + represents a change event with both current and previous values. + + ' + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: outpatient_appointments_change_logs + tags: + - base + - clinical + - audit +- columns: + blood_type: + data_type: character varying(255) + description: "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n\ + - `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-`" + name: blood_type + tags: + - quasi_identifier + country_id: + data_type: character varying(255) + description: Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: country_id + tags: + - quasi_identifier + country_of_birth_id: + data_type: character varying(255) + description: Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: country_of_birth_id + tags: + - quasi_identifier + division_id: + data_type: character varying(255) + description: Reference to patient administrative division of residence ([Reference + Data](#!/source/source.tamanu.tamanu.reference_data)). + name: division_id + tags: + - quasi_identifier + educational_level: + data_type: character varying(255) + description: Highest educational attainment. + name: educational_level + tags: + - quasi_identifier + ethnicity_id: + data_type: character varying(255) + description: Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: ethnicity_id + tags: + - quasi_identifier + father_id: + data_type: character varying(255) + description: Reference to [patient](#!/source/source.tamanu.tamanu.patients) + ID of father / parent. + name: father_id + tags: + - quasi_identifier + health_center_id: + data_type: text + description: Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: health_center_id + tags: + - quasi_identifier + insurer_id: + data_type: character varying(255) + description: Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: insurer_id + tags: + - quasi_identifier + marital_status: + data_type: character varying(255) + description: "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\ + \n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`" + name: marital_status + tags: + - quasi_identifier + medical_area_id: + data_type: character varying(255) + description: Reference to patient administrative medical area of residence ([Reference + Data](#!/source/source.tamanu.tamanu.reference_data)). + name: medical_area_id + tags: + - quasi_identifier + mother_id: + data_type: character varying(255) + description: Reference to [patient](#!/source/source.tamanu.tamanu.patients) + ID of mother / parent. + name: mother_id + tags: + - quasi_identifier + nationality_id: + data_type: character varying(255) + description: Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: nationality_id + tags: + - quasi_identifier + nursing_zone_id: + data_type: character varying(255) + description: Reference to patient administrative nursing zone of residence ([Reference + Data](#!/source/source.tamanu.tamanu.reference_data)). + name: nursing_zone_id + tags: + - quasi_identifier + occupation_id: + data_type: character varying(255) + description: Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: occupation_id + tags: + - quasi_identifier + patient_billing_type_id: + data_type: character varying(255) + description: Reference to patient billing type. + name: patient_billing_type_id + tags: + - quasi_identifier + patient_id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in patient_additional_data. + name: patient_id + place_of_birth: + data_type: character varying(255) + description: Free-form place of birth (typically a place name or country). + name: place_of_birth + tags: + - quasi_identifier + registered_by_id: + data_type: character varying(255) + description: Reference to the [user](#!/source/source.tamanu.tamanu.users) who + registered the patient in Tamanu. + name: registered_by_id + registration_date: + data_type: date + description: Timestamp of when record was created in patient_additional_data + which is used as a best estimate of registration date. + name: registration_date + religion_id: + data_type: character varying(255) + description: Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: religion_id + tags: + - quasi_identifier + secondary_village_id: + data_type: text + description: "Reference to patient administrative village of residence ([Reference\ + \ Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\n\ + See also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients)." + name: secondary_village_id + tags: + - quasi_identifier + subdivision_id: + data_type: character varying(255) + description: Reference to patient administrative subdivision of residence ([Reference + Data](#!/source/source.tamanu.tamanu.reference_data)). + name: subdivision_id + tags: + - quasi_identifier + title: + data_type: character varying(255) + description: 'Patient name: title.' + name: title + updated_by_field: + data_type: json + description: "JSON object recording the updated datetime for individual columns.\r\ + \n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields\ + \ are edited separately in\r\ndifferent facilities. The default sync strategy\ + \ is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict,\ + \ but this can lead to discarding important data in the case of PADs. This\ + \ field\r\nis used to implement per-field \"last edit wins\" instead." + name: updated_by_field + config: + tags: + - base + - patient + description: "Core or adjunct patient data that doesn't fit elsewhere, but is only\ + \ downloaded to a facility once a\r\npatient is marked for sync.\r\n\r\nThis is\ + \ often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`,\ + \ `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and\ + \ specify custom/non-standard data to be stored against patients." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: true + tier: silver + name: patient_additional_data + tags: + - base + - patient +- columns: + blood_type: + data_type: text + description: "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n\ + - `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-` from history." + name: blood_type + tags: + - quasi_identifier + changelog_id: + data_type: uuid + description: The ID of the change log row. UUID + name: changelog_id + country_id: + data_type: text + description: Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + from history. + name: country_id + tags: + - quasi_identifier + country_of_birth_id: + data_type: text + description: Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + from history. + name: country_of_birth_id + tags: + - quasi_identifier + division_id: + data_type: text + description: Reference to patient administrative division of residence ([Reference + Data](#!/source/source.tamanu.tamanu.reference_data)). from history. + name: division_id + tags: + - quasi_identifier + educational_level: + data_type: text + description: Highest educational attainment. from history. + name: educational_level + tags: + - quasi_identifier + ethnicity_id: + data_type: text + description: Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + from history. + name: ethnicity_id + tags: + - quasi_identifier + father_id: + data_type: text + description: Reference to [patient](#!/source/source.tamanu.tamanu.patients) + ID of father / parent. from history. + name: father_id + tags: + - quasi_identifier + health_center_id: + data_type: text + description: Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + from history. + name: health_center_id + tags: + - quasi_identifier + insurer_id: + data_type: text + description: Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + from history. + name: insurer_id + tags: + - quasi_identifier + logged_at: + data_type: timestamp + description: The timestamp this change was logged. in patient additional data + history. + name: logged_at + marital_status: + data_type: text + description: "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\ + \n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`\ + \ from history." + name: marital_status + tags: + - quasi_identifier + medical_area_id: + data_type: text + description: Reference to patient administrative medical area of residence ([Reference + Data](#!/source/source.tamanu.tamanu.reference_data)). from history. + name: medical_area_id + tags: + - quasi_identifier + mother_id: + data_type: text + description: Reference to [patient](#!/source/source.tamanu.tamanu.patients) + ID of mother / parent. from history. + name: mother_id + tags: + - quasi_identifier + nationality_id: + data_type: text + description: Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + from history. + name: nationality_id + tags: + - quasi_identifier + nursing_zone_id: + data_type: text + description: Reference to patient administrative nursing zone of residence ([Reference + Data](#!/source/source.tamanu.tamanu.reference_data)). from history. + name: nursing_zone_id + tags: + - quasi_identifier + occupation_id: + data_type: text + description: Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + from history. + name: occupation_id + tags: + - quasi_identifier + patient_billing_type_id: + data_type: text + description: Reference to patient billing type. from history. + name: patient_billing_type_id + tags: + - quasi_identifier + patient_id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in patient_additional_data + from history. + name: patient_id + place_of_birth: + data_type: text + description: Free-form place of birth (typically a place name or country). from + history. + name: place_of_birth + tags: + - quasi_identifier + registered_by_id: + data_type: text + description: Reference to the [user](#!/source/source.tamanu.tamanu.users) who + registered the patient in Tamanu. from history. + name: registered_by_id + registration_date: + data_type: date + description: Timestamp of when record was created in patient additional data + history which is used as a best estimate of registration date. + name: registration_date + religion_id: + data_type: text + description: Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + from history. + name: religion_id + tags: + - quasi_identifier + secondary_village_id: + data_type: text + description: "Reference to patient administrative village of residence ([Reference\ + \ Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\n\ + See also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients).\ + \ from history." + name: secondary_village_id + tags: + - quasi_identifier + subdivision_id: + data_type: text + description: Reference to patient administrative subdivision of residence ([Reference + Data](#!/source/source.tamanu.tamanu.reference_data)). from history. + name: subdivision_id + tags: + - quasi_identifier + title: + data_type: text + description: 'Patient name: title. from history.' + name: title + updated_by_field: + data_type: jsonb + description: "JSON object recording the updated datetime for individual columns.\r\ + \n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields\ + \ are edited separately in\r\ndifferent facilities. The default sync strategy\ + \ is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict,\ + \ but this can lead to discarding important data in the case of PADs. This\ + \ field\r\nis used to implement per-field \"last edit wins\" instead. from\ + \ history." + name: updated_by_field + updated_by_user_id: + data_type: text + description: "The value of the `updated_by_user_id` field of the change data.\r\ + \n\r\nThis is extracted from the data to make it easier to query on. in patient\ + \ additional data history." + name: updated_by_user_id + config: + tags: + - base + - patient + - log + description: "Change logs of Core or adjunct patient data that doesn't fit elsewhere,\ + \ but is only downloaded to a facility once a\r\npatient is marked for sync.\r\ + \n\r\nThis is often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`,\ + \ `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and\ + \ specify custom/non-standard data to be stored against patients." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: true + tier: silver + name: patient_additional_data_change_logs + tags: + - base + - patient + - log +- columns: + allergy_id: + data_type: character varying(255) + description: Reference to an allergy ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: allergy_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in patient_allergies. + name: id + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + recorded_by: + data_type: character varying(255) + description: Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) + recording this allergy. + name: recorded_by + recorded_date: + data_type: date + description: Datetime at which this allergy was recorded. + name: recorded_date + config: + tags: + - base + - clinical + description: "List of allergies known of the patient.\r\n\r\nIn Tamanu this is displayed\ + \ and entered in the patient view sidebar, under \"Allergies\".\r\n\r\nSee also:\ + \ `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`,\ + \ `public.patient_issues`." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_allergies + tags: + - base + - clinical +- columns: + apgar_score_five_minutes: + data_type: integer + description: '[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) five + minutes after birth.' + name: apgar_score_five_minutes + apgar_score_one_minute: + data_type: integer + description: '[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) one minute + after birth.' + name: apgar_score_one_minute + apgar_score_ten_minutes: + data_type: integer + description: '[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) ten minutes + after birth.' + name: apgar_score_ten_minutes + attendant_at_birth: + data_type: character varying(255) + description: "The type of the attendant at birth.\r\n\r\nOne of:\r\n- `doctor`\r\ + \n- `midwife`\r\n- `nurse`\r\n- `traditional_birth_attentdant`\r\n- `other`" + name: attendant_at_birth + birth_delivery_type: + data_type: character varying(255) + description: "Type of delivery.\r\n\r\nOne of:\r\n- `normal_vaginal_delivery`\r\ + \n- `breech`\r\n- `emergency_c_section`\r\n- `elective_c_section`\r\n- `vacuum_extraction`\r\ + \n- `forceps`\r\n- `other`" + name: birth_delivery_type + birth_facility_id: + data_type: character varying(255) + description: "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities)\ + \ the birth was recorded at.\r\n\r\nThis is only required when `registered_birth_place`\ + \ is `health_facility`." + name: birth_facility_id + birth_length: + data_type: numeric + description: Length in cm at birth. + name: birth_length + birth_time: + data_type: time + description: Datetime of birth. + name: birth_time + birth_type: + data_type: character varying(255) + description: '`single` or `plural` birth.' + name: birth_type + birth_weight: + data_type: numeric + description: Weight in kg at birth. + name: birth_weight + gestational_age_estimate: + data_type: double precision + description: Gestational age estimate (weeks). + name: gestational_age_estimate + name_of_attendant_at_birth: + data_type: character varying(255) + description: Name of attendant at birth. + name: name_of_attendant_at_birth + patient_id: + data_type: character varying(255) + description: "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\ + \n\r\nThere is at most one `patient_birth_data` row per patient.\r\n\r\nNote\ + \ that the `id` column is generated from this column to enforce this." + name: patient_id + registered_birth_place: + data_type: character varying(255) + description: "Type of the actual birth place.\r\n\r\nOne of:\r\n- `health_facility`\r\ + \n- `home`\r\n- `other`" + name: registered_birth_place + registration_date: + data_type: date + description: Timestamp of when record was created in patient_birth_data. + name: registration_date + config: + tags: + - base + - clinical + description: "Information about the birth of the patient, if their birth was recorded\ + \ into Tamanu.\r\n\r\nThis is specifically data about the newborn, and only the\ + \ birth-relevant data.\r\nOther patient data is found in the normal tables i.e.\ + \ `patients`, `patient_additional_data`, etc." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_birth_data + tags: + - base + - clinical +- columns: + care_plan_datetime: + data_type: timestamp + description: Local date for the record in patient_care_plans. + name: care_plan_datetime + care_plan_id: + data_type: character varying(255) + description: Reference to the care plan ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: care_plan_id + clinician_id: + data_type: character varying(255) + description: Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) + who prescribed this care plan. + name: clinician_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in patient_care_plans. + name: id + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + config: + tags: + - base + - clinical + description: "List of current care plans the patient is on.\r\n\r\nIn Tamanu this\ + \ is displayed and entered in the patient view sidebar, under \"Care plans\".\r\ + \n\r\nSee also: `public.patient_allergies`, `public.patient_conditions`, `public.patient_family_histories`,\r\ + \n`public.patient_issues`." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_care_plans + tags: + - base + - clinical +- columns: + condition_id: + data_type: character varying(255) + description: Reference to a diagnosis describing this issue ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). + name: condition_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in patient_conditions. + name: id + is_resolved: + data_type: boolean + description: Whether the condition has resolved. + name: is_resolved + note: + data_type: character varying(255) + description: Free-form description of this condition. + name: note + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + recorded_by_id: + data_type: character varying(255) + description: "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users)\ + \ diagnosing/recording this\r\ncondition." + name: recorded_by_id + recorded_datetime: + data_type: timestamp + description: Datetime at which this issue was recorded. + name: recorded_datetime + resolution_note: + data_type: text + description: Free-form description or notes about the resolution of this condition. + name: resolution_note + resolved_by_id: + data_type: character varying(255) + description: "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users)\ + \ diagnosing/recording the\r\nresolution of this condition." + name: resolved_by_id + resolved_datetime: + data_type: character(19) + description: Datetime at which this issue was resolved. + name: resolved_datetime + config: + tags: + - base + - clinical + description: "List of ongoing conditions known about a patient.\r\n\r\nIn Tamanu\ + \ this is displayed and entered in the patient view sidebar, under \"Ongoing conditions\"\ + .\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`,\r\n\ + `public.patient_family_histories`, `public.patient_issues`." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_conditions + tags: + - base + - clinical +- columns: + condition_id: + data_type: character varying(255) + description: Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = diagnosis`). + name: condition_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in contributing_death_causes. + name: id + min_after_onset: + data_type: integer + description: Time between onset of recorded cause and death in minutes. + name: min_after_onset + patient_death_data_id: + data_type: character varying(255) + description: The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) + record. + name: patient_death_data_id + config: + tags: + - base + - clinical + description: Contributing causes recorded with the patient's death data. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_death_contributing_causes + tags: + - base + - clinical +- columns: + antecedent_cause1_condition_id: + data_type: character varying(255) + description: "Reference to an antecedent (1) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)),\ + \ if applicable." + name: antecedent_cause1_condition_id + antecedent_cause1_mins_after_onset: + data_type: integer + description: The time in minutes after onset of an antecedent (1) cause of death, + if applicable. + name: antecedent_cause1_mins_after_onset + antecedent_cause2_condition_id: + data_type: character varying(255) + description: "Reference to an antecedent (2) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)),\ + \ if applicable." + name: antecedent_cause2_condition_id + antecedent_cause2_mins_after_onset: + data_type: integer + description: The time in minutes after onset of an antecedent (2) cause of death, + if applicable. + name: antecedent_cause2_mins_after_onset + antecedent_cause3_condition_id: + data_type: character varying(255) + description: "Reference to an antecedent (3) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)),\ + \ if applicable." + name: antecedent_cause3_condition_id + antecedent_cause3_mins_after_onset: + data_type: integer + description: The time in minutes after onset of an antecedent (3) cause of death, + if applicable. + name: antecedent_cause3_mins_after_onset + autopsy_findings_used: + data_type: character varying(255) + description: If an autopsy was requested, whether the findings were used in + the death certification. + name: autopsy_findings_used + autopsy_requested: + data_type: character varying(255) + description: Whether an autopsy was requested. + name: autopsy_requested + birth_weight: + data_type: integer + description: If the deceased was a foetus, stillborn, or infant, their birth + weight. + name: birth_weight + carrier_age: + data_type: integer + description: If the deceased was a foetus, stillborn, or infant, the age of + the carrier. + name: carrier_age + carrier_pregnancy_weeks: + data_type: integer + description: If the deceased was a foetus, stillborn, or infant, how many weeks + pregnant their carrier was. + name: carrier_pregnancy_weeks + external_cause_date: + data_type: date + description: Datetime of external cause of death, if applicable. + name: external_cause_date + external_cause_location: + data_type: character varying(255) + description: Physical location of external cause of death, if applicable. + name: external_cause_location + external_cause_notes: + data_type: text + description: Free-form description of the location of external cause of death, + if applicable. + name: external_cause_notes + facility_id: + data_type: character varying(255) + description: Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) + where this death is being recorded. + name: facility_id + had_recent_surgery: + data_type: character varying(255) + description: Whether the deceased patient had a recent surgery, if any. + name: had_recent_surgery + hours_survived_since_birth: + data_type: integer + description: If the deceased was an infant, how many days since the birth passed + before their death. + name: hours_survived_since_birth + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in patient_death_data. + name: id + is_final: + data_type: boolean + description: "Whether this date record is final.\r\n\r\nIn Tamanu, this is set\ + \ by a supervisor after review, and cannot be reversed; it causes all fields\ + \ to\r\nbecome read-only. The only way to undo this record is through a `death_revert_logs`." + name: is_final + last_surgery_date: + data_type: date + description: Datetime of the most recent surgery the patient received, if any. + name: last_surgery_date + last_surgery_reason_id: + data_type: character varying(255) + description: "Reference to a `diagnosis` ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))\ + \ for the\r\nreason of the most recent surgery the patient received, if any." + name: last_surgery_reason_id + manner: + data_type: character varying(255) + description: A descriptive text specifying the manner of death. + name: manner + manner_of_death_description: + data_type: text + description: If an external cause occurred, a text description on how and if + applicable, notes of poisoning agent. + name: manner_of_death_description + mother_condition_description: + data_type: text + description: A text description stating the conditions of mother that affected + the fetus/newborn, if the death was perinatal. + name: mother_condition_description + multiple_pregnancy: + data_type: character varying(255) + description: Whether the deceased infant happened in a multiple pregnancy. + name: multiple_pregnancy + patient_id: + data_type: character varying(255) + description: The [patient](#!/source/source.tamanu.tamanu.patients) who died. + name: patient_id + pregnancy_contributed: + data_type: character varying(255) + description: Whether the pregnancy contributed to the death. + name: pregnancy_contributed + pregnancy_moment: + data_type: character varying(255) + description: The status of the pregnancy of the deceased, if applicable. + name: pregnancy_moment + primary_cause_condition_id: + data_type: character varying(255) + description: "Reference to the primary cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)),\ + \ if known." + name: primary_cause_condition_id + primary_cause_mins_after_onset: + data_type: integer + description: The time in minutes after onset of the primary cause of death, + if known. + name: primary_cause_mins_after_onset + recorded_by_id: + data_type: character varying(255) + description: Reference to the [clinician](#!/source/source.tamanu.tamanu.users) + who is recording this death. + name: recorded_by_id + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in patient_death_data." + name: visibility_status + was_fetal_or_infant: + data_type: boolean + description: Whether the deceased was themselves a foetus or infant. + name: was_fetal_or_infant + was_outside_health_facility: + data_type: boolean + description: Whether the death occurred outside of the facility. + name: was_outside_health_facility + was_pregnant: + data_type: character varying(255) + description: Whether the deceased was pregnant. + name: was_pregnant + was_stillborn: + data_type: character varying(255) + description: Whether the deceased was themselves stillborn. + name: was_stillborn + was_within_day_of_birth: + data_type: boolean + description: If the deceased was a foetus, stillborn, or infant, whether their + passing was on the day of their birth. + name: was_within_day_of_birth + config: + tags: + - base + - clinical + description: Information about a patient's death. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_death_data + tags: + - base + - clinical +- columns: + created_at: + data_type: timestamp with time zone + description: Timestamp of when record was created in patient_facilities. + name: created_at + facility_id: + data_type: character varying(255) + description: Reference to the [facility](#!/source/source.tamanu.tamanu.facilities). + name: facility_id + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in patient_facilities. + name: id + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + config: + tags: + - base + - clinical + description: "Tracks which patients are of interest to which facilities.\r\n\r\n\ + This is used to refine sync data: only patient data related to these patients\ + \ is synced to a\r\nfacility (plus general data, and some exceptions apply like\ + \ vaccine data under some conditions).\r\n\r\nIn Tamanu, this can be set manually\ + \ on the facility server (via the \"mark for sync\" button), or\r\ncentrally (via\ + \ some labs / vaccine programs, or via bulk-imports).\r\n\r\n_(\"Joe Patient attends\ + \ X Clinic\" is clinical info; even though an entry in patient facilities\r\n\ + doesn't necessarily imply this, it often does.)_" + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_facilities + tags: + - base + - clinical +- columns: + clinician_id: + data_type: character varying(255) + description: Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) + recording this history. + name: clinician_id + diagnosis_id: + data_type: character varying(255) + description: "Reference to a diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))\r\ + \ndescribing this issue." + name: diagnosis_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in patient_family_histories. + name: id + note: + data_type: character varying(255) + description: Free-form description of this issue. + name: note + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + recorded_datetime: + data_type: timestamp + description: Datetime at which this issue was recorded. + name: recorded_datetime + relationship: + data_type: character varying(255) + description: Free-form description of the family relationship. + name: relationship + config: + tags: + - base + - clinical + description: "List of family history conditions known about a patient.\r\n\r\nIn\ + \ Tamanu this is displayed and entered in the patient view sidebar, under \"Family\ + \ history\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`,\ + \ `public.patient_conditions`,\r\n`public.patient_issues`." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_family_histories + tags: + - base + - clinical +- columns: + definition_id: + data_type: character varying(255) + description: The [field definition](#!/source/source.tamanu.tamanu.patient_field_definitions). + name: definition_id + patient_id: + data_type: character varying(255) + description: Reference to the [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + value: + data_type: text + description: Value. + name: value + config: + tags: + - base + - patient + description: "Values recorded in custom patient fields.\r\n\r\nThe `id` column is\ + \ generated to enforce one value row per field definition per patient." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: true + tier: silver + name: patient_field_values + tags: + - base + - patient +- columns: + datetime: + data_type: timestamp + description: Local date for the record in patient_program_registration_conditions. + name: datetime + deleted_by_id: + data_type: character varying(255) + description: Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) + that removed the condition. + name: deleted_by_id + deleted_datetime: + data_type: timestamp + description: Date field which is a timestamp of record being deleted in patient_program_registration_conditions. + name: deleted_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in patient_program_registration_conditions. + name: id + patient_program_registration_id: + data_type: uuid + description: "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\ + \nof the condition." + name: patient_program_registration_id + program_registry_condition_category_id: + data_type: character varying(255) + description: "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\ + \nof the condition." + name: program_registry_condition_category_id + program_registry_condition_id: + data_type: character varying(255) + description: Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions). + name: program_registry_condition_id + reason_for_change: + data_type: character varying(255) + description: Optional field for recording the reason for changing the condition. + name: reason_for_change + recorded_by_id: + data_type: character varying(255) + description: Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) + recording that condition. + name: recorded_by_id + config: + tags: + - base + - clinical + description: Table of conditions related to patients in a program registration. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_program_registration_conditions + tags: + - base + - clinical +- columns: + changelog_id: + data_type: uuid + description: The ID of the change log row. UUID + name: changelog_id + datetime: + data_type: timestamp + description: Local date for the record in patient_program_registration_conditions + history. + name: datetime + deleted_by_id: + data_type: text + description: Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) + that removed the condition. from history. + name: deleted_by_id + deleted_datetime: + data_type: timestamp + description: Date field which is a timestamp of record being deleted in patient_program_registration_conditions + history. + name: deleted_datetime + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in patient_program_registration_conditions. + name: id + logged_at: + data_type: timestamp + description: The timestamp this change was logged. in patient program registration + condition record. + name: logged_at + patient_program_registration_id: + data_type: text + description: "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\ + \nof the condition. from history." + name: patient_program_registration_id + program_registry_condition_category_id: + data_type: text + description: "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\ + \nof the condition. from history." + name: program_registry_condition_category_id + program_registry_condition_id: + data_type: text + description: Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions). + from history. + name: program_registry_condition_id + reason_for_change: + data_type: text + description: Optional field for recording the reason for changing the condition. + from history. + name: reason_for_change + recorded_by_id: + data_type: text + description: Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) + recording that condition. from history. + name: recorded_by_id + updated_by_user_id: + data_type: text + description: "The value of the `updated_by_user_id` field of the change data.\r\ + \n\r\nThis is extracted from the data to make it easier to query on. in patient\ + \ program registration condition record." + name: updated_by_user_id + config: + tags: + - base + - clinical + - log + description: Change logs of Table of conditions related to patients in a program + registration. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_program_registration_conditions_change_logs + tags: + - base + - clinical + - log +- columns: + clinical_status_id: + data_type: character varying(255) + description: "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\ + \nof the registration." + name: clinical_status_id + datetime: + data_type: timestamp + description: Local date for the record in patient_program_registrations. + name: datetime + deactivated_by_id: + data_type: character varying(255) + description: The clinician that removed the patient from the program registry. + name: deactivated_by_id + deactivated_datetime: + data_type: timestamp + description: The date that the patient from the program registry. + name: deactivated_datetime + facility_id: + data_type: character varying(255) + description: "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities)\ + \ this program\r\nregistration is from." + name: facility_id + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in patient_program_registrations. + name: id + patient_id: + data_type: character varying(255) + description: Reference to the [Patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + program_registry_id: + data_type: character varying(255) + description: "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\ + \nof the registration." + name: program_registry_id + registered_by_id: + data_type: character varying(255) + description: "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users)\ + \ recording that\r\nregistration." + name: registered_by_id + registering_facility_id: + data_type: character varying(255) + description: "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities)\ + \ where the\r\nregistration was registered in." + name: registering_facility_id + registration_status: + data_type: text + description: "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\ + \n- `inactive`\r\n- `recordedInError`" + name: registration_status + village_id: + data_type: character varying(255) + description: "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\ + \n(`type=village`) this program registration is from." + name: village_id + config: + tags: + - base + - clinical + description: "Table with information about the program registrations of a patient.\ + \ This is helpful\r\nto enroll a specific patient within a program that will be\ + \ followed for an extended\r\nperiod of time.\r\n\r\n**This table is append-only.**\r\ + \nA new record is created every time there is a change to the status of a registration.\ + \ \r\n\r\nAt the moment, this implies that when merging two patients, both with\ + \ a registration to the same\r\nregistry, the merged patient ends up with two\ + \ registrations." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_program_registrations + tags: + - base + - clinical +- columns: + changelog_id: + data_type: uuid + description: The ID of the change log row. UUID + name: changelog_id + clinical_status_id: + data_type: text + description: "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\ + \nof the registration. from history." + name: clinical_status_id + datetime: + data_type: timestamp + description: Local date for the record in patient_program_registrations history. + name: datetime + deactivated_by_id: + data_type: text + description: The clinician that removed the patient from the program registry. + from history. + name: deactivated_by_id + deactivated_datetime: + data_type: timestamp + description: The date that the patient from the program registry. from history. + name: deactivated_datetime + facility_id: + data_type: text + description: "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities)\ + \ this program\r\nregistration is from. from history." + name: facility_id + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in patient_program_registrations. + name: id + logged_at: + data_type: timestamp + description: The timestamp this change was logged. in patient_program registrations + history. + name: logged_at + patient_id: + data_type: text + description: Reference to the [Patient](#!/source/source.tamanu.tamanu.patients). + from history. + name: patient_id + program_registry_id: + data_type: text + description: "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\ + \nof the registration. from history." + name: program_registry_id + registered_by_id: + data_type: text + description: "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users)\ + \ recording that\r\nregistration. from history." + name: registered_by_id + registering_facility_id: + data_type: text + description: "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities)\ + \ where the\r\nregistration was registered in. from history." + name: registering_facility_id + registration_status: + data_type: text + description: "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\ + \n- `inactive`\r\n- `recordedInError` from history." + name: registration_status + updated_by_user_id: + data_type: text + description: "The value of the `updated_by_user_id` field of the change data.\r\ + \n\r\nThis is extracted from the data to make it easier to query on. in patient_program\ + \ registrations history." + name: updated_by_user_id + village_id: + data_type: text + description: "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\ + \n(`type=village`) this program registration is from. from history." + name: village_id + config: + tags: + - base + - clinical + - log + description: "Change logs of Table with information about the program registrations\ + \ of a patient. This is helpful\r\nto enroll a specific patient within a program\ + \ that will be followed for an extended\r\nperiod of time.\r\n\r\n**This table\ + \ is append-only.**\r\nA new record is created every time there is a change to\ + \ the status of a registration. \r\n\r\nAt the moment, this implies that when\ + \ merging two patients, both with a registration to the same\r\nregistry, the\ + \ merged patient ends up with two registrations." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_program_registrations_change_logs + tags: + - base + - clinical + - log +- columns: + days_till_due: + data_type: integer + description: "Number of days until the scheduled vaccine is due. Negative numbers\ + \ indicates the number of days in the past the vaccine\r\nwas due." + name: days_till_due + due_date: + data_type: date + description: Due date of the scheduled vaccine. + name: due_date + patient_id: + data_type: character varying + description: The [patient](#!/source/source.tamanu.tamanu.patients). + name: patient_id + status: + data_type: text + description: Status of the upcoming vaccination listed ['DUE', 'OVERDUE', 'MISSED', + 'SCHEDULED', 'UPCOMING'] + name: status + vaccine_category: + data_type: character varying + description: Vaccine category [Routine, Catch-up, Campaign, Other] + name: vaccine_category + vaccine_id: + data_type: character varying + description: Reference to the vaccine ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = drug`). + name: vaccine_id + vaccine_schedules_id: + data_type: character varying + description: Reference to the [scheduled vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines). + name: vaccine_schedules_id + config: + tags: + - base + - clinical + description: "A **view** which lists patients and next vaccine due for a given vaccine\ + \ type.\r\n\r\nThe first dose of a vaccine type is based on weeks from birth due\ + \ whilst subsequent doses are based on weeks from last \r\nvaccination due.\r\n\ + \r\nAge limits in years and thresholds in days for scheduled status are configurable\ + \ with the following defaults:\r\n\r\n- Age = 15\r\n- Status: Scheduled = 28\r\ + \n- Status: Upcoming = 7\r\n- Status: Due = -7\r\n- Status: Overdue = -55\r\n\ + - Status: Missed = -Infinity" + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: patient_vaccinations_upcoming + tags: + - base + - clinical +- columns: + date_of_birth: + data_type: date + description: Date of birth of patient + name: date_of_birth + tags: + - quasi_identifier + date_of_death: + data_type: timestamp + description: Date and time of death of patient + name: date_of_death + tags: + - quasi_identifier + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in patients. + name: id + sex: + data_type: character varying(255) + description: "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n-\ + \ `other`" + name: sex + tags: + - quasi_identifier + village_id: + data_type: character varying(255) + description: Tamanu village identifier defined in the reference data + name: village_id + tags: + - quasi_identifier + config: + tags: + - base + - patient + description: "The central record for a patient.\r\n\r\n⚠️ The full contents of this\ + \ table are synced to all devices, and in larger deployments this may be\r\nhundreds\ + \ of thousands of records (or even millions), so it is critical to keep the row\ + \ size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare\ + \ minimum to be able to find that patient\r\nin the system from the search page.\r\ + \n\r\nThe remainder of the patient data is stored in the `patient_additional_data`\ + \ table, which is only\r\nsynced to a device once it has marked that patient for\ + \ sync (in the `patient_facility` table)." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: true + tier: silver + name: patients + tags: + - base + - patient +- columns: + back_end_context: + data_type: jsonb + description: A JSON object containing back end information about the record + access + name: back_end_context + device_id: + data_type: text + description: The id for the device that the user was accessing the record on + name: device_id + facility_id: + data_type: text + description: The facility that the record was accessed on + name: facility_id + front_end_context: + data_type: jsonb + description: A JSON object containing front end information about the record + access + name: front_end_context + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in patients_access_logs. + name: id + is_mobile: + data_type: boolean + description: Whether or not the user accessed the record from mobile + name: is_mobile + logged_at: + data_type: timestamp with time zone + description: The time string of when the record was accessed + name: logged_at + patient_id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in patients. + name: patient_id + session_id: + data_type: text + description: The user session that the record was accessed on + name: session_id + user_id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in users. + name: user_id + version: + data_type: text + description: The version of tamanu the record was created on + name: version + config: + tags: + - base + - administration + - log + description: Access logs of patient data + meta: + classification: confidential + domain: admin + owner: bes-maui + pii: false + tier: silver + name: patients_access_logs + tags: + - base + - administration + - log +- columns: + changelog_id: + data_type: uuid + description: The ID of the change log row. UUID + name: changelog_id + date_of_birth: + data_type: date + description: Date of birth of patient from history. + name: date_of_birth + tags: + - quasi_identifier + date_of_death: + data_type: timestamp + description: Date and time of death of patient from history. + name: date_of_death + tags: + - quasi_identifier + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in patients. + name: id + logged_at: + data_type: timestamp + description: The timestamp this change was logged. in patients history. + name: logged_at + registration_date: + data_type: date + description: Timestamp of when record was created in patients history which + is used as a best estimate of registration date. + name: registration_date + sex: + data_type: text + description: "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n-\ + \ `other` from history." + name: sex + tags: + - quasi_identifier + updated_by_user_id: + data_type: text + description: "The value of the `updated_by_user_id` field of the change data.\r\ + \n\r\nThis is extracted from the data to make it easier to query on. in patients\ + \ history." + name: updated_by_user_id + village_id: + data_type: text + description: Tamanu village identifier defined in the reference data from history. + name: village_id + tags: + - quasi_identifier + config: + tags: + - base + - patient + - log + description: "Change logs for The central record for a patient.\r\n\r\n⚠️ The full\ + \ contents of this table are synced to all devices, and in larger deployments\ + \ this may be\r\nhundreds of thousands of records (or even millions), so it is\ + \ critical to keep the row size small.\r\n\r\nOnly contains basic patient data\ + \ (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the\ + \ system from the search page.\r\n\r\nThe remainder of the patient data is stored\ + \ in the `patient_additional_data` table, which is only\r\nsynced to a device\ + \ once it has marked that patient for sync (in the `patient_facility` table)." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: true + tier: silver + name: patients_change_logs + tags: + - base + - patient + - log +- columns: + date_of_birth: + data_type: date + description: Date of birth of patient + name: date_of_birth + tags: + - quasi_identifier + date_of_death: + data_type: timestamp + description: Date and time of death of patient + name: date_of_death + tags: + - quasi_identifier + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in patients. + name: id + registration_date: + data_type: date + description: Timestamp of when record was created in patients which is used + as a best estimate of registration date. + name: registration_date + sex: + data_type: character varying(255) + description: "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n-\ + \ `other`" + name: sex + tags: + - quasi_identifier + village_id: + data_type: character varying(255) + description: Tamanu village identifier defined in the reference data + name: village_id + tags: + - quasi_identifier + config: + tags: + - base + - patient + description: "Only includes patients that have been merged. The central record for\ + \ a patient.\r\n\r\n⚠️ The full contents of this table are synced to all devices,\ + \ and in larger deployments this may be\r\nhundreds of thousands of records (or\ + \ even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains\ + \ basic patient data (name, dob, etc.): the bare minimum to be able to find that\ + \ patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient\ + \ data is stored in the `patient_additional_data` table, which is only\r\nsynced\ + \ to a device once it has marked that patient for sync (in the `patient_facility`\ + \ table)." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: true + tier: silver + name: patients_merged + tags: + - base + - patient +- columns: + created_datetime: + data_type: timestamp + description: Timestamp of when record was created in the patients table. + name: created_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in patients. + name: id + updated_datetime: + data_type: timestamp + description: Timestamp of when record was last updated in the patients table. + name: updated_datetime + config: + tags: + - base + - patient + - log + description: Metadata information extracted from the change logs for patients. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: true + tier: silver + name: patients_metadata + tags: + - base + - patient + - log +- columns: + display_id: + data_type: character varying(255) + description: Human-readable request number for this prescription order. A new + request number is generated each time a prescription is sent to pharmacy. + name: display_id + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in pharmacy_order_prescriptions. + name: id + is_completed: + data_type: boolean + description: Indicates whether this prescription has been fully completed. Set + to `true` when all repeats have been dispensed for a discharge prescription + (outpatient medication). Used to filter completed prescriptions from active + medication request lists. + name: is_completed + ongoing_prescription_id: + data_type: text + description: When this pharmacy order prescription was created from an ongoing + prescription (send to pharmacy flow), references the ongoing [prescription](#!/source/source.tamanu.tamanu.prescriptions). + Null for encounter-based pharmacy orders. + name: ongoing_prescription_id + pharmacy_order_id: + data_type: uuid + description: Reference to the [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders). + name: pharmacy_order_id + prescription_id: + data_type: text + description: Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions). + name: prescription_id + quantity: + data_type: integer + description: Quantity of medication ordered. + name: quantity + repeats: + data_type: integer + description: Number of repeats for the prescription. + name: repeats + config: + tags: + - base + - clinical + - reference + description: Individual prescriptions that are included in a [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders). + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: pharmacy_order_prescriptions + tags: + - base + - clinical + - reference +- columns: + datetime: + data_type: timestamp + description: Local date and time for the record in pharmacy_orders. + name: datetime + encounter_id: + data_type: text + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + for the order. + name: encounter_id + facility_id: + data_type: character varying(255) + description: Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) + where the pharmacy order was placed. + name: facility_id + id: + data_type: uuid + description: Tamanu internal identifier (generally a UUID) in pharmacy_orders. + name: id + is_discharge_prescription: + data_type: boolean + description: If the patient is being discharged with this prescription. + name: is_discharge_prescription + ordering_clinician_id: + data_type: text + description: Reference to the [clinician](#!/source/source.tamanu.tamanu.users) + who placed the order. + name: ordering_clinician_id + config: + tags: + - base + - clinical + - reference + description: An order for prescriptions placed by Tamanu to a Pharmacy + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: pharmacy_orders + tags: + - base + - clinical + - reference +- columns: + datetime: + data_type: timestamp + description: Local date and time for the record in prescriptions. + name: datetime + discontinued_by_id: + data_type: character varying(255) + description: If the prescription was discontinued, who did it. + name: discontinued_by_id + discontinued_datetime: + data_type: timestamp + description: If the prescription was discontinued, when that happened. + name: discontinued_datetime + discontinuing_reason: + data_type: character varying(255) + description: If the prescription was discontinued, why that happened. + name: discontinuing_reason + dose_amount: + data_type: numeric + description: Numeric field to record dose amount + name: dose_amount + duration_unit: + data_type: character varying(255) + description: The duration unit of the prescription + name: duration_unit + duration_value: + data_type: numeric + description: The duration value of the prescription + name: duration_value + end_datetime: + data_type: timestamp + description: When the prescription ends. + name: end_datetime + frequency: + data_type: character varying(255) + description: The frequency of the prescription + name: frequency + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in prescriptions. + name: id + ideal_times: + data_type: array + description: Ideal times which are specified by prescriber + name: ideal_times + indication: + data_type: character varying(255) + description: The [indication of use](https://en.wikipedia.org/wiki/Indication_(medicine)) + for the medicine. + name: indication + is_discontinued: + data_type: boolean + description: Whether the prescription was discontinued. + name: is_discontinued + is_ongoing: + data_type: boolean + description: A flag to determine whether or not the current prescription is + ongoing + name: is_ongoing + is_phone_order: + data_type: boolean + description: A flag to determine whether or not the current prescription is + phone order + name: is_phone_order + is_prn: + data_type: boolean + description: A flag to determine whether or not the current prescription is + prn + name: is_prn + is_variable_dose: + data_type: boolean + description: A flag to determine whether or not the current prescription is + variable does + name: is_variable_dose + medication_id: + data_type: character varying(255) + description: The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = drug`). + name: medication_id + prescriber_id: + data_type: character varying(255) + description: '[Who](#!/source/source.tamanu.tamanu.users) prescribed the medication.' + name: prescriber_id + quantity: + data_type: integer + description: Quantity of medicine to dispense. + name: quantity + repeats: + data_type: integer + description: How many times this prescription can be repeatedly dispensed without + a new prescription. + name: repeats + route: + data_type: character varying(255) + description: Administration route for the medication. + name: route + start_datetime: + data_type: timestamp + description: The start date of the prescription + name: start_datetime + units: + data_type: character varying(255) + description: The units of the prescription + name: units + config: + tags: + - base + - clinical + description: Records prescriptions for medications. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: true + tier: silver + name: prescriptions + tags: + - base + - clinical +- columns: + anaesthetic_id: + data_type: character varying(255) + description: Reference to the anaesthetic ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = drug`). + name: anaesthetic_id + anaesthetist_id: + data_type: character varying(255) + description: Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users). + name: anaesthetist_id + assistant_anaesthetist_id: + data_type: character varying(255) + description: Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users). + name: assistant_anaesthetist_id + clinician_id: + data_type: character varying(255) + description: Reference to the [physician](#!/source/source.tamanu.tamanu.users). + name: clinician_id + completed_note: + data_type: text + description: Free-form notes at completion of the procedure. + name: completed_note + date: + data_type: date + description: Local date for the record in procedures. + name: date + encounter_id: + data_type: character varying(255) + description: The [encounter](#!/source/source.tamanu.tamanu.encounters) this + procedure is a part of. + name: encounter_id + end_time: + data_type: time + description: When the procedure ended, if it's completed. + name: end_time + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in procedures. + name: id + is_completed: + data_type: boolean + description: Whether the procedure has completed. + name: is_completed + location_id: + data_type: character varying(255) + description: Reference to the [location](#!/source/source.tamanu.tamanu.locations) + the procedure happens in. + name: location_id + note: + data_type: text + description: Free-form description of the procedure. + name: note + procedure_type_id: + data_type: character varying(255) + description: Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = procedureType`). + name: procedure_type_id + start_time: + data_type: time + description: When the procedure started. + name: start_time + time_in: + data_type: time + description: The time when the patient entered the procedure room or when the + procedure setup began. + name: time_in + time_out: + data_type: time + description: The time when the patient left the procedure room or when the procedure + cleanup was completed. + name: time_out + config: + tags: + - base + - clinical + description: Record of each procedure in progress or completed. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: procedures + tags: + - base + - clinical +- columns: + created_datetime: + data_type: timestamp + description: Timestamp of when record was created in the procedures table. + name: created_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in procedures. + name: id + updated_datetime: + data_type: timestamp + description: Timestamp of when record was last updated in the procedures table. + name: updated_datetime + config: + tags: + - base + - clinical + - log + description: Metadata information extracted from the change logs for procedures. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: procedures_metadata + tags: + - base + - clinical + - log +- columns: + code: + data_type: character varying(255) + description: "Machine-friendly short name for the question.\r\n\r\nThis is also\ + \ used to refer to questions within criteria and such." + name: code + default_options: + data_type: text + description: Default options if this is a dropdown. + name: default_options + default_text: + data_type: character varying(255) + description: Default value. + name: default_text + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in program_data_elements. + name: id + indicator: + data_type: character varying(255) + description: "Another name for the data element.\r\n\r\nIt's named `indicator`\ + \ from mimicry of Tupaia." + name: indicator + name: + data_type: character varying(255) + description: Human-friendly name + name: name + type: + data_type: character varying(31) + description: "Type of the field.\r\n\r\nTypes are here: " + name: type + visualisation_config: + data_type: text + description: JSON visualisation configuration. + name: visualisation_config + config: + tags: + - base + - reference + description: "Describes how a survey question gets stored.\r\n\r\nSee [survey screen\ + \ components](#!/source/source.tamanu.tamanu.survey_screen_components), which\r\ + \ndescribes how the question is displayed." + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: program_data_elements + tags: + - base + - reference +- columns: + code: + data_type: text + description: Machine-friendly identifier. + name: code + currently_at_type: + data_type: text + description: "Defines what kind of location the registry can be filtered with.\r\ + \n\r\nOne of:\r\n- `village`\r\n- `facility`" + name: currently_at_type + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in program_registries. + name: id + name: + data_type: text + description: Human-friendly name. + name: name + program_id: + data_type: character varying(255) + description: Reference to a [program](#!/source/source.tamanu.tamanu.programs). + name: program_id + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registries." + name: visibility_status + config: + tags: + - base + - reference + description: "Table of program registries.\r\n\r\nThis provides functionality to\ + \ track a patient population defined by a particular disease or\r\ncondition,\ + \ and follow this population over time.\r\n\r\nThis table defines the different\ + \ registries available to track users with." + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: program_registries + tags: + - base + - reference +- columns: + code: + data_type: text + description: Code (identifier) for the clinical status. + name: code + color: + data_type: text + description: "A color for the clinical status.\r\n\r\nOne of:\r\n- `purple`\r\ + \n- `pink`\r\n- `orange`\r\n- `yellow`\r\n- `blue`\r\n- `green`\r\n- `grey`\r\ + \n- `red`\r\n- `brown`\r\n- `teal`" + name: color + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in program_registry_clinical_statuses. + name: id + name: + data_type: text + description: The name of the clinical status. + name: name + program_registry_id: + data_type: character varying(255) + description: "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\ + \nthe status is a part of." + name: program_registry_id + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_clinical_statuses." + name: visibility_status + config: + tags: + - base + - reference + description: Table of clinical statuses used in program registries. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: program_registry_clinical_statuses + tags: + - base + - reference +- columns: + code: + data_type: text + description: The code for the category. + name: code + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in program_registry_condition_categories. + name: id + name: + data_type: text + description: The name for the category. + name: name + program_registry_id: + data_type: character varying(255) + description: The id of the program registry. + name: program_registry_id + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_condition_categories." + name: visibility_status + config: + tags: + - base + - reference + description: Categories to be set against patient program registry conditions. The + categories are configured through the program importer for each program registry. + There is a hard-loaded list that is seeded by default in the database for each + program registry. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: program_registry_condition_categories + tags: + - base + - reference +- columns: + code: + data_type: text + description: Code (identifier) for the condition. + name: code + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in program_registry_conditions. + name: id + name: + data_type: text + description: The name of the condition. + name: name + program_registry_id: + data_type: character varying(255) + description: "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\ + \nthe condition is a part of." + name: program_registry_id + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_conditions." + name: visibility_status + config: + tags: + - base + - reference + description: Table of program registry conditions. + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: program_registry_conditions + tags: + - base + - reference +- columns: + code: + data_type: character varying(255) + description: Machine-friendly code. + name: code + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in programs. + name: id + name: + data_type: character varying(255) + description: Human-friendly name. + name: name + config: + tags: + - base + - reference + description: Groups of [surveys](#!/source/source.tamanu.tamanu.surveys) or [program + registries](#!/source/source.tamanu.tamanu.program_registries). + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: programs + tags: + - base + - reference +- columns: + code: + data_type: character varying(255) + description: Code of the data item (short value, alphanumerics and hyphens). + name: code + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in reference_data. + name: id + name: + data_type: text + description: Actual data + name: name + type: + data_type: character varying(255) + description: "Class of the data (referred to in code).\r\n\r\nWhenever this\ + \ table is referred to in a relationship, it's to a specific `type` here.\ + \ For example a\r\ntable might have a `diagnosis_id`, which is a reference\ + \ to this table, for specifically only the\r\nrows with `type = diagnosis`." + name: type + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in reference_data." + name: visibility_status + config: + tags: + - base + - reference + description: "User imported reference data for the environment grouped by type.\r\ + \n\r\n- Catch-all for simple reference data types - there are a LOT of kinds of\ + \ reference data that exist as just an ID, a \r\nstring label, and occasionally\ + \ a code; these are all grouped into this table to avoid overcomplicating the\ + \ schema.\r\n- Occasionally a type of simple reference data will gain some complexity,\ + \ at which point it will be refactored/migrated \r\nout to use its own table.\r\ + \n- Simple reference data types include a code, type, name and visibility status.\r\ + \n- Example types include `diagnosis`, `procedures`" + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: reference_data + tags: + - base + - reference +- columns: + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in referrals. + name: id + initiating_encounter_id: + data_type: character varying(255) + description: Reference to the [initiating encounter](#!/source/source.tamanu.tamanu.encounters). + name: initiating_encounter_id + referred_facility: + data_type: character varying(255) + description: Unused. + name: referred_facility + status: + data_type: character varying(255) + description: "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\ + \n- `completed`" + name: status + survey_response_id: + data_type: character varying(255) + description: Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) + with more data. + name: survey_response_id + config: + tags: + - base + - clinical + description: "[Referrals](https://en.wikipedia.org/wiki/Referral_(medicine)).\r\n\ + \r\nReferrals use a confusing mix of data in the `referrals` table and\r\n[`survey_response_answers`](#!/source/source.tamanu.tamanu.survey_response_answers)\ + \ identified by\r\nthe text of the question they are for. \r\n\r\nSome additional\ + \ data is captured in\r\n[survey response answers](#!/source/source.tamanu.tamanu.survey_response_answers),\ + \ but this is\r\nvariable and not enforced through any validation:\r\n- Where\ + \ the person is being referred to can be captured by a range of questions, sometimes\ + \ with a\r\n list of hard coded facility name options, or location groups, or\ + \ departments.\r\n- Who the referral is \"completed by\" can be captured by a\ + \ question either the name\r\n 'Referring doctor' or 'Referral completed by'.\r\ + \n- Some referrals are the product of a previous screening survey. In some cases\ + \ (e.g. Samoa) there is\r\n a SurveyLink question that captures which survey\ + \ led to this referral, in others (e.g. Nauru)\r\n there is no such question\ + \ so the two survey responses cannot be reliably linked." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: referrals + tags: + - base + - clinical +- columns: + created_at: + description: Timestamp of when record was created + name: created_at + device_id: + description: Unique device ID from the client. + name: device_id + expires_at: + description: When the refresh token expires. + name: expires_at + id: + description: Tamanu internal identifier (generally a UUID) + name: id + updated_at: + description: Timestamp of when record was last updated + name: updated_at + user_id: + description: The [user](#!/source/source.tamanu.tamanu.users) being authenticated + as. + name: user_id + config: + tags: + - base + - administration + description: Refresh tokens are used by API clients to refresh their authentication + quickly, within a timeout. + meta: + classification: confidential + domain: admin + owner: bes-maui + pii: false + tier: silver + name: refresh_tokens + tags: + - base + - administration +- columns: + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in roles. + name: id + name: + data_type: character varying(255) + description: Readable name for the role. + name: name + config: + tags: + - base + - administration + description: "These are sets of permissions that are given to users to determine\ + \ what they can do in Tamanu.\r\n\r\nThe actual permissions are associated to\ + \ the role in the\r\n[`permissions`](#!/source/source.tamanu.tamanu.permissions)\ + \ table." + meta: + classification: confidential + domain: admin + owner: bes-maui + pii: false + tier: silver + name: roles + tags: + - base + - administration +- columns: + body: + data_type: text + description: Value of the answer. + name: body + data_element_id: + data_type: character varying(255) + description: Reference to the [question](#!/source/source.tamanu.tamanu.program_data_elements). + name: data_element_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in survey_response_answers. + name: id + name: + data_type: character varying(255) + description: Name of the question. + name: name + response_id: + data_type: character varying(255) + description: The [survey response](#!/source/source.tamanu.tamanu.survey_responses). + name: response_id + config: + tags: + - base + - clinical + description: A single answer as part of a [survey response](#!/source/source.tamanu.tamanu.survey_responses). + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: survey_response_answers + tags: + - base + - clinical +- columns: + encounter_id: + data_type: character varying(255) + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + this survey response is a part of. + name: encounter_id + end_datetime: + data_type: timestamp + description: When the survey was completed. + name: end_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in survey_responses. + name: id + is_notified: + data_type: boolean + description: "If the [survey](#!/source/source.tamanu.tamanu.surveys) is `notifiable`,\ + \ whether this response's\r\nnotification has been sent." + name: is_notified + result_text: + data_type: text + description: The textual value that is the summary of the survey response. + name: result_text + start_datetime: + data_type: timestamp + description: When the survey was started. + name: start_datetime + submitted_by_id: + data_type: character varying(255) + description: Reference to the [user](#!/source/source.tamanu.tamanu.users) recording + this survey response. + name: submitted_by_id + survey_id: + data_type: character varying(255) + description: The [survey](#!/source/source.tamanu.tamanu.surveys) being responded + to. + name: survey_id + config: + tags: + - base + - clinical + description: "A response to a survey (as recorded by a practitioner).\r\n\r\nTypically\ + \ surveys are filled on behalf of patients as part of an encounter.\r\n\r\nBecause\ + \ there are multiple distinct kinds of dates at play here:\r\n- `created_at`,\ + \ `updated_at`, `deleted_at` are system data for syncing and cannot be relied\ + \ on for realtime\r\n- `start_time`, `end_time` are real datetimes automatically\ + \ recorded when starting and submitting a survey response\r\n- in survey response\ + \ answers, there could be a data element for targeting the date of when exactly\ + \ the data is recorded in real time." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: survey_responses + tags: + - base + - clinical +- columns: + calculation: + data_type: character varying(255) + description: "Math expression to do calculations on the entered value before\ + \ it's saved.\r\n\r\nFor example `questionCode + 3`." + name: calculation + component_index: + data_type: integer + description: The absolute index (order) of the component in the survey. + name: component_index + config: + data_type: character varying(255) + description: JSON additional config of the component. + name: config + data_element_id: + data_type: character varying(255) + description: "Reference to the [data element](#!/source/source.tamanu.tamanu.program_data_elements)\ + \ configuring\r\nhow the data from the question is stored." + name: data_element_id + detail: + data_type: character varying(255) + description: Longer description or explanatory text of this component. + name: detail + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in survey_screen_components. + name: id + options: + data_type: character varying(255) + description: JSON array of strings of options to be selected. + name: options + screen_index: + data_type: integer + description: "Screen this component should appear on.\r\n\r\nSurveys can have\ + \ multiple \"screens\" or pages, this index sets where this particular question\ + \ sits." + name: screen_index + survey_id: + data_type: character varying(255) + description: The [survey](#!/source/source.tamanu.tamanu.surveys). + name: survey_id + text: + data_type: character varying(255) + description: Description or question of this component. + name: text + validation_criteria: + data_type: text + description: JSON criteria that determines whether the value entered in this + component is accepted. + name: validation_criteria + visibility_criteria: + data_type: character varying(255) + description: "JSON criteria that determines when this component is visible.\r\ + \n\r\nA criteria is a list of other components' codes and the value that will\ + \ make this question show up:\r\n\r\n```json\r\n{\r\n \"otherQuestion\":\ + \ \"Yes\"\r\n}\r\n```\r\n\r\nThere can also be the special criterium `{\"\ + hidden\": true}` which always hides the question, and the\r\nspecial key `\"\ + _conjunction\": \"or\"` which makes it so _any one_ item in the list is sufficient\ + \ to\r\nshow the question, instead of the default where _all_ items must match." + name: visibility_criteria + visibility_status: + data_type: character varying(255) + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in survey_screen_components." + name: visibility_status + config: + tags: + - base + - reference + description: "Describes how a survey question gets displayed.\r\n\r\nSee [program\ + \ data element](#!/source/source.tamanu.tamanu.program_data_elements), which describes\r\ + \nhow the data from the question is stored." + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: survey_screen_components + tags: + - base + - reference +- columns: + code: + data_type: character varying(255) + description: Machine-friendly code. + name: code + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in surveys. + name: id + is_notifiable: + data_type: boolean + description: "Whether filling this survey sends a notification email.\r\n\r\n\ + These are sent by the `SurveyCompletionNotifierProcessor` scheduled task." + name: is_notifiable + is_sensitive: + data_type: boolean + description: Whether the data recorded in the survey is sensitive. + name: is_sensitive + name: + data_type: character varying(255) + description: Human-friendly name. + name: name + notify_email_addresses: + data_type: array + description: If `notifiable` is true, where to send the notification. + name: notify_email_addresses + program_id: + data_type: character varying(255) + description: The [program](#!/source/source.tamanu.tamanu.programs) grouping + this survey. + name: program_id + survey_type: + data_type: character varying(255) + description: "Type of survey.\r\n\r\nOne of:\r\n- `programs`\r\n- `referral`\r\ + \n- `obsolete`\r\n- `vitals`" + name: survey_type + visibility_status: + data_type: character varying(255) + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in surveys." + name: visibility_status + config: + tags: + - base + - reference + description: "Surveys, aka custom forms that can be filled by practitioners.\r\n\ + \r\nThese are composed of [screen components](#!/source/source.tamanu.tamanu.survey_screen_components)." + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: surveys + tags: + - base + - reference +- columns: + language: + data_type: text + description: The language code. + name: language + string_id: + data_type: text + description: The internal reference of the item being translated. + name: string_id + text: + data_type: text + description: The actual translated text. + name: text + config: + tags: + - base + - reference + description: "Localisation and translation strings.\r\n\r\nThese are used for two\ + \ distinct purposes:\r\n- to translate Tamanu in languages other than English\r\ + \n- to adjust the wording of specific items in the UI" + meta: + classification: internal + domain: admin + owner: bes-maui + pii: false + tier: silver + name: translated_strings + tags: + - base + - reference +- columns: + arrival_datetime: + data_type: timestamp + description: When the patient arrived. + name: arrival_datetime + arrival_mode_id: + data_type: character varying(255) + description: Reference to how the patient arrived ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = arrivalMode`). + name: arrival_mode_id + chief_complaint_id: + data_type: character varying(255) + description: Reference to the primary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = triageReason`). + name: chief_complaint_id + clinician_id: + data_type: character varying(255) + description: Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) + assigned to this patient. + name: clinician_id + closed_datetime: + data_type: timestamp + description: When the patient was processed. + name: closed_datetime + encounter_id: + data_type: character varying(255) + description: Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) + this triage is for. + name: encounter_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in triages. + name: id + score: + data_type: text + description: Classification done by the triage practitioner. + name: score + secondary_complaint_id: + data_type: character varying(255) + description: Reference to the secondary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), + `type = triageReason`). + name: secondary_complaint_id + triage_datetime: + data_type: timestamp + description: When the patient was triaged. + name: triage_datetime + config: + tags: + - base + - clinical + description: Triage data of patients waiting in an emergency department. + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: triages + tags: + - base + - clinical +- columns: + display_id: + data_type: character varying(255) + description: "Display identifier for the user.\r\n\r\nThis may be the employee\ + \ code or badge number." + name: display_id + display_name: + data_type: character varying(255) + description: The human readable display name for the user. + name: display_name + email: + data_type: character varying(255) + description: Email address for user. This is used to login and receive emails. + name: email + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in users. + name: id + phone_number: + data_type: character varying(255) + description: "Phone number for the user.\r\n\r\nThis is not currently available\ + \ anywhere visible." + name: phone_number + role: + data_type: character varying(255) + description: "The role of the user, which sets their permission level.\r\n\r\ + \nThe special values `admin` and `system` indicate a superadmin and a system\ + \ user respectively." + name: role + visibility_status: + data_type: character varying(255) + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in users." + name: visibility_status + config: + tags: + - base + - administration + description: "Records of each user that can login to Tamanu.\r\n\r\nThis includes\ + \ machine users.\r\n\r\nThere is one special user account with an all-zero `id`,\ + \ which is the global \"system\" user. This is\r\nused as a pseudo identity where\ + \ the Tamanu system itself takes an action that normally is performed\r\nby a\ + \ human or API user." + meta: + classification: restricted + domain: admin + owner: bes-maui + pii: true + tier: silver + name: users + tags: + - base + - administration +- columns: + created_datetime: + data_type: timestamp + description: Timestamp of when record was created in the users table. + name: created_datetime + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in users. + name: id + updated_datetime: + data_type: timestamp + description: Timestamp of when record was last updated in the users table. + name: updated_datetime + config: + tags: + - base + - administration + - log + description: Metadata information extracted from the change logs for users. + meta: + classification: confidential + domain: admin + owner: bes-maui + pii: false + tier: silver + name: users_metadata + tags: + - base + - administration + - log +- columns: + batch: + data_type: character varying(255) + description: Batch identifier of vaccine administrations recorded + name: batch + circumstance_ids: + data_type: array + description: "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\ + \n(`type=vaccineCircumstance`)." + name: circumstance_ids + consent_given_by: + data_type: text + description: "Free text field recording who gave consent for the vaccination.\r\ + \nThis is usually the patient themselves, but may differ for children or dependent\r\ + \npersons or other cases." + name: consent_given_by + datetime: + data_type: timestamp + description: Local date for the record in vaccine_administrations. + name: datetime + department_id: + data_type: character varying(255) + description: "Reference to the [Department](#!/source/source.tamanu.tamanu.departments)\ + \ at which the vaccine was\r\ngiven." + name: department_id + disease: + data_type: text + description: Disease the vaccine addresses of the vaccine administration recorded + name: disease + encounter_id: + data_type: character varying(255) + description: Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) + this vaccine was given in. + name: encounter_id + given_by_id: + data_type: text + description: "Free text field for the name of the health practitioner who administered\ + \ the\r\nvaccine. This is defaulted to the `display_name` of the logged-in\ + \ User, but can\r\nbe changed. It is not a requirement that the administerer\ + \ is a Tamanu User." + name: given_by_id + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in vaccine_administrations. + name: id + injection_site: + data_type: character varying(255) + description: Injection site of the vaccine administrations recorded + name: injection_site + is_consented: + data_type: boolean + description: Consent of the vaccine administrations recorded + name: is_consented + is_given_elsewhere: + data_type: boolean + description: Checks if the vaccine was given elsewhere + name: is_given_elsewhere + location_id: + data_type: character varying(255) + description: "Reference to the [Location](#!/source/source.tamanu.tamanu.locations)\ + \ at which the vaccine was\r\ngiven." + name: location_id + not_given_reason_id: + data_type: character varying(255) + description: "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\ + \n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown\ + \ for ease of recording and reporting, alongside the free-text field." + name: not_given_reason_id + reason: + data_type: character varying(255) + description: Reason for vaccine administrations `NOT_GIVEN` status. This is + a free text field + name: reason + recorded_by_id: + data_type: character varying(255) + description: "Reference to the [User](#!/source/source.tamanu.tamanu.users)\ + \ who recorded this vaccination.\r\nThis may differ from the User or person\ + \ who administered the vaccine." + name: recorded_by_id + scheduled_vaccine_id: + data_type: character varying(255) + description: "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines)\ + \ that was\r\nadministered." + name: scheduled_vaccine_id + status: + data_type: character varying(255) + description: "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR`\ + \ status is assigned to vaccines initially recorded\r\nas `GIVEN` that are\ + \ then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially\ + \ recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL`\ + \ status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but\ + \ hides this\r\nrecord from the frontend to avoid confusion or conflict with\ + \ the `GIVEN`\r\nrecord." + name: status + vaccine_brand: + data_type: text + description: Vaccine brand of the vaccine administration recorded + name: vaccine_brand + vaccine_name: + data_type: text + description: Vaccine name of the vaccine administration recorded + name: vaccine_name + config: + tags: + - base + - clinical + description: "Table of vaccines administered to patients.\r\n\r\nVaccinations are\ + \ recorded via the Vaccinations modal; they are selected\r\nfrom a list of Scheduled\ + \ Vaccines and linked to a Patient via an Encounter." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: vaccine_administrations + tags: + - base + - clinical +- columns: + batch: + data_type: text + description: Batch identifier of vaccine administrations recorded from history. + name: batch + changelog_id: + data_type: uuid + description: The ID of the change log row. UUID + name: changelog_id + circumstance_ids: + data_type: text + description: "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\ + \n(`type=vaccineCircumstance`). from history." + name: circumstance_ids + consent_given_by: + data_type: text + description: "Free text field recording who gave consent for the vaccination.\r\ + \nThis is usually the patient themselves, but may differ for children or dependent\r\ + \npersons or other cases. from history." + name: consent_given_by + created_at: + data_type: timestamp + description: Timestamp of when record was created in vaccine_administrations + from history. + name: created_at + datetime: + data_type: timestamp + description: Local date for the record in vaccine_administrations from history. + name: datetime + department_id: + data_type: text + description: "Reference to the [Department](#!/source/source.tamanu.tamanu.departments)\ + \ at which the vaccine was\r\ngiven. from history." + name: department_id + disease: + data_type: text + description: Disease the vaccine addresses of the vaccine administration recorded + from history. + name: disease + encounter_id: + data_type: text + description: Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) + this vaccine was given in. from history. + name: encounter_id + given_by: + data_type: text + description: "Free text field for the name of the health practitioner who administered\ + \ the\r\nvaccine. This is defaulted to the `display_name` of the logged-in\ + \ User, but can\r\nbe changed. It is not a requirement that the administerer\ + \ is a Tamanu User. from history." + name: given_by + id: + data_type: text + description: Tamanu internal identifier (generally a UUID) in vaccine_administrations + from history. + name: id + injection_site: + data_type: text + description: Injection site of the vaccine administrations recorded from history. + name: injection_site + is_consented: + data_type: boolean + description: Consent of the vaccine administrations recorded from history. + name: is_consented + is_given_elsewhere: + data_type: boolean + description: Checks if the vaccine was given elsewhere from history. + name: is_given_elsewhere + location_id: + data_type: text + description: "Reference to the [Location](#!/source/source.tamanu.tamanu.locations)\ + \ at which the vaccine was\r\ngiven. from history." + name: location_id + logged_at: + data_type: timestamp + description: The timestamp this change was logged. in vaccine administrations + history. + name: logged_at + not_given_reason_id: + data_type: text + description: "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\ + \n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown\ + \ for ease of recording and reporting, alongside the free-text field. from\ + \ history." + name: not_given_reason_id + reason: + data_type: text + description: Reason for vaccine administrations `NOT_GIVEN` status. This is + a free text field from history. + name: reason + recorded_by_id: + data_type: text + description: "Reference to the [User](#!/source/source.tamanu.tamanu.users)\ + \ who recorded this vaccination.\r\nThis may differ from the User or person\ + \ who administered the vaccine. from history." + name: recorded_by_id + scheduled_vaccine_id: + data_type: text + description: "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines)\ + \ that was\r\nadministered. from history." + name: scheduled_vaccine_id + status: + data_type: text + description: "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR`\ + \ status is assigned to vaccines initially recorded\r\nas `GIVEN` that are\ + \ then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially\ + \ recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL`\ + \ status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but\ + \ hides this\r\nrecord from the frontend to avoid confusion or conflict with\ + \ the `GIVEN`\r\nrecord. from history." + name: status + updated_at: + data_type: timestamp + description: Timestamp of when record was last updated in vaccine_administrations + from history. + name: updated_at + updated_by_user_id: + data_type: text + description: "The value of the `updated_by_user_id` field of the change data.\r\ + \n\r\nThis is extracted from the data to make it easier to query on. in vaccine\ + \ administrations history." + name: updated_by_user_id + vaccine_brand: + data_type: text + description: Vaccine brand of the vaccine administration recorded from history. + name: vaccine_brand + vaccine_name: + data_type: text + description: Vaccine name of the vaccine administration recorded from history. + name: vaccine_name + config: + tags: + - base + - clinical + - log + description: "Change logs of Table of vaccines administered to patients.\r\n\r\n\ + Vaccinations are recorded via the Vaccinations modal; they are selected\r\nfrom\ + \ a list of Scheduled Vaccines and linked to a Patient via an Encounter." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: vaccine_administrations_change_logs + tags: + - base + - clinical + - log +- columns: + category: + data_type: character varying(255) + description: Vaccine category [Routine, Catch-up, Campaign, Other] + name: category + dose_label: + data_type: character varying(255) + description: "Dose label indicates what will appear on the front end of Tamanu\ + \ re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth',\ + \ '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')" + name: dose_label + id: + data_type: character varying(255) + description: Tamanu internal identifier (generally a UUID) in vaccine_schedules. + name: id + index: + data_type: integer + description: "This column is used to show when a second dose is due in relation\ + \ to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose\ + \ 2 is due at 10 weeks, this column would read '4' against the 10 week dose\ + \ as dose 2 is due 4 weeks after \r\ndose 1 is given." + name: index + label: + data_type: character varying(255) + description: "Contents of the label column is what will be displayed on the\ + \ front end of Tamanu \r\nunder fields labelled 'Vaccine'. This is where the\ + \ vaccine name is listed. E.g. 'BCG'." + name: label + sort_index: + data_type: integer + description: Sort index defaults to 0 + name: sort_index + vaccine_id: + data_type: character varying(255) + description: "Use the vaccineId column to link the id column of the Reference\ + \ Data sheet Drug to the vaccine schedule. Copy the exact \r\nid from the\ + \ id column in the reference data sheet Drug and paste it in the vaccineId\ + \ column in the Scheduled Vaccine \r\nsheet." + name: vaccine_id + visibility_status: + data_type: text + description: "The visibility status of the record.\r\n\r\n- `current` indicates\ + \ the record is currently in use and should be visible and accessible to users\r\ + \n on the User Interface.\r\n- `historical` indicates that the record is\ + \ no longer in use and should not be visible nor\r\n accessible to users.\ + \ However, the record may still be present in Reporting.\r\n- `merged` indicates\ + \ that the record has been merged, is no longer in use and should not be visible\r\ + \n nor accessible to users.\r\n\r\nThe default value is `current`. in vaccine_schedules." + name: visibility_status + weeks_from_birth_due: + data_type: integer + description: "This column is used to tell Tamanu how many weeks from the child's\ + \ date of birth a vaccine is due. This will populate \r\nthe front end within\ + \ the Vaccine schedule section in the column 'Due date'. For a vaccine to\ + \ appear in the Vaccine \r\nschedule a dose must have a `weeksFromBirthDue`\ + \ entered into the reference data. \r\n\r\nThis field should be used only\ + \ for the first dose of the vaccine. Subsequent doses should use \r\n`weeks_from_last_vaccination_due`" + name: weeks_from_birth_due + weeks_from_last_vaccination_due: + data_type: integer + description: "This column is used to show when a second dose is due in relation\ + \ to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose\ + \ 2 is due at 10 weeks, this column would read '4' against the 10 week dose\ + \ as dose 2 is due 4 weeks after \r\ndose 1 is given. The order of a vaccine\ + \ dose is defined at the `index` field. \r\n\r\nThis field should not be used\ + \ for the first dose but for subsequent doses. First dose should use `weeks_from_birth_due`" + name: weeks_from_last_vaccination_due + config: + tags: + - base + - clinical + description: "A vaccine schedule listing all vaccines expected to be given to a\ + \ child as part of a country wide Expanded Program of \r\nImmunisation can be\ + \ incorporated into Tamanu to show each dose and due date on the front end of\ + \ the system. \r\n\r\nFirst dose of a vaccine should use `weeks_from_birth_due`\ + \ whilst subsequent doses should use \r\n`weeks_from_last_vaccination_due`." + meta: + classification: restricted + domain: clinical + owner: bes-maui + pii: false + tier: silver + name: vaccine_schedules + tags: + - base + - clinical diff --git a/compiled/v2.50.11/reporting-docs-v2.50.11-standard.html b/compiled/v2.50.11/reporting-docs-v2.50.11-standard.html new file mode 100644 index 00000000..bf7460d7 --- /dev/null +++ b/compiled/v2.50.11/reporting-docs-v2.50.11-standard.html @@ -0,0 +1,250 @@ + + + + + + + dbt Docs + + + + + + + + + + + + + + + +
+ icons + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + \ No newline at end of file diff --git a/compiled/v2.50.11/reporting-schema-v2.50.11-standard.sql b/compiled/v2.50.11/reporting-schema-v2.50.11-standard.sql new file mode 100644 index 00000000..e20a28c1 --- /dev/null +++ b/compiled/v2.50.11/reporting-schema-v2.50.11-standard.sql @@ -0,0 +1,4979 @@ +drop schema if exists reporting cascade; +create schema reporting; +grant usage on schema reporting to reporting; +alter default privileges in schema reporting grant select on tables to reporting; +create or replace view "reporting"."contributing_death_causes" as ( +select + cdc.id, + cdc.time_after_onset, + cdc.patient_death_data_id, + cdc.condition_id +from "public"."contributing_death_causes" cdc +join "public"."patient_death_data" pdd on pdd.id = cdc.patient_death_data_id +where cdc.deleted_at is null + and pdd.deleted_at is null + and pdd.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."departments" as ( +select + id, + code, + name, + facility_id, + visibility_status +from "public"."departments" +where deleted_at is null +); +create or replace view "reporting"."discharges" as ( +select distinct on (d.encounter_id) + d.id, + d.note, + d.encounter_id, + d.discharger_id as discharged_by_id, + d.disposition_id +from "public"."discharges" d +join "public"."encounters" e on e.id = d.encounter_id +where d.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +order by d.encounter_id asc, d.created_at asc +); +create or replace view "reporting"."document_metadata" as ( +select + id, + name, + type, + created_at::timestamp as created_datetime, + patient_id, + encounter_id +from "public"."document_metadata" +where deleted_at is null +); +create or replace view "reporting"."encounters" as ( +select + id, + start_date::timestamp as start_datetime, + case + when end_date < start_date then start_date::timestamp + else end_date::timestamp + end as end_datetime, + encounter_type, + reason_for_encounter, + device_id, + patient_id, + department_id, + location_id, + examiner_id as clinician_id, + patient_billing_type_id, + referral_source_id, + planned_location_id, + planned_location_start_time::timestamp as planned_location_start_datetime, + discharge_draft +from "public"."encounters" +where deleted_at is null + and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."encounters_metadata" as ( +with change_logs as ( + select + record_id, + logged_at, + least(record_created_at, logged_at) as created_datetime + from "logs"."changes" + where table_name = 'encounters' +) +select + record_id as id, + min(created_datetime) as created_datetime, + max(logged_at) as updated_datetime +from change_logs +group by record_id +); +create or replace view "reporting"."encounter_diagnoses" as ( +select + ed.id, + ed.date::timestamp as datetime, + ed.is_primary, + ed.certainty, + ed.encounter_id, + ed.diagnosis_id, + ed.clinician_id as diagnosed_by_id +from "public"."encounter_diagnoses" ed +join "public"."encounters" e on e.id = ed.encounter_id +where ed.deleted_at is null + and ed.certainty not in ('disproven', 'error') + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."encounter_diagnoses_metadata" as ( +with change_logs as ( + select + record_id, + logged_at, + least(record_created_at, logged_at) as created_datetime + from "logs"."changes" + where table_name = 'encounter_diagnoses' +) +select + record_id as id, + min(created_datetime) as created_datetime, + max(logged_at) as updated_datetime +from change_logs +group by record_id +); +create or replace view "reporting"."encounter_diets" as ( +select + ed.id, + ed.encounter_id, + ed.diet_id +from "public"."encounter_diets" ed +join "public"."encounters" e on e.id = ed.encounter_id +where ed.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."encounter_history" as ( +select + eh.id, + eh.date::timestamp as datetime, + eh.encounter_id, + eh.department_id, + eh.location_id, + eh.encounter_type, + eh.examiner_id as clinician_id, + eh.actor_id as updated_by_id, + eh.change_type::text[] +from "public"."encounter_history" eh +join "public"."encounters" e on e.id = eh.encounter_id +where eh.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."encounter_prescriptions" as ( +select + ep.id, + ep.encounter_id, + ep.prescription_id, + ep.is_selected_for_discharge +from "public"."encounter_prescriptions" ep +join "public"."encounters" e on e.id = ep.encounter_id +where ep.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."facilities" as ( +select + id, + code, + name, + division, + type, + email, + contact_number, + city_town, + street_address, + catchment_id, + visibility_status, + is_sensitive +from "public"."facilities" +where deleted_at is null +); +create or replace view "reporting"."imaging_area_external_codes" as ( +select + id, + area_id, + code, + description, + visibility_status +from "public"."imaging_area_external_codes" +where deleted_at is null +); +create or replace view "reporting"."imaging_requests" as ( +select + ir.id, + ir.display_id, + ir.requested_date::timestamp as datetime, + ir.status, + ir.priority, + ir.imaging_type, + ir.encounter_id, + ir.requested_by_id, + ir.completed_by_id, + ir.location_id, + ir.location_group_id, + ir.reason_for_cancellation +from "public"."imaging_requests" ir +join "public"."encounters" e on e.id = ir.encounter_id +where ir.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."imaging_request_areas" as ( +select + ira.id, + ira.imaging_request_id, + ira.area_id +from "public"."imaging_request_areas" ira +join "public"."imaging_requests" ir on ir.id = ira.imaging_request_id +join "public"."encounters" e on e.id = ir.encounter_id +where ira.deleted_at is null + and ir.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."imaging_results" as ( +select + ires.id, + ires.completed_at::timestamp as datetime, + ires.description, + ires.imaging_request_id, + ires.external_code, + ires.completed_by_id, + ires.visibility_status +from "public"."imaging_results" ires +join "public"."imaging_requests" ireq on ireq.id = ires.imaging_request_id +join "public"."encounters" e on e.id = ireq.encounter_id +where ires.deleted_at is null + and ireq.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."invoices" as ( +select + i.id, + i.display_id, + i.date::timestamp as datetime, + i.status, + i.patient_payment_status, + i.insurer_payment_status, + i.encounter_id +from "public"."invoices" i +join "public"."encounters" e on e.id = i.encounter_id +where + i.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."invoice_insurance_plans" as ( +select + id, + name, + code, + default_coverage, + visibility_status +from "public"."invoice_insurance_plans" +where deleted_at is null +); +create or replace view "reporting"."invoice_insurance_plan_items" as ( +select + id, + invoice_insurance_plan_id, + invoice_product_id, + coverage_value +from "public"."invoice_insurance_plan_items" +where deleted_at is null +); +create or replace view "reporting"."invoice_items" as ( +select + ii.id, + ii.invoice_id, + ii.order_date::date as date, + ii.product_id, + ii.product_code_final, + ii.product_name_final, + ii.price_final, + ii.manual_entry_price, + ii.quantity, + ii.ordered_by_user_id, + ii.approved, + ii.source_record_type, + ii.source_record_id +from "public"."invoice_items" ii +join "public"."invoices" i on i.id = ii.invoice_id +join "public"."encounters" e on e.id = i.encounter_id +where + ii.deleted_at is null + and i.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."invoice_price_lists" as ( +select + id, + name, + code, + visibility_status +from "public"."invoice_price_lists" +where deleted_at is null +); +create or replace view "reporting"."invoice_price_list_items" as ( +select + id, + invoice_price_list_id, + invoice_product_id, + price, + is_hidden +from "public"."invoice_price_list_items" +where deleted_at is null +); +create or replace view "reporting"."invoice_products" as ( +select + id, + name, + insurable, + category, + source_record_id, + visibility_status +from "public"."invoice_products" +where deleted_at is null +); +create or replace view "reporting"."lab_requests" as ( +select + lr.id, + lr.created_at as created_datetime, + lr.updated_at as updated_datetime, + lr.display_id, + lr.urgent as is_urgent, + lr.status, + lr.requested_date::timestamp as requested_datetime, + lr.lab_test_priority_id, + lr.lab_test_category_id, + lr.lab_test_panel_request_id, + lr.lab_test_laboratory_id, + lr.requested_by_id, + lr.specimen_attached as is_specimen_collected, + lr.specimen_type_id, + lr.lab_sample_site_id, + lr.sample_time::timestamp as collected_datetime, + lr.collected_by_id, + lr.reason_for_cancellation, + lr.published_date::timestamp as published_datetime, + lr.encounter_id, + lr.department_id +from "public"."lab_requests" lr +join "public"."encounters" e on e.id = lr.encounter_id +where lr.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."lab_requests_metadata" as ( +with change_logs as ( + select + record_id, + logged_at, + least(record_created_at, logged_at) as created_datetime + from "logs"."changes" + where table_name = 'lab_requests' +) +select + record_id as id, + min(created_datetime) as created_datetime, + max(logged_at) as updated_datetime +from change_logs +group by record_id +); +create or replace view "reporting"."lab_request_logs" as ( +select + lrl.id, + lrl.created_at as created_datetime, + lrl.updated_at as updated_datetime, + lrl.lab_request_id, + lrl.status, + lrl.updated_by_id +from "public"."lab_request_logs" lrl +join "public"."lab_requests" lr on lr.id = lrl.lab_request_id +join "public"."encounters" e on e.id = lr.encounter_id +where lrl.deleted_at is null + and lr.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."lab_request_logs_metadata" as ( +with change_logs as ( + select + record_id, + logged_at, + least(record_created_at, logged_at) as created_datetime + from "logs"."changes" + where table_name = 'lab_request_logs' +) +select + record_id as id, + min(created_datetime) as created_datetime, + max(logged_at) as updated_datetime +from change_logs +group by record_id +); +create or replace view "reporting"."lab_tests" as ( +select + lt.id, + lt.date::date as date, + lt.result, + lt.lab_request_id, + lt.lab_test_type_id, + lt.lab_test_method_id, + lt.laboratory_officer, + lt.completed_date::timestamp as completed_datetime, + lt.verification +from "public"."lab_tests" lt +join "public"."lab_requests" lr on lr.id = lt.lab_request_id +join "public"."encounters" e on e.id = lr.encounter_id +where lt.deleted_at is null + and lr.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."lab_test_panels" as ( +select + id, + code, + external_code, + name, + category_id, + visibility_status +from "public"."lab_test_panels" +where deleted_at is null +); +create or replace view "reporting"."lab_test_panel_lab_test_types" as ( +select + id, + lab_test_panel_id, + lab_test_type_id +from "public"."lab_test_panel_lab_test_types" +where deleted_at is null +); +create or replace view "reporting"."lab_test_panel_requests" as ( +select + ltpr.id, + ltpr.lab_test_panel_id, + ltpr.encounter_id +from "public"."lab_test_panel_requests" ltpr +join "public"."encounters" e on e.id = ltpr.encounter_id +where ltpr.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."lab_test_types" as ( +select + id, + code, + external_code, + name, + unit, + male_min, + male_max, + female_min, + female_max, + range_text + as result_type, + options, + lab_test_category_id, + visibility_status, + is_sensitive +from "public"."lab_test_types" +where deleted_at is null +); +create or replace view "reporting"."locations" as ( +select + id, + code, + name, + max_occupancy, + location_group_id, + facility_id, + visibility_status +from "public"."locations" +where deleted_at is null +); +create or replace view "reporting"."location_bookings" as ( +select + id, + start_time::timestamp as start_datetime, + end_time::timestamp as end_datetime, + patient_id, + clinician_id, + encounter_id, + location_id, + booking_type_id, + is_high_priority, + status +from "public"."appointments" +where booking_type_id notnull + and deleted_at is null + and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."location_groups" as ( +select + id, + code, + name, + facility_id, + visibility_status +from "public"."location_groups" +where deleted_at is null +); +create or replace view "reporting"."medication_dispenses" as ( +select + md.id, + md.pharmacy_order_prescription_id, + md.quantity, + md.dispensed_at::timestamp as dispensed_at, + md.dispensed_by_user_id +from "public"."medication_dispenses" md +join "public"."pharmacy_order_prescriptions" pop + on pop.id = md.pharmacy_order_prescription_id +join "public"."pharmacy_orders" po on po.id = pop.pharmacy_order_id +join "public"."encounters" e on e.id = po.encounter_id +where md.deleted_at is null + and pop.deleted_at is null + and po.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."notes" as ( +-- May include notes for the test patient. +select + n.id, + n.date::timestamp as datetime, + n.content, + n.note_type_id, + rd.name as note_type, + n.record_type, + n.record_id, + n.author_id as authored_by_id, + n.on_behalf_of_id, + n.revised_by_id as updated_note_id, + n.visibility_status +from "public"."notes" n +join "public"."reference_data" rd + on rd.id = n.note_type_id +where n.deleted_at is null +); +create or replace view "reporting"."outpatient_appointments" as ( +select + a.id, + a.start_time::timestamp as start_datetime, + a.end_time::timestamp as end_datetime, + a.patient_id, + a.clinician_id, + a.encounter_id, + a.schedule_id, + a.location_group_id, + a.appointment_type_id, + case + when a.is_high_priority then 'Yes' else 'No' + end as priority, + a.status, + s.until_date::date as until_date, + s.interval, + s.days_of_week, + s.frequency, + s.nth_weekday, + s.occurrence_count, + s.is_fully_generated, + s.generated_until_date, + s.cancelled_at_date +from "public"."appointments" a +left join "public"."appointment_schedules" s on s.id = a.schedule_id +where a.deleted_at is null + and a.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' + and a.appointment_type_id notnull +); +create or replace view "reporting"."outpatient_appointments_change_logs" as ( +-- Base model for outpatient appointment change logs +-- Extracts appointment modifications from logs.changes table +-- Each row represents a change event to an appointment + +with appointment_changes as ( + select + c.id as change_id, + c.record_id as appointment_id, + c.logged_at as modified_datetime, + c.updated_by_user_id as modified_by_user_id, + -- Extract current values from the change log record_data + (c.record_data ->> 'start_time')::timestamp as start_datetime, + (c.record_data ->> 'end_time')::timestamp as end_datetime, + c.record_data ->> 'patient_id' as patient_id, + c.record_data ->> 'clinician_id' as clinician_id, + c.record_data ->> 'location_group_id' as location_group_id, + c.record_data ->> 'appointment_type_id' as appointment_type_id, + (c.record_data ->> 'is_high_priority')::boolean as is_high_priority, + c.record_data ->> 'status' as status, + (c.record_data ->> 'schedule_id')::uuid as schedule_id, + -- Get creator from the first change_sequence (initial creation) + first_value(c.updated_by_user_id) over ( + partition by c.record_id + order by c.logged_at + ) as created_by_user_id, + -- Use LAG to get the previous record state + lag(c.record_data) over ( + partition by c.record_id + order by c.logged_at + ) as previous_record_data, + -- Track change sequence + row_number() over ( + partition by c.record_id + order by c.logged_at + ) as change_sequence + from "logs"."changes" c + where c.table_name = 'appointments' + and c.record_deleted_at is null + and (c.record_data ->> 'appointment_type_id') is not null +) + +select + change_id, + appointment_id, + modified_datetime, + modified_by_user_id, + created_by_user_id, + patient_id, + -- Current appointment details + start_datetime, + end_datetime, + clinician_id, + location_group_id, + appointment_type_id, + is_high_priority, + status, + schedule_id, + -- Previous appointment details + (previous_record_data ->> 'start_time')::timestamp as prev_start_datetime, + (previous_record_data ->> 'end_time')::timestamp as prev_end_datetime, + (previous_record_data ->> 'clinician_id') as prev_clinician_id, + (previous_record_data ->> 'location_group_id') as prev_location_group_id, + (previous_record_data ->> 'appointment_type_id') as prev_appointment_type_id, + (previous_record_data ->> 'is_high_priority')::boolean as prev_is_high_priority, + (previous_record_data ->> 'status') as prev_status, + change_sequence +from appointment_changes +); +create or replace view "reporting"."patients" as ( +select + id, + created_at as created_datetime, + updated_at as updated_datetime, + display_id as display_id, + first_name as first_name, + middle_name as middle_name, + last_name as last_name, + cultural_name as cultural_name, + email as email, + initcap(sex::text) as sex, + date_of_birth::date as date_of_birth, + date_of_death::timestamp as date_of_death, + village_id as village_id +from "public"."patients" +where deleted_at is null + and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' + and visibility_status != 'merged' +); +create or replace view "reporting"."patients_access_logs" as ( +select + id, + user_id, + record_id as patient_id, + facility_id, + logged_at at time zone 'Australia/Sydney' as logged_at, + session_id, + device_id, + is_mobile, + version, + front_end_context, + back_end_context +from "logs"."accesses" +where deleted_at is null + and record_type = 'Patient' +); +create or replace view "reporting"."patients_change_logs" as ( +with filtered_changes as ( + select + id as changelog_id, + logged_at, + updated_by_user_id, + record_created_at, + record_updated_at, + record_id, + record_data + from "logs"."changes" + where table_name = 'patients' + and record_id not in ( + select id::text + from "public"."patients" t + where t.deleted_at notnull + ) + and record_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +) + +select + fc.changelog_id, + fc.logged_at at time zone 'Australia/Sydney' as logged_at, + fc.updated_by_user_id, + fc.record_id as id, + fc.record_data ->> 'display_id' as display_id, + fc.record_data ->> 'first_name' as first_name, + fc.record_data ->> 'middle_name' as middle_name, + fc.record_data ->> 'last_name' as last_name, + fc.record_data ->> 'cultural_name' as cultural_name, + fc.record_data ->> 'email' as email, + initcap(fc.record_data ->> 'sex') as sex, + (fc.record_data ->> 'date_of_birth')::date as date_of_birth, + (fc.record_data ->> 'date_of_death')::timestamp as date_of_death, + fc.record_data ->> 'village_id' as village_id, + (fc.record_data ->> 'created_at')::date as registration_date +from filtered_changes fc +); +create or replace view "reporting"."patients_merged" as ( +select + id, + display_id as display_id, + first_name as first_name, + middle_name as middle_name, + last_name as last_name, + cultural_name as cultural_name, + email as email, + initcap(sex::text) as sex, + date_of_birth::date as date_of_birth, + date_of_death::timestamp as date_of_death, + village_id as village_id, + created_at::date as registration_date +from "public"."patients" +where deleted_at is null + and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' + and visibility_status = 'merged' +); +create or replace view "reporting"."patients_metadata" as ( +with change_logs as ( + select + record_id, + logged_at, + least(record_created_at, logged_at) as created_datetime + from "logs"."changes" + where table_name = 'patients' +) +select + record_id as id, + min(created_datetime) as created_datetime, + max(logged_at) as updated_datetime +from change_logs +group by record_id +); +create or replace view "reporting"."patient_additional_data" as ( +select + patient_id, + title as title, + marital_status as marital_status, + primary_contact_number as primary_contact_number, + secondary_contact_number as secondary_contact_number, + emergency_contact_name as emergency_contact_name, + emergency_contact_number as emergency_contact_number, + social_media as social_media, + ethnicity_id as ethnicity_id, + religion_id as religion_id, + nationality_id as nationality_id, + secondary_village_id as secondary_village_id, + country_id as country_id, + division_id as division_id, + subdivision_id as subdivision_id, + medical_area_id as medical_area_id, + nursing_zone_id as nursing_zone_id, + settlement_id as settlement_id, + city_town as city_town, + street_village as street_village, + country_of_birth_id as country_of_birth_id, + place_of_birth as place_of_birth, + birth_certificate as birth_certificate, + driving_license as driving_license, + passport as passport, + educational_level as educational_level, + occupation_id as occupation_id, + blood_type as blood_type, + patient_billing_type_id as patient_billing_type_id, + health_center_id as health_center_id, + insurer_id as insurer_id, + insurer_policy_number as insurer_policy_number, + mother_id as mother_id, + father_id as father_id, + registered_by_id as registered_by_id, + updated_at_by_field as updated_by_field, + created_at::date as registration_date +from "public"."patient_additional_data" +where deleted_at is null + and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_additional_data_change_logs" as ( +with filtered_changes as ( + select + id as changelog_id, + logged_at, + updated_by_user_id, + record_created_at, + record_updated_at, + record_id, + record_data + from "logs"."changes" + where table_name = 'patient_additional_data' + and record_id not in ( + select id::text + from "public"."patient_additional_data" t + where t.deleted_at notnull + ) + and record_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' -- noqa: ST10 +) + +select + fc.changelog_id, + fc.logged_at at time zone 'Australia/Sydney' as logged_at, + fc.updated_by_user_id, + fc.record_id as patient_id, + fc.record_data ->> 'title' as title, + fc.record_data ->> 'marital_status' as marital_status, + fc.record_data ->> 'primary_contact_number' as primary_contact_number, + fc.record_data ->> 'secondary_contact_number' as secondary_contact_number, + fc.record_data ->> 'emergency_contact_name' as emergency_contact_name, + fc.record_data ->> 'emergency_contact_number' as emergency_contact_number, + fc.record_data ->> 'social_media' as social_media, + fc.record_data ->> 'ethnicity_id' as ethnicity_id, + fc.record_data ->> 'religion_id' as religion_id, + fc.record_data ->> 'nationality_id' as nationality_id, + fc.record_data ->> 'secondary_village_id' as secondary_village_id, + fc.record_data ->> 'country_id' as country_id, + fc.record_data ->> 'division_id' as division_id, + fc.record_data ->> 'subdivision_id' as subdivision_id, + fc.record_data ->> 'medical_area_id' as medical_area_id, + fc.record_data ->> 'nursing_zone_id' as nursing_zone_id, + fc.record_data ->> 'settlement_id' as settlement_id, + fc.record_data ->> 'city_town' as city_town, + fc.record_data ->> 'street_village' as street_village, + fc.record_data ->> 'country_of_birth_id' as country_of_birth_id, + fc.record_data ->> 'place_of_birth' as place_of_birth, + fc.record_data ->> 'birth_certificate' as birth_certificate, + fc.record_data ->> 'driving_license' as driving_license, + fc.record_data ->> 'passport' as passport, + fc.record_data ->> 'educational_level' as educational_level, + fc.record_data ->> 'occupation_id' as occupation_id, + fc.record_data ->> 'blood_type' as blood_type, + fc.record_data ->> 'patient_billing_type_id' as patient_billing_type_id, + fc.record_data ->> 'health_center_id' as health_center_id, + fc.record_data ->> 'insurer_id' as insurer_id, + fc.record_data ->> 'insurer_policy_number' as insurer_policy_number, + fc.record_data ->> 'mother_id' as mother_id, + fc.record_data ->> 'father_id' as father_id, + fc.record_data ->> 'registered_by_id' as registered_by_id, + fc.record_data -> 'updated_at_by_field' as updated_by_field, + (fc.record_data ->> 'created_at')::date as registration_date +from filtered_changes fc +); +create or replace view "reporting"."patient_allergies" as ( +select + id, + patient_id, + allergy_id, + recorded_date::date as recorded_date, + practitioner_id as recorded_by +from "public"."patient_allergies" +where deleted_at is null +); +create or replace view "reporting"."patient_birth_data" as ( +select + patient_id, + time_of_birth::time as birth_time, + gestational_age_estimate, + attendant_at_birth, + name_of_attendant_at_birth, + birth_type, + birth_delivery_type, + birth_weight, + birth_length, + apgar_score_one_minute, + apgar_score_five_minutes, + apgar_score_ten_minutes, + registered_birth_place, + birth_facility_id, + created_at::date as registration_date +from "public"."patient_birth_data" +where deleted_at is null + and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_care_plans" as ( +select + id, + date::timestamp as care_plan_datetime, + patient_id, + examiner_id as clinician_id, + care_plan_id +from "public"."patient_care_plans" +where deleted_at is null + and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_conditions" as ( +select + id, + recorded_date::timestamp as recorded_datetime, + note, + condition_id, + patient_id, + examiner_id as recorded_by_id, + resolved as is_resolved, + resolution_date::timestamp as resolved_datetime, + resolution_practitioner_id as resolved_by_id, + resolution_note +from "public"."patient_conditions" +where deleted_at is null + and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_death_contributing_causes" as ( +select + cdc.id, + cdc.time_after_onset as mins_after_onset, + cdc.patient_death_data_id, + cdc.condition_id +from "public"."contributing_death_causes" cdc +join "public"."patient_death_data" pdd on pdd.id = cdc.patient_death_data_id +where cdc.deleted_at is null + and pdd.deleted_at is null + and pdd.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_death_data" as ( +select + id, + manner, + recent_surgery as had_recent_surgery, + last_surgery_date::date as last_surgery_date, + last_surgery_reason_id, + external_cause_date::date as external_cause_date, + external_cause_location, + external_cause_notes, + was_pregnant, + pregnancy_contributed, + fetal_or_infant as was_fetal_or_infant, + stillborn as was_stillborn, + birth_weight, + within_day_of_birth as was_within_day_of_birth, + hours_survived_since_birth, + carrier_age, + carrier_pregnancy_weeks, + outside_health_facility as was_outside_health_facility, + primary_cause_time_after_onset as primary_cause_mins_after_onset, + primary_cause_condition_id, + antecedent_cause1_time_after_onset as antecedent_cause1_mins_after_onset, + antecedent_cause1_condition_id, + antecedent_cause2_time_after_onset as antecedent_cause2_mins_after_onset, + antecedent_cause2_condition_id, + antecedent_cause3_time_after_onset as antecedent_cause3_mins_after_onset, + antecedent_cause3_condition_id, + patient_id, + clinician_id as recorded_by_id, + facility_id, + is_final, + visibility_status, + autopsy_requested, + autopsy_findings_used, + manner_of_death_description, + pregnancy_moment, + multiple_pregnancy, + mother_condition_description +from "public"."patient_death_data" +where deleted_at is null + and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_facilities" as ( +select + id, + created_at, + patient_id, + facility_id +from "public"."patient_facilities" +where deleted_at is null + and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_family_histories" as ( +select + id, + recorded_date::timestamp as recorded_datetime, + patient_id, + practitioner_id as clinician_id, + diagnosis_id, + relationship, + note +from "public"."patient_family_histories" +where deleted_at is null + and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_field_values" as ( +select + patient_id, + definition_id, + value +from "public"."patient_field_values" +where deleted_at is null + and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_program_registrations" as ( +select + id, + date::timestamp as datetime, + registration_status, + patient_id, + program_registry_id, + clinical_status_id, + clinician_id as registered_by_id, + registering_facility_id, + facility_id, + village_id, + deactivated_clinician_id as deactivated_by_id, + deactivated_date::timestamp as deactivated_datetime +from "public"."patient_program_registrations" +where deleted_at is null + and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_program_registrations_change_logs" as ( +with filtered_changes as ( + select + id as changelog_id, + logged_at, + updated_by_user_id, + record_created_at, + record_updated_at, + record_id, + record_data + from "logs"."changes" + where table_name = 'patient_program_registrations' + and record_id not in ( + select id::text + from "public"."patient_program_registrations" t + where t.deleted_at notnull + ) + and ( + version = 'unknown' + or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int [] + ) + and record_data ->> 'patient_id' != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +) + +select + fc.changelog_id, + fc.logged_at, + fc.updated_by_user_id, + fc.record_id as id, + (fc.record_data ->> 'date')::timestamp as datetime, + fc.record_data ->> 'registration_status' as registration_status, + fc.record_data ->> 'patient_id' as patient_id, + fc.record_data ->> 'program_registry_id' as program_registry_id, + fc.record_data ->> 'clinical_status_id' as clinical_status_id, + fc.record_data ->> 'clinician_id' as registered_by_id, + fc.record_data ->> 'registering_facility_id' as registering_facility_id, + fc.record_data ->> 'facility_id' as facility_id, + fc.record_data ->> 'village_id' as village_id, + fc.record_data ->> 'deactivated_clinician_id' as deactivated_by_id, + (fc.record_data ->> 'deactivated_date')::timestamp as deactivated_datetime +from filtered_changes fc +); +create or replace view "reporting"."patient_program_registration_conditions" as ( +select + pprc.id, + pprc.date::timestamp as datetime, + pprc.program_registry_condition_id, + pprc.patient_program_registration_id, + pprc.program_registry_condition_category_id, + pprc.reason_for_change, + pprc.clinician_id as recorded_by_id, + pprc.deletion_date::timestamp as deleted_datetime, + pprc.deletion_clinician_id as deleted_by_id +from "public"."patient_program_registration_conditions" pprc +join "public"."patient_program_registrations" ppr + on ppr.id = pprc.patient_program_registration_id +where pprc.deleted_at is null + and ppr.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."patient_program_registration_conditions_change_logs" as ( +with filtered_changes as ( + select + id as changelog_id, + logged_at, + updated_by_user_id, + record_created_at, + record_updated_at, + record_id, + record_data + from "logs"."changes" + where table_name = 'patient_program_registration_conditions' + and record_id not in ( + select id::text + from "public"."patient_program_registration_conditions" t + where t.deleted_at notnull + ) + and ( + version = 'unknown' + or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int [] + ) +) + +select + fc.changelog_id, + fc.logged_at, + fc.updated_by_user_id, + fc.record_id as id, + (fc.record_data ->> 'date')::timestamp as datetime, + fc.record_data ->> 'program_registry_condition_id' as program_registry_condition_id, + fc.record_data ->> 'patient_program_registration_id' as patient_program_registration_id, + fc.record_data ->> 'program_registry_condition_category_id' as program_registry_condition_category_id, + fc.record_data ->> 'reason_for_change' as reason_for_change, + fc.record_data ->> 'clinician_id' as recorded_by_id, + (fc.record_data ->> 'deletion_date')::timestamp as deleted_datetime, + fc.record_data ->> 'deletion_clinician_id' as deleted_by_id +from filtered_changes fc +); +create or replace view "reporting"."patient_vaccinations_upcoming" as ( +select + patient_id, + scheduled_vaccine_id as vaccine_schedules_id, + vaccine_category, + vaccine_id, + due_date::date, + days_till_due, + status +from "public"."upcoming_vaccinations" +where patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."pharmacy_orders" as ( +select + po.id, + po.encounter_id, + po.ordering_clinician_id, + po.facility_id, + po.is_discharge_prescription, + po.date::timestamp as datetime +from "public"."pharmacy_orders" po +join "public"."encounters" e on e.id = po.encounter_id +where po.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."pharmacy_order_prescriptions" as ( +select + pop.id, + pop.pharmacy_order_id, + pop.prescription_id, + pop.ongoing_prescription_id, + pop.display_id, + pop.quantity, + pop.repeats, + pop.is_completed +from "public"."pharmacy_order_prescriptions" pop +join "public"."pharmacy_orders" po on po.id = pop.pharmacy_order_id +join "public"."encounters" e on e.id = po.encounter_id +where pop.deleted_at is null + and po.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."prescriptions" as ( +select + p.id, + p.date::timestamp as datetime, + p.start_date::timestamp as start_datetime, + p.end_date::timestamp as end_datetime, + p.medication_id, + p.prescriber_id, + p.indication, + p.route, + p.quantity, + p.repeats, + p.is_ongoing, + p.is_prn, + p.is_variable_dose, + p.dose_amount, + p.units, + p.frequency, + p.duration_value, + p.duration_unit, + p.is_phone_order, + p.ideal_times, + p.discontinued as is_discontinued, + p.discontinuing_clinician_id as discontinued_by_id, + p.discontinuing_reason, + p.discontinued_date::timestamp as discontinued_datetime +from "public"."prescriptions" p +where p.deleted_at is null + and exists ( + select 1 + from "public"."encounter_prescriptions" ep + join "public"."encounters" e on e.id = ep.encounter_id + where ep.prescription_id = p.id + and ep.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' + ) +); +create or replace view "reporting"."procedures" as ( +select + p.id, + p.date::date as date, + p.start_time::timestamp::time as start_time, + p.end_time::timestamp::time as end_time, + p.completed as is_completed, + p.note, + p.completed_note, + p.encounter_id, + p.location_id, + p.procedure_type_id, + p.anaesthetic_id, + p.physician_id as clinician_id, + p.anaesthetist_id, + p.assistant_anaesthetist_id, + p.time_in::time as time_in, + p.time_out::time as time_out +from "public"."procedures" p +join "public"."encounters" e on e.id = p.encounter_id +where p.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."procedures_metadata" as ( +with change_logs as ( + select + record_id, + logged_at, + least(record_created_at, logged_at) as created_datetime + from "logs"."changes" + where table_name = 'procedures' +) +select + record_id as id, + min(created_datetime) as created_datetime, + max(logged_at) as updated_datetime +from change_logs +group by record_id +); +create or replace view "reporting"."programs" as ( +select + id, + code, + name +from "public"."programs" +where deleted_at is null +); +create or replace view "reporting"."program_data_elements" as ( +select + id, + code, + name, + type, + indicator, + default_text, + default_options, + visualisation_config +from "public"."program_data_elements" +where deleted_at is null +); +create or replace view "reporting"."program_registries" as ( +select + id, + code, + name, + currently_at_type, + visibility_status, + program_id +from "public"."program_registries" +where deleted_at is null +); +create or replace view "reporting"."program_registry_clinical_statuses" as ( +select + id, + code, + name, + color, + visibility_status, + program_registry_id +from "public"."program_registry_clinical_statuses" +where deleted_at is null +); +create or replace view "reporting"."program_registry_conditions" as ( +select + id, + code, + name, + visibility_status, + program_registry_id +from "public"."program_registry_conditions" +where deleted_at is null +); +create or replace view "reporting"."program_registry_condition_categories" as ( +select + id, + code, + name, + visibility_status, + program_registry_id +from "public"."program_registry_condition_categories" +where deleted_at is null +); +create or replace view "reporting"."reference_data" as ( +select + id, + code, + name, + type, + visibility_status +from "public"."reference_data" +where deleted_at is null +); +create or replace view "reporting"."referrals" as ( +select + id, + status, + referred_facility, + initiating_encounter_id, + survey_response_id +from "public"."referrals" +where deleted_at is null +); +create or replace view "reporting"."refresh_tokens" as ( +select + id, + device_id, + user_id, + expires_at, + created_at, + updated_at +from + "public"."refresh_tokens" +where deleted_at is null +); +create or replace view "reporting"."roles" as ( +select + id, + name +from "public"."roles" +where deleted_at is null +); +create or replace view "reporting"."surveys" as ( +select + id, + code, + name, + survey_type, + is_sensitive, + notifiable as is_notifiable, + notify_email_addresses, + program_id, + visibility_status +from "public"."surveys" +where deleted_at is null +); +create or replace view "reporting"."survey_responses" as ( +select + id, + start_time::timestamp as start_datetime, + end_time::timestamp as end_datetime, + result_text, + notified as is_notified, + survey_id, + encounter_id, + user_id as submitted_by_id +from "public"."survey_responses" +where deleted_at is null +); +create or replace view "reporting"."survey_response_answers" as ( +select + id, + name, + body, + response_id, + data_element_id +from "public"."survey_response_answers" +where deleted_at is null +); +create or replace view "reporting"."survey_screen_components" as ( +select + id, + screen_index, + component_index, + text, + visibility_criteria, + validation_criteria, + detail, + config, + options, + calculation, + survey_id, + data_element_id, + visibility_status +from "public"."survey_screen_components" +where deleted_at is null +); +create or replace view "reporting"."translated_strings" as ( +select + string_id, + language, + text +from "public"."translated_strings" +where deleted_at is null +); +create or replace view "reporting"."triages" as ( +select + t.id, + t.arrival_time::timestamp as arrival_datetime, + t.triage_time::timestamp as triage_datetime, + t.closed_time::timestamp as closed_datetime, + t.arrival_mode_id, + t.score, + t.encounter_id, + t.practitioner_id as clinician_id, + t.chief_complaint_id, + t.secondary_complaint_id +from "public"."triages" t +join "public"."encounters" e on e.id = t.encounter_id +where t.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."users" as ( +select + id, + display_id, + display_name, + email, + phone_number, + role, + visibility_status +from "public"."users" +where deleted_at is null +); +create or replace view "reporting"."users_metadata" as ( +with change_logs as ( + select + record_id, + logged_at, + least(record_created_at, logged_at) as created_datetime + from "logs"."changes" + where table_name = 'users' +) +select + record_id as id, + min(created_datetime) as created_datetime, + max(logged_at) as updated_datetime +from change_logs +group by record_id +); +create or replace view "reporting"."vaccine_administrations" as ( +select + av.id, + av.date::timestamp as datetime, + av.encounter_id, + av.location_id, + av.department_id, + av.scheduled_vaccine_id, + av.status, + av.reason, + av.not_given_reason_id, + av.batch, + av.vaccine_name, + av.vaccine_brand, + av.disease, + av.consent as is_consented, + av.consent_given_by, + av.injection_site, + av.given_by, + av.given_elsewhere as is_given_elsewhere, + av.circumstance_ids, + av.recorder_id as recorded_by_id +from "public"."administered_vaccines" av +join "public"."encounters" e on e.id = av.encounter_id +where av.deleted_at is null + and e.deleted_at is null + and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' +); +create or replace view "reporting"."vaccine_schedules" as ( +select + id, + category, + vaccine_id, + label, + dose_label, + index, + weeks_from_birth_due, + weeks_from_last_vaccination_due, + sort_index, + visibility_status +from "public"."scheduled_vaccines" +where deleted_at is null +); +create or replace view "reporting"."vaccine_administrations_change_logs" as ( +with filtered_changes as ( + select + av.changelog_id, + av.logged_at, + av.updated_by_user_id, + av.record_created_at, + av.record_updated_at, + av.record_id, + av.record_data + from (select + id as changelog_id, + logged_at, + updated_by_user_id, + record_created_at, + record_updated_at, + record_id, + record_data + from "logs"."changes" + where table_name = 'administered_vaccines' + and record_id not in ( + select id::text + from "public"."administered_vaccines" t + where t.deleted_at notnull + )) av + join "reporting"."encounters" e on e.id = av.record_data ->> 'encounter_id' +) + +select + fc.changelog_id, + fc.logged_at at time zone 'Australia/Sydney' as logged_at, + fc.record_created_at at time zone 'Australia/Sydney' as created_at, + fc.record_updated_at at time zone 'Australia/Sydney' as updated_at, + fc.updated_by_user_id, + fc.record_id as id, + (fc.record_data ->> 'date')::timestamp as datetime, + fc.record_data ->> 'batch' as batch, + (fc.record_data ->> 'consent')::boolean as is_consented, + fc.record_data ->> 'disease' as disease, + fc.record_data ->> 'given_by' as given_by, + (fc.record_data ->> 'given_elsewhere')::boolean as is_given_elsewhere, + fc.record_data ->> 'circumstance_ids' as circumstance_ids, + fc.record_data ->> 'recorder_id' as recorded_by_id, + fc.record_data ->> 'encounter_id' as encounter_id, + fc.record_data ->> 'location_id' as location_id, + fc.record_data ->> 'department_id' as department_id, + fc.record_data ->> 'vaccine_name' as vaccine_name, + fc.record_data ->> 'vaccine_brand' as vaccine_brand, + fc.record_data ->> 'injection_site' as injection_site, + fc.record_data ->> 'consent_given_by' as consent_given_by, + fc.record_data ->> 'scheduled_vaccine_id' as scheduled_vaccine_id, + fc.record_data ->> 'status' as status, + fc.record_data ->> 'reason' as reason, + fc.record_data ->> 'not_given_reason_id' as not_given_reason_id +from filtered_changes fc +); +create or replace view "reporting"."ds__births" as ( +select + pbd.registration_date, + case + when left(pbd.registration_date::text, 10) = left(pad.registration_date::text, 10) then u.display_name + end as registered_by, + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + rd_ethnicity.name as ethnicity, + rd_nationality.name as nationality, + p.village_id, + rd_village.name as village, + case + when + p_mother.id is not null + then concat(p_mother.first_name, ' ', p_mother.last_name, ' (', p_mother.display_id, ')') + end as mother, + case + when + p_father.id is not null + then concat(p_father.first_name, ' ', p_father.last_name, ' (', p_father.display_id, ')') + end as father, + pbd.birth_time, + pbd.gestational_age_estimate, + case when pbd.registered_birth_place = 'health_facility' then 'Health facility' + when pbd.registered_birth_place = 'home' then 'Home' + when pbd.registered_birth_place = 'other' then 'Other' + else pbd.registered_birth_place + end as registered_birth_place, + f.id as birth_facility_id, + f.name as birth_facility, + case when pbd.attendant_at_birth = 'doctor' then 'Doctor' + when pbd.attendant_at_birth = 'midwife' then 'Midwife' + when pbd.attendant_at_birth = 'nurse' then 'Nurse' + when pbd.attendant_at_birth = 'traditional_birth_attentdant' then 'Traditional birth attendant' + when pbd.attendant_at_birth = 'other' then 'Other' + else pbd.attendant_at_birth + end as attendant_at_birth, + pbd.name_of_attendant_at_birth, + case + when pbd.birth_delivery_type = 'normal_vaginal_delivery' then 'Normal vaginal delivery' + when pbd.birth_delivery_type = 'breech' then 'Breech' + when pbd.birth_delivery_type = 'emergency_c_section' then 'Emergency C-section' + when pbd.birth_delivery_type = 'elective_c_section' then 'Elective C-section' + when pbd.birth_delivery_type = 'vacuum_extraction' then 'Vacuum extraction' + when pbd.birth_delivery_type = 'forceps' then 'Forceps' + when pbd.birth_delivery_type = 'other' then 'Other' + else pbd.birth_delivery_type + end as birth_delivery_type, + initcap(pbd.birth_type::text) as birth_type, + pbd.birth_weight, + pbd.birth_length, + pbd.apgar_score_one_minute, + pbd.apgar_score_five_minutes, + pbd.apgar_score_ten_minutes +from "reporting"."patient_birth_data" pbd +join "reporting"."patients" p on p.id = pbd.patient_id +left join "reporting"."reference_data" rd_village on rd_village.id = p.village_id +left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id +left join "reporting"."reference_data" rd_nationality on rd_nationality.id = pad.nationality_id +left join "reporting"."reference_data" rd_ethnicity on rd_ethnicity.id = pad.ethnicity_id +left join "reporting"."patients" p_mother on p_mother.id = pad.mother_id +left join "reporting"."patients" p_father on p_father.id = pad.father_id +left join "reporting"."facilities" f on f.id = pbd.birth_facility_id +left join "reporting"."users" u on u.id = pad.registered_by_id +); +create or replace view "reporting"."ds__deaths" as ( +with contributing_death_causes as ( + select + cdc.patient_death_data_id, + array_agg( + cdc.condition_id + order by cdc.time_after_onset + ) as other_conditions + from "reporting"."contributing_death_causes" cdc + group by cdc.patient_death_data_id +), + +encounters_with_death as ( + select distinct on (e.patient_id) + e.patient_id, + e.start_datetime, + e.end_datetime, + e.location_id, + e.department_id, + e.clinician_id + from "reporting"."encounters" e + join "reporting"."patients" p + on p.id = e.patient_id + and p.date_of_death between e.start_datetime and e.end_datetime + order by e.patient_id asc, e.end_datetime desc +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(p.date_of_death::date, p.date_of_birth::date)) as age, + p.sex, + village.id as village_id, + village.name as village, + nationality.id as nationality_id, + nationality.name as nationality, + case + when pdd.was_outside_health_facility then 'Died outside health facility' + else facility.name + end as place_of_death, + facility.id as facility_id, + department.id as department_id, + department.name as department, + location_group.id as location_group_id, + location_group.name as location_group, + location.id as location_id, + location.name as location, + p.date_of_death, + clinician.id as attending_clinician_id, + clinician.display_name as attending_clinician, + primary_condition.id as primary_cause_condition_id, + primary_condition.name as primary_cause_condition, + case + when pdd.primary_cause_mins_after_onset is null or pdd.primary_cause_mins_after_onset = 0 + then '0 minutes' + when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 365)) = 0 + then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 365), ' years') + when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 30)) = 0 + then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 30), ' months') + when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 7)) = 0 + then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 7), ' weeks') + when mod(pdd.primary_cause_mins_after_onset, (60 * 24)) = 0 + then concat(pdd.primary_cause_mins_after_onset / (60 * 24), ' days') + when mod(pdd.primary_cause_mins_after_onset, 60) = 0 + then concat(pdd.primary_cause_mins_after_onset / 60, ' hours') + else concat(pdd.primary_cause_mins_after_onset, ' minutes') + end as time_between_onset_and_death, + antecedent_condition_1.id as antecedent_cause_1_id, + antecedent_condition_1.name as antecedent_cause_1, + antecedent_condition_2.id as antecedent_cause_2_id, + antecedent_condition_2.name as antecedent_cause_2, + other_condition_1.id as other_condition_1_id, + other_condition_1.name as other_condition_1, + other_condition_2.id as other_condition_2_id, + other_condition_2.name as other_condition_2, + other_condition_3.id as other_condition_3_id, + other_condition_3.name as other_condition_3, + other_condition_4.id as other_condition_4_id, + other_condition_4.name as other_condition_4, + initcap(pdd.had_recent_surgery) as had_recent_surgery, + pdd.last_surgery_date, + surgery_reason.id as reason_for_surgery_id, + surgery_reason.name as reason_for_surgery, + pdd.manner as manner_of_death, + pdd.external_cause_date, + pdd.external_cause_location, + initcap(pdd.was_pregnant) as was_pregnant, + pdd.pregnancy_contributed, + case + when pdd.was_fetal_or_infant then 'Yes' + else 'No' + end as was_fetal_or_infant, + initcap(pdd.was_stillborn) as was_stillborn, + pdd.birth_weight, + pdd.carrier_pregnancy_weeks as completed_weeks_of_pregnancy, + pdd.carrier_age as age_of_mother, + pdd.mother_condition_description as condition_in_mother_affecting_fetus_or_newborn, + case + when pdd.was_within_day_of_birth then 'Yes' + else 'No' + end as death_within_day_of_birth, + pdd.hours_survived_since_birth +from "reporting"."patient_death_data" pdd +join "reporting"."patients" p + on p.id = pdd.patient_id +left join "reporting"."patient_additional_data" pd + on pd.patient_id = p.id +left join "reporting"."reference_data" village + on village.id = p.village_id +left join "reporting"."reference_data" nationality + on nationality.id = pd.nationality_id +left join "reporting"."reference_data" primary_condition + on primary_condition.id = pdd.primary_cause_condition_id +left join "reporting"."reference_data" antecedent_condition_1 + on antecedent_condition_1.id = pdd.antecedent_cause1_condition_id +left join "reporting"."reference_data" antecedent_condition_2 + on antecedent_condition_2.id = pdd.antecedent_cause2_condition_id +left join contributing_death_causes cdc + on cdc.patient_death_data_id = pdd.id +left join "reporting"."reference_data" other_condition_1 + on other_condition_1.id = cdc.other_conditions[1] +left join "reporting"."reference_data" other_condition_2 + on other_condition_2.id = cdc.other_conditions[2] +left join "reporting"."reference_data" other_condition_3 + on other_condition_3.id = cdc.other_conditions[3] +left join "reporting"."reference_data" other_condition_4 + on other_condition_4.id = cdc.other_conditions[4] +left join "reporting"."reference_data" surgery_reason + on surgery_reason.id = pdd.last_surgery_reason_id +left join encounters_with_death ewd + on ewd.patient_id = p.id +left join "reporting"."facilities" facility + on facility.id = pdd.facility_id +left join "reporting"."departments" department + on department.id = ewd.department_id +left join "reporting"."locations" location + on location.id = ewd.location_id +left join "reporting"."location_groups" location_group + on location_group.id = location.location_group_id +left join "reporting"."users" clinician + on clinician.id = pdd.recorded_by_id +where pdd.visibility_status = 'current' + and pdd.is_final +); +create or replace view "reporting"."ds__invoice_products" as ( + + +with price_pivot as ( + select + invoice_product_id + from "reporting"."invoice_price_list_items" + where is_hidden = false + group by invoice_product_id +), + +insurance_pivot as ( + select + invoice_product_id + from "reporting"."invoice_insurance_plan_items" + group by invoice_product_id +) + +select + ip.id, + ip.name, + ip.insurable, + ip.category, + ip.source_record_id, + ip.visibility_status, + coalesce(ltt.external_code, ltp.external_code) as external_code +from "reporting"."invoice_products" ip +left join price_pivot pp on pp.invoice_product_id = ip.id +left join insurance_pivot insurp on insurp.invoice_product_id = ip.id +left join "reporting"."lab_test_types" ltt on ltt.id = ip.source_record_id +left join "reporting"."lab_test_panels" ltp on ltp.id = ip.source_record_id +); +create or replace view "reporting"."ds__ongoing_conditions" as ( +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(pc.recorded_datetime::date, p.date_of_birth)) as age, + p.sex, + village.name as village, + village.id as village_id, + conditions.name as condition, + conditions.id as condition_id, + pc.recorded_datetime, + clinician.id as clinician_id, + clinician.display_name as clinician, + case when pc.is_resolved then pc.resolved_datetime end as date_resolved, + case when pc.is_resolved then resolving_clinician.display_name end as clinician_resolving +from "reporting"."patient_conditions" pc +join "reporting"."patients" p on p.id = pc.patient_id +join "reporting"."reference_data" conditions on conditions.id = pc.condition_id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."users" clinician on clinician.id = pc.recorded_by_id +left join "reporting"."users" resolving_clinician + on resolving_clinician.id = pc.resolved_by_id +); +create or replace view "reporting"."ds__patients" as ( +select + p.created_datetime as registration_date, + u.display_name as registered_by, + p.id as patient_id, + p.first_name, + p.middle_name, + p.last_name, + p.cultural_name, + p.display_id, + p.sex, + p.village_id, + village.name as village, + p.date_of_birth, + p.date_of_death, + pad.birth_certificate, + pad.driving_license, + pad.passport, + pad.blood_type, + pad.title, + pad.marital_status, + pad.primary_contact_number, + pad.secondary_contact_number, + cob.name as country_of_birth, + nationality.name as nationality, + ethnicity.name as ethnicity, + occupation.name as occupation, + religion.name as religion, + billing.name as patient_billing_type, + pad.mother_id, + pad.father_id, + pad.street_village, + case + when pbd.patient_id is null then 'Patient' + else 'Birth' + end as registration_type, + date_part( + 'year', + age( + coalesce(p.date_of_death::date, current_date), + p.date_of_birth + ) + ) as age, + case + when p.date_of_death is not null then 'Deceased' + else 'Alive' + end as status +from "reporting"."patients" p +left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id +left join "reporting"."patient_birth_data" pbd on pbd.patient_id = p.id +left join "reporting"."users" u on u.id = pad.registered_by_id +left join "reporting"."reference_data" village on village.id = p.village_id and village.type = 'village' +left join "reporting"."reference_data" cob on cob.id = pad.country_of_birth_id and cob.type = 'country' +left join "reporting"."reference_data" nationality on nationality.id = pad.nationality_id and nationality.type = 'nationality' +left join "reporting"."reference_data" ethnicity on ethnicity.id = pad.ethnicity_id and ethnicity.type = 'ethnicity' +left join "reporting"."reference_data" occupation on occupation.id = pad.occupation_id and occupation.type = 'occupation' +left join "reporting"."reference_data" religion on religion.id = pad.religion_id and religion.type = 'religion' +left join "reporting"."reference_data" billing on billing.id = pad.patient_billing_type_id and billing.type = 'patientBillingType' +); +create or replace view "reporting"."ds__patients_access_logs" as ( +with grouped_access_logs as ( + select + lap.patient_id, + lap.user_id, + lap.facility_id, + date_trunc('minute', min(lap.logged_at)) as date_time_viewed, + -- Take the first values for fields that might vary within the same minute + lap.is_mobile, + lap.session_id, + lap.device_id + from "reporting"."patients_access_logs" lap + group by + lap.patient_id, + lap.user_id, + lap.facility_id, + lap.is_mobile, + lap.session_id, + lap.device_id +) + +select + gal.patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + p.village_id, + village.name as village, + gal.user_id as viewed_by_user_id, + u.display_name as viewed_by_user, + u.email as user_email, + u.role as user_role, + f.name as viewed_at_facility, + gal.date_time_viewed, + gal.facility_id, + gal.is_mobile, + gal.session_id, + gal.device_id +from grouped_access_logs gal +join "reporting"."patients" p on p.id = gal.patient_id +left join "reporting"."users" u on u.id = gal.user_id +left join "reporting"."facilities" f on f.id = gal.facility_id +left join "reporting"."reference_data" village on village.id = p.village_id +); +create or replace view "reporting"."ds__patients_change_logs" as ( +with patient_edits as ( + -- Patient details edits + select + lcp.id as patient_id, + lcp.display_id, + lcp.first_name, + lcp.last_name, + lcp.date_of_birth, + lcp.sex, + lcp.village_id, + lcp.updated_by_user_id, + lcp.logged_at + from "reporting"."patients_change_logs" lcp + + union all + + -- Patient additional data edits + select + lcpad.patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + p.village_id, + lcpad.updated_by_user_id, + lcpad.logged_at + from "reporting"."patient_additional_data_change_logs" lcpad + left join "reporting"."patients" p on p.id = lcpad.patient_id +), + +grouped_edits as ( + select + pe.patient_id, + pe.display_id, + pe.first_name, + pe.last_name, + pe.date_of_birth, + pe.sex, + pe.village_id, + pe.updated_by_user_id, + date_trunc('minute', pe.logged_at) as edited_datetime + from patient_edits pe + group by + pe.patient_id, + pe.display_id, + pe.first_name, + pe.last_name, + pe.date_of_birth, + pe.sex, + pe.village_id, + pe.updated_by_user_id, + date_trunc('minute', pe.logged_at) +) + +select + ge.patient_id, + ge.display_id, + ge.first_name, + ge.last_name, + ge.date_of_birth, + ge.sex, + ge.village_id, + village.name as village, + ge.updated_by_user_id as edited_by_user_id, + u.display_name as edited_by_user, + u.email as user_email, + u.role as user_role, + ge.edited_datetime +from grouped_edits ge +left join "reporting"."users" u on u.id = ge.updated_by_user_id +left join "reporting"."reference_data" village on village.id = ge.village_id +); +create or replace view "reporting"."ds__patient_program_registrations" as ( +with related_conditions as ( + select + ppr.id as patient_program_registration_id, + string_agg( + prc.name, '; ' + order by pprc.datetime + ) as conditions, + array_agg( + pprc.program_registry_condition_id + order by pprc.datetime + ) as condition_ids, + string_agg( + prcc.name, '; ' + order by pprc.datetime + ) as condition_categories, + array_agg( + pprc.program_registry_condition_category_id + order by pprc.datetime + ) as condition_category_ids + from "reporting"."patient_program_registration_conditions" pprc + join "reporting"."patient_program_registrations" ppr on ppr.id = pprc.patient_program_registration_id + left join "reporting"."program_registry_conditions" prc on prc.id = pprc.program_registry_condition_id + left join "reporting"."program_registry_condition_categories" prcc on prcc.id = pprc.program_registry_condition_category_id + group by ppr.id +) + +select + ppr.id as patient_program_registration_id, + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + village.id as village_id, + village.name as village, + registering_facility.id as registering_facility_id, + registering_facility.name as registering_facility, + registered_by.id as registered_by_id, + registered_by.display_name as registered_by, + case + when pr.currently_at_type = 'facility' then currently_at_facility.name + when pr.currently_at_type = 'village' then currently_at_village.name + end as currently_at, + pr.currently_at_type, + c.condition_ids as related_condition_ids, + c.conditions as related_conditions, + c.condition_category_ids as related_condition_category_ids, + c.condition_categories as related_condition_categories, + prcs.id as clinical_status_id, + prcs.name as clinical_status, + ppr.registration_status, + ppr.program_registry_id, + subdivision.id as subdivision_id, + subdivision.name as subdivision, + division.id as division_id, + division.name as division, + ppr.datetime as registration_datetime, + ppr.deactivated_by_id, + deactivated_by.display_name as deactivated_by, + ppr.deactivated_datetime, + pad.primary_contact_number, + pad.secondary_contact_number, + pad.emergency_contact_name, + pad.emergency_contact_number +from "reporting"."patient_program_registrations" ppr +join "reporting"."program_registries" pr on pr.id = ppr.program_registry_id +join "reporting"."patients" p on p.id = ppr.patient_id +left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id +left join "reporting"."facilities" registering_facility on registering_facility.id = ppr.registering_facility_id +left join "reporting"."users" registered_by on registered_by.id = ppr.registered_by_id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."facilities" currently_at_facility on currently_at_facility.id = ppr.facility_id +left join "reporting"."reference_data" subdivision on subdivision.id = pad.subdivision_id +left join "reporting"."reference_data" division on division.id = pad.division_id +left join "reporting"."reference_data" currently_at_village on currently_at_village.id = ppr.village_id +left join related_conditions c on c.patient_program_registration_id = ppr.id +left join "reporting"."program_registry_clinical_statuses" prcs on prcs.id = ppr.clinical_status_id +left join "reporting"."users" deactivated_by on deactivated_by.id = ppr.deactivated_by_id +); +create or replace view "reporting"."ds__patient_vaccinations_upcoming" as ( +select + p.display_id, + p.first_name, + p.last_name, + p.id as patient_id, + p.date_of_birth, + date_part('year', age(p.date_of_birth)) as age, + p.sex, + village.id as village_id, + village.name as village, + pvu.due_date, + pvu.vaccine_category, + pvu.vaccine_schedules_id, + sv.label as vaccine_name, + sv.dose_label as vaccine_schedule, + pvu.status as vaccine_status +from "reporting"."patient_vaccinations_upcoming" pvu +join "reporting"."patients" p on p.id = pvu.patient_id +join "reporting"."vaccine_schedules" sv on sv.id = pvu.vaccine_schedules_id +left join "reporting"."reference_data" village on village.id = p.village_id +where p.date_of_death is null +); +create or replace view "reporting"."ds__usage_quality_metrics_patient_details" as ( +with data as ( + select + p.id as patient_id, + pm.id as patient_merged_id, + coalesce(nullif(trim(p.first_name), ''), nullif(trim(pm.first_name), '')) as first_name, + coalesce(nullif(trim(p.last_name), ''), nullif(trim(pm.last_name), '')) as last_name, + coalesce(p.date_of_birth, pm.date_of_birth) as date_of_birth, + coalesce(nullif(trim(p.village_id), ''), nullif(trim(pm.village_id), '')) as village_id, + nullif(trim(pad.nursing_zone_id), '') as nursing_zone_id, + nullif(trim(pad.medical_area_id), '') as medical_area_id, + nullif(trim(pad.subdivision_id), '') as subdivision_id, + nullif(trim(pad.division_id), '') as division_id, + nullif(trim(pad.primary_contact_number), '') as primary_contact_number, + nullif(trim(pad.secondary_contact_number), '') as secondary_contact_number + from "reporting"."patients" p + full join "reporting"."patients_merged" pm + on pm.id = p.id + left join "reporting"."patient_additional_data" pad + on pad.patient_id = coalesce(p.id, pm.id) +) + +select + count(*) as total_patients, + count(*) filter (where first_name is null or last_name is null) as total_patients_with_incomplete_name, + count(*) filter (where date_of_birth is null) as total_patients_with_missing_dob, + count(*) filter (where date_of_birth <= '1900-01-01' or date_of_birth > now()::date) as total_patients_with_invalid_dob, + count(*) filter (where coalesce(village_id, nursing_zone_id, medical_area_id, subdivision_id, division_id) is null) as total_patients_with_missing_location, + count(*) filter (where coalesce(primary_contact_number, secondary_contact_number) is null) as total_patients_with_missing_contact, + count(patient_merged_id) as total_patients_merged +from data +); +create or replace view "reporting"."ds__usage_quality_metrics_patient_registrations" as ( +with data as ( + select + p.created_datetime as registration_date, + p.id as registration_patient_id, + pbd.patient_id as birth_patient_id, + p.date_of_birth, + age(p.created_datetime, p.date_of_birth) < interval '6 months' as age_under_6m_at_registration + from "reporting"."patients" p + left join "reporting"."patient_birth_data" pbd + on pbd.patient_id = p.id +) + +select + registration_date, + count(*) filter (where birth_patient_id is null) as total_patient_registrations, + count(birth_patient_id) as total_birth_registrations, + count(*) filter (where birth_patient_id is null and age_under_6m_at_registration) as total_incorrect_registrations_for_patient_under_6mth +from data +group by registration_date +); +create or replace view "reporting"."ds__sensitive_admissions" as ( + + +with admission_encounters as ( + select + e.id, + e.patient_id, + e.start_datetime, + e.end_datetime, + e.location_id, + e.patient_billing_type_id, + f.id as facility_id, + f.name as facility_name + from "reporting"."encounters" e + join "reporting"."locations" l on l.id = e.location_id + join "reporting"."facilities" f on f.id = l.facility_id + where e.encounter_type = 'admission' + and f.is_sensitive = True +), + +encounter_history_consolidated as ( + select + eh.encounter_id, + eh.datetime, + eh.change_type, + eh.clinician_id, + eh.department_id, + eh.location_id, + u.display_name as clinician_name, + d.name as department_name, + l.name as location_name, + lg.id as location_group_id, + lg.name as location_group_name, + -- Window functions for ordering and lag operations + row_number() over ( + partition by eh.encounter_id, ('encounter_type' = any(eh.change_type)) + order by eh.datetime + ) as encounter_type_change_sequence, + lag(lg.id) over ( + partition by eh.encounter_id + order by eh.datetime + ) as prev_location_group_id + from admission_encounters ae + left join "reporting"."encounter_history" eh + on eh.encounter_id = ae.id + and eh.encounter_type = 'admission' + and (eh.change_type is null or eh.change_type && array['encounter_type', 'examiner', 'department', 'location']) + left join "reporting"."users" u + on u.id = eh.clinician_id + left join "reporting"."departments" d + on d.id = eh.department_id + left join "reporting"."locations" l + on l.id = eh.location_id + left join "reporting"."location_groups" lg + on lg.id = l.location_group_id +), + +-- Clinician changes and admitting clinician logic +clinician_data as ( + select + encounter_id, + bool_or('encounter_type' = any(change_type) and encounter_type_change_sequence = 1) as is_transfer, + min(datetime) filter (where change_type is null or change_type && array['encounter_type', 'examiner']) as admission_datetime, + array_agg( + datetime + order by datetime + ) filter (where change_type is null or change_type && array['encounter_type', 'examiner'] + ) as clinician_datetimes, + array_agg( + clinician_id + order by datetime + ) filter (where change_type is null or change_type && array['encounter_type', 'examiner'] + ) as clinician_ids, + array_agg( + clinician_name + order by datetime + ) filter (where change_type is null or change_type && array['encounter_type', 'examiner'] + ) as clinician_names + from encounter_history_consolidated + group by encounter_id +), + +-- Admitting clinician determination +admitting_clinicians as ( + select + encounter_id, + admission_datetime, + case + when is_transfer and array_length(clinician_ids, 1) > 1 + then clinician_ids[2] + else clinician_ids[1] + end as admitting_clinician_id, + case + when is_transfer and array_length(clinician_names, 1) > 1 + then clinician_names[2] + else clinician_names[1] + end as admitting_clinician_name + from clinician_data +), + +-- Department changes aggregation +department_changes as ( + select + encounter_id, + string_agg( + to_char(datetime, 'YYYY-MM-DD HH24:MI'), + '; ' + order by datetime + ) as department_datetimes, + array_agg( + department_id + order by datetime + ) as department_ids, + string_agg( + department_name, ', ' + order by datetime + ) as departments + from encounter_history_consolidated + where change_type is null or change_type && array['encounter_type', 'department'] + group by encounter_id +), + +-- Location changes aggregation +location_changes as ( + select + encounter_id, + string_agg( + to_char(datetime, 'YYYY-MM-DD HH24:MI'), + '; ' + order by datetime + ) as location_datetimes, + array_agg( + location_id + order by datetime + ) as location_ids, + string_agg( + location_name, ', ' + order by datetime + ) as locations + from encounter_history_consolidated + where change_type is null or change_type && array['encounter_type', 'location'] + group by encounter_id +), + +-- Location group changes (deduplicated in single pass) +location_group_changes as ( + select + encounter_id, + string_agg( + to_char(datetime, 'YYYY-MM-DD HH24:MI'), + '; ' + order by datetime + ) as location_group_datetimes, + array_agg( + location_group_id + order by datetime + ) as location_group_ids, + string_agg( + location_group_name, ', ' + order by datetime + ) as location_groups + from encounter_history_consolidated + where (change_type is null or change_type && array['encounter_type', 'location']) + and (location_group_id != prev_location_group_id or prev_location_group_id is null) + group by encounter_id +), + +-- Diagnoses aggregation +encounter_diagnoses as ( + select + ed.encounter_id, + string_agg( + case when ed.is_primary + then rd.name || ' (' || rd.code || ')' + end, + '; ' + order by ed.datetime + ) as primary_diagnoses, + string_agg( + case when not ed.is_primary + then rd.name || ' (' || rd.code || ')' + end, + '; ' + order by ed.datetime + ) as secondary_diagnoses + from admission_encounters ae + inner join "reporting"."encounter_diagnoses" ed + on ed.encounter_id = ae.id + inner join "reporting"."reference_data" rd + on rd.id = ed.diagnosis_id + where ed.certainty not in ('disproven', 'error') + group by ed.encounter_id +), + +-- Patient and reference data +patient_data as ( + select + ae.id as encounter_id, + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + p.village_id, + village.name as village_name, + ae.patient_billing_type_id, + bt.name as billing_type_name, + ae.start_datetime, + ae.end_datetime, + ae.location_id, + ae.facility_id, + ae.facility_name + from admission_encounters ae + left join "reporting"."patients" p + on p.id = ae.patient_id + left join "reporting"."reference_data" village + on village.id = p.village_id + left join "reporting"."reference_data" bt + on bt.id = ae.patient_billing_type_id +) + +select + pd.patient_id, + pd.display_id, + pd.first_name, + pd.last_name, + pd.date_of_birth, + date_part('year', age(ac.admission_datetime, pd.date_of_birth)) as age, + initcap(pd.sex::text) as sex, + pd.village_id, + pd.village_name as village, + pd.patient_billing_type_id as billing_type_id, + pd.billing_type_name as billing_type, + ac.admitting_clinician_id, + ac.admitting_clinician_name as admitting_clinician, + ac.admission_datetime, + case + when pd.end_datetime is null then 'active' + else 'discharged' + end as admission_status, + pd.end_datetime as discharge_datetime, + pd.facility_id, + pd.facility_name as facility, + dc.department_ids, + dc.departments, + dc.department_datetimes, + lgc.location_group_ids, + lgc.location_groups, + lgc.location_group_datetimes, + lc.location_ids, + lc.locations, + lc.location_datetimes, + ed.primary_diagnoses, + ed.secondary_diagnoses +from patient_data pd +left join admitting_clinicians ac + on ac.encounter_id = pd.encounter_id +left join department_changes dc + on dc.encounter_id = pd.encounter_id +left join location_changes lc + on lc.encounter_id = pd.encounter_id +left join location_group_changes lgc + on lgc.encounter_id = pd.encounter_id +left join encounter_diagnoses ed + on ed.encounter_id = pd.encounter_id + + +); +create or replace view "reporting"."ds__sensitive_diagnoses" as ( + + +select + e.id as encounter_id, + p.id as patient_id, + diagnosis.id as diagnosis_id, + diagnosis.name as diagnosis, + ed.datetime as diagnosis_datetime, + p.first_name, + p.last_name, + p.display_id, + date_part('year', age(ed.datetime::date, p.date_of_birth)) as age, + p.sex, + coalesce(pad.primary_contact_number, pad.secondary_contact_number) as contact_number, + village.id as village_id, + village.name as village, + clinician.id as clinician_id, + clinician.display_name as clinician, + d.id as department_id, + d.name as department, + l.id as location_id, + l.name as location, + f.id as facility_id, + f.name as facility, + initcap(ed.certainty) as certainty, + case when ed.is_primary = true then 'Yes' else 'No' end as is_primary +from "reporting"."encounter_diagnoses" ed +join "reporting"."reference_data" diagnosis on diagnosis.id = ed.diagnosis_id +join "reporting"."encounters" e on e.id = ed.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."users" clinician on clinician.id = e.clinician_id +left join "reporting"."departments" d on d.id = e.department_id +join "reporting"."locations" l on l.id = e.location_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = True + + +); +create or replace view "reporting"."ds__sensitive_encounters_emergency" as ( + + +select + t.id as triage_id, + t.arrival_datetime, + t.triage_datetime, + t.closed_datetime, + t.score, + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + p.village_id, + village.name as village, + e.id as encounter_id, + e.encounter_type, + arrival_mode.name as arrival_mode, + chief_complaint.name as chief_complaint, + secondary_complaint.name as secondary_complaint, + clinician.display_name as clinician, + t.clinician_id, + f.id as facility_id, + f.name as facility +from "reporting"."triages" t +join "reporting"."encounters" e on e.id = t.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."locations" l on l.id = e.location_id +join "reporting"."facilities" f on f.id = l.facility_id and f.is_sensitive = True +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."reference_data" arrival_mode on arrival_mode.id = t.arrival_mode_id +left join "reporting"."reference_data" chief_complaint on chief_complaint.id = t.chief_complaint_id +left join "reporting"."reference_data" secondary_complaint on secondary_complaint.id = t.secondary_complaint_id +left join "reporting"."users" clinician on clinician.id = t.clinician_id + + +); +create or replace view "reporting"."ds__sensitive_encounter_diets" as ( + + +with diets as ( + select + ed.encounter_id, + string_agg( + rd.name, ', ' + order by rd.name + ) as diets + from "reporting"."encounter_diets" ed + join "reporting"."reference_data" rd + on rd.id = ed.diet_id + group by ed.encounter_id +), + +allergies as ( + select + pa.patient_id, + string_agg( + rd.name, ', ' + order by rd.name + ) as allergies + from "reporting"."patient_allergies" pa + join "reporting"."reference_data" rd + on rd.id = pa.allergy_id + group by pa.patient_id +) + +select + e.id as encounter_id, + p.id as patient_id, + p.display_id, + concat(p.first_name, ' ', p.last_name) as patient_name, + e.start_datetime, + case + when age(current_date, p.date_of_birth) < interval '8 days' + then concat(extract(day from age(current_date, p.date_of_birth)), ' days') + when age(current_date, p.date_of_birth) >= interval '8 days' + and age(current_date, p.date_of_birth) < interval '1 month' + then concat(extract(week from age(current_date, p.date_of_birth)), ' weeks') + when age(current_date, p.date_of_birth) >= interval '1 month' + and age(current_date, p.date_of_birth) < interval '2 years' + then concat(extract(month from age(current_date, p.date_of_birth)), ' months') + when age(current_date, p.date_of_birth) >= interval '2 years' + then concat(extract(year from age(current_date, p.date_of_birth)), ' years') + end as age, + l.id as location_id, + l.name as location, + lg.id as location_group_id, + lg.name as location_group, + d.diets, + a.allergies +from "reporting"."encounters" e +join "reporting"."patients" p + on p.id = e.patient_id +join "reporting"."locations" l + on l.id = e.location_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = True +left join "reporting"."location_groups" lg + on lg.id = l.location_group_id +left join diets d + on d.encounter_id = e.id +left join allergies a + on a.patient_id = p.id +where e.end_datetime is null + + +); +create or replace view "reporting"."ds__sensitive_encounter_prescriptions" as ( + + +select + ep.encounter_id, + ep.prescription_id, + pr.datetime, + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(pr.datetime, p.date_of_birth)) as age, + p.sex, + coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number, + vil.id as village_id, + vil.name as village, + l.facility_id, + f.name as facility, + ep.is_selected_for_discharge, + pr.medication_id, + m.code as medication_code, + m.name as medication, + pr.route, + pr.quantity, + pr.repeats, + pr.is_ongoing, + pr.is_prn, + pr.is_variable_dose, + pr.dose_amount, + pr.units, + pr.frequency, + pr.is_discontinued, + pr.discontinued_by_id, + pr.discontinuing_reason, + pr.discontinued_datetime +from "reporting"."encounter_prescriptions" ep +join "reporting"."encounters" e on e.id = ep.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."prescriptions" pr on pr.id = ep.prescription_id +join "reporting"."locations" l on l.id = e.location_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = True +left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id +left join "reporting"."reference_data" vil on vil.id = p.village_id +join "reporting"."reference_data" m on m.id = pr.medication_id + + +); +create or replace view "reporting"."ds__sensitive_imaging_requests" as ( + + +with results as ( + select + imaging_request_id, + min(datetime) as completed_datetime + from "reporting"."imaging_results" + group by imaging_request_id +), + +imaging_area_notes as ( + select + record_id as imaging_request_id, + string_agg(content, ', ' order by datetime) as imaging_area + from "reporting"."notes" + where record_type = 'ImagingRequest' + and note_type_id = 'notetype-areaToBeImaged' + group by record_id +), + +imaging_areas as ( + select + ir.id as imaging_request_id, + coalesce( + string_agg(ia.name, ', ' order by ia.name), + n.imaging_area + ) as imaging_area + from "reporting"."imaging_requests" ir + left join "reporting"."imaging_request_areas" ira on ira.imaging_request_id = ir.id + left join "reporting"."reference_data" ia on ia.id = ira.area_id + left join imaging_area_notes n on n.imaging_request_id = ir.id + group by ir.id, n.imaging_area +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(ir.datetime::date, p.date_of_birth)) as age, + p.sex, + v.id as village_id, + v.name as village, + f.id as facility_id, + f.name as facility, + d.id as department_id, + d.name as department, + lg.id as location_group_id, + lg.name as location_group, + ir.display_id as request_id, + ir.datetime as requested_datetime, + su.id as supervising_clinician_id, + su.display_name as supervising_clinician, + ru.id as requesting_clinician_id, + ru.display_name as requesting_clinician, + case + when ir.priority = 'routine' then 'Routine' + when ir.priority = 'urgent' then 'Urgent' + when ir.priority = 'asap' then 'ASAP' + when ir.priority = 'stat' then 'STAT' + when ir.priority = 'today' then 'Today' + else ir.priority + end as priority, + ir.imaging_type, + areas.imaging_area, + ir.status as status_id, + case + when ir.status = 'pending' then 'Pending' + when ir.status = 'in_progress' then 'In progress' + when ir.status = 'completed' then 'Completed' + when ir.status = 'cancelled' then 'Cancelled' + when ir.status = 'deleted' then 'Deleted' + when ir.status = 'entered_in_error' then 'Entered in error' + else 'Unknown' + end as status, + case + when ir.status = 'completed' then irs.completed_datetime + end as completed_datetime, + case + when ir.reason_for_cancellation = 'clinical' then 'Clinical reason' + when ir.reason_for_cancellation = 'duplicate' then 'Duplicate' + when ir.reason_for_cancellation = 'entered-in-error' then 'Entered in error' + when ir.reason_for_cancellation = 'patient-discharged' then 'Patient discharged' + when ir.reason_for_cancellation = 'patient-refused' then 'Patient refused' + when ir.reason_for_cancellation = 'other' then 'Other' + end as reason_for_cancellation +from "reporting"."imaging_requests" ir +join "reporting"."encounters" e on e.id = ir.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."locations" l on l.id = e.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = True +left join "reporting"."departments" d on d.id = e.department_id +left join "reporting"."users" su on su.id = e.clinician_id +left join "reporting"."users" ru on ru.id = ir.requested_by_id +left join imaging_areas areas on areas.imaging_request_id = ir.id +left join "reporting"."reference_data" v on v.id = p.village_id +left join results irs on irs.imaging_request_id = ir.id + + +); +create or replace view "reporting"."ds__sensitive_lab_requests" as ( + + +with lab_test_data as ( + select + lr.id as lab_request_id, + string_agg(ltt.name, ', ' + order by ltt.name + ) as tests, + max(lt.completed_datetime) as completed_datetime + from "reporting"."lab_requests" lr + join "reporting"."lab_tests" lt on lt.lab_request_id = lr.id + join "reporting"."lab_test_types" ltt on ltt.id = lt.lab_test_type_id + where ltt.is_sensitive = True + group by lr.id +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(lr.requested_datetime, p.date_of_birth)) as age, + p.sex, + village.id as village_id, + village.name as village, + f.id as facility_id, + f.name as facility, + d.name as department, + d.id as department_id, + l.id as location_id, + l.name as location, + lg.id as location_group_id, + lg.name as location_group, + laboratory.id as laboratory_id, + laboratory.name as laboratory, + lr.display_id as request_id, + case lr.status + when 'reception_pending' then 'Reception pending' + when 'results_pending' then 'Results pending' + when 'to_be_verified' then 'To be verified' + when 'verified' then 'Verified' + when 'published' then 'Published' + when 'cancelled' then 'Cancelled' + when 'deleted' then 'Deleted' + when 'sample-not-collected' then 'Sample not collected' + when 'entered-in-error' then 'Entered in error' + else lr.status + end as status, + lr.status as status_id, + lr.requested_datetime, + req_clinician.id as requested_by_id, + req_clinician.display_name as requested_by, + lr.department_id as requesting_department_id, + req_department.name as requesting_department, + lr.lab_test_priority_id as priority_id, + priority.name as priority, + category.id as lab_test_category_id, + category.name as lab_test_category, + ltp.name as lab_test_panel, + lta.tests, + lr.collected_datetime, + lr.collected_by_id, + collector.display_name as collected_by, + lr.specimen_type_id, + specimen.name as specimen_type, + site.name as site, + lta.completed_datetime, + case lr.reason_for_cancellation + when 'clinical' then 'Clinical reason' + when 'duplicate' then 'Duplicate' + when 'entered-in-error' then 'Entered in error' + when 'patient-discharged' then 'Patient discharged' + when 'patient-refused' then 'Patient refused' + when 'other' then 'Other' + else lr.reason_for_cancellation + end as reason_for_cancellation +from "reporting"."lab_requests" lr +join lab_test_data lta on lta.lab_request_id = lr.id +join "reporting"."encounters" e on e.id = lr.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."locations" l on l.id = e.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +left join "reporting"."departments" d on d.id = e.department_id +left join "reporting"."facilities" f on f.id = l.facility_id +left join "reporting"."reference_data" laboratory on laboratory.id = lr.lab_test_laboratory_id +left join "reporting"."users" req_clinician on req_clinician.id = lr.requested_by_id +left join "reporting"."departments" req_department on req_department.id = lr.department_id +left join "reporting"."reference_data" priority on priority.id = lr.lab_test_priority_id +left join "reporting"."reference_data" category on category.id = lr.lab_test_category_id +left join "reporting"."users" collector on collector.id = lr.collected_by_id +left join "reporting"."reference_data" specimen on specimen.id = lr.specimen_type_id +left join "reporting"."reference_data" site on site.id = lr.lab_sample_site_id +left join "reporting"."lab_test_panel_requests" ltpr + on ltpr.id = lr.lab_test_panel_request_id +left join "reporting"."lab_test_panels" ltp on ltp.id = ltpr.lab_test_panel_id + + +); +create or replace view "reporting"."ds__sensitive_lab_tests" as ( + + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(lr.requested_datetime, p.date_of_birth::date)) as age, + p.sex, + village.id as village_id, + village.name as village, + f.id as facility_id, + f.name as facility, + d.id as department_id, + d.name as department, + req_dept.id as requesting_department_id, + req_dept.name as requesting_department, + lg.id as location_group_id, + lg.name as location_group, + l.id as location_id, + l.name as location, + lr.display_id as lab_request_id, + lr.status as status_id, + case lr.status + when 'reception_pending' then 'Reception pending' + when 'results_pending' then 'Results pending' + when 'to_be_verified' then 'To be verified' + when 'verified' then 'Verified' + when 'published' then 'Published' + when 'cancelled' then 'Cancelled' + when 'deleted' then 'Deleted' + when 'sample-not-collected' then 'Sample not collected' + when 'entered-in-error' then 'Entered in error' + else lr.status + end as status, + ltp.id as lab_test_panel_id, + ltp.name as lab_test_panel, + category.id as lab_test_category_id, + category.name as lab_test_category, + lr.requested_datetime, + requester.id as requested_by_id, + requester.display_name as requested_by, + lr.published_datetime as lab_request_published_datetime, + lt.date as lab_test_date, + lt.result, + lt.verification, + ltt.id as lab_test_type_id, + ltt.name as lab_test_type, + lt.completed_datetime as lab_test_completed_datetime +from "reporting"."lab_requests" lr +join "reporting"."encounters" e on e.id = lr.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."locations" l on l.id = e.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +left join "reporting"."departments" d on d.id = e.department_id +left join "reporting"."departments" req_dept on req_dept.id = lr.department_id +left join "reporting"."facilities" f on f.id = l.facility_id +left join "reporting"."users" requester on requester.id = lr.requested_by_id +left join "reporting"."lab_test_panel_requests" ltpr on ltpr.id = lr.lab_test_panel_request_id +left join "reporting"."lab_test_panels" ltp on ltp.id = ltpr.lab_test_panel_id +left join "reporting"."reference_data" category on category.id = lr.lab_test_category_id +join "reporting"."lab_tests" lt on lt.lab_request_id = lr.id +join "reporting"."lab_test_types" ltt on ltt.id = lt.lab_test_type_id +where ltt.is_sensitive = True + + +); +create or replace view "reporting"."ds__sensitive_location_bookings" as ( + + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(a.start_datetime::date, p.date_of_birth)) as age, + p.sex, + vil.id as village_id, + vil.name as village, + billing.id as billing_type_id, + billing.name as billing_type, + a.start_datetime as booking_start_datetime, + a.end_datetime as booking_end_datetime, + a.status as booking_status, + u.id as clinician_id, + u.display_name as clinician, + lg.id as location_group_id, + lg.name as location_group, + l.id as location_id, + l.name as location, + a.booking_type_id, + bt.name as booking_type +from "reporting"."location_bookings" a +join "reporting"."patients" p on p.id = a.patient_id +left join "reporting"."users" u on u.id = a.clinician_id +join "reporting"."locations" l on l.id = a.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +join "reporting"."facilities" f on f.id = l.facility_id + and f.is_sensitive = True +left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id +left join "reporting"."reference_data" billing on billing.id = pd.patient_billing_type_id +left join "reporting"."reference_data" vil on vil.id = p.village_id +left join "reporting"."reference_data" bt on bt.id = a.booking_type_id + + +); +create or replace view "reporting"."ds__sensitive_medication_dispenses" as ( + + +select + md.id, + md.quantity, + md.dispensed_at, + po.facility_id, + f.name as facility, + pr.medication_id, + m.code as medication_code, + m.name as medication +from "reporting"."medication_dispenses" md +join "reporting"."pharmacy_order_prescriptions" pop + on pop.id = md.pharmacy_order_prescription_id +join "reporting"."pharmacy_orders" po + on po.id = pop.pharmacy_order_id +-- prescription_id is not null on all pharmacy_order_prescriptions rows (enforced by source not_null test). +-- ongoing_prescription_id is the nullable supplementary reference and is not used for the medication lookup +join "reporting"."prescriptions" pr + on pr.id = pop.prescription_id +join "reporting"."reference_data" m + on m.id = pr.medication_id +join "reporting"."facilities" f + on f.id = po.facility_id + and f.is_sensitive = True + + +); +create or replace view "reporting"."ds__sensitive_outpatient_appointments" as ( + + +with appointment_creators as ( + select + appointment_id, + created_by_user_id + from "reporting"."outpatient_appointments_change_logs" + where change_sequence = 1 +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(a.start_datetime, p.date_of_birth)) as age, + p.sex, + coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number, + vil.id as village_id, + vil.name as village, + billing.id as billing_type_id, + billing.name as billing_type, + a.start_datetime as appointment_start_datetime, + a.end_datetime as appointment_end_datetime, + a.appointment_type_id, + apt.name as appointment_type, + a.status as appointment_status, + u.id as clinician_id, + u.display_name as clinician, + lg.id as location_group_id, + lg.name as location_group, + a.priority, + a.schedule_id, + a.until_date, + a.interval, + a.days_of_week, + a.frequency, + a.nth_weekday, + ac.created_by_user_id, + creator.display_name as created_by +from "reporting"."outpatient_appointments" a +join "reporting"."patients" p on p.id = a.patient_id +left join "reporting"."users" u on u.id = a.clinician_id +join "reporting"."location_groups" lg on lg.id = a.location_group_id +join "reporting"."facilities" f on f.id = lg.facility_id + and f.is_sensitive = True +left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id +left join "reporting"."reference_data" billing on billing.id = pd.patient_billing_type_id +left join "reporting"."reference_data" vil on vil.id = p.village_id +left join "reporting"."reference_data" apt on apt.id = a.appointment_type_id +left join appointment_creators ac on ac.appointment_id = a.id +left join "reporting"."users" creator on creator.id = ac.created_by_user_id + + +); +create or replace view "reporting"."ds__sensitive_outpatient_appointments_audit" as ( + + +-- Outpatient Appointments Audit Dataset +-- This dataset tracks changes/modifications to outpatient appointments +-- Each row represents a modification event (excludes initial creation) +-- +-- Included changes: +-- - Status changed to 'Cancelled' (individual cancellations only) +-- - Changes to: start/end datetime, clinician, location group, appointment type, priority +-- +-- Excluded changes: +-- - Initial appointment creation (change_sequence = 1) +-- - Status-only changes (unless changing to 'Cancelled') +-- - Appointments automatically cancelled when their schedule was cancelled +-- (i.e., bulk cancellations via "cancel this and all future appointments") +-- +-- change_number: starts from 1 for the first modification, increments for subsequent changes +-- +-- Note: schedule_id never changes on existing appointments in Tamanu. +-- When a schedule is modified, old appointments are cancelled and new ones are created. + +with change_evaluation as ( + select + cl.*, + -- Determine if this change has meaningful field modifications + case + -- Status changed to Cancelled + when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true + -- Any non-status fields changed + when ( + cl.prev_start_datetime is distinct from cl.start_datetime + or cl.prev_end_datetime is distinct from cl.end_datetime + or cl.prev_clinician_id is distinct from cl.clinician_id + or cl.prev_location_group_id is distinct from cl.location_group_id + or cl.prev_appointment_type_id is distinct from cl.appointment_type_id + or cl.prev_is_high_priority is distinct from cl.is_high_priority + ) then true + else false + end as is_meaningful_change + from "reporting"."outpatient_appointments_change_logs" cl + left join "public"."appointment_schedules" s on s.id = cl.schedule_id + where + -- Exclude appointments that were automatically cancelled when the schedule was cancelled + -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule) + not ( + cl.status = 'Cancelled' + and s.cancelled_at_date is not null + and cl.start_datetime::date > s.cancelled_at_date::date + ) +), + +numbered_changes as ( + select + ce.*, + -- Assign change number: starts from 1 for first modification + row_number() over ( + partition by ce.appointment_id + order by ce.modified_datetime + ) as change_number + from change_evaluation ce + where ce.is_meaningful_change = true + and ce.change_sequence > 1 -- Exclude initial creation +) + +select + fc.change_id, + fc.appointment_id, + fc.change_number, + -- Patient details + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + -- Current appointment details + fc.start_datetime as appointment_start_datetime, + fc.end_datetime as appointment_end_datetime, + apt.name as appointment_type, + fc.appointment_type_id, + clinician.display_name as clinician, + fc.clinician_id, + lg.name as location_group, + fc.location_group_id, + case when fc.is_high_priority then 'Yes' else 'No' end as priority, + fc.schedule_id, + case + when fc.schedule_id is not null then 'Yes' + else 'No' + end as is_repeating, + -- Modification details + creator.display_name as created_by, + fc.created_by_user_id, + modifier.display_name as modified_by, + fc.modified_by_user_id, + fc.modified_datetime, + case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled, + -- Previous appointment details (only shown if different from current) + case + when fc.prev_start_datetime is distinct from fc.start_datetime + then fc.prev_start_datetime + end as prev_start_datetime, + case + when fc.prev_end_datetime is distinct from fc.end_datetime + then fc.prev_end_datetime + end as prev_end_datetime, + case + when fc.prev_appointment_type_id is distinct from fc.appointment_type_id + then prev_apt.name + end as prev_appointment_type, + case + when fc.prev_appointment_type_id is distinct from fc.appointment_type_id + then fc.prev_appointment_type_id + end as prev_appointment_type_id, + case + when fc.prev_clinician_id is distinct from fc.clinician_id + then prev_clinician.display_name + end as prev_clinician, + case + when fc.prev_clinician_id is distinct from fc.clinician_id + then fc.prev_clinician_id + end as prev_clinician_id, + case + when fc.prev_location_group_id is distinct from fc.location_group_id + then prev_lg.name + end as prev_location_group, + case + when fc.prev_location_group_id is distinct from fc.location_group_id + then fc.prev_location_group_id + end as prev_location_group_id, + case + when fc.prev_is_high_priority is not null + and fc.prev_is_high_priority is distinct from fc.is_high_priority + then case when fc.prev_is_high_priority then 'Yes' else 'No' end + end as prev_priority, + -- Facility details for filtering + f.id as facility_id, + f.name as facility +from numbered_changes fc +join "reporting"."patients" p on p.id = fc.patient_id +left join "reporting"."users" clinician on clinician.id = fc.clinician_id +left join "reporting"."users" prev_clinician on prev_clinician.id = fc.prev_clinician_id +left join "reporting"."users" creator on creator.id = fc.created_by_user_id +left join "reporting"."users" modifier on modifier.id = fc.modified_by_user_id +join "reporting"."location_groups" lg on lg.id = fc.location_group_id +left join "reporting"."location_groups" prev_lg on prev_lg.id = fc.prev_location_group_id +left join "reporting"."reference_data" apt on apt.id = fc.appointment_type_id +left join "reporting"."reference_data" prev_apt on prev_apt.id = fc.prev_appointment_type_id +left join "public"."appointment_schedules" s on s.id = fc.schedule_id +-- Join to facility for filtering by sensitivity +join "reporting"."facilities" f on f.id = lg.facility_id + and f.is_sensitive = True + + +); +create or replace view "reporting"."ds__sensitive_procedures" as ( + + +with filtered_procedure as ( + select + pc.*, + eh.department_id, + eh.encounter_type, + row_number() over ( + partition by pc.id + order by eh.datetime desc + ) as encounter_history_record + from "reporting"."procedures" pc + left join "reporting"."encounter_history" eh + on eh.encounter_id = pc.encounter_id + and eh.datetime::date <= pc.date +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(pc.date, p.date_of_birth)) as age, + p.sex, + nationality.name as nationality, + encounter_facility.id as encounter_facility_id, + encounter_facility.name as encounter_facility, + encounter_department.id as encounter_department_id, + encounter_department.name as encounter_department, + case + when coalesce(pc.encounter_type, e.encounter_type) = 'admission' then 'Hospital Admission' + when coalesce(pc.encounter_type, e.encounter_type) = 'clinic' then 'Clinic' + when coalesce(pc.encounter_type, e.encounter_type) in ('triage', 'observation', 'emergency') then 'Triage' + end as encounter_type, + e.start_datetime as encounter_start_datetime, + e.end_datetime as encounter_end_datetime, + procedure_facility.id as procedure_facility_id, + procedure_facility.name as procedure_facility, + procedure_area.id as procedure_area_id, + procedure_area.name as procedure_area, + procedure_location.id as procedure_location_id, + procedure_location.name as procedure_location, + procedure_type.id as procedure_type_id, + procedure_type.name as procedure_type, + pc.date as procedure_date, + pc.start_time as procedure_start_time, + pc.end_time as procedure_end_time, + case + when pc.end_time is not null and pc.start_time is not null then + concat( + lpad(( + case + when pc.end_time < pc.start_time + then + (24 + extract(hour from pc.end_time) - extract(hour from pc.start_time)) + else + extract(hour from (pc.end_time - pc.start_time)) + end + )::text, 2, '0'), ':', + lpad(( + case + when pc.end_time < pc.start_time + then + (extract(minute from pc.end_time) - extract(minute from pc.start_time)) + else + extract(minute from (pc.end_time - pc.start_time)) + end + )::text, 2, '0') + ) + end as procedure_duration, + clinician.id as procedure_clinician_id, + clinician.display_name as procedure_clinician, + anaesthetist.id as procedure_anaesthetist_id, + anaesthetist.display_name as procedure_anaesthetist, + assistant_anaesthetist.id as procedure_assistant_anaesthetist_id, + assistant_anaesthetist.display_name as procedure_assistant_anaesthetist, + case + when pc.is_completed then 'Y' else 'N' + end as is_completed, + pc.time_in, + pc.time_out +from filtered_procedure pc +join "reporting"."encounters" e on e.id = pc.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."reference_data" procedure_type on procedure_type.id = pc.procedure_type_id +join "reporting"."locations" procedure_location + on procedure_location.id = pc.location_id +left join "reporting"."location_groups" procedure_area + on procedure_area.id = procedure_location.location_group_id +join "reporting"."facilities" procedure_facility + on procedure_facility.id = procedure_location.facility_id + and procedure_facility.is_sensitive = True +join "reporting"."locations" encounter_location + on encounter_location.id = e.location_id +join "reporting"."facilities" encounter_facility + on encounter_facility.id = encounter_location.facility_id + and encounter_facility.is_sensitive = True +join "reporting"."departments" encounter_department + on encounter_department.id = coalesce(pc.department_id, e.department_id) +left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id +left join "reporting"."reference_data" nationality on nationality.id = pd.nationality_id +left join "reporting"."users" assistant_anaesthetist on assistant_anaesthetist.id = pc.assistant_anaesthetist_id +left join "reporting"."users" anaesthetist on anaesthetist.id = pc.anaesthetist_id +left join "reporting"."users" clinician on clinician.id = pc.clinician_id +where pc.encounter_history_record = 1 + + +); +create or replace view "reporting"."ds__sensitive_referrals" as ( + + +with diagnoses as ( + select + ed.encounter_id, + string_agg(concat(d.name), '; ') as diagnoses + from "reporting"."encounter_diagnoses" ed + left join "reporting"."reference_data" d on d.id = ed.diagnosis_id + group by ed.encounter_id +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.village_id, + ed.diagnoses, + s.name as referral_type, + u.id as referring_doctor_id, + u.display_name as referring_doctor_name, + sr.end_datetime as referral_datetime, + rf.status, + d.name as department +from "reporting"."referrals" rf +join "reporting"."encounters" e on e.id = rf.initiating_encounter_id +join "reporting"."locations" l on l.id = e.location_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = True +join "reporting"."survey_responses" sr on sr.id = rf.survey_response_id +join "reporting"."surveys" s on s.id = sr.survey_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."users" u on u.id = e.clinician_id +join "reporting"."departments" d on d.id = e.department_id +left join diagnoses ed on ed.encounter_id = rf.initiating_encounter_id + + +); +create or replace view "reporting"."ds__sensitive_user_audit" as ( + + +with non_system_notes as ( + select distinct on (n.record_id) + n.record_id, + first_value(n.datetime) over w as first_note_datetime, + last_value(n.datetime) over w as last_note_datetime, + last_value(concat_ws(' on behalf of ', author.display_name, on_behalf.display_name)) over w as last_clinician + from "reporting"."notes" n + left join "reporting"."users" author on author.id = n.authored_by_id + left join "reporting"."users" on_behalf on on_behalf.id = n.on_behalf_of_id + where n.note_type_id != 'notetype-system' + window w as ( + partition by n.record_id + order by n.datetime + rows between unbounded preceding and unbounded following + ) +) + +select + u.id as user_id, + u.display_name as user_name, + r.name as user_role, + p.id as patient_id, + p.display_id, + bt.name as patient_category, + t.score as triage_category, + f.id as facility_id, + f.name as facility, + d.id as department_id, + d.name as department, + lg.id as location_group_id, + lg.name as location_group, + l.id as location_id, + l.name as location, + e.start_datetime as encounter_start_datetime, + e.end_datetime as encounter_end_datetime, + n.first_note_datetime, + n.last_note_datetime, + case when e.end_datetime isnull then 'Patient not discharged' + else 'Patient discharged' + end as is_discharged, + case when ds.note like 'Automatically discharged%' then n.last_clinician + end as non_discharge_by_clinicians +from "reporting"."encounters" e +left join "reporting"."users" u on u.id = e.clinician_id +left join "reporting"."roles" r on r.id = u.role +left join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."patient_additional_data" pad on pad.patient_id = e.patient_id +left join "reporting"."reference_data" bt + on bt.id = coalesce(e.patient_billing_type_id, pad.patient_billing_type_id) +left join "reporting"."triages" t on t.encounter_id = e.id +join "reporting"."locations" l on l.id = e.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = True +left join "reporting"."departments" d on d.id = e.department_id +left join "reporting"."discharges" ds on ds.encounter_id = e.id +left join non_system_notes n on n.record_id = e.id + + +); +create or replace view "reporting"."ds__admissions" as ( + + +with admission_encounters as ( + select + e.id, + e.patient_id, + e.start_datetime, + e.end_datetime, + e.location_id, + e.patient_billing_type_id, + f.id as facility_id, + f.name as facility_name + from "reporting"."encounters" e + join "reporting"."locations" l on l.id = e.location_id + join "reporting"."facilities" f on f.id = l.facility_id + where e.encounter_type = 'admission' + and f.is_sensitive = False +), + +encounter_history_consolidated as ( + select + eh.encounter_id, + eh.datetime, + eh.change_type, + eh.clinician_id, + eh.department_id, + eh.location_id, + u.display_name as clinician_name, + d.name as department_name, + l.name as location_name, + lg.id as location_group_id, + lg.name as location_group_name, + -- Window functions for ordering and lag operations + row_number() over ( + partition by eh.encounter_id, ('encounter_type' = any(eh.change_type)) + order by eh.datetime + ) as encounter_type_change_sequence, + lag(lg.id) over ( + partition by eh.encounter_id + order by eh.datetime + ) as prev_location_group_id + from admission_encounters ae + left join "reporting"."encounter_history" eh + on eh.encounter_id = ae.id + and eh.encounter_type = 'admission' + and (eh.change_type is null or eh.change_type && array['encounter_type', 'examiner', 'department', 'location']) + left join "reporting"."users" u + on u.id = eh.clinician_id + left join "reporting"."departments" d + on d.id = eh.department_id + left join "reporting"."locations" l + on l.id = eh.location_id + left join "reporting"."location_groups" lg + on lg.id = l.location_group_id +), + +-- Clinician changes and admitting clinician logic +clinician_data as ( + select + encounter_id, + bool_or('encounter_type' = any(change_type) and encounter_type_change_sequence = 1) as is_transfer, + min(datetime) filter (where change_type is null or change_type && array['encounter_type', 'examiner']) as admission_datetime, + array_agg( + datetime + order by datetime + ) filter (where change_type is null or change_type && array['encounter_type', 'examiner'] + ) as clinician_datetimes, + array_agg( + clinician_id + order by datetime + ) filter (where change_type is null or change_type && array['encounter_type', 'examiner'] + ) as clinician_ids, + array_agg( + clinician_name + order by datetime + ) filter (where change_type is null or change_type && array['encounter_type', 'examiner'] + ) as clinician_names + from encounter_history_consolidated + group by encounter_id +), + +-- Admitting clinician determination +admitting_clinicians as ( + select + encounter_id, + admission_datetime, + case + when is_transfer and array_length(clinician_ids, 1) > 1 + then clinician_ids[2] + else clinician_ids[1] + end as admitting_clinician_id, + case + when is_transfer and array_length(clinician_names, 1) > 1 + then clinician_names[2] + else clinician_names[1] + end as admitting_clinician_name + from clinician_data +), + +-- Department changes aggregation +department_changes as ( + select + encounter_id, + string_agg( + to_char(datetime, 'YYYY-MM-DD HH24:MI'), + '; ' + order by datetime + ) as department_datetimes, + array_agg( + department_id + order by datetime + ) as department_ids, + string_agg( + department_name, ', ' + order by datetime + ) as departments + from encounter_history_consolidated + where change_type is null or change_type && array['encounter_type', 'department'] + group by encounter_id +), + +-- Location changes aggregation +location_changes as ( + select + encounter_id, + string_agg( + to_char(datetime, 'YYYY-MM-DD HH24:MI'), + '; ' + order by datetime + ) as location_datetimes, + array_agg( + location_id + order by datetime + ) as location_ids, + string_agg( + location_name, ', ' + order by datetime + ) as locations + from encounter_history_consolidated + where change_type is null or change_type && array['encounter_type', 'location'] + group by encounter_id +), + +-- Location group changes (deduplicated in single pass) +location_group_changes as ( + select + encounter_id, + string_agg( + to_char(datetime, 'YYYY-MM-DD HH24:MI'), + '; ' + order by datetime + ) as location_group_datetimes, + array_agg( + location_group_id + order by datetime + ) as location_group_ids, + string_agg( + location_group_name, ', ' + order by datetime + ) as location_groups + from encounter_history_consolidated + where (change_type is null or change_type && array['encounter_type', 'location']) + and (location_group_id != prev_location_group_id or prev_location_group_id is null) + group by encounter_id +), + +-- Diagnoses aggregation +encounter_diagnoses as ( + select + ed.encounter_id, + string_agg( + case when ed.is_primary + then rd.name || ' (' || rd.code || ')' + end, + '; ' + order by ed.datetime + ) as primary_diagnoses, + string_agg( + case when not ed.is_primary + then rd.name || ' (' || rd.code || ')' + end, + '; ' + order by ed.datetime + ) as secondary_diagnoses + from admission_encounters ae + inner join "reporting"."encounter_diagnoses" ed + on ed.encounter_id = ae.id + inner join "reporting"."reference_data" rd + on rd.id = ed.diagnosis_id + where ed.certainty not in ('disproven', 'error') + group by ed.encounter_id +), + +-- Patient and reference data +patient_data as ( + select + ae.id as encounter_id, + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + p.village_id, + village.name as village_name, + ae.patient_billing_type_id, + bt.name as billing_type_name, + ae.start_datetime, + ae.end_datetime, + ae.location_id, + ae.facility_id, + ae.facility_name + from admission_encounters ae + left join "reporting"."patients" p + on p.id = ae.patient_id + left join "reporting"."reference_data" village + on village.id = p.village_id + left join "reporting"."reference_data" bt + on bt.id = ae.patient_billing_type_id +) + +select + pd.patient_id, + pd.display_id, + pd.first_name, + pd.last_name, + pd.date_of_birth, + date_part('year', age(ac.admission_datetime, pd.date_of_birth)) as age, + initcap(pd.sex::text) as sex, + pd.village_id, + pd.village_name as village, + pd.patient_billing_type_id as billing_type_id, + pd.billing_type_name as billing_type, + ac.admitting_clinician_id, + ac.admitting_clinician_name as admitting_clinician, + ac.admission_datetime, + case + when pd.end_datetime is null then 'active' + else 'discharged' + end as admission_status, + pd.end_datetime as discharge_datetime, + pd.facility_id, + pd.facility_name as facility, + dc.department_ids, + dc.departments, + dc.department_datetimes, + lgc.location_group_ids, + lgc.location_groups, + lgc.location_group_datetimes, + lc.location_ids, + lc.locations, + lc.location_datetimes, + ed.primary_diagnoses, + ed.secondary_diagnoses +from patient_data pd +left join admitting_clinicians ac + on ac.encounter_id = pd.encounter_id +left join department_changes dc + on dc.encounter_id = pd.encounter_id +left join location_changes lc + on lc.encounter_id = pd.encounter_id +left join location_group_changes lgc + on lgc.encounter_id = pd.encounter_id +left join encounter_diagnoses ed + on ed.encounter_id = pd.encounter_id + + +); +create or replace view "reporting"."ds__diagnoses" as ( + + +select + e.id as encounter_id, + p.id as patient_id, + diagnosis.id as diagnosis_id, + diagnosis.name as diagnosis, + ed.datetime as diagnosis_datetime, + p.first_name, + p.last_name, + p.display_id, + date_part('year', age(ed.datetime::date, p.date_of_birth)) as age, + p.sex, + coalesce(pad.primary_contact_number, pad.secondary_contact_number) as contact_number, + village.id as village_id, + village.name as village, + clinician.id as clinician_id, + clinician.display_name as clinician, + d.id as department_id, + d.name as department, + l.id as location_id, + l.name as location, + f.id as facility_id, + f.name as facility, + initcap(ed.certainty) as certainty, + case when ed.is_primary = true then 'Yes' else 'No' end as is_primary +from "reporting"."encounter_diagnoses" ed +join "reporting"."reference_data" diagnosis on diagnosis.id = ed.diagnosis_id +join "reporting"."encounters" e on e.id = ed.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."users" clinician on clinician.id = e.clinician_id +left join "reporting"."departments" d on d.id = e.department_id +join "reporting"."locations" l on l.id = e.location_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = False + + +); +create or replace view "reporting"."ds__encounters_emergency" as ( + + +select + t.id as triage_id, + t.arrival_datetime, + t.triage_datetime, + t.closed_datetime, + t.score, + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + p.village_id, + village.name as village, + e.id as encounter_id, + e.encounter_type, + arrival_mode.name as arrival_mode, + chief_complaint.name as chief_complaint, + secondary_complaint.name as secondary_complaint, + clinician.display_name as clinician, + t.clinician_id, + f.id as facility_id, + f.name as facility +from "reporting"."triages" t +join "reporting"."encounters" e on e.id = t.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."locations" l on l.id = e.location_id +join "reporting"."facilities" f on f.id = l.facility_id and f.is_sensitive = False +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."reference_data" arrival_mode on arrival_mode.id = t.arrival_mode_id +left join "reporting"."reference_data" chief_complaint on chief_complaint.id = t.chief_complaint_id +left join "reporting"."reference_data" secondary_complaint on secondary_complaint.id = t.secondary_complaint_id +left join "reporting"."users" clinician on clinician.id = t.clinician_id + + +); +create or replace view "reporting"."ds__encounter_diets" as ( + + +with diets as ( + select + ed.encounter_id, + string_agg( + rd.name, ', ' + order by rd.name + ) as diets + from "reporting"."encounter_diets" ed + join "reporting"."reference_data" rd + on rd.id = ed.diet_id + group by ed.encounter_id +), + +allergies as ( + select + pa.patient_id, + string_agg( + rd.name, ', ' + order by rd.name + ) as allergies + from "reporting"."patient_allergies" pa + join "reporting"."reference_data" rd + on rd.id = pa.allergy_id + group by pa.patient_id +) + +select + e.id as encounter_id, + p.id as patient_id, + p.display_id, + concat(p.first_name, ' ', p.last_name) as patient_name, + e.start_datetime, + case + when age(current_date, p.date_of_birth) < interval '8 days' + then concat(extract(day from age(current_date, p.date_of_birth)), ' days') + when age(current_date, p.date_of_birth) >= interval '8 days' + and age(current_date, p.date_of_birth) < interval '1 month' + then concat(extract(week from age(current_date, p.date_of_birth)), ' weeks') + when age(current_date, p.date_of_birth) >= interval '1 month' + and age(current_date, p.date_of_birth) < interval '2 years' + then concat(extract(month from age(current_date, p.date_of_birth)), ' months') + when age(current_date, p.date_of_birth) >= interval '2 years' + then concat(extract(year from age(current_date, p.date_of_birth)), ' years') + end as age, + l.id as location_id, + l.name as location, + lg.id as location_group_id, + lg.name as location_group, + d.diets, + a.allergies +from "reporting"."encounters" e +join "reporting"."patients" p + on p.id = e.patient_id +join "reporting"."locations" l + on l.id = e.location_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = False +left join "reporting"."location_groups" lg + on lg.id = l.location_group_id +left join diets d + on d.encounter_id = e.id +left join allergies a + on a.patient_id = p.id +where e.end_datetime is null + + +); +create or replace view "reporting"."ds__encounter_prescriptions" as ( + + +select + ep.encounter_id, + ep.prescription_id, + pr.datetime, + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(pr.datetime, p.date_of_birth)) as age, + p.sex, + coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number, + vil.id as village_id, + vil.name as village, + l.facility_id, + f.name as facility, + ep.is_selected_for_discharge, + pr.medication_id, + m.code as medication_code, + m.name as medication, + pr.route, + pr.quantity, + pr.repeats, + pr.is_ongoing, + pr.is_prn, + pr.is_variable_dose, + pr.dose_amount, + pr.units, + pr.frequency, + pr.is_discontinued, + pr.discontinued_by_id, + pr.discontinuing_reason, + pr.discontinued_datetime +from "reporting"."encounter_prescriptions" ep +join "reporting"."encounters" e on e.id = ep.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."prescriptions" pr on pr.id = ep.prescription_id +join "reporting"."locations" l on l.id = e.location_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = False +left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id +left join "reporting"."reference_data" vil on vil.id = p.village_id +join "reporting"."reference_data" m on m.id = pr.medication_id + + +); +create or replace view "reporting"."ds__imaging_requests" as ( + + +with results as ( + select + imaging_request_id, + min(datetime) as completed_datetime + from "reporting"."imaging_results" + group by imaging_request_id +), + +imaging_area_notes as ( + select + record_id as imaging_request_id, + string_agg(content, ', ' order by datetime) as imaging_area + from "reporting"."notes" + where record_type = 'ImagingRequest' + and note_type_id = 'notetype-areaToBeImaged' + group by record_id +), + +imaging_areas as ( + select + ir.id as imaging_request_id, + coalesce( + string_agg(ia.name, ', ' order by ia.name), + n.imaging_area + ) as imaging_area + from "reporting"."imaging_requests" ir + left join "reporting"."imaging_request_areas" ira on ira.imaging_request_id = ir.id + left join "reporting"."reference_data" ia on ia.id = ira.area_id + left join imaging_area_notes n on n.imaging_request_id = ir.id + group by ir.id, n.imaging_area +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(ir.datetime::date, p.date_of_birth)) as age, + p.sex, + v.id as village_id, + v.name as village, + f.id as facility_id, + f.name as facility, + d.id as department_id, + d.name as department, + lg.id as location_group_id, + lg.name as location_group, + ir.display_id as request_id, + ir.datetime as requested_datetime, + su.id as supervising_clinician_id, + su.display_name as supervising_clinician, + ru.id as requesting_clinician_id, + ru.display_name as requesting_clinician, + case + when ir.priority = 'routine' then 'Routine' + when ir.priority = 'urgent' then 'Urgent' + when ir.priority = 'asap' then 'ASAP' + when ir.priority = 'stat' then 'STAT' + when ir.priority = 'today' then 'Today' + else ir.priority + end as priority, + ir.imaging_type, + areas.imaging_area, + ir.status as status_id, + case + when ir.status = 'pending' then 'Pending' + when ir.status = 'in_progress' then 'In progress' + when ir.status = 'completed' then 'Completed' + when ir.status = 'cancelled' then 'Cancelled' + when ir.status = 'deleted' then 'Deleted' + when ir.status = 'entered_in_error' then 'Entered in error' + else 'Unknown' + end as status, + case + when ir.status = 'completed' then irs.completed_datetime + end as completed_datetime, + case + when ir.reason_for_cancellation = 'clinical' then 'Clinical reason' + when ir.reason_for_cancellation = 'duplicate' then 'Duplicate' + when ir.reason_for_cancellation = 'entered-in-error' then 'Entered in error' + when ir.reason_for_cancellation = 'patient-discharged' then 'Patient discharged' + when ir.reason_for_cancellation = 'patient-refused' then 'Patient refused' + when ir.reason_for_cancellation = 'other' then 'Other' + end as reason_for_cancellation +from "reporting"."imaging_requests" ir +join "reporting"."encounters" e on e.id = ir.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."locations" l on l.id = e.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = False +left join "reporting"."departments" d on d.id = e.department_id +left join "reporting"."users" su on su.id = e.clinician_id +left join "reporting"."users" ru on ru.id = ir.requested_by_id +left join imaging_areas areas on areas.imaging_request_id = ir.id +left join "reporting"."reference_data" v on v.id = p.village_id +left join results irs on irs.imaging_request_id = ir.id + + +); +create or replace view "reporting"."ds__lab_requests" as ( + + +with lab_test_data as ( + select + lr.id as lab_request_id, + string_agg(ltt.name, ', ' + order by ltt.name + ) as tests, + max(lt.completed_datetime) as completed_datetime + from "reporting"."lab_requests" lr + join "reporting"."lab_tests" lt on lt.lab_request_id = lr.id + join "reporting"."lab_test_types" ltt on ltt.id = lt.lab_test_type_id + where ltt.is_sensitive = False + group by lr.id +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(lr.requested_datetime, p.date_of_birth)) as age, + p.sex, + village.id as village_id, + village.name as village, + f.id as facility_id, + f.name as facility, + d.name as department, + d.id as department_id, + l.id as location_id, + l.name as location, + lg.id as location_group_id, + lg.name as location_group, + laboratory.id as laboratory_id, + laboratory.name as laboratory, + lr.display_id as request_id, + case lr.status + when 'reception_pending' then 'Reception pending' + when 'results_pending' then 'Results pending' + when 'to_be_verified' then 'To be verified' + when 'verified' then 'Verified' + when 'published' then 'Published' + when 'cancelled' then 'Cancelled' + when 'deleted' then 'Deleted' + when 'sample-not-collected' then 'Sample not collected' + when 'entered-in-error' then 'Entered in error' + else lr.status + end as status, + lr.status as status_id, + lr.requested_datetime, + req_clinician.id as requested_by_id, + req_clinician.display_name as requested_by, + lr.department_id as requesting_department_id, + req_department.name as requesting_department, + lr.lab_test_priority_id as priority_id, + priority.name as priority, + category.id as lab_test_category_id, + category.name as lab_test_category, + ltp.name as lab_test_panel, + lta.tests, + lr.collected_datetime, + lr.collected_by_id, + collector.display_name as collected_by, + lr.specimen_type_id, + specimen.name as specimen_type, + site.name as site, + lta.completed_datetime, + case lr.reason_for_cancellation + when 'clinical' then 'Clinical reason' + when 'duplicate' then 'Duplicate' + when 'entered-in-error' then 'Entered in error' + when 'patient-discharged' then 'Patient discharged' + when 'patient-refused' then 'Patient refused' + when 'other' then 'Other' + else lr.reason_for_cancellation + end as reason_for_cancellation +from "reporting"."lab_requests" lr +join lab_test_data lta on lta.lab_request_id = lr.id +join "reporting"."encounters" e on e.id = lr.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."locations" l on l.id = e.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +left join "reporting"."departments" d on d.id = e.department_id +left join "reporting"."facilities" f on f.id = l.facility_id +left join "reporting"."reference_data" laboratory on laboratory.id = lr.lab_test_laboratory_id +left join "reporting"."users" req_clinician on req_clinician.id = lr.requested_by_id +left join "reporting"."departments" req_department on req_department.id = lr.department_id +left join "reporting"."reference_data" priority on priority.id = lr.lab_test_priority_id +left join "reporting"."reference_data" category on category.id = lr.lab_test_category_id +left join "reporting"."users" collector on collector.id = lr.collected_by_id +left join "reporting"."reference_data" specimen on specimen.id = lr.specimen_type_id +left join "reporting"."reference_data" site on site.id = lr.lab_sample_site_id +left join "reporting"."lab_test_panel_requests" ltpr + on ltpr.id = lr.lab_test_panel_request_id +left join "reporting"."lab_test_panels" ltp on ltp.id = ltpr.lab_test_panel_id + + +); +create or replace view "reporting"."ds__lab_tests" as ( + + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(lr.requested_datetime, p.date_of_birth::date)) as age, + p.sex, + village.id as village_id, + village.name as village, + f.id as facility_id, + f.name as facility, + d.id as department_id, + d.name as department, + req_dept.id as requesting_department_id, + req_dept.name as requesting_department, + lg.id as location_group_id, + lg.name as location_group, + l.id as location_id, + l.name as location, + lr.display_id as lab_request_id, + lr.status as status_id, + case lr.status + when 'reception_pending' then 'Reception pending' + when 'results_pending' then 'Results pending' + when 'to_be_verified' then 'To be verified' + when 'verified' then 'Verified' + when 'published' then 'Published' + when 'cancelled' then 'Cancelled' + when 'deleted' then 'Deleted' + when 'sample-not-collected' then 'Sample not collected' + when 'entered-in-error' then 'Entered in error' + else lr.status + end as status, + ltp.id as lab_test_panel_id, + ltp.name as lab_test_panel, + category.id as lab_test_category_id, + category.name as lab_test_category, + lr.requested_datetime, + requester.id as requested_by_id, + requester.display_name as requested_by, + lr.published_datetime as lab_request_published_datetime, + lt.date as lab_test_date, + lt.result, + lt.verification, + ltt.id as lab_test_type_id, + ltt.name as lab_test_type, + lt.completed_datetime as lab_test_completed_datetime +from "reporting"."lab_requests" lr +join "reporting"."encounters" e on e.id = lr.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."locations" l on l.id = e.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +left join "reporting"."departments" d on d.id = e.department_id +left join "reporting"."departments" req_dept on req_dept.id = lr.department_id +left join "reporting"."facilities" f on f.id = l.facility_id +left join "reporting"."users" requester on requester.id = lr.requested_by_id +left join "reporting"."lab_test_panel_requests" ltpr on ltpr.id = lr.lab_test_panel_request_id +left join "reporting"."lab_test_panels" ltp on ltp.id = ltpr.lab_test_panel_id +left join "reporting"."reference_data" category on category.id = lr.lab_test_category_id +join "reporting"."lab_tests" lt on lt.lab_request_id = lr.id +join "reporting"."lab_test_types" ltt on ltt.id = lt.lab_test_type_id +where ltt.is_sensitive = False + + +); +create or replace view "reporting"."ds__location_bookings" as ( + + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(a.start_datetime::date, p.date_of_birth)) as age, + p.sex, + vil.id as village_id, + vil.name as village, + billing.id as billing_type_id, + billing.name as billing_type, + a.start_datetime as booking_start_datetime, + a.end_datetime as booking_end_datetime, + a.status as booking_status, + u.id as clinician_id, + u.display_name as clinician, + lg.id as location_group_id, + lg.name as location_group, + l.id as location_id, + l.name as location, + a.booking_type_id, + bt.name as booking_type +from "reporting"."location_bookings" a +join "reporting"."patients" p on p.id = a.patient_id +left join "reporting"."users" u on u.id = a.clinician_id +join "reporting"."locations" l on l.id = a.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +join "reporting"."facilities" f on f.id = l.facility_id + and f.is_sensitive = False +left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id +left join "reporting"."reference_data" billing on billing.id = pd.patient_billing_type_id +left join "reporting"."reference_data" vil on vil.id = p.village_id +left join "reporting"."reference_data" bt on bt.id = a.booking_type_id + + +); +create or replace view "reporting"."ds__medication_dispenses" as ( + + +select + md.id, + md.quantity, + md.dispensed_at, + po.facility_id, + f.name as facility, + pr.medication_id, + m.code as medication_code, + m.name as medication +from "reporting"."medication_dispenses" md +join "reporting"."pharmacy_order_prescriptions" pop + on pop.id = md.pharmacy_order_prescription_id +join "reporting"."pharmacy_orders" po + on po.id = pop.pharmacy_order_id +-- prescription_id is not null on all pharmacy_order_prescriptions rows (enforced by source not_null test). +-- ongoing_prescription_id is the nullable supplementary reference and is not used for the medication lookup +join "reporting"."prescriptions" pr + on pr.id = pop.prescription_id +join "reporting"."reference_data" m + on m.id = pr.medication_id +join "reporting"."facilities" f + on f.id = po.facility_id + and f.is_sensitive = False + + +); +create or replace view "reporting"."ds__outpatient_appointments" as ( + + +with appointment_creators as ( + select + appointment_id, + created_by_user_id + from "reporting"."outpatient_appointments_change_logs" + where change_sequence = 1 +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(a.start_datetime, p.date_of_birth)) as age, + p.sex, + coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number, + vil.id as village_id, + vil.name as village, + billing.id as billing_type_id, + billing.name as billing_type, + a.start_datetime as appointment_start_datetime, + a.end_datetime as appointment_end_datetime, + a.appointment_type_id, + apt.name as appointment_type, + a.status as appointment_status, + u.id as clinician_id, + u.display_name as clinician, + lg.id as location_group_id, + lg.name as location_group, + a.priority, + a.schedule_id, + a.until_date, + a.interval, + a.days_of_week, + a.frequency, + a.nth_weekday, + ac.created_by_user_id, + creator.display_name as created_by +from "reporting"."outpatient_appointments" a +join "reporting"."patients" p on p.id = a.patient_id +left join "reporting"."users" u on u.id = a.clinician_id +join "reporting"."location_groups" lg on lg.id = a.location_group_id +join "reporting"."facilities" f on f.id = lg.facility_id + and f.is_sensitive = False +left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id +left join "reporting"."reference_data" billing on billing.id = pd.patient_billing_type_id +left join "reporting"."reference_data" vil on vil.id = p.village_id +left join "reporting"."reference_data" apt on apt.id = a.appointment_type_id +left join appointment_creators ac on ac.appointment_id = a.id +left join "reporting"."users" creator on creator.id = ac.created_by_user_id + + +); +create or replace view "reporting"."ds__outpatient_appointments_audit" as ( + + +-- Outpatient Appointments Audit Dataset +-- This dataset tracks changes/modifications to outpatient appointments +-- Each row represents a modification event (excludes initial creation) +-- +-- Included changes: +-- - Status changed to 'Cancelled' (individual cancellations only) +-- - Changes to: start/end datetime, clinician, location group, appointment type, priority +-- +-- Excluded changes: +-- - Initial appointment creation (change_sequence = 1) +-- - Status-only changes (unless changing to 'Cancelled') +-- - Appointments automatically cancelled when their schedule was cancelled +-- (i.e., bulk cancellations via "cancel this and all future appointments") +-- +-- change_number: starts from 1 for the first modification, increments for subsequent changes +-- +-- Note: schedule_id never changes on existing appointments in Tamanu. +-- When a schedule is modified, old appointments are cancelled and new ones are created. + +with change_evaluation as ( + select + cl.*, + -- Determine if this change has meaningful field modifications + case + -- Status changed to Cancelled + when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true + -- Any non-status fields changed + when ( + cl.prev_start_datetime is distinct from cl.start_datetime + or cl.prev_end_datetime is distinct from cl.end_datetime + or cl.prev_clinician_id is distinct from cl.clinician_id + or cl.prev_location_group_id is distinct from cl.location_group_id + or cl.prev_appointment_type_id is distinct from cl.appointment_type_id + or cl.prev_is_high_priority is distinct from cl.is_high_priority + ) then true + else false + end as is_meaningful_change + from "reporting"."outpatient_appointments_change_logs" cl + left join "public"."appointment_schedules" s on s.id = cl.schedule_id + where + -- Exclude appointments that were automatically cancelled when the schedule was cancelled + -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule) + not ( + cl.status = 'Cancelled' + and s.cancelled_at_date is not null + and cl.start_datetime::date > s.cancelled_at_date::date + ) +), + +numbered_changes as ( + select + ce.*, + -- Assign change number: starts from 1 for first modification + row_number() over ( + partition by ce.appointment_id + order by ce.modified_datetime + ) as change_number + from change_evaluation ce + where ce.is_meaningful_change = true + and ce.change_sequence > 1 -- Exclude initial creation +) + +select + fc.change_id, + fc.appointment_id, + fc.change_number, + -- Patient details + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + -- Current appointment details + fc.start_datetime as appointment_start_datetime, + fc.end_datetime as appointment_end_datetime, + apt.name as appointment_type, + fc.appointment_type_id, + clinician.display_name as clinician, + fc.clinician_id, + lg.name as location_group, + fc.location_group_id, + case when fc.is_high_priority then 'Yes' else 'No' end as priority, + fc.schedule_id, + case + when fc.schedule_id is not null then 'Yes' + else 'No' + end as is_repeating, + -- Modification details + creator.display_name as created_by, + fc.created_by_user_id, + modifier.display_name as modified_by, + fc.modified_by_user_id, + fc.modified_datetime, + case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled, + -- Previous appointment details (only shown if different from current) + case + when fc.prev_start_datetime is distinct from fc.start_datetime + then fc.prev_start_datetime + end as prev_start_datetime, + case + when fc.prev_end_datetime is distinct from fc.end_datetime + then fc.prev_end_datetime + end as prev_end_datetime, + case + when fc.prev_appointment_type_id is distinct from fc.appointment_type_id + then prev_apt.name + end as prev_appointment_type, + case + when fc.prev_appointment_type_id is distinct from fc.appointment_type_id + then fc.prev_appointment_type_id + end as prev_appointment_type_id, + case + when fc.prev_clinician_id is distinct from fc.clinician_id + then prev_clinician.display_name + end as prev_clinician, + case + when fc.prev_clinician_id is distinct from fc.clinician_id + then fc.prev_clinician_id + end as prev_clinician_id, + case + when fc.prev_location_group_id is distinct from fc.location_group_id + then prev_lg.name + end as prev_location_group, + case + when fc.prev_location_group_id is distinct from fc.location_group_id + then fc.prev_location_group_id + end as prev_location_group_id, + case + when fc.prev_is_high_priority is not null + and fc.prev_is_high_priority is distinct from fc.is_high_priority + then case when fc.prev_is_high_priority then 'Yes' else 'No' end + end as prev_priority, + -- Facility details for filtering + f.id as facility_id, + f.name as facility +from numbered_changes fc +join "reporting"."patients" p on p.id = fc.patient_id +left join "reporting"."users" clinician on clinician.id = fc.clinician_id +left join "reporting"."users" prev_clinician on prev_clinician.id = fc.prev_clinician_id +left join "reporting"."users" creator on creator.id = fc.created_by_user_id +left join "reporting"."users" modifier on modifier.id = fc.modified_by_user_id +join "reporting"."location_groups" lg on lg.id = fc.location_group_id +left join "reporting"."location_groups" prev_lg on prev_lg.id = fc.prev_location_group_id +left join "reporting"."reference_data" apt on apt.id = fc.appointment_type_id +left join "reporting"."reference_data" prev_apt on prev_apt.id = fc.prev_appointment_type_id +left join "public"."appointment_schedules" s on s.id = fc.schedule_id +-- Join to facility for filtering by sensitivity +join "reporting"."facilities" f on f.id = lg.facility_id + and f.is_sensitive = False + + +); +create or replace view "reporting"."ds__procedures" as ( + + +with filtered_procedure as ( + select + pc.*, + eh.department_id, + eh.encounter_type, + row_number() over ( + partition by pc.id + order by eh.datetime desc + ) as encounter_history_record + from "reporting"."procedures" pc + left join "reporting"."encounter_history" eh + on eh.encounter_id = pc.encounter_id + and eh.datetime::date <= pc.date +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(pc.date, p.date_of_birth)) as age, + p.sex, + nationality.name as nationality, + encounter_facility.id as encounter_facility_id, + encounter_facility.name as encounter_facility, + encounter_department.id as encounter_department_id, + encounter_department.name as encounter_department, + case + when coalesce(pc.encounter_type, e.encounter_type) = 'admission' then 'Hospital Admission' + when coalesce(pc.encounter_type, e.encounter_type) = 'clinic' then 'Clinic' + when coalesce(pc.encounter_type, e.encounter_type) in ('triage', 'observation', 'emergency') then 'Triage' + end as encounter_type, + e.start_datetime as encounter_start_datetime, + e.end_datetime as encounter_end_datetime, + procedure_facility.id as procedure_facility_id, + procedure_facility.name as procedure_facility, + procedure_area.id as procedure_area_id, + procedure_area.name as procedure_area, + procedure_location.id as procedure_location_id, + procedure_location.name as procedure_location, + procedure_type.id as procedure_type_id, + procedure_type.name as procedure_type, + pc.date as procedure_date, + pc.start_time as procedure_start_time, + pc.end_time as procedure_end_time, + case + when pc.end_time is not null and pc.start_time is not null then + concat( + lpad(( + case + when pc.end_time < pc.start_time + then + (24 + extract(hour from pc.end_time) - extract(hour from pc.start_time)) + else + extract(hour from (pc.end_time - pc.start_time)) + end + )::text, 2, '0'), ':', + lpad(( + case + when pc.end_time < pc.start_time + then + (extract(minute from pc.end_time) - extract(minute from pc.start_time)) + else + extract(minute from (pc.end_time - pc.start_time)) + end + )::text, 2, '0') + ) + end as procedure_duration, + clinician.id as procedure_clinician_id, + clinician.display_name as procedure_clinician, + anaesthetist.id as procedure_anaesthetist_id, + anaesthetist.display_name as procedure_anaesthetist, + assistant_anaesthetist.id as procedure_assistant_anaesthetist_id, + assistant_anaesthetist.display_name as procedure_assistant_anaesthetist, + case + when pc.is_completed then 'Y' else 'N' + end as is_completed, + pc.time_in, + pc.time_out +from filtered_procedure pc +join "reporting"."encounters" e on e.id = pc.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."reference_data" procedure_type on procedure_type.id = pc.procedure_type_id +join "reporting"."locations" procedure_location + on procedure_location.id = pc.location_id +left join "reporting"."location_groups" procedure_area + on procedure_area.id = procedure_location.location_group_id +join "reporting"."facilities" procedure_facility + on procedure_facility.id = procedure_location.facility_id + and procedure_facility.is_sensitive = False +join "reporting"."locations" encounter_location + on encounter_location.id = e.location_id +join "reporting"."facilities" encounter_facility + on encounter_facility.id = encounter_location.facility_id + and encounter_facility.is_sensitive = False +join "reporting"."departments" encounter_department + on encounter_department.id = coalesce(pc.department_id, e.department_id) +left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id +left join "reporting"."reference_data" nationality on nationality.id = pd.nationality_id +left join "reporting"."users" assistant_anaesthetist on assistant_anaesthetist.id = pc.assistant_anaesthetist_id +left join "reporting"."users" anaesthetist on anaesthetist.id = pc.anaesthetist_id +left join "reporting"."users" clinician on clinician.id = pc.clinician_id +where pc.encounter_history_record = 1 + + +); +create or replace view "reporting"."ds__referrals" as ( + + +with diagnoses as ( + select + ed.encounter_id, + string_agg(concat(d.name), '; ') as diagnoses + from "reporting"."encounter_diagnoses" ed + left join "reporting"."reference_data" d on d.id = ed.diagnosis_id + group by ed.encounter_id +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.village_id, + ed.diagnoses, + s.name as referral_type, + u.id as referring_doctor_id, + u.display_name as referring_doctor_name, + sr.end_datetime as referral_datetime, + rf.status, + d.name as department +from "reporting"."referrals" rf +join "reporting"."encounters" e on e.id = rf.initiating_encounter_id +join "reporting"."locations" l on l.id = e.location_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = False +join "reporting"."survey_responses" sr on sr.id = rf.survey_response_id +join "reporting"."surveys" s on s.id = sr.survey_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."users" u on u.id = e.clinician_id +join "reporting"."departments" d on d.id = e.department_id +left join diagnoses ed on ed.encounter_id = rf.initiating_encounter_id + + +); +create or replace view "reporting"."ds__user_audit" as ( + + +with non_system_notes as ( + select distinct on (n.record_id) + n.record_id, + first_value(n.datetime) over w as first_note_datetime, + last_value(n.datetime) over w as last_note_datetime, + last_value(concat_ws(' on behalf of ', author.display_name, on_behalf.display_name)) over w as last_clinician + from "reporting"."notes" n + left join "reporting"."users" author on author.id = n.authored_by_id + left join "reporting"."users" on_behalf on on_behalf.id = n.on_behalf_of_id + where n.note_type_id != 'notetype-system' + window w as ( + partition by n.record_id + order by n.datetime + rows between unbounded preceding and unbounded following + ) +) + +select + u.id as user_id, + u.display_name as user_name, + r.name as user_role, + p.id as patient_id, + p.display_id, + bt.name as patient_category, + t.score as triage_category, + f.id as facility_id, + f.name as facility, + d.id as department_id, + d.name as department, + lg.id as location_group_id, + lg.name as location_group, + l.id as location_id, + l.name as location, + e.start_datetime as encounter_start_datetime, + e.end_datetime as encounter_end_datetime, + n.first_note_datetime, + n.last_note_datetime, + case when e.end_datetime isnull then 'Patient not discharged' + else 'Patient discharged' + end as is_discharged, + case when ds.note like 'Automatically discharged%' then n.last_clinician + end as non_discharge_by_clinicians +from "reporting"."encounters" e +left join "reporting"."users" u on u.id = e.clinician_id +left join "reporting"."roles" r on r.id = u.role +left join "reporting"."patients" p on p.id = e.patient_id +left join "reporting"."patient_additional_data" pad on pad.patient_id = e.patient_id +left join "reporting"."reference_data" bt + on bt.id = coalesce(e.patient_billing_type_id, pad.patient_billing_type_id) +left join "reporting"."triages" t on t.encounter_id = e.id +join "reporting"."locations" l on l.id = e.location_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = False +left join "reporting"."departments" d on d.id = e.department_id +left join "reporting"."discharges" ds on ds.encounter_id = e.id +left join non_system_notes n on n.record_id = e.id + + +); +create or replace view "reporting"."int__admission_history_department" as ( +with admission_department_log as ( + select + eh.id, + eh.encounter_id, + eh.datetime as start_datetime, + eh.department_id, + case + when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission' + else 'transfer-in' + end as type + from "reporting"."encounter_history" eh + where (eh.change_type isnull or eh.change_type && array['department', 'encounter_type']) + and eh.encounter_type = 'admission' +) + +select + dl.encounter_id, + dl.department_id, + d.name as department, + d.facility_id, + f.name as facility, + dl.start_datetime, + coalesce(lead(dl.start_datetime) over w, e.end_datetime) as end_datetime, + case + when coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date < 1 then 1 + else coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date + end as length_of_stay, + coalesce(dl.type = 'admission', false) as admission, + coalesce(lead(dl.department_id) over w isnull and e.end_datetime notnull, false) as discharge, + coalesce(dl.type = 'transfer-in', false) as transfer_in, + coalesce(lead(dl.department_id) over w notnull, false) as transfer_out, + coalesce(lead(dl.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death +from admission_department_log dl +join "reporting"."encounters" e on e.id = dl.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."departments" d on d.id = dl.department_id +join "reporting"."facilities" f on f.id = d.facility_id +window w as ( + partition by encounter_id + order by dl.start_datetime +) +); +create or replace view "reporting"."int__admission_history_location" as ( +with admission_location_log as ( + select + eh.id, + eh.encounter_id, + eh.datetime as start_datetime, + eh.location_id, + case + when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission' + else 'transfer-in' + end as type + from "reporting"."encounter_history" eh + where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type']) + and eh.encounter_type = 'admission' +) + +select + ll.encounter_id, + l.location_group_id, + lg.name as location_group, + ll.location_id, + l.name as location, + l.facility_id, + f.name as facility, + ll.start_datetime, + coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime, + case + when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1 + else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date + end as length_of_stay, + coalesce(ll.type = 'admission', false) as admission, + coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge, + coalesce(ll.type = 'transfer-in', false) as transfer_in, + coalesce(lead(ll.location_id) over w notnull, false) as transfer_out, + coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death +from admission_location_log ll +join "reporting"."encounters" e on e.id = ll.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +join "reporting"."locations" l on l.id = ll.location_id +join "reporting"."location_groups" lg on lg.id = l.location_group_id +join "reporting"."facilities" f on f.id = l.facility_id +window w as ( + partition by ll.encounter_id + order by ll.start_datetime +) +); +create or replace view "reporting"."int__lab_requests_history" as ( +select distinct on (lr.id, coalesce(lrl.status, lr.status)) + lr.id as request_id, + lr.requested_datetime::date as requested_date, + lr.encounter_id, + f.id as facility_id, + f.name as facility, + d.id as department_id, + d.name as department, + ltc.id as lab_test_category_id, + ltc.name as lab_test_category, + coalesce(lrl.status, lr.status) as status, + coalesce(lrl.updated_datetime, lr.updated_datetime)::date as status_start_date, + case + when coalesce(lrl.status, lr.status) = 'published' + then + coalesce(lrl.updated_datetime, lr.updated_datetime)::date + when lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w is not null + then + case + when coalesce(lrl.updated_datetime, lr.updated_datetime)::date + = (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date + then (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date + else (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w - interval '1 day')::date + end + else current_date + end as status_end_date +from "reporting"."lab_requests" lr +left join "reporting"."lab_request_logs" lrl on lrl.lab_request_id = lr.id +left join "reporting"."encounters" e on e.id = lr.encounter_id +left join "reporting"."departments" d on d.id = coalesce(lr.department_id, e.department_id) +left join "reporting"."facilities" f on f.id = d.facility_id +left join "reporting"."reference_data" ltc on ltc.id = lr.lab_test_category_id +where lr.status not in ('deleted', 'cancelled', 'entered-in-error') +window + w as ( + partition by lr.id + order by coalesce(lrl.updated_datetime, lr.updated_datetime) + ) +order by lr.id, coalesce(lrl.status, lr.status) +); +create or replace view "reporting"."ds__sensitive_vaccinations" as ( + + +with vaccine_administrations_metadata as ( + select + id, + max(updated_at) as updated_at + from "reporting"."vaccine_administrations_change_logs" + group by id +), + +administered_circumstances as ( + select + a.id, + string_agg(rd_cir.name, '; ') as circumstance_name + from "reporting"."vaccine_administrations" a + cross join lateral unnest(a.circumstance_ids) c (unnest_circumstance_id) + left join "reporting"."reference_data" rd_cir + on rd_cir.id = c.unnest_circumstance_id + group by a.id +) + +select + p.display_id, + p.first_name, + p.last_name, + p.id as patient_id, + p.date_of_birth, + date_part('year', age(p.date_of_birth)) as age, + p.sex, + p.village_id, + rd_vil.name as village, + f.id as facility_id, + f.name as facility, + d.id as department_id, + d.name as department, + lg.id as location_group_id, + lg.name as location_group, + l.id as location_id, + l.name as location, + av.scheduled_vaccine_id, + case + when av.is_given_elsewhere = true and av.datetime is null then null + else av.datetime::date + end as vaccination_date, + sv.category as vaccine_category, + sv.label as vaccine_name, + case when sv.category = 'Other' then av.vaccine_brand end as vaccine_brand, + case when sv.category = 'Other' then av.disease end as disease, + case + when av.status = 'GIVEN' then 'Given' + when av.status = 'NOT_GIVEN' then 'Not given' + when av.status = 'RECORDED_IN_ERROR' then 'Recorded in error' + when av.status = 'HISTORICAL' then 'Historical' + end as vaccine_status, + sv.dose_label as vaccine_schedule, + av.batch, + case + when av.status in ('GIVEN', 'NOT_GIVEN', 'RECORDED_IN_ERROR') then u.display_name + end as recorded_by, + case + when av.is_given_elsewhere = true then ac.circumstance_name + end as circumstances, + case + when av.status = 'NOT_GIVEN' then null + when av.status = 'GIVEN' and av.is_given_elsewhere = true then null + when av.status in ('HISTORICAL', 'RECORDED_IN_ERROR') and av.is_given_elsewhere = true then av.given_by + when av.status = 'GIVEN' then av.given_by + end as given_by, + case when av.is_given_elsewhere = true then av.given_by end as given_elsewhere_by, + case + when av.status = 'NOT_GIVEN' then av.given_by + end as not_given_clinician, + case + when av.status = 'NOT_GIVEN' then rd_reason.name + end as not_given_reason, + case + when av.status = 'HISTORICAL' then u.display_name + end as modified_by, + vam.updated_at +from "reporting"."vaccine_administrations" av +join "reporting"."encounters" e on e.id = av.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join vaccine_administrations_metadata vam on vam.id = av.id +join "reporting"."locations" l on l.id = av.location_id +left join "reporting"."departments" d on d.id = av.department_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = True +left join "reporting"."vaccine_schedules" sv on sv.id = av.scheduled_vaccine_id +left join "reporting"."users" u on u.id = av.recorded_by_id +left join "reporting"."reference_data" rd_vil on rd_vil.id = p.village_id +left join "reporting"."reference_data" rd_reason on rd_reason.id = av.not_given_reason_id +left join administered_circumstances ac on ac.id = av.id + + +); +create or replace view "reporting"."ds__vaccinations" as ( + + +with vaccine_administrations_metadata as ( + select + id, + max(updated_at) as updated_at + from "reporting"."vaccine_administrations_change_logs" + group by id +), + +administered_circumstances as ( + select + a.id, + string_agg(rd_cir.name, '; ') as circumstance_name + from "reporting"."vaccine_administrations" a + cross join lateral unnest(a.circumstance_ids) c (unnest_circumstance_id) + left join "reporting"."reference_data" rd_cir + on rd_cir.id = c.unnest_circumstance_id + group by a.id +) + +select + p.display_id, + p.first_name, + p.last_name, + p.id as patient_id, + p.date_of_birth, + date_part('year', age(p.date_of_birth)) as age, + p.sex, + p.village_id, + rd_vil.name as village, + f.id as facility_id, + f.name as facility, + d.id as department_id, + d.name as department, + lg.id as location_group_id, + lg.name as location_group, + l.id as location_id, + l.name as location, + av.scheduled_vaccine_id, + case + when av.is_given_elsewhere = true and av.datetime is null then null + else av.datetime::date + end as vaccination_date, + sv.category as vaccine_category, + sv.label as vaccine_name, + case when sv.category = 'Other' then av.vaccine_brand end as vaccine_brand, + case when sv.category = 'Other' then av.disease end as disease, + case + when av.status = 'GIVEN' then 'Given' + when av.status = 'NOT_GIVEN' then 'Not given' + when av.status = 'RECORDED_IN_ERROR' then 'Recorded in error' + when av.status = 'HISTORICAL' then 'Historical' + end as vaccine_status, + sv.dose_label as vaccine_schedule, + av.batch, + case + when av.status in ('GIVEN', 'NOT_GIVEN', 'RECORDED_IN_ERROR') then u.display_name + end as recorded_by, + case + when av.is_given_elsewhere = true then ac.circumstance_name + end as circumstances, + case + when av.status = 'NOT_GIVEN' then null + when av.status = 'GIVEN' and av.is_given_elsewhere = true then null + when av.status in ('HISTORICAL', 'RECORDED_IN_ERROR') and av.is_given_elsewhere = true then av.given_by + when av.status = 'GIVEN' then av.given_by + end as given_by, + case when av.is_given_elsewhere = true then av.given_by end as given_elsewhere_by, + case + when av.status = 'NOT_GIVEN' then av.given_by + end as not_given_clinician, + case + when av.status = 'NOT_GIVEN' then rd_reason.name + end as not_given_reason, + case + when av.status = 'HISTORICAL' then u.display_name + end as modified_by, + vam.updated_at +from "reporting"."vaccine_administrations" av +join "reporting"."encounters" e on e.id = av.encounter_id +join "reporting"."patients" p on p.id = e.patient_id +left join vaccine_administrations_metadata vam on vam.id = av.id +join "reporting"."locations" l on l.id = av.location_id +left join "reporting"."departments" d on d.id = av.department_id +left join "reporting"."location_groups" lg on lg.id = l.location_group_id +join "reporting"."facilities" f + on f.id = l.facility_id + and f.is_sensitive = False +left join "reporting"."vaccine_schedules" sv on sv.id = av.scheduled_vaccine_id +left join "reporting"."users" u on u.id = av.recorded_by_id +left join "reporting"."reference_data" rd_vil on rd_vil.id = p.village_id +left join "reporting"."reference_data" rd_reason on rd_reason.id = av.not_given_reason_id +left join administered_circumstances ac on ac.id = av.id + + +); \ No newline at end of file From 7b435320d13ef5806fe0b1c574364c9f7143443b Mon Sep 17 00:00:00 2001 From: julianam-w <77252335+julianam-w@users.noreply.github.com> Date: Fri, 26 Jun 2026 07:37:49 +1000 Subject: [PATCH 5/7] refactor(datasets): flatten admin datasets into standard Folder-only move of all 23 models/datasets/admin/* files into models/datasets/standard/, and drop the now-dead datasets `admin` tag block from dbt_project.yml. Model names (ds__*) are unchanged, so ref()s are unaffected; the models lose the path-based dbt `admin` tag. Internal yml metadata (meta.domain, tags) is left untouched. Rides on the pending version bump (compiled assets regenerated by the release build). Co-Authored-By: Claude Opus 4.8 (1M context) --- dbt_project.yml | 3 --- models/datasets/{admin => standard}/ds__births.sql | 0 models/datasets/{admin => standard}/ds__births.yml | 0 models/datasets/{admin => standard}/ds__deaths.sql | 0 models/datasets/{admin => standard}/ds__deaths.yml | 0 models/datasets/{admin => standard}/ds__invoice_products.md | 0 models/datasets/{admin => standard}/ds__invoice_products.sql | 0 models/datasets/{admin => standard}/ds__invoice_products.yml | 0 models/datasets/{admin => standard}/ds__ongoing_conditions.sql | 0 models/datasets/{admin => standard}/ds__ongoing_conditions.yml | 0 .../{admin => standard}/ds__patient_program_registrations.sql | 0 .../{admin => standard}/ds__patient_program_registrations.yml | 0 .../{admin => standard}/ds__patient_vaccinations_upcoming.sql | 0 .../{admin => standard}/ds__patient_vaccinations_upcoming.yml | 0 models/datasets/{admin => standard}/ds__patients.sql | 0 models/datasets/{admin => standard}/ds__patients.yml | 0 .../datasets/{admin => standard}/ds__patients_access_logs.sql | 0 .../datasets/{admin => standard}/ds__patients_access_logs.yml | 0 .../datasets/{admin => standard}/ds__patients_change_logs.sql | 0 .../datasets/{admin => standard}/ds__patients_change_logs.yml | 0 .../ds__usage_quality_metrics_patient_details.sql | 0 .../ds__usage_quality_metrics_patient_details.yml | 0 .../ds__usage_quality_metrics_patient_registrations.sql | 0 .../ds__usage_quality_metrics_patient_registrations.yml | 0 24 files changed, 3 deletions(-) rename models/datasets/{admin => standard}/ds__births.sql (100%) rename models/datasets/{admin => standard}/ds__births.yml (100%) rename models/datasets/{admin => standard}/ds__deaths.sql (100%) rename models/datasets/{admin => standard}/ds__deaths.yml (100%) rename models/datasets/{admin => standard}/ds__invoice_products.md (100%) rename models/datasets/{admin => standard}/ds__invoice_products.sql (100%) rename models/datasets/{admin => standard}/ds__invoice_products.yml (100%) rename models/datasets/{admin => standard}/ds__ongoing_conditions.sql (100%) rename models/datasets/{admin => standard}/ds__ongoing_conditions.yml (100%) rename models/datasets/{admin => standard}/ds__patient_program_registrations.sql (100%) rename models/datasets/{admin => standard}/ds__patient_program_registrations.yml (100%) rename models/datasets/{admin => standard}/ds__patient_vaccinations_upcoming.sql (100%) rename models/datasets/{admin => standard}/ds__patient_vaccinations_upcoming.yml (100%) rename models/datasets/{admin => standard}/ds__patients.sql (100%) rename models/datasets/{admin => standard}/ds__patients.yml (100%) rename models/datasets/{admin => standard}/ds__patients_access_logs.sql (100%) rename models/datasets/{admin => standard}/ds__patients_access_logs.yml (100%) rename models/datasets/{admin => standard}/ds__patients_change_logs.sql (100%) rename models/datasets/{admin => standard}/ds__patients_change_logs.yml (100%) rename models/datasets/{admin => standard}/ds__usage_quality_metrics_patient_details.sql (100%) rename models/datasets/{admin => standard}/ds__usage_quality_metrics_patient_details.yml (100%) rename models/datasets/{admin => standard}/ds__usage_quality_metrics_patient_registrations.sql (100%) rename models/datasets/{admin => standard}/ds__usage_quality_metrics_patient_registrations.yml (100%) diff --git a/dbt_project.yml b/dbt_project.yml index 603ca7cd..430add80 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -51,9 +51,6 @@ models: sensitive: +tags: - restricted - admin: - +tags: - - admin reports: +docs: show: false diff --git a/models/datasets/admin/ds__births.sql b/models/datasets/standard/ds__births.sql similarity index 100% rename from models/datasets/admin/ds__births.sql rename to models/datasets/standard/ds__births.sql diff --git a/models/datasets/admin/ds__births.yml b/models/datasets/standard/ds__births.yml similarity index 100% rename from models/datasets/admin/ds__births.yml rename to models/datasets/standard/ds__births.yml diff --git a/models/datasets/admin/ds__deaths.sql b/models/datasets/standard/ds__deaths.sql similarity index 100% rename from models/datasets/admin/ds__deaths.sql rename to models/datasets/standard/ds__deaths.sql diff --git a/models/datasets/admin/ds__deaths.yml b/models/datasets/standard/ds__deaths.yml similarity index 100% rename from models/datasets/admin/ds__deaths.yml rename to models/datasets/standard/ds__deaths.yml diff --git a/models/datasets/admin/ds__invoice_products.md b/models/datasets/standard/ds__invoice_products.md similarity index 100% rename from models/datasets/admin/ds__invoice_products.md rename to models/datasets/standard/ds__invoice_products.md diff --git a/models/datasets/admin/ds__invoice_products.sql b/models/datasets/standard/ds__invoice_products.sql similarity index 100% rename from models/datasets/admin/ds__invoice_products.sql rename to models/datasets/standard/ds__invoice_products.sql diff --git a/models/datasets/admin/ds__invoice_products.yml b/models/datasets/standard/ds__invoice_products.yml similarity index 100% rename from models/datasets/admin/ds__invoice_products.yml rename to models/datasets/standard/ds__invoice_products.yml diff --git a/models/datasets/admin/ds__ongoing_conditions.sql b/models/datasets/standard/ds__ongoing_conditions.sql similarity index 100% rename from models/datasets/admin/ds__ongoing_conditions.sql rename to models/datasets/standard/ds__ongoing_conditions.sql diff --git a/models/datasets/admin/ds__ongoing_conditions.yml b/models/datasets/standard/ds__ongoing_conditions.yml similarity index 100% rename from models/datasets/admin/ds__ongoing_conditions.yml rename to models/datasets/standard/ds__ongoing_conditions.yml diff --git a/models/datasets/admin/ds__patient_program_registrations.sql b/models/datasets/standard/ds__patient_program_registrations.sql similarity index 100% rename from models/datasets/admin/ds__patient_program_registrations.sql rename to models/datasets/standard/ds__patient_program_registrations.sql diff --git a/models/datasets/admin/ds__patient_program_registrations.yml b/models/datasets/standard/ds__patient_program_registrations.yml similarity index 100% rename from models/datasets/admin/ds__patient_program_registrations.yml rename to models/datasets/standard/ds__patient_program_registrations.yml diff --git a/models/datasets/admin/ds__patient_vaccinations_upcoming.sql b/models/datasets/standard/ds__patient_vaccinations_upcoming.sql similarity index 100% rename from models/datasets/admin/ds__patient_vaccinations_upcoming.sql rename to models/datasets/standard/ds__patient_vaccinations_upcoming.sql diff --git a/models/datasets/admin/ds__patient_vaccinations_upcoming.yml b/models/datasets/standard/ds__patient_vaccinations_upcoming.yml similarity index 100% rename from models/datasets/admin/ds__patient_vaccinations_upcoming.yml rename to models/datasets/standard/ds__patient_vaccinations_upcoming.yml diff --git a/models/datasets/admin/ds__patients.sql b/models/datasets/standard/ds__patients.sql similarity index 100% rename from models/datasets/admin/ds__patients.sql rename to models/datasets/standard/ds__patients.sql diff --git a/models/datasets/admin/ds__patients.yml b/models/datasets/standard/ds__patients.yml similarity index 100% rename from models/datasets/admin/ds__patients.yml rename to models/datasets/standard/ds__patients.yml diff --git a/models/datasets/admin/ds__patients_access_logs.sql b/models/datasets/standard/ds__patients_access_logs.sql similarity index 100% rename from models/datasets/admin/ds__patients_access_logs.sql rename to models/datasets/standard/ds__patients_access_logs.sql diff --git a/models/datasets/admin/ds__patients_access_logs.yml b/models/datasets/standard/ds__patients_access_logs.yml similarity index 100% rename from models/datasets/admin/ds__patients_access_logs.yml rename to models/datasets/standard/ds__patients_access_logs.yml diff --git a/models/datasets/admin/ds__patients_change_logs.sql b/models/datasets/standard/ds__patients_change_logs.sql similarity index 100% rename from models/datasets/admin/ds__patients_change_logs.sql rename to models/datasets/standard/ds__patients_change_logs.sql diff --git a/models/datasets/admin/ds__patients_change_logs.yml b/models/datasets/standard/ds__patients_change_logs.yml similarity index 100% rename from models/datasets/admin/ds__patients_change_logs.yml rename to models/datasets/standard/ds__patients_change_logs.yml diff --git a/models/datasets/admin/ds__usage_quality_metrics_patient_details.sql b/models/datasets/standard/ds__usage_quality_metrics_patient_details.sql similarity index 100% rename from models/datasets/admin/ds__usage_quality_metrics_patient_details.sql rename to models/datasets/standard/ds__usage_quality_metrics_patient_details.sql diff --git a/models/datasets/admin/ds__usage_quality_metrics_patient_details.yml b/models/datasets/standard/ds__usage_quality_metrics_patient_details.yml similarity index 100% rename from models/datasets/admin/ds__usage_quality_metrics_patient_details.yml rename to models/datasets/standard/ds__usage_quality_metrics_patient_details.yml diff --git a/models/datasets/admin/ds__usage_quality_metrics_patient_registrations.sql b/models/datasets/standard/ds__usage_quality_metrics_patient_registrations.sql similarity index 100% rename from models/datasets/admin/ds__usage_quality_metrics_patient_registrations.sql rename to models/datasets/standard/ds__usage_quality_metrics_patient_registrations.sql diff --git a/models/datasets/admin/ds__usage_quality_metrics_patient_registrations.yml b/models/datasets/standard/ds__usage_quality_metrics_patient_registrations.yml similarity index 100% rename from models/datasets/admin/ds__usage_quality_metrics_patient_registrations.yml rename to models/datasets/standard/ds__usage_quality_metrics_patient_registrations.yml From 639208f538915065a7f27d881ff1972e5177830c Mon Sep 17 00:00:00 2001 From: julianam-w <77252335+julianam-w@users.noreply.github.com> Date: Fri, 26 Jun 2026 09:12:58 +1000 Subject: [PATCH 6/7] Update Co-Authored-By: Claude Opus 4.8 (1M context) Co-Authored-By: github-actions[bot] --- .../reporting-docs-v2.50.11-standard.html | 2 +- .../reporting-schema-v2.50.11-standard.sql | 1594 ++++++++--------- 2 files changed, 798 insertions(+), 798 deletions(-) diff --git a/compiled/v2.50.11/reporting-docs-v2.50.11-standard.html b/compiled/v2.50.11/reporting-docs-v2.50.11-standard.html index bf7460d7..1de3af98 100644 --- a/compiled/v2.50.11/reporting-docs-v2.50.11-standard.html +++ b/compiled/v2.50.11/reporting-docs-v2.50.11-standard.html @@ -192,7 +192,7 @@ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function () { var o = "Expected a function", a = "__lodash_placeholder__", s = [["ary", 128], ["bind", 1], ["bindKey", 2], ["curry", 8], ["curryRight", 16], ["flip", 512], ["partial", 32], ["partialRight", 64], ["rearg", 256]], l = "[object Arguments]", c = "[object Array]", u = "[object Boolean]", d = "[object Date]", p = "[object Error]", f = "[object Function]", h = "[object GeneratorFunction]", g = "[object Map]", m = "[object Number]", v = "[object Object]", b = "[object RegExp]", y = "[object Set]", x = "[object String]", w = "[object Symbol]", k = "[object WeakMap]", A = "[object ArrayBuffer]", E = "[object DataView]", S = "[object Float32Array]", $ = "[object Float64Array]", C = "[object Int8Array]", _ = "[object Int16Array]", O = "[object Int32Array]", T = "[object Uint8Array]", j = "[object Uint16Array]", P = "[object Uint32Array]", D = /\b__p \+= '';/g, R = /\b(__p \+=) '' \+/g, I = /(__e\(.*?\)|\b__t\)) \+\n'';/g, N = /&(?:amp|lt|gt|quot|#39);/g, M = /[&<>"']/g, z = RegExp(N.source), L = RegExp(M.source), B = /<%-([\s\S]+?)%>/g, F = /<%([\s\S]+?)%>/g, q = /<%=([\s\S]+?)%>/g, V = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, U = /^\w*$/, H = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, G = /[\\^$.*+?()[\]{}|]/g, W = RegExp(G.source), Y = /^\s+/, X = /\s/, Z = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Q = /\{\n\/\* \[wrapped with (.+)\] \*/, J = /,? & /, K = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, ee = /[()=,{}\[\]\/\s]/, te = /\\(\\)?/g, ne = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, re = /\w*$/, ie = /^[-+]0x[0-9a-f]+$/i, oe = /^0b[01]+$/i, ae = /^\[object .+?Constructor\]$/, se = /^0o[0-7]+$/i, le = /^(?:0|[1-9]\d*)$/, ce = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, ue = /($^)/, de = /['\n\r\u2028\u2029\\]/g, pe = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", fe = "\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", he = "[\\ud800-\\udfff]", ge = "[" + fe + "]", me = "[" + pe + "]", ve = "\\d+", be = "[\\u2700-\\u27bf]", ye = "[a-z\\xdf-\\xf6\\xf8-\\xff]", xe = "[^\\ud800-\\udfff" + fe + ve + "\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]", we = "\\ud83c[\\udffb-\\udfff]", ke = "[^\\ud800-\\udfff]", Ae = "(?:\\ud83c[\\udde6-\\uddff]){2}", Ee = "[\\ud800-\\udbff][\\udc00-\\udfff]", Se = "[A-Z\\xc0-\\xd6\\xd8-\\xde]", $e = "(?:" + ye + "|" + xe + ")", Ce = "(?:" + Se + "|" + xe + ")", _e = "(?:" + me + "|" + we + ")" + "?", Oe = "[\\ufe0e\\ufe0f]?" + _e + ("(?:\\u200d(?:" + [ke, Ae, Ee].join("|") + ")[\\ufe0e\\ufe0f]?" + _e + ")*"), Te = "(?:" + [be, Ae, Ee].join("|") + ")" + Oe, je = "(?:" + [ke + me + "?", me, Ae, Ee, he].join("|") + ")", Pe = RegExp("['’]", "g"), De = RegExp(me, "g"), Re = RegExp(we + "(?=" + we + ")|" + je + Oe, "g"), Ie = RegExp([Se + "?" + ye + "+(?:['’](?:d|ll|m|re|s|t|ve))?(?=" + [ge, Se, "$"].join("|") + ")", Ce + "+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=" + [ge, Se + $e, "$"].join("|") + ")", Se + "?" + $e + "+(?:['’](?:d|ll|m|re|s|t|ve))?", Se + "+(?:['’](?:D|LL|M|RE|S|T|VE))?", "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", ve, Te].join("|"), "g"), Ne = RegExp("[\\u200d\\ud800-\\udfff" + pe + "\\ufe0e\\ufe0f]"), Me = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, ze = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"], Le = -1, Be = {}; Be[S] = Be[$] = Be[C] = Be[_] = Be[O] = Be[T] = Be["[object Uint8ClampedArray]"] = Be[j] = Be[P] = !0, Be[l] = Be[c] = Be[A] = Be[u] = Be[E] = Be[d] = Be[p] = Be[f] = Be[g] = Be[m] = Be[v] = Be[b] = Be[y] = Be[x] = Be[k] = !1; var Fe = {}; Fe[l] = Fe[c] = Fe[A] = Fe[E] = Fe[u] = Fe[d] = Fe[S] = Fe[$] = Fe[C] = Fe[_] = Fe[O] = Fe[g] = Fe[m] = Fe[v] = Fe[b] = Fe[y] = Fe[x] = Fe[w] = Fe[T] = Fe["[object Uint8ClampedArray]"] = Fe[j] = Fe[P] = !0, Fe[p] = Fe[f] = Fe[k] = !1; var qe = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }, Ve = parseFloat, Ue = parseInt, He = "object" == typeof e && e && e.Object === Object && e, Ge = "object" == typeof self && self && self.Object === Object && self, We = He || Ge || Function("return this")(), Ye = t && !t.nodeType && t, Xe = Ye && "object" == typeof r && r && !r.nodeType && r, Ze = Xe && Xe.exports === Ye, Qe = Ze && He.process, Je = function () { try { var e = Xe && Xe.require && Xe.require("util").types; return e || Qe && Qe.binding && Qe.binding("util") } catch (e) { } }(), Ke = Je && Je.isArrayBuffer, et = Je && Je.isDate, tt = Je && Je.isMap, nt = Je && Je.isRegExp, rt = Je && Je.isSet, it = Je && Je.isTypedArray; function ot(e, t, n) { switch (n.length) { case 0: return e.call(t); case 1: return e.call(t, n[0]); case 2: return e.call(t, n[0], n[1]); case 3: return e.call(t, n[0], n[1], n[2]) }return e.apply(t, n) } function at(e, t, n, r) { for (var i = -1, o = null == e ? 0 : e.length; ++i < o;) { var a = e[i]; t(r, a, n(a), e) } return r } function st(e, t) { for (var n = -1, r = null == e ? 0 : e.length; ++n < r && !1 !== t(e[n], n, e);); return e } function lt(e, t) { for (var n = null == e ? 0 : e.length; n-- && !1 !== t(e[n], n, e);); return e } function ct(e, t) { for (var n = -1, r = null == e ? 0 : e.length; ++n < r;)if (!t(e[n], n, e)) return !1; return !0 } function ut(e, t) { for (var n = -1, r = null == e ? 0 : e.length, i = 0, o = []; ++n < r;) { var a = e[n]; t(a, n, e) && (o[i++] = a) } return o } function dt(e, t) { return !!(null == e ? 0 : e.length) && wt(e, t, 0) > -1 } function pt(e, t, n) { for (var r = -1, i = null == e ? 0 : e.length; ++r < i;)if (n(t, e[r])) return !0; return !1 } function ft(e, t) { for (var n = -1, r = null == e ? 0 : e.length, i = Array(r); ++n < r;)i[n] = t(e[n], n, e); return i } function ht(e, t) { for (var n = -1, r = t.length, i = e.length; ++n < r;)e[i + n] = t[n]; return e } function gt(e, t, n, r) { var i = -1, o = null == e ? 0 : e.length; for (r && o && (n = e[++i]); ++i < o;)n = t(n, e[i], i, e); return n } function mt(e, t, n, r) { var i = null == e ? 0 : e.length; for (r && i && (n = e[--i]); i--;)n = t(n, e[i], i, e); return n } function vt(e, t) { for (var n = -1, r = null == e ? 0 : e.length; ++n < r;)if (t(e[n], n, e)) return !0; return !1 } var bt = St("length"); function yt(e, t, n) { var r; return n(e, (function (e, n, i) { if (t(e, n, i)) return r = n, !1 })), r } function xt(e, t, n, r) { for (var i = e.length, o = n + (r ? 1 : -1); r ? o-- : ++o < i;)if (t(e[o], o, e)) return o; return -1 } function wt(e, t, n) { return t == t ? function (e, t, n) { var r = n - 1, i = e.length; for (; ++r < i;)if (e[r] === t) return r; return -1 }(e, t, n) : xt(e, At, n) } function kt(e, t, n, r) { for (var i = n - 1, o = e.length; ++i < o;)if (r(e[i], t)) return i; return -1 } function At(e) { return e != e } function Et(e, t) { var n = null == e ? 0 : e.length; return n ? _t(e, t) / n : NaN } function St(e) { return function (t) { return null == t ? void 0 : t[e] } } function $t(e) { return function (t) { return null == e ? void 0 : e[t] } } function Ct(e, t, n, r, i) { return i(e, (function (e, i, o) { n = r ? (r = !1, e) : t(n, e, i, o) })), n } function _t(e, t) { for (var n, r = -1, i = e.length; ++r < i;) { var o = t(e[r]); void 0 !== o && (n = void 0 === n ? o : n + o) } return n } function Ot(e, t) { for (var n = -1, r = Array(e); ++n < e;)r[n] = t(n); return r } function Tt(e) { return e ? e.slice(0, Yt(e) + 1).replace(Y, "") : e } function jt(e) { return function (t) { return e(t) } } function Pt(e, t) { return ft(t, (function (t) { return e[t] })) } function Dt(e, t) { return e.has(t) } function Rt(e, t) { for (var n = -1, r = e.length; ++n < r && wt(t, e[n], 0) > -1;); return n } function It(e, t) { for (var n = e.length; n-- && wt(t, e[n], 0) > -1;); return n } function Nt(e, t) { for (var n = e.length, r = 0; n--;)e[n] === t && ++r; return r } var Mt = $t({ "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "a", "å": "a", "Ç": "C", "ç": "c", "Ð": "D", "ð": "d", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "è": "e", "é": "e", "ê": "e", "ë": "e", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "ì": "i", "í": "i", "î": "i", "ï": "i", "Ñ": "N", "ñ": "n", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "o", "ø": "o", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "ù": "u", "ú": "u", "û": "u", "ü": "u", "Ý": "Y", "ý": "y", "ÿ": "y", "Æ": "Ae", "æ": "ae", "Þ": "Th", "þ": "th", "ß": "ss", "Ā": "A", "Ă": "A", "Ą": "A", "ā": "a", "ă": "a", "ą": "a", "Ć": "C", "Ĉ": "C", "Ċ": "C", "Č": "C", "ć": "c", "ĉ": "c", "ċ": "c", "č": "c", "Ď": "D", "Đ": "D", "ď": "d", "đ": "d", "Ē": "E", "Ĕ": "E", "Ė": "E", "Ę": "E", "Ě": "E", "ē": "e", "ĕ": "e", "ė": "e", "ę": "e", "ě": "e", "Ĝ": "G", "Ğ": "G", "Ġ": "G", "Ģ": "G", "ĝ": "g", "ğ": "g", "ġ": "g", "ģ": "g", "Ĥ": "H", "Ħ": "H", "ĥ": "h", "ħ": "h", "Ĩ": "I", "Ī": "I", "Ĭ": "I", "Į": "I", "İ": "I", "ĩ": "i", "ī": "i", "ĭ": "i", "į": "i", "ı": "i", "Ĵ": "J", "ĵ": "j", "Ķ": "K", "ķ": "k", "ĸ": "k", "Ĺ": "L", "Ļ": "L", "Ľ": "L", "Ŀ": "L", "Ł": "L", "ĺ": "l", "ļ": "l", "ľ": "l", "ŀ": "l", "ł": "l", "Ń": "N", "Ņ": "N", "Ň": "N", "Ŋ": "N", "ń": "n", "ņ": "n", "ň": "n", "ŋ": "n", "Ō": "O", "Ŏ": "O", "Ő": "O", "ō": "o", "ŏ": "o", "ő": "o", "Ŕ": "R", "Ŗ": "R", "Ř": "R", "ŕ": "r", "ŗ": "r", "ř": "r", "Ś": "S", "Ŝ": "S", "Ş": "S", "Š": "S", "ś": "s", "ŝ": "s", "ş": "s", "š": "s", "Ţ": "T", "Ť": "T", "Ŧ": "T", "ţ": "t", "ť": "t", "ŧ": "t", "Ũ": "U", "Ū": "U", "Ŭ": "U", "Ů": "U", "Ű": "U", "Ų": "U", "ũ": "u", "ū": "u", "ŭ": "u", "ů": "u", "ű": "u", "ų": "u", "Ŵ": "W", "ŵ": "w", "Ŷ": "Y", "ŷ": "y", "Ÿ": "Y", "Ź": "Z", "Ż": "Z", "Ž": "Z", "ź": "z", "ż": "z", "ž": "z", "IJ": "IJ", "ij": "ij", "Œ": "Oe", "œ": "oe", "ʼn": "'n", "ſ": "s" }), zt = $t({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }); function Lt(e) { return "\\" + qe[e] } function Bt(e) { return Ne.test(e) } function Ft(e) { var t = -1, n = Array(e.size); return e.forEach((function (e, r) { n[++t] = [r, e] })), n } function qt(e, t) { return function (n) { return e(t(n)) } } function Vt(e, t) { for (var n = -1, r = e.length, i = 0, o = []; ++n < r;) { var s = e[n]; s !== t && s !== a || (e[n] = a, o[i++] = n) } return o } function Ut(e) { var t = -1, n = Array(e.size); return e.forEach((function (e) { n[++t] = e })), n } function Ht(e) { var t = -1, n = Array(e.size); return e.forEach((function (e) { n[++t] = [e, e] })), n } function Gt(e) { return Bt(e) ? function (e) { var t = Re.lastIndex = 0; for (; Re.test(e);)++t; return t }(e) : bt(e) } function Wt(e) { return Bt(e) ? function (e) { return e.match(Re) || [] }(e) : function (e) { return e.split("") }(e) } function Yt(e) { for (var t = e.length; t-- && X.test(e.charAt(t));); return t } var Xt = $t({ "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }); var Zt = function e(t) { var n, r = (t = null == t ? We : Zt.defaults(We.Object(), t, Zt.pick(We, ze))).Array, i = t.Date, X = t.Error, pe = t.Function, fe = t.Math, he = t.Object, ge = t.RegExp, me = t.String, ve = t.TypeError, be = r.prototype, ye = pe.prototype, xe = he.prototype, we = t["__core-js_shared__"], ke = ye.toString, Ae = xe.hasOwnProperty, Ee = 0, Se = (n = /[^.]+$/.exec(we && we.keys && we.keys.IE_PROTO || "")) ? "Symbol(src)_1." + n : "", $e = xe.toString, Ce = ke.call(he), _e = We._, Oe = ge("^" + ke.call(Ae).replace(G, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Te = Ze ? t.Buffer : void 0, je = t.Symbol, Re = t.Uint8Array, Ne = Te ? Te.allocUnsafe : void 0, qe = qt(he.getPrototypeOf, he), He = he.create, Ge = xe.propertyIsEnumerable, Ye = be.splice, Xe = je ? je.isConcatSpreadable : void 0, Qe = je ? je.iterator : void 0, Je = je ? je.toStringTag : void 0, bt = function () { try { var e = eo(he, "defineProperty"); return e({}, "", {}), e } catch (e) { } }(), $t = t.clearTimeout !== We.clearTimeout && t.clearTimeout, Qt = i && i.now !== We.Date.now && i.now, Jt = t.setTimeout !== We.setTimeout && t.setTimeout, Kt = fe.ceil, en = fe.floor, tn = he.getOwnPropertySymbols, nn = Te ? Te.isBuffer : void 0, rn = t.isFinite, on = be.join, an = qt(he.keys, he), sn = fe.max, ln = fe.min, cn = i.now, un = t.parseInt, dn = fe.random, pn = be.reverse, fn = eo(t, "DataView"), hn = eo(t, "Map"), gn = eo(t, "Promise"), mn = eo(t, "Set"), vn = eo(t, "WeakMap"), bn = eo(he, "create"), yn = vn && new vn, xn = {}, wn = _o(fn), kn = _o(hn), An = _o(gn), En = _o(mn), Sn = _o(vn), $n = je ? je.prototype : void 0, Cn = $n ? $n.valueOf : void 0, _n = $n ? $n.toString : void 0; function On(e) { if (Ha(e) && !Ra(e) && !(e instanceof Dn)) { if (e instanceof Pn) return e; if (Ae.call(e, "__wrapped__")) return Oo(e) } return new Pn(e) } var Tn = function () { function e() { } return function (t) { if (!Ua(t)) return {}; if (He) return He(t); e.prototype = t; var n = new e; return e.prototype = void 0, n } }(); function jn() { } function Pn(e, t) { this.__wrapped__ = e, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = void 0 } function Dn(e) { this.__wrapped__ = e, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = 4294967295, this.__views__ = [] } function Rn(e) { var t = -1, n = null == e ? 0 : e.length; for (this.clear(); ++t < n;) { var r = e[t]; this.set(r[0], r[1]) } } function In(e) { var t = -1, n = null == e ? 0 : e.length; for (this.clear(); ++t < n;) { var r = e[t]; this.set(r[0], r[1]) } } function Nn(e) { var t = -1, n = null == e ? 0 : e.length; for (this.clear(); ++t < n;) { var r = e[t]; this.set(r[0], r[1]) } } function Mn(e) { var t = -1, n = null == e ? 0 : e.length; for (this.__data__ = new Nn; ++t < n;)this.add(e[t]) } function zn(e) { var t = this.__data__ = new In(e); this.size = t.size } function Ln(e, t) { var n = Ra(e), r = !n && Da(e), i = !n && !r && za(e), o = !n && !r && !i && Ka(e), a = n || r || i || o, s = a ? Ot(e.length, me) : [], l = s.length; for (var c in e) !t && !Ae.call(e, c) || a && ("length" == c || i && ("offset" == c || "parent" == c) || o && ("buffer" == c || "byteLength" == c || "byteOffset" == c) || so(c, l)) || s.push(c); return s } function Bn(e) { var t = e.length; return t ? e[Mr(0, t - 1)] : void 0 } function Fn(e, t) { return So(bi(e), Zn(t, 0, e.length)) } function qn(e) { return So(bi(e)) } function Vn(e, t, n) { (void 0 !== n && !Ta(e[t], n) || void 0 === n && !(t in e)) && Yn(e, t, n) } function Un(e, t, n) { var r = e[t]; Ae.call(e, t) && Ta(r, n) && (void 0 !== n || t in e) || Yn(e, t, n) } function Hn(e, t) { for (var n = e.length; n--;)if (Ta(e[n][0], t)) return n; return -1 } function Gn(e, t, n, r) { return tr(e, (function (e, i, o) { t(r, e, n(e), o) })), r } function Wn(e, t) { return e && yi(t, ws(t), e) } function Yn(e, t, n) { "__proto__" == t && bt ? bt(e, t, { configurable: !0, enumerable: !0, value: n, writable: !0 }) : e[t] = n } function Xn(e, t) { for (var n = -1, i = t.length, o = r(i), a = null == e; ++n < i;)o[n] = a ? void 0 : ms(e, t[n]); return o } function Zn(e, t, n) { return e == e && (void 0 !== n && (e = e <= n ? e : n), void 0 !== t && (e = e >= t ? e : t)), e } function Qn(e, t, n, r, i, o) { var a, s = 1 & t, c = 2 & t, p = 4 & t; if (n && (a = i ? n(e, r, i, o) : n(e)), void 0 !== a) return a; if (!Ua(e)) return e; var k = Ra(e); if (k) { if (a = function (e) { var t = e.length, n = new e.constructor(t); t && "string" == typeof e[0] && Ae.call(e, "index") && (n.index = e.index, n.input = e.input); return n }(e), !s) return bi(e, a) } else { var D = ro(e), R = D == f || D == h; if (za(e)) return pi(e, s); if (D == v || D == l || R && !i) { if (a = c || R ? {} : oo(e), !s) return c ? function (e, t) { return yi(e, no(e), t) }(e, function (e, t) { return e && yi(t, ks(t), e) }(a, e)) : function (e, t) { return yi(e, to(e), t) }(e, Wn(a, e)) } else { if (!Fe[D]) return i ? e : {}; a = function (e, t, n) { var r = e.constructor; switch (t) { case A: return fi(e); case u: case d: return new r(+e); case E: return function (e, t) { var n = t ? fi(e.buffer) : e.buffer; return new e.constructor(n, e.byteOffset, e.byteLength) }(e, n); case S: case $: case C: case _: case O: case T: case "[object Uint8ClampedArray]": case j: case P: return hi(e, n); case g: return new r; case m: case x: return new r(e); case b: return function (e) { var t = new e.constructor(e.source, re.exec(e)); return t.lastIndex = e.lastIndex, t }(e); case y: return new r; case w: return i = e, Cn ? he(Cn.call(i)) : {} }var i }(e, D, s) } } o || (o = new zn); var I = o.get(e); if (I) return I; o.set(e, a), Za(e) ? e.forEach((function (r) { a.add(Qn(r, t, n, r, e, o)) })) : Ga(e) && e.forEach((function (r, i) { a.set(i, Qn(r, t, n, i, e, o)) })); var N = k ? void 0 : (p ? c ? Wi : Gi : c ? ks : ws)(e); return st(N || e, (function (r, i) { N && (r = e[i = r]), Un(a, i, Qn(r, t, n, i, e, o)) })), a } function Jn(e, t, n) { var r = n.length; if (null == e) return !r; for (e = he(e); r--;) { var i = n[r], o = t[i], a = e[i]; if (void 0 === a && !(i in e) || !o(a)) return !1 } return !0 } function Kn(e, t, n) { if ("function" != typeof e) throw new ve(o); return wo((function () { e.apply(void 0, n) }), t) } function er(e, t, n, r) { var i = -1, o = dt, a = !0, s = e.length, l = [], c = t.length; if (!s) return l; n && (t = ft(t, jt(n))), r ? (o = pt, a = !1) : t.length >= 200 && (o = Dt, a = !1, t = new Mn(t)); e: for (; ++i < s;) { var u = e[i], d = null == n ? u : n(u); if (u = r || 0 !== u ? u : 0, a && d == d) { for (var p = c; p--;)if (t[p] === d) continue e; l.push(u) } else o(t, d, r) || l.push(u) } return l } On.templateSettings = { escape: B, evaluate: F, interpolate: q, variable: "", imports: { _: On } }, On.prototype = jn.prototype, On.prototype.constructor = On, Pn.prototype = Tn(jn.prototype), Pn.prototype.constructor = Pn, Dn.prototype = Tn(jn.prototype), Dn.prototype.constructor = Dn, Rn.prototype.clear = function () { this.__data__ = bn ? bn(null) : {}, this.size = 0 }, Rn.prototype.delete = function (e) { var t = this.has(e) && delete this.__data__[e]; return this.size -= t ? 1 : 0, t }, Rn.prototype.get = function (e) { var t = this.__data__; if (bn) { var n = t[e]; return "__lodash_hash_undefined__" === n ? void 0 : n } return Ae.call(t, e) ? t[e] : void 0 }, Rn.prototype.has = function (e) { var t = this.__data__; return bn ? void 0 !== t[e] : Ae.call(t, e) }, Rn.prototype.set = function (e, t) { var n = this.__data__; return this.size += this.has(e) ? 0 : 1, n[e] = bn && void 0 === t ? "__lodash_hash_undefined__" : t, this }, In.prototype.clear = function () { this.__data__ = [], this.size = 0 }, In.prototype.delete = function (e) { var t = this.__data__, n = Hn(t, e); return !(n < 0) && (n == t.length - 1 ? t.pop() : Ye.call(t, n, 1), --this.size, !0) }, In.prototype.get = function (e) { var t = this.__data__, n = Hn(t, e); return n < 0 ? void 0 : t[n][1] }, In.prototype.has = function (e) { return Hn(this.__data__, e) > -1 }, In.prototype.set = function (e, t) { var n = this.__data__, r = Hn(n, e); return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this }, Nn.prototype.clear = function () { this.size = 0, this.__data__ = { hash: new Rn, map: new (hn || In), string: new Rn } }, Nn.prototype.delete = function (e) { var t = Ji(this, e).delete(e); return this.size -= t ? 1 : 0, t }, Nn.prototype.get = function (e) { return Ji(this, e).get(e) }, Nn.prototype.has = function (e) { return Ji(this, e).has(e) }, Nn.prototype.set = function (e, t) { var n = Ji(this, e), r = n.size; return n.set(e, t), this.size += n.size == r ? 0 : 1, this }, Mn.prototype.add = Mn.prototype.push = function (e) { return this.__data__.set(e, "__lodash_hash_undefined__"), this }, Mn.prototype.has = function (e) { return this.__data__.has(e) }, zn.prototype.clear = function () { this.__data__ = new In, this.size = 0 }, zn.prototype.delete = function (e) { var t = this.__data__, n = t.delete(e); return this.size = t.size, n }, zn.prototype.get = function (e) { return this.__data__.get(e) }, zn.prototype.has = function (e) { return this.__data__.has(e) }, zn.prototype.set = function (e, t) { var n = this.__data__; if (n instanceof In) { var r = n.__data__; if (!hn || r.length < 199) return r.push([e, t]), this.size = ++n.size, this; n = this.__data__ = new Nn(r) } return n.set(e, t), this.size = n.size, this }; var tr = ki(cr), nr = ki(ur, !0); function rr(e, t) { var n = !0; return tr(e, (function (e, r, i) { return n = !!t(e, r, i) })), n } function ir(e, t, n) { for (var r = -1, i = e.length; ++r < i;) { var o = e[r], a = t(o); if (null != a && (void 0 === s ? a == a && !Ja(a) : n(a, s))) var s = a, l = o } return l } function or(e, t) { var n = []; return tr(e, (function (e, r, i) { t(e, r, i) && n.push(e) })), n } function ar(e, t, n, r, i) { var o = -1, a = e.length; for (n || (n = ao), i || (i = []); ++o < a;) { var s = e[o]; t > 0 && n(s) ? t > 1 ? ar(s, t - 1, n, r, i) : ht(i, s) : r || (i[i.length] = s) } return i } var sr = Ai(), lr = Ai(!0); function cr(e, t) { return e && sr(e, t, ws) } function ur(e, t) { return e && lr(e, t, ws) } function dr(e, t) { return ut(t, (function (t) { return Fa(e[t]) })) } function pr(e, t) { for (var n = 0, r = (t = li(t, e)).length; null != e && n < r;)e = e[Co(t[n++])]; return n && n == r ? e : void 0 } function fr(e, t, n) { var r = t(e); return Ra(e) ? r : ht(r, n(e)) } function hr(e) { return null == e ? void 0 === e ? "[object Undefined]" : "[object Null]" : Je && Je in he(e) ? function (e) { var t = Ae.call(e, Je), n = e[Je]; try { e[Je] = void 0; var r = !0 } catch (e) { } var i = $e.call(e); r && (t ? e[Je] = n : delete e[Je]); return i }(e) : function (e) { return $e.call(e) }(e) } function gr(e, t) { return e > t } function mr(e, t) { return null != e && Ae.call(e, t) } function vr(e, t) { return null != e && t in he(e) } function br(e, t, n) { for (var i = n ? pt : dt, o = e[0].length, a = e.length, s = a, l = r(a), c = 1 / 0, u = []; s--;) { var d = e[s]; s && t && (d = ft(d, jt(t))), c = ln(d.length, c), l[s] = !n && (t || o >= 120 && d.length >= 120) ? new Mn(s && d) : void 0 } d = e[0]; var p = -1, f = l[0]; e: for (; ++p < o && u.length < c;) { var h = d[p], g = t ? t(h) : h; if (h = n || 0 !== h ? h : 0, !(f ? Dt(f, g) : i(u, g, n))) { for (s = a; --s;) { var m = l[s]; if (!(m ? Dt(m, g) : i(e[s], g, n))) continue e } f && f.push(g), u.push(h) } } return u } function yr(e, t, n) { var r = null == (e = vo(e, t = li(t, e))) ? e : e[Co(Bo(t))]; return null == r ? void 0 : ot(r, e, n) } function xr(e) { return Ha(e) && hr(e) == l } function wr(e, t, n, r, i) { return e === t || (null == e || null == t || !Ha(e) && !Ha(t) ? e != e && t != t : function (e, t, n, r, i, o) { var a = Ra(e), s = Ra(t), f = a ? c : ro(e), h = s ? c : ro(t), k = (f = f == l ? v : f) == v, S = (h = h == l ? v : h) == v, $ = f == h; if ($ && za(e)) { if (!za(t)) return !1; a = !0, k = !1 } if ($ && !k) return o || (o = new zn), a || Ka(e) ? Ui(e, t, n, r, i, o) : function (e, t, n, r, i, o, a) { switch (n) { case E: if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1; e = e.buffer, t = t.buffer; case A: return !(e.byteLength != t.byteLength || !o(new Re(e), new Re(t))); case u: case d: case m: return Ta(+e, +t); case p: return e.name == t.name && e.message == t.message; case b: case x: return e == t + ""; case g: var s = Ft; case y: var l = 1 & r; if (s || (s = Ut), e.size != t.size && !l) return !1; var c = a.get(e); if (c) return c == t; r |= 2, a.set(e, t); var f = Ui(s(e), s(t), r, i, o, a); return a.delete(e), f; case w: if (Cn) return Cn.call(e) == Cn.call(t) }return !1 }(e, t, f, n, r, i, o); if (!(1 & n)) { var C = k && Ae.call(e, "__wrapped__"), _ = S && Ae.call(t, "__wrapped__"); if (C || _) { var O = C ? e.value() : e, T = _ ? t.value() : t; return o || (o = new zn), i(O, T, n, r, o) } } if (!$) return !1; return o || (o = new zn), function (e, t, n, r, i, o) { var a = 1 & n, s = Gi(e), l = s.length, c = Gi(t).length; if (l != c && !a) return !1; var u = l; for (; u--;) { var d = s[u]; if (!(a ? d in t : Ae.call(t, d))) return !1 } var p = o.get(e), f = o.get(t); if (p && f) return p == t && f == e; var h = !0; o.set(e, t), o.set(t, e); var g = a; for (; ++u < l;) { d = s[u]; var m = e[d], v = t[d]; if (r) var b = a ? r(v, m, d, t, e, o) : r(m, v, d, e, t, o); if (!(void 0 === b ? m === v || i(m, v, n, r, o) : b)) { h = !1; break } g || (g = "constructor" == d) } if (h && !g) { var y = e.constructor, x = t.constructor; y == x || !("constructor" in e) || !("constructor" in t) || "function" == typeof y && y instanceof y && "function" == typeof x && x instanceof x || (h = !1) } return o.delete(e), o.delete(t), h }(e, t, n, r, i, o) }(e, t, n, r, wr, i)) } function kr(e, t, n, r) { var i = n.length, o = i, a = !r; if (null == e) return !o; for (e = he(e); i--;) { var s = n[i]; if (a && s[2] ? s[1] !== e[s[0]] : !(s[0] in e)) return !1 } for (; ++i < o;) { var l = (s = n[i])[0], c = e[l], u = s[1]; if (a && s[2]) { if (void 0 === c && !(l in e)) return !1 } else { var d = new zn; if (r) var p = r(c, u, l, e, t, d); if (!(void 0 === p ? wr(u, c, 3, r, d) : p)) return !1 } } return !0 } function Ar(e) { return !(!Ua(e) || (t = e, Se && Se in t)) && (Fa(e) ? Oe : ae).test(_o(e)); var t } function Er(e) { return "function" == typeof e ? e : null == e ? Ws : "object" == typeof e ? Ra(e) ? Tr(e[0], e[1]) : Or(e) : nl(e) } function Sr(e) { if (!fo(e)) return an(e); var t = []; for (var n in he(e)) Ae.call(e, n) && "constructor" != n && t.push(n); return t } function $r(e) { if (!Ua(e)) return function (e) { var t = []; if (null != e) for (var n in he(e)) t.push(n); return t }(e); var t = fo(e), n = []; for (var r in e) ("constructor" != r || !t && Ae.call(e, r)) && n.push(r); return n } function Cr(e, t) { return e < t } function _r(e, t) { var n = -1, i = Na(e) ? r(e.length) : []; return tr(e, (function (e, r, o) { i[++n] = t(e, r, o) })), i } function Or(e) { var t = Ki(e); return 1 == t.length && t[0][2] ? go(t[0][0], t[0][1]) : function (n) { return n === e || kr(n, e, t) } } function Tr(e, t) { return co(e) && ho(t) ? go(Co(e), t) : function (n) { var r = ms(n, e); return void 0 === r && r === t ? vs(n, e) : wr(t, r, 3) } } function jr(e, t, n, r, i) { e !== t && sr(t, (function (o, a) { if (i || (i = new zn), Ua(o)) !function (e, t, n, r, i, o, a) { var s = yo(e, n), l = yo(t, n), c = a.get(l); if (c) return void Vn(e, n, c); var u = o ? o(s, l, n + "", e, t, a) : void 0, d = void 0 === u; if (d) { var p = Ra(l), f = !p && za(l), h = !p && !f && Ka(l); u = l, p || f || h ? Ra(s) ? u = s : Ma(s) ? u = bi(s) : f ? (d = !1, u = pi(l, !0)) : h ? (d = !1, u = hi(l, !0)) : u = [] : Ya(l) || Da(l) ? (u = s, Da(s) ? u = ss(s) : Ua(s) && !Fa(s) || (u = oo(l))) : d = !1 } d && (a.set(l, u), i(u, l, r, o, a), a.delete(l)); Vn(e, n, u) }(e, t, a, n, jr, r, i); else { var s = r ? r(yo(e, a), o, a + "", e, t, i) : void 0; void 0 === s && (s = o), Vn(e, a, s) } }), ks) } function Pr(e, t) { var n = e.length; if (n) return so(t += t < 0 ? n : 0, n) ? e[t] : void 0 } function Dr(e, t, n) { t = t.length ? ft(t, (function (e) { return Ra(e) ? function (t) { return pr(t, 1 === e.length ? e[0] : e) } : e })) : [Ws]; var r = -1; return t = ft(t, jt(Qi())), function (e, t) { var n = e.length; for (e.sort(t); n--;)e[n] = e[n].value; return e }(_r(e, (function (e, n, i) { return { criteria: ft(t, (function (t) { return t(e) })), index: ++r, value: e } })), (function (e, t) { return function (e, t, n) { var r = -1, i = e.criteria, o = t.criteria, a = i.length, s = n.length; for (; ++r < a;) { var l = gi(i[r], o[r]); if (l) { if (r >= s) return l; var c = n[r]; return l * ("desc" == c ? -1 : 1) } } return e.index - t.index }(e, t, n) })) } function Rr(e, t, n) { for (var r = -1, i = t.length, o = {}; ++r < i;) { var a = t[r], s = pr(e, a); n(s, a) && qr(o, li(a, e), s) } return o } function Ir(e, t, n, r) { var i = r ? kt : wt, o = -1, a = t.length, s = e; for (e === t && (t = bi(t)), n && (s = ft(e, jt(n))); ++o < a;)for (var l = 0, c = t[o], u = n ? n(c) : c; (l = i(s, u, l, r)) > -1;)s !== e && Ye.call(s, l, 1), Ye.call(e, l, 1); return e } function Nr(e, t) { for (var n = e ? t.length : 0, r = n - 1; n--;) { var i = t[n]; if (n == r || i !== o) { var o = i; so(i) ? Ye.call(e, i, 1) : ei(e, i) } } return e } function Mr(e, t) { return e + en(dn() * (t - e + 1)) } function zr(e, t) { var n = ""; if (!e || t < 1 || t > 9007199254740991) return n; do { t % 2 && (n += e), (t = en(t / 2)) && (e += e) } while (t); return n } function Lr(e, t) { return ko(mo(e, t, Ws), e + "") } function Br(e) { return Bn(Ts(e)) } function Fr(e, t) { var n = Ts(e); return So(n, Zn(t, 0, n.length)) } function qr(e, t, n, r) { if (!Ua(e)) return e; for (var i = -1, o = (t = li(t, e)).length, a = o - 1, s = e; null != s && ++i < o;) { var l = Co(t[i]), c = n; if ("__proto__" === l || "constructor" === l || "prototype" === l) return e; if (i != a) { var u = s[l]; void 0 === (c = r ? r(u, l, s) : void 0) && (c = Ua(u) ? u : so(t[i + 1]) ? [] : {}) } Un(s, l, c), s = s[l] } return e } var Vr = yn ? function (e, t) { return yn.set(e, t), e } : Ws, Ur = bt ? function (e, t) { return bt(e, "toString", { configurable: !0, enumerable: !1, value: Us(t), writable: !0 }) } : Ws; function Hr(e) { return So(Ts(e)) } function Gr(e, t, n) { var i = -1, o = e.length; t < 0 && (t = -t > o ? 0 : o + t), (n = n > o ? o : n) < 0 && (n += o), o = t > n ? 0 : n - t >>> 0, t >>>= 0; for (var a = r(o); ++i < o;)a[i] = e[i + t]; return a } function Wr(e, t) { var n; return tr(e, (function (e, r, i) { return !(n = t(e, r, i)) })), !!n } function Yr(e, t, n) { var r = 0, i = null == e ? r : e.length; if ("number" == typeof t && t == t && i <= 2147483647) { for (; r < i;) { var o = r + i >>> 1, a = e[o]; null !== a && !Ja(a) && (n ? a <= t : a < t) ? r = o + 1 : i = o } return i } return Xr(e, t, Ws, n) } function Xr(e, t, n, r) { var i = 0, o = null == e ? 0 : e.length; if (0 === o) return 0; for (var a = (t = n(t)) != t, s = null === t, l = Ja(t), c = void 0 === t; i < o;) { var u = en((i + o) / 2), d = n(e[u]), p = void 0 !== d, f = null === d, h = d == d, g = Ja(d); if (a) var m = r || h; else m = c ? h && (r || p) : s ? h && p && (r || !f) : l ? h && p && !f && (r || !g) : !f && !g && (r ? d <= t : d < t); m ? i = u + 1 : o = u } return ln(o, 4294967294) } function Zr(e, t) { for (var n = -1, r = e.length, i = 0, o = []; ++n < r;) { var a = e[n], s = t ? t(a) : a; if (!n || !Ta(s, l)) { var l = s; o[i++] = 0 === a ? 0 : a } } return o } function Qr(e) { return "number" == typeof e ? e : Ja(e) ? NaN : +e } function Jr(e) { if ("string" == typeof e) return e; if (Ra(e)) return ft(e, Jr) + ""; if (Ja(e)) return _n ? _n.call(e) : ""; var t = e + ""; return "0" == t && 1 / e == -1 / 0 ? "-0" : t } function Kr(e, t, n) { var r = -1, i = dt, o = e.length, a = !0, s = [], l = s; if (n) a = !1, i = pt; else if (o >= 200) { var c = t ? null : zi(e); if (c) return Ut(c); a = !1, i = Dt, l = new Mn } else l = t ? [] : s; e: for (; ++r < o;) { var u = e[r], d = t ? t(u) : u; if (u = n || 0 !== u ? u : 0, a && d == d) { for (var p = l.length; p--;)if (l[p] === d) continue e; t && l.push(d), s.push(u) } else i(l, d, n) || (l !== s && l.push(d), s.push(u)) } return s } function ei(e, t) { return null == (e = vo(e, t = li(t, e))) || delete e[Co(Bo(t))] } function ti(e, t, n, r) { return qr(e, t, n(pr(e, t)), r) } function ni(e, t, n, r) { for (var i = e.length, o = r ? i : -1; (r ? o-- : ++o < i) && t(e[o], o, e);); return n ? Gr(e, r ? 0 : o, r ? o + 1 : i) : Gr(e, r ? o + 1 : 0, r ? i : o) } function ri(e, t) { var n = e; return n instanceof Dn && (n = n.value()), gt(t, (function (e, t) { return t.func.apply(t.thisArg, ht([e], t.args)) }), n) } function ii(e, t, n) { var i = e.length; if (i < 2) return i ? Kr(e[0]) : []; for (var o = -1, a = r(i); ++o < i;)for (var s = e[o], l = -1; ++l < i;)l != o && (a[o] = er(a[o] || s, e[l], t, n)); return Kr(ar(a, 1), t, n) } function oi(e, t, n) { for (var r = -1, i = e.length, o = t.length, a = {}; ++r < i;) { var s = r < o ? t[r] : void 0; n(a, e[r], s) } return a } function ai(e) { return Ma(e) ? e : [] } function si(e) { return "function" == typeof e ? e : Ws } function li(e, t) { return Ra(e) ? e : co(e, t) ? [e] : $o(ls(e)) } var ci = Lr; function ui(e, t, n) { var r = e.length; return n = void 0 === n ? r : n, !t && n >= r ? e : Gr(e, t, n) } var di = $t || function (e) { return We.clearTimeout(e) }; function pi(e, t) { if (t) return e.slice(); var n = e.length, r = Ne ? Ne(n) : new e.constructor(n); return e.copy(r), r } function fi(e) { var t = new e.constructor(e.byteLength); return new Re(t).set(new Re(e)), t } function hi(e, t) { var n = t ? fi(e.buffer) : e.buffer; return new e.constructor(n, e.byteOffset, e.length) } function gi(e, t) { if (e !== t) { var n = void 0 !== e, r = null === e, i = e == e, o = Ja(e), a = void 0 !== t, s = null === t, l = t == t, c = Ja(t); if (!s && !c && !o && e > t || o && a && l && !s && !c || r && a && l || !n && l || !i) return 1; if (!r && !o && !c && e < t || c && n && i && !r && !o || s && n && i || !a && i || !l) return -1 } return 0 } function mi(e, t, n, i) { for (var o = -1, a = e.length, s = n.length, l = -1, c = t.length, u = sn(a - s, 0), d = r(c + u), p = !i; ++l < c;)d[l] = t[l]; for (; ++o < s;)(p || o < a) && (d[n[o]] = e[o]); for (; u--;)d[l++] = e[o++]; return d } function vi(e, t, n, i) { for (var o = -1, a = e.length, s = -1, l = n.length, c = -1, u = t.length, d = sn(a - l, 0), p = r(d + u), f = !i; ++o < d;)p[o] = e[o]; for (var h = o; ++c < u;)p[h + c] = t[c]; for (; ++s < l;)(f || o < a) && (p[h + n[s]] = e[o++]); return p } function bi(e, t) { var n = -1, i = e.length; for (t || (t = r(i)); ++n < i;)t[n] = e[n]; return t } function yi(e, t, n, r) { var i = !n; n || (n = {}); for (var o = -1, a = t.length; ++o < a;) { var s = t[o], l = r ? r(n[s], e[s], s, n, e) : void 0; void 0 === l && (l = e[s]), i ? Yn(n, s, l) : Un(n, s, l) } return n } function xi(e, t) { return function (n, r) { var i = Ra(n) ? at : Gn, o = t ? t() : {}; return i(n, e, Qi(r, 2), o) } } function wi(e) { return Lr((function (t, n) { var r = -1, i = n.length, o = i > 1 ? n[i - 1] : void 0, a = i > 2 ? n[2] : void 0; for (o = e.length > 3 && "function" == typeof o ? (i--, o) : void 0, a && lo(n[0], n[1], a) && (o = i < 3 ? void 0 : o, i = 1), t = he(t); ++r < i;) { var s = n[r]; s && e(t, s, r, o) } return t })) } function ki(e, t) { return function (n, r) { if (null == n) return n; if (!Na(n)) return e(n, r); for (var i = n.length, o = t ? i : -1, a = he(n); (t ? o-- : ++o < i) && !1 !== r(a[o], o, a);); return n } } function Ai(e) { return function (t, n, r) { for (var i = -1, o = he(t), a = r(t), s = a.length; s--;) { var l = a[e ? s : ++i]; if (!1 === n(o[l], l, o)) break } return t } } function Ei(e) { return function (t) { var n = Bt(t = ls(t)) ? Wt(t) : void 0, r = n ? n[0] : t.charAt(0), i = n ? ui(n, 1).join("") : t.slice(1); return r[e]() + i } } function Si(e) { return function (t) { return gt(Fs(Ds(t).replace(Pe, "")), e, "") } } function $i(e) { return function () { var t = arguments; switch (t.length) { case 0: return new e; case 1: return new e(t[0]); case 2: return new e(t[0], t[1]); case 3: return new e(t[0], t[1], t[2]); case 4: return new e(t[0], t[1], t[2], t[3]); case 5: return new e(t[0], t[1], t[2], t[3], t[4]); case 6: return new e(t[0], t[1], t[2], t[3], t[4], t[5]); case 7: return new e(t[0], t[1], t[2], t[3], t[4], t[5], t[6]) }var n = Tn(e.prototype), r = e.apply(n, t); return Ua(r) ? r : n } } function Ci(e) { return function (t, n, r) { var i = he(t); if (!Na(t)) { var o = Qi(n, 3); t = ws(t), n = function (e) { return o(i[e], e, i) } } var a = e(t, n, r); return a > -1 ? i[o ? t[a] : a] : void 0 } } function _i(e) { return Hi((function (t) { var n = t.length, r = n, i = Pn.prototype.thru; for (e && t.reverse(); r--;) { var a = t[r]; if ("function" != typeof a) throw new ve(o); if (i && !s && "wrapper" == Xi(a)) var s = new Pn([], !0) } for (r = s ? r : n; ++r < n;) { var l = Xi(a = t[r]), c = "wrapper" == l ? Yi(a) : void 0; s = c && uo(c[0]) && 424 == c[1] && !c[4].length && 1 == c[9] ? s[Xi(c[0])].apply(s, c[3]) : 1 == a.length && uo(a) ? s[l]() : s.thru(a) } return function () { var e = arguments, r = e[0]; if (s && 1 == e.length && Ra(r)) return s.plant(r).value(); for (var i = 0, o = n ? t[i].apply(this, e) : r; ++i < n;)o = t[i].call(this, o); return o } })) } function Oi(e, t, n, i, o, a, s, l, c, u) { var d = 128 & t, p = 1 & t, f = 2 & t, h = 24 & t, g = 512 & t, m = f ? void 0 : $i(e); return function v() { for (var b = arguments.length, y = r(b), x = b; x--;)y[x] = arguments[x]; if (h) var w = Zi(v), k = Nt(y, w); if (i && (y = mi(y, i, o, h)), a && (y = vi(y, a, s, h)), b -= k, h && b < u) { var A = Vt(y, w); return Ni(e, t, Oi, v.placeholder, n, y, A, l, c, u - b) } var E = p ? n : this, S = f ? E[e] : e; return b = y.length, l ? y = bo(y, l) : g && b > 1 && y.reverse(), d && c < b && (y.length = c), this && this !== We && this instanceof v && (S = m || $i(S)), S.apply(E, y) } } function Ti(e, t) { return function (n, r) { return function (e, t, n, r) { return cr(e, (function (e, i, o) { t(r, n(e), i, o) })), r }(n, e, t(r), {}) } } function ji(e, t) { return function (n, r) { var i; if (void 0 === n && void 0 === r) return t; if (void 0 !== n && (i = n), void 0 !== r) { if (void 0 === i) return r; "string" == typeof n || "string" == typeof r ? (n = Jr(n), r = Jr(r)) : (n = Qr(n), r = Qr(r)), i = e(n, r) } return i } } function Pi(e) { return Hi((function (t) { return t = ft(t, jt(Qi())), Lr((function (n) { var r = this; return e(t, (function (e) { return ot(e, r, n) })) })) })) } function Di(e, t) { var n = (t = void 0 === t ? " " : Jr(t)).length; if (n < 2) return n ? zr(t, e) : t; var r = zr(t, Kt(e / Gt(t))); return Bt(t) ? ui(Wt(r), 0, e).join("") : r.slice(0, e) } function Ri(e) { return function (t, n, i) { return i && "number" != typeof i && lo(t, n, i) && (n = i = void 0), t = rs(t), void 0 === n ? (n = t, t = 0) : n = rs(n), function (e, t, n, i) { for (var o = -1, a = sn(Kt((t - e) / (n || 1)), 0), s = r(a); a--;)s[i ? a : ++o] = e, e += n; return s }(t, n, i = void 0 === i ? t < n ? 1 : -1 : rs(i), e) } } function Ii(e) { return function (t, n) { return "string" == typeof t && "string" == typeof n || (t = as(t), n = as(n)), e(t, n) } } function Ni(e, t, n, r, i, o, a, s, l, c) { var u = 8 & t; t |= u ? 32 : 64, 4 & (t &= ~(u ? 64 : 32)) || (t &= -4); var d = [e, t, i, u ? o : void 0, u ? a : void 0, u ? void 0 : o, u ? void 0 : a, s, l, c], p = n.apply(void 0, d); return uo(e) && xo(p, d), p.placeholder = r, Ao(p, e, t) } function Mi(e) { var t = fe[e]; return function (e, n) { if (e = as(e), (n = null == n ? 0 : ln(is(n), 292)) && rn(e)) { var r = (ls(e) + "e").split("e"); return +((r = (ls(t(r[0] + "e" + (+r[1] + n))) + "e").split("e"))[0] + "e" + (+r[1] - n)) } return t(e) } } var zi = mn && 1 / Ut(new mn([, -0]))[1] == 1 / 0 ? function (e) { return new mn(e) } : Js; function Li(e) { return function (t) { var n = ro(t); return n == g ? Ft(t) : n == y ? Ht(t) : function (e, t) { return ft(t, (function (t) { return [t, e[t]] })) }(t, e(t)) } } function Bi(e, t, n, i, s, l, c, u) { var d = 2 & t; if (!d && "function" != typeof e) throw new ve(o); var p = i ? i.length : 0; if (p || (t &= -97, i = s = void 0), c = void 0 === c ? c : sn(is(c), 0), u = void 0 === u ? u : is(u), p -= s ? s.length : 0, 64 & t) { var f = i, h = s; i = s = void 0 } var g = d ? void 0 : Yi(e), m = [e, t, n, i, s, f, h, l, c, u]; if (g && function (e, t) { var n = e[1], r = t[1], i = n | r, o = i < 131, s = 128 == r && 8 == n || 128 == r && 256 == n && e[7].length <= t[8] || 384 == r && t[7].length <= t[8] && 8 == n; if (!o && !s) return e; 1 & r && (e[2] = t[2], i |= 1 & n ? 0 : 4); var l = t[3]; if (l) { var c = e[3]; e[3] = c ? mi(c, l, t[4]) : l, e[4] = c ? Vt(e[3], a) : t[4] } (l = t[5]) && (c = e[5], e[5] = c ? vi(c, l, t[6]) : l, e[6] = c ? Vt(e[5], a) : t[6]); (l = t[7]) && (e[7] = l); 128 & r && (e[8] = null == e[8] ? t[8] : ln(e[8], t[8])); null == e[9] && (e[9] = t[9]); e[0] = t[0], e[1] = i }(m, g), e = m[0], t = m[1], n = m[2], i = m[3], s = m[4], !(u = m[9] = void 0 === m[9] ? d ? 0 : e.length : sn(m[9] - p, 0)) && 24 & t && (t &= -25), t && 1 != t) v = 8 == t || 16 == t ? function (e, t, n) { var i = $i(e); return function o() { for (var a = arguments.length, s = r(a), l = a, c = Zi(o); l--;)s[l] = arguments[l]; var u = a < 3 && s[0] !== c && s[a - 1] !== c ? [] : Vt(s, c); if ((a -= u.length) < n) return Ni(e, t, Oi, o.placeholder, void 0, s, u, void 0, void 0, n - a); var d = this && this !== We && this instanceof o ? i : e; return ot(d, this, s) } }(e, t, u) : 32 != t && 33 != t || s.length ? Oi.apply(void 0, m) : function (e, t, n, i) { var o = 1 & t, a = $i(e); return function t() { for (var s = -1, l = arguments.length, c = -1, u = i.length, d = r(u + l), p = this && this !== We && this instanceof t ? a : e; ++c < u;)d[c] = i[c]; for (; l--;)d[c++] = arguments[++s]; return ot(p, o ? n : this, d) } }(e, t, n, i); else var v = function (e, t, n) { var r = 1 & t, i = $i(e); return function t() { var o = this && this !== We && this instanceof t ? i : e; return o.apply(r ? n : this, arguments) } }(e, t, n); return Ao((g ? Vr : xo)(v, m), e, t) } function Fi(e, t, n, r) { return void 0 === e || Ta(e, xe[n]) && !Ae.call(r, n) ? t : e } function qi(e, t, n, r, i, o) { return Ua(e) && Ua(t) && (o.set(t, e), jr(e, t, void 0, qi, o), o.delete(t)), e } function Vi(e) { return Ya(e) ? void 0 : e } function Ui(e, t, n, r, i, o) { var a = 1 & n, s = e.length, l = t.length; if (s != l && !(a && l > s)) return !1; var c = o.get(e), u = o.get(t); if (c && u) return c == t && u == e; var d = -1, p = !0, f = 2 & n ? new Mn : void 0; for (o.set(e, t), o.set(t, e); ++d < s;) { var h = e[d], g = t[d]; if (r) var m = a ? r(g, h, d, t, e, o) : r(h, g, d, e, t, o); if (void 0 !== m) { if (m) continue; p = !1; break } if (f) { if (!vt(t, (function (e, t) { if (!Dt(f, t) && (h === e || i(h, e, n, r, o))) return f.push(t) }))) { p = !1; break } } else if (h !== g && !i(h, g, n, r, o)) { p = !1; break } } return o.delete(e), o.delete(t), p } function Hi(e) { return ko(mo(e, void 0, Io), e + "") } function Gi(e) { return fr(e, ws, to) } function Wi(e) { return fr(e, ks, no) } var Yi = yn ? function (e) { return yn.get(e) } : Js; function Xi(e) { for (var t = e.name + "", n = xn[t], r = Ae.call(xn, t) ? n.length : 0; r--;) { var i = n[r], o = i.func; if (null == o || o == e) return i.name } return t } function Zi(e) { return (Ae.call(On, "placeholder") ? On : e).placeholder } function Qi() { var e = On.iteratee || Ys; return e = e === Ys ? Er : e, arguments.length ? e(arguments[0], arguments[1]) : e } function Ji(e, t) { var n, r, i = e.__data__; return ("string" == (r = typeof (n = t)) || "number" == r || "symbol" == r || "boolean" == r ? "__proto__" !== n : null === n) ? i["string" == typeof t ? "string" : "hash"] : i.map } function Ki(e) { for (var t = ws(e), n = t.length; n--;) { var r = t[n], i = e[r]; t[n] = [r, i, ho(i)] } return t } function eo(e, t) { var n = function (e, t) { return null == e ? void 0 : e[t] }(e, t); return Ar(n) ? n : void 0 } var to = tn ? function (e) { return null == e ? [] : (e = he(e), ut(tn(e), (function (t) { return Ge.call(e, t) }))) } : ol, no = tn ? function (e) { for (var t = []; e;)ht(t, to(e)), e = qe(e); return t } : ol, ro = hr; function io(e, t, n) { for (var r = -1, i = (t = li(t, e)).length, o = !1; ++r < i;) { var a = Co(t[r]); if (!(o = null != e && n(e, a))) break; e = e[a] } return o || ++r != i ? o : !!(i = null == e ? 0 : e.length) && Va(i) && so(a, i) && (Ra(e) || Da(e)) } function oo(e) { return "function" != typeof e.constructor || fo(e) ? {} : Tn(qe(e)) } function ao(e) { return Ra(e) || Da(e) || !!(Xe && e && e[Xe]) } function so(e, t) { var n = typeof e; return !!(t = null == t ? 9007199254740991 : t) && ("number" == n || "symbol" != n && le.test(e)) && e > -1 && e % 1 == 0 && e < t } function lo(e, t, n) { if (!Ua(n)) return !1; var r = typeof t; return !!("number" == r ? Na(n) && so(t, n.length) : "string" == r && t in n) && Ta(n[t], e) } function co(e, t) { if (Ra(e)) return !1; var n = typeof e; return !("number" != n && "symbol" != n && "boolean" != n && null != e && !Ja(e)) || (U.test(e) || !V.test(e) || null != t && e in he(t)) } function uo(e) { var t = Xi(e), n = On[t]; if ("function" != typeof n || !(t in Dn.prototype)) return !1; if (e === n) return !0; var r = Yi(n); return !!r && e === r[0] } (fn && ro(new fn(new ArrayBuffer(1))) != E || hn && ro(new hn) != g || gn && "[object Promise]" != ro(gn.resolve()) || mn && ro(new mn) != y || vn && ro(new vn) != k) && (ro = function (e) { var t = hr(e), n = t == v ? e.constructor : void 0, r = n ? _o(n) : ""; if (r) switch (r) { case wn: return E; case kn: return g; case An: return "[object Promise]"; case En: return y; case Sn: return k }return t }); var po = we ? Fa : al; function fo(e) { var t = e && e.constructor; return e === ("function" == typeof t && t.prototype || xe) } function ho(e) { return e == e && !Ua(e) } function go(e, t) { return function (n) { return null != n && (n[e] === t && (void 0 !== t || e in he(n))) } } function mo(e, t, n) { return t = sn(void 0 === t ? e.length - 1 : t, 0), function () { for (var i = arguments, o = -1, a = sn(i.length - t, 0), s = r(a); ++o < a;)s[o] = i[t + o]; o = -1; for (var l = r(t + 1); ++o < t;)l[o] = i[o]; return l[t] = n(s), ot(e, this, l) } } function vo(e, t) { return t.length < 2 ? e : pr(e, Gr(t, 0, -1)) } function bo(e, t) { for (var n = e.length, r = ln(t.length, n), i = bi(e); r--;) { var o = t[r]; e[r] = so(o, n) ? i[o] : void 0 } return e } function yo(e, t) { if (("constructor" !== t || "function" != typeof e[t]) && "__proto__" != t) return e[t] } var xo = Eo(Vr), wo = Jt || function (e, t) { return We.setTimeout(e, t) }, ko = Eo(Ur); function Ao(e, t, n) { var r = t + ""; return ko(e, function (e, t) { var n = t.length; if (!n) return e; var r = n - 1; return t[r] = (n > 1 ? "& " : "") + t[r], t = t.join(n > 2 ? ", " : " "), e.replace(Z, "{\n/* [wrapped with " + t + "] */\n") }(r, function (e, t) { return st(s, (function (n) { var r = "_." + n[0]; t & n[1] && !dt(e, r) && e.push(r) })), e.sort() }(function (e) { var t = e.match(Q); return t ? t[1].split(J) : [] }(r), n))) } function Eo(e) { var t = 0, n = 0; return function () { var r = cn(), i = 16 - (r - n); if (n = r, i > 0) { if (++t >= 800) return arguments[0] } else t = 0; return e.apply(void 0, arguments) } } function So(e, t) { var n = -1, r = e.length, i = r - 1; for (t = void 0 === t ? r : t; ++n < t;) { var o = Mr(n, i), a = e[o]; e[o] = e[n], e[n] = a } return e.length = t, e } var $o = function (e) { var t = Ea(e, (function (e) { return 500 === n.size && n.clear(), e })), n = t.cache; return t }((function (e) { var t = []; return 46 === e.charCodeAt(0) && t.push(""), e.replace(H, (function (e, n, r, i) { t.push(r ? i.replace(te, "$1") : n || e) })), t })); function Co(e) { if ("string" == typeof e || Ja(e)) return e; var t = e + ""; return "0" == t && 1 / e == -1 / 0 ? "-0" : t } function _o(e) { if (null != e) { try { return ke.call(e) } catch (e) { } try { return e + "" } catch (e) { } } return "" } function Oo(e) { if (e instanceof Dn) return e.clone(); var t = new Pn(e.__wrapped__, e.__chain__); return t.__actions__ = bi(e.__actions__), t.__index__ = e.__index__, t.__values__ = e.__values__, t } var To = Lr((function (e, t) { return Ma(e) ? er(e, ar(t, 1, Ma, !0)) : [] })), jo = Lr((function (e, t) { var n = Bo(t); return Ma(n) && (n = void 0), Ma(e) ? er(e, ar(t, 1, Ma, !0), Qi(n, 2)) : [] })), Po = Lr((function (e, t) { var n = Bo(t); return Ma(n) && (n = void 0), Ma(e) ? er(e, ar(t, 1, Ma, !0), void 0, n) : [] })); function Do(e, t, n) { var r = null == e ? 0 : e.length; if (!r) return -1; var i = null == n ? 0 : is(n); return i < 0 && (i = sn(r + i, 0)), xt(e, Qi(t, 3), i) } function Ro(e, t, n) { var r = null == e ? 0 : e.length; if (!r) return -1; var i = r - 1; return void 0 !== n && (i = is(n), i = n < 0 ? sn(r + i, 0) : ln(i, r - 1)), xt(e, Qi(t, 3), i, !0) } function Io(e) { return (null == e ? 0 : e.length) ? ar(e, 1) : [] } function No(e) { return e && e.length ? e[0] : void 0 } var Mo = Lr((function (e) { var t = ft(e, ai); return t.length && t[0] === e[0] ? br(t) : [] })), zo = Lr((function (e) { var t = Bo(e), n = ft(e, ai); return t === Bo(n) ? t = void 0 : n.pop(), n.length && n[0] === e[0] ? br(n, Qi(t, 2)) : [] })), Lo = Lr((function (e) { var t = Bo(e), n = ft(e, ai); return (t = "function" == typeof t ? t : void 0) && n.pop(), n.length && n[0] === e[0] ? br(n, void 0, t) : [] })); function Bo(e) { var t = null == e ? 0 : e.length; return t ? e[t - 1] : void 0 } var Fo = Lr(qo); function qo(e, t) { return e && e.length && t && t.length ? Ir(e, t) : e } var Vo = Hi((function (e, t) { var n = null == e ? 0 : e.length, r = Xn(e, t); return Nr(e, ft(t, (function (e) { return so(e, n) ? +e : e })).sort(gi)), r })); function Uo(e) { return null == e ? e : pn.call(e) } var Ho = Lr((function (e) { return Kr(ar(e, 1, Ma, !0)) })), Go = Lr((function (e) { var t = Bo(e); return Ma(t) && (t = void 0), Kr(ar(e, 1, Ma, !0), Qi(t, 2)) })), Wo = Lr((function (e) { var t = Bo(e); return t = "function" == typeof t ? t : void 0, Kr(ar(e, 1, Ma, !0), void 0, t) })); function Yo(e) { if (!e || !e.length) return []; var t = 0; return e = ut(e, (function (e) { if (Ma(e)) return t = sn(e.length, t), !0 })), Ot(t, (function (t) { return ft(e, St(t)) })) } function Xo(e, t) { if (!e || !e.length) return []; var n = Yo(e); return null == t ? n : ft(n, (function (e) { return ot(t, void 0, e) })) } var Zo = Lr((function (e, t) { return Ma(e) ? er(e, t) : [] })), Qo = Lr((function (e) { return ii(ut(e, Ma)) })), Jo = Lr((function (e) { var t = Bo(e); return Ma(t) && (t = void 0), ii(ut(e, Ma), Qi(t, 2)) })), Ko = Lr((function (e) { var t = Bo(e); return t = "function" == typeof t ? t : void 0, ii(ut(e, Ma), void 0, t) })), ea = Lr(Yo); var ta = Lr((function (e) { var t = e.length, n = t > 1 ? e[t - 1] : void 0; return n = "function" == typeof n ? (e.pop(), n) : void 0, Xo(e, n) })); function na(e) { var t = On(e); return t.__chain__ = !0, t } function ra(e, t) { return t(e) } var ia = Hi((function (e) { var t = e.length, n = t ? e[0] : 0, r = this.__wrapped__, i = function (t) { return Xn(t, e) }; return !(t > 1 || this.__actions__.length) && r instanceof Dn && so(n) ? ((r = r.slice(n, +n + (t ? 1 : 0))).__actions__.push({ func: ra, args: [i], thisArg: void 0 }), new Pn(r, this.__chain__).thru((function (e) { return t && !e.length && e.push(void 0), e }))) : this.thru(i) })); var oa = xi((function (e, t, n) { Ae.call(e, n) ? ++e[n] : Yn(e, n, 1) })); var aa = Ci(Do), sa = Ci(Ro); function la(e, t) { return (Ra(e) ? st : tr)(e, Qi(t, 3)) } function ca(e, t) { return (Ra(e) ? lt : nr)(e, Qi(t, 3)) } var ua = xi((function (e, t, n) { Ae.call(e, n) ? e[n].push(t) : Yn(e, n, [t]) })); var da = Lr((function (e, t, n) { var i = -1, o = "function" == typeof t, a = Na(e) ? r(e.length) : []; return tr(e, (function (e) { a[++i] = o ? ot(t, e, n) : yr(e, t, n) })), a })), pa = xi((function (e, t, n) { Yn(e, n, t) })); function fa(e, t) { return (Ra(e) ? ft : _r)(e, Qi(t, 3)) } var ha = xi((function (e, t, n) { e[n ? 0 : 1].push(t) }), (function () { return [[], []] })); var ga = Lr((function (e, t) { if (null == e) return []; var n = t.length; return n > 1 && lo(e, t[0], t[1]) ? t = [] : n > 2 && lo(t[0], t[1], t[2]) && (t = [t[0]]), Dr(e, ar(t, 1), []) })), ma = Qt || function () { return We.Date.now() }; function va(e, t, n) { return t = n ? void 0 : t, Bi(e, 128, void 0, void 0, void 0, void 0, t = e && null == t ? e.length : t) } function ba(e, t) { var n; if ("function" != typeof t) throw new ve(o); return e = is(e), function () { return --e > 0 && (n = t.apply(this, arguments)), e <= 1 && (t = void 0), n } } var ya = Lr((function (e, t, n) { var r = 1; if (n.length) { var i = Vt(n, Zi(ya)); r |= 32 } return Bi(e, r, t, n, i) })), xa = Lr((function (e, t, n) { var r = 3; if (n.length) { var i = Vt(n, Zi(xa)); r |= 32 } return Bi(t, r, e, n, i) })); function wa(e, t, n) { var r, i, a, s, l, c, u = 0, d = !1, p = !1, f = !0; if ("function" != typeof e) throw new ve(o); function h(t) { var n = r, o = i; return r = i = void 0, u = t, s = e.apply(o, n) } function g(e) { return u = e, l = wo(v, t), d ? h(e) : s } function m(e) { var n = e - c; return void 0 === c || n >= t || n < 0 || p && e - u >= a } function v() { var e = ma(); if (m(e)) return b(e); l = wo(v, function (e) { var n = t - (e - c); return p ? ln(n, a - (e - u)) : n }(e)) } function b(e) { return l = void 0, f && r ? h(e) : (r = i = void 0, s) } function y() { var e = ma(), n = m(e); if (r = arguments, i = this, c = e, n) { if (void 0 === l) return g(c); if (p) return di(l), l = wo(v, t), h(c) } return void 0 === l && (l = wo(v, t)), s } return t = as(t) || 0, Ua(n) && (d = !!n.leading, a = (p = "maxWait" in n) ? sn(as(n.maxWait) || 0, t) : a, f = "trailing" in n ? !!n.trailing : f), y.cancel = function () { void 0 !== l && di(l), u = 0, r = c = i = l = void 0 }, y.flush = function () { return void 0 === l ? s : b(ma()) }, y } var ka = Lr((function (e, t) { return Kn(e, 1, t) })), Aa = Lr((function (e, t, n) { return Kn(e, as(t) || 0, n) })); function Ea(e, t) { if ("function" != typeof e || null != t && "function" != typeof t) throw new ve(o); var n = function () { var r = arguments, i = t ? t.apply(this, r) : r[0], o = n.cache; if (o.has(i)) return o.get(i); var a = e.apply(this, r); return n.cache = o.set(i, a) || o, a }; return n.cache = new (Ea.Cache || Nn), n } function Sa(e) { if ("function" != typeof e) throw new ve(o); return function () { var t = arguments; switch (t.length) { case 0: return !e.call(this); case 1: return !e.call(this, t[0]); case 2: return !e.call(this, t[0], t[1]); case 3: return !e.call(this, t[0], t[1], t[2]) }return !e.apply(this, t) } } Ea.Cache = Nn; var $a = ci((function (e, t) { var n = (t = 1 == t.length && Ra(t[0]) ? ft(t[0], jt(Qi())) : ft(ar(t, 1), jt(Qi()))).length; return Lr((function (r) { for (var i = -1, o = ln(r.length, n); ++i < o;)r[i] = t[i].call(this, r[i]); return ot(e, this, r) })) })), Ca = Lr((function (e, t) { return Bi(e, 32, void 0, t, Vt(t, Zi(Ca))) })), _a = Lr((function (e, t) { return Bi(e, 64, void 0, t, Vt(t, Zi(_a))) })), Oa = Hi((function (e, t) { return Bi(e, 256, void 0, void 0, void 0, t) })); function Ta(e, t) { return e === t || e != e && t != t } var ja = Ii(gr), Pa = Ii((function (e, t) { return e >= t })), Da = xr(function () { return arguments }()) ? xr : function (e) { return Ha(e) && Ae.call(e, "callee") && !Ge.call(e, "callee") }, Ra = r.isArray, Ia = Ke ? jt(Ke) : function (e) { return Ha(e) && hr(e) == A }; function Na(e) { return null != e && Va(e.length) && !Fa(e) } function Ma(e) { return Ha(e) && Na(e) } var za = nn || al, La = et ? jt(et) : function (e) { return Ha(e) && hr(e) == d }; function Ba(e) { if (!Ha(e)) return !1; var t = hr(e); return t == p || "[object DOMException]" == t || "string" == typeof e.message && "string" == typeof e.name && !Ya(e) } function Fa(e) { if (!Ua(e)) return !1; var t = hr(e); return t == f || t == h || "[object AsyncFunction]" == t || "[object Proxy]" == t } function qa(e) { return "number" == typeof e && e == is(e) } function Va(e) { return "number" == typeof e && e > -1 && e % 1 == 0 && e <= 9007199254740991 } function Ua(e) { var t = typeof e; return null != e && ("object" == t || "function" == t) } function Ha(e) { return null != e && "object" == typeof e } var Ga = tt ? jt(tt) : function (e) { return Ha(e) && ro(e) == g }; function Wa(e) { return "number" == typeof e || Ha(e) && hr(e) == m } function Ya(e) { if (!Ha(e) || hr(e) != v) return !1; var t = qe(e); if (null === t) return !0; var n = Ae.call(t, "constructor") && t.constructor; return "function" == typeof n && n instanceof n && ke.call(n) == Ce } var Xa = nt ? jt(nt) : function (e) { return Ha(e) && hr(e) == b }; var Za = rt ? jt(rt) : function (e) { return Ha(e) && ro(e) == y }; function Qa(e) { return "string" == typeof e || !Ra(e) && Ha(e) && hr(e) == x } function Ja(e) { return "symbol" == typeof e || Ha(e) && hr(e) == w } var Ka = it ? jt(it) : function (e) { return Ha(e) && Va(e.length) && !!Be[hr(e)] }; var es = Ii(Cr), ts = Ii((function (e, t) { return e <= t })); function ns(e) { if (!e) return []; if (Na(e)) return Qa(e) ? Wt(e) : bi(e); if (Qe && e[Qe]) return function (e) { for (var t, n = []; !(t = e.next()).done;)n.push(t.value); return n }(e[Qe]()); var t = ro(e); return (t == g ? Ft : t == y ? Ut : Ts)(e) } function rs(e) { return e ? (e = as(e)) === 1 / 0 || e === -1 / 0 ? 17976931348623157e292 * (e < 0 ? -1 : 1) : e == e ? e : 0 : 0 === e ? e : 0 } function is(e) { var t = rs(e), n = t % 1; return t == t ? n ? t - n : t : 0 } function os(e) { return e ? Zn(is(e), 0, 4294967295) : 0 } function as(e) { if ("number" == typeof e) return e; if (Ja(e)) return NaN; if (Ua(e)) { var t = "function" == typeof e.valueOf ? e.valueOf() : e; e = Ua(t) ? t + "" : t } if ("string" != typeof e) return 0 === e ? e : +e; e = Tt(e); var n = oe.test(e); return n || se.test(e) ? Ue(e.slice(2), n ? 2 : 8) : ie.test(e) ? NaN : +e } function ss(e) { return yi(e, ks(e)) } function ls(e) { return null == e ? "" : Jr(e) } var cs = wi((function (e, t) { if (fo(t) || Na(t)) yi(t, ws(t), e); else for (var n in t) Ae.call(t, n) && Un(e, n, t[n]) })), us = wi((function (e, t) { yi(t, ks(t), e) })), ds = wi((function (e, t, n, r) { yi(t, ks(t), e, r) })), ps = wi((function (e, t, n, r) { yi(t, ws(t), e, r) })), fs = Hi(Xn); var hs = Lr((function (e, t) { e = he(e); var n = -1, r = t.length, i = r > 2 ? t[2] : void 0; for (i && lo(t[0], t[1], i) && (r = 1); ++n < r;)for (var o = t[n], a = ks(o), s = -1, l = a.length; ++s < l;) { var c = a[s], u = e[c]; (void 0 === u || Ta(u, xe[c]) && !Ae.call(e, c)) && (e[c] = o[c]) } return e })), gs = Lr((function (e) { return e.push(void 0, qi), ot(Es, void 0, e) })); function ms(e, t, n) { var r = null == e ? void 0 : pr(e, t); return void 0 === r ? n : r } function vs(e, t) { return null != e && io(e, t, vr) } var bs = Ti((function (e, t, n) { null != t && "function" != typeof t.toString && (t = $e.call(t)), e[t] = n }), Us(Ws)), ys = Ti((function (e, t, n) { null != t && "function" != typeof t.toString && (t = $e.call(t)), Ae.call(e, t) ? e[t].push(n) : e[t] = [n] }), Qi), xs = Lr(yr); function ws(e) { return Na(e) ? Ln(e) : Sr(e) } function ks(e) { return Na(e) ? Ln(e, !0) : $r(e) } var As = wi((function (e, t, n) { jr(e, t, n) })), Es = wi((function (e, t, n, r) { jr(e, t, n, r) })), Ss = Hi((function (e, t) { var n = {}; if (null == e) return n; var r = !1; t = ft(t, (function (t) { return t = li(t, e), r || (r = t.length > 1), t })), yi(e, Wi(e), n), r && (n = Qn(n, 7, Vi)); for (var i = t.length; i--;)ei(n, t[i]); return n })); var $s = Hi((function (e, t) { return null == e ? {} : function (e, t) { return Rr(e, t, (function (t, n) { return vs(e, n) })) }(e, t) })); function Cs(e, t) { if (null == e) return {}; var n = ft(Wi(e), (function (e) { return [e] })); return t = Qi(t), Rr(e, n, (function (e, n) { return t(e, n[0]) })) } var _s = Li(ws), Os = Li(ks); function Ts(e) { return null == e ? [] : Pt(e, ws(e)) } var js = Si((function (e, t, n) { return t = t.toLowerCase(), e + (n ? Ps(t) : t) })); function Ps(e) { return Bs(ls(e).toLowerCase()) } function Ds(e) { return (e = ls(e)) && e.replace(ce, Mt).replace(De, "") } var Rs = Si((function (e, t, n) { return e + (n ? "-" : "") + t.toLowerCase() })), Is = Si((function (e, t, n) { return e + (n ? " " : "") + t.toLowerCase() })), Ns = Ei("toLowerCase"); var Ms = Si((function (e, t, n) { return e + (n ? "_" : "") + t.toLowerCase() })); var zs = Si((function (e, t, n) { return e + (n ? " " : "") + Bs(t) })); var Ls = Si((function (e, t, n) { return e + (n ? " " : "") + t.toUpperCase() })), Bs = Ei("toUpperCase"); function Fs(e, t, n) { return e = ls(e), void 0 === (t = n ? void 0 : t) ? function (e) { return Me.test(e) }(e) ? function (e) { return e.match(Ie) || [] }(e) : function (e) { return e.match(K) || [] }(e) : e.match(t) || [] } var qs = Lr((function (e, t) { try { return ot(e, void 0, t) } catch (e) { return Ba(e) ? e : new X(e) } })), Vs = Hi((function (e, t) { return st(t, (function (t) { t = Co(t), Yn(e, t, ya(e[t], e)) })), e })); function Us(e) { return function () { return e } } var Hs = _i(), Gs = _i(!0); function Ws(e) { return e } function Ys(e) { return Er("function" == typeof e ? e : Qn(e, 1)) } var Xs = Lr((function (e, t) { return function (n) { return yr(n, e, t) } })), Zs = Lr((function (e, t) { return function (n) { return yr(e, n, t) } })); function Qs(e, t, n) { var r = ws(t), i = dr(t, r); null != n || Ua(t) && (i.length || !r.length) || (n = t, t = e, e = this, i = dr(t, ws(t))); var o = !(Ua(n) && "chain" in n && !n.chain), a = Fa(e); return st(i, (function (n) { var r = t[n]; e[n] = r, a && (e.prototype[n] = function () { var t = this.__chain__; if (o || t) { var n = e(this.__wrapped__), i = n.__actions__ = bi(this.__actions__); return i.push({ func: r, args: arguments, thisArg: e }), n.__chain__ = t, n } return r.apply(e, ht([this.value()], arguments)) }) })), e } function Js() { } var Ks = Pi(ft), el = Pi(ct), tl = Pi(vt); function nl(e) { return co(e) ? St(Co(e)) : function (e) { return function (t) { return pr(t, e) } }(e) } var rl = Ri(), il = Ri(!0); function ol() { return [] } function al() { return !1 } var sl = ji((function (e, t) { return e + t }), 0), ll = Mi("ceil"), cl = ji((function (e, t) { return e / t }), 1), ul = Mi("floor"); var dl, pl = ji((function (e, t) { return e * t }), 1), fl = Mi("round"), hl = ji((function (e, t) { return e - t }), 0); return On.after = function (e, t) { if ("function" != typeof t) throw new ve(o); return e = is(e), function () { if (--e < 1) return t.apply(this, arguments) } }, On.ary = va, On.assign = cs, On.assignIn = us, On.assignInWith = ds, On.assignWith = ps, On.at = fs, On.before = ba, On.bind = ya, On.bindAll = Vs, On.bindKey = xa, On.castArray = function () { if (!arguments.length) return []; var e = arguments[0]; return Ra(e) ? e : [e] }, On.chain = na, On.chunk = function (e, t, n) { t = (n ? lo(e, t, n) : void 0 === t) ? 1 : sn(is(t), 0); var i = null == e ? 0 : e.length; if (!i || t < 1) return []; for (var o = 0, a = 0, s = r(Kt(i / t)); o < i;)s[a++] = Gr(e, o, o += t); return s }, On.compact = function (e) { for (var t = -1, n = null == e ? 0 : e.length, r = 0, i = []; ++t < n;) { var o = e[t]; o && (i[r++] = o) } return i }, On.concat = function () { var e = arguments.length; if (!e) return []; for (var t = r(e - 1), n = arguments[0], i = e; i--;)t[i - 1] = arguments[i]; return ht(Ra(n) ? bi(n) : [n], ar(t, 1)) }, On.cond = function (e) { var t = null == e ? 0 : e.length, n = Qi(); return e = t ? ft(e, (function (e) { if ("function" != typeof e[1]) throw new ve(o); return [n(e[0]), e[1]] })) : [], Lr((function (n) { for (var r = -1; ++r < t;) { var i = e[r]; if (ot(i[0], this, n)) return ot(i[1], this, n) } })) }, On.conforms = function (e) { return function (e) { var t = ws(e); return function (n) { return Jn(n, e, t) } }(Qn(e, 1)) }, On.constant = Us, On.countBy = oa, On.create = function (e, t) { var n = Tn(e); return null == t ? n : Wn(n, t) }, On.curry = function e(t, n, r) { var i = Bi(t, 8, void 0, void 0, void 0, void 0, void 0, n = r ? void 0 : n); return i.placeholder = e.placeholder, i }, On.curryRight = function e(t, n, r) { var i = Bi(t, 16, void 0, void 0, void 0, void 0, void 0, n = r ? void 0 : n); return i.placeholder = e.placeholder, i }, On.debounce = wa, On.defaults = hs, On.defaultsDeep = gs, On.defer = ka, On.delay = Aa, On.difference = To, On.differenceBy = jo, On.differenceWith = Po, On.drop = function (e, t, n) { var r = null == e ? 0 : e.length; return r ? Gr(e, (t = n || void 0 === t ? 1 : is(t)) < 0 ? 0 : t, r) : [] }, On.dropRight = function (e, t, n) { var r = null == e ? 0 : e.length; return r ? Gr(e, 0, (t = r - (t = n || void 0 === t ? 1 : is(t))) < 0 ? 0 : t) : [] }, On.dropRightWhile = function (e, t) { return e && e.length ? ni(e, Qi(t, 3), !0, !0) : [] }, On.dropWhile = function (e, t) { return e && e.length ? ni(e, Qi(t, 3), !0) : [] }, On.fill = function (e, t, n, r) { var i = null == e ? 0 : e.length; return i ? (n && "number" != typeof n && lo(e, t, n) && (n = 0, r = i), function (e, t, n, r) { var i = e.length; for ((n = is(n)) < 0 && (n = -n > i ? 0 : i + n), (r = void 0 === r || r > i ? i : is(r)) < 0 && (r += i), r = n > r ? 0 : os(r); n < r;)e[n++] = t; return e }(e, t, n, r)) : [] }, On.filter = function (e, t) { return (Ra(e) ? ut : or)(e, Qi(t, 3)) }, On.flatMap = function (e, t) { return ar(fa(e, t), 1) }, On.flatMapDeep = function (e, t) { return ar(fa(e, t), 1 / 0) }, On.flatMapDepth = function (e, t, n) { return n = void 0 === n ? 1 : is(n), ar(fa(e, t), n) }, On.flatten = Io, On.flattenDeep = function (e) { return (null == e ? 0 : e.length) ? ar(e, 1 / 0) : [] }, On.flattenDepth = function (e, t) { return (null == e ? 0 : e.length) ? ar(e, t = void 0 === t ? 1 : is(t)) : [] }, On.flip = function (e) { return Bi(e, 512) }, On.flow = Hs, On.flowRight = Gs, On.fromPairs = function (e) { for (var t = -1, n = null == e ? 0 : e.length, r = {}; ++t < n;) { var i = e[t]; r[i[0]] = i[1] } return r }, On.functions = function (e) { return null == e ? [] : dr(e, ws(e)) }, On.functionsIn = function (e) { return null == e ? [] : dr(e, ks(e)) }, On.groupBy = ua, On.initial = function (e) { return (null == e ? 0 : e.length) ? Gr(e, 0, -1) : [] }, On.intersection = Mo, On.intersectionBy = zo, On.intersectionWith = Lo, On.invert = bs, On.invertBy = ys, On.invokeMap = da, On.iteratee = Ys, On.keyBy = pa, On.keys = ws, On.keysIn = ks, On.map = fa, On.mapKeys = function (e, t) { var n = {}; return t = Qi(t, 3), cr(e, (function (e, r, i) { Yn(n, t(e, r, i), e) })), n }, On.mapValues = function (e, t) { var n = {}; return t = Qi(t, 3), cr(e, (function (e, r, i) { Yn(n, r, t(e, r, i)) })), n }, On.matches = function (e) { return Or(Qn(e, 1)) }, On.matchesProperty = function (e, t) { return Tr(e, Qn(t, 1)) }, On.memoize = Ea, On.merge = As, On.mergeWith = Es, On.method = Xs, On.methodOf = Zs, On.mixin = Qs, On.negate = Sa, On.nthArg = function (e) { return e = is(e), Lr((function (t) { return Pr(t, e) })) }, On.omit = Ss, On.omitBy = function (e, t) { return Cs(e, Sa(Qi(t))) }, On.once = function (e) { return ba(2, e) }, On.orderBy = function (e, t, n, r) { return null == e ? [] : (Ra(t) || (t = null == t ? [] : [t]), Ra(n = r ? void 0 : n) || (n = null == n ? [] : [n]), Dr(e, t, n)) }, On.over = Ks, On.overArgs = $a, On.overEvery = el, On.overSome = tl, On.partial = Ca, On.partialRight = _a, On.partition = ha, On.pick = $s, On.pickBy = Cs, On.property = nl, On.propertyOf = function (e) { return function (t) { return null == e ? void 0 : pr(e, t) } }, On.pull = Fo, On.pullAll = qo, On.pullAllBy = function (e, t, n) { return e && e.length && t && t.length ? Ir(e, t, Qi(n, 2)) : e }, On.pullAllWith = function (e, t, n) { return e && e.length && t && t.length ? Ir(e, t, void 0, n) : e }, On.pullAt = Vo, On.range = rl, On.rangeRight = il, On.rearg = Oa, On.reject = function (e, t) { return (Ra(e) ? ut : or)(e, Sa(Qi(t, 3))) }, On.remove = function (e, t) { var n = []; if (!e || !e.length) return n; var r = -1, i = [], o = e.length; for (t = Qi(t, 3); ++r < o;) { var a = e[r]; t(a, r, e) && (n.push(a), i.push(r)) } return Nr(e, i), n }, On.rest = function (e, t) { if ("function" != typeof e) throw new ve(o); return Lr(e, t = void 0 === t ? t : is(t)) }, On.reverse = Uo, On.sampleSize = function (e, t, n) { return t = (n ? lo(e, t, n) : void 0 === t) ? 1 : is(t), (Ra(e) ? Fn : Fr)(e, t) }, On.set = function (e, t, n) { return null == e ? e : qr(e, t, n) }, On.setWith = function (e, t, n, r) { return r = "function" == typeof r ? r : void 0, null == e ? e : qr(e, t, n, r) }, On.shuffle = function (e) { return (Ra(e) ? qn : Hr)(e) }, On.slice = function (e, t, n) { var r = null == e ? 0 : e.length; return r ? (n && "number" != typeof n && lo(e, t, n) ? (t = 0, n = r) : (t = null == t ? 0 : is(t), n = void 0 === n ? r : is(n)), Gr(e, t, n)) : [] }, On.sortBy = ga, On.sortedUniq = function (e) { return e && e.length ? Zr(e) : [] }, On.sortedUniqBy = function (e, t) { return e && e.length ? Zr(e, Qi(t, 2)) : [] }, On.split = function (e, t, n) { return n && "number" != typeof n && lo(e, t, n) && (t = n = void 0), (n = void 0 === n ? 4294967295 : n >>> 0) ? (e = ls(e)) && ("string" == typeof t || null != t && !Xa(t)) && !(t = Jr(t)) && Bt(e) ? ui(Wt(e), 0, n) : e.split(t, n) : [] }, On.spread = function (e, t) { if ("function" != typeof e) throw new ve(o); return t = null == t ? 0 : sn(is(t), 0), Lr((function (n) { var r = n[t], i = ui(n, 0, t); return r && ht(i, r), ot(e, this, i) })) }, On.tail = function (e) { var t = null == e ? 0 : e.length; return t ? Gr(e, 1, t) : [] }, On.take = function (e, t, n) { return e && e.length ? Gr(e, 0, (t = n || void 0 === t ? 1 : is(t)) < 0 ? 0 : t) : [] }, On.takeRight = function (e, t, n) { var r = null == e ? 0 : e.length; return r ? Gr(e, (t = r - (t = n || void 0 === t ? 1 : is(t))) < 0 ? 0 : t, r) : [] }, On.takeRightWhile = function (e, t) { return e && e.length ? ni(e, Qi(t, 3), !1, !0) : [] }, On.takeWhile = function (e, t) { return e && e.length ? ni(e, Qi(t, 3)) : [] }, On.tap = function (e, t) { return t(e), e }, On.throttle = function (e, t, n) { var r = !0, i = !0; if ("function" != typeof e) throw new ve(o); return Ua(n) && (r = "leading" in n ? !!n.leading : r, i = "trailing" in n ? !!n.trailing : i), wa(e, t, { leading: r, maxWait: t, trailing: i }) }, On.thru = ra, On.toArray = ns, On.toPairs = _s, On.toPairsIn = Os, On.toPath = function (e) { return Ra(e) ? ft(e, Co) : Ja(e) ? [e] : bi($o(ls(e))) }, On.toPlainObject = ss, On.transform = function (e, t, n) { var r = Ra(e), i = r || za(e) || Ka(e); if (t = Qi(t, 4), null == n) { var o = e && e.constructor; n = i ? r ? new o : [] : Ua(e) && Fa(o) ? Tn(qe(e)) : {} } return (i ? st : cr)(e, (function (e, r, i) { return t(n, e, r, i) })), n }, On.unary = function (e) { return va(e, 1) }, On.union = Ho, On.unionBy = Go, On.unionWith = Wo, On.uniq = function (e) { return e && e.length ? Kr(e) : [] }, On.uniqBy = function (e, t) { return e && e.length ? Kr(e, Qi(t, 2)) : [] }, On.uniqWith = function (e, t) { return t = "function" == typeof t ? t : void 0, e && e.length ? Kr(e, void 0, t) : [] }, On.unset = function (e, t) { return null == e || ei(e, t) }, On.unzip = Yo, On.unzipWith = Xo, On.update = function (e, t, n) { return null == e ? e : ti(e, t, si(n)) }, On.updateWith = function (e, t, n, r) { return r = "function" == typeof r ? r : void 0, null == e ? e : ti(e, t, si(n), r) }, On.values = Ts, On.valuesIn = function (e) { return null == e ? [] : Pt(e, ks(e)) }, On.without = Zo, On.words = Fs, On.wrap = function (e, t) { return Ca(si(t), e) }, On.xor = Qo, On.xorBy = Jo, On.xorWith = Ko, On.zip = ea, On.zipObject = function (e, t) { return oi(e || [], t || [], Un) }, On.zipObjectDeep = function (e, t) { return oi(e || [], t || [], qr) }, On.zipWith = ta, On.entries = _s, On.entriesIn = Os, On.extend = us, On.extendWith = ds, Qs(On, On), On.add = sl, On.attempt = qs, On.camelCase = js, On.capitalize = Ps, On.ceil = ll, On.clamp = function (e, t, n) { return void 0 === n && (n = t, t = void 0), void 0 !== n && (n = (n = as(n)) == n ? n : 0), void 0 !== t && (t = (t = as(t)) == t ? t : 0), Zn(as(e), t, n) }, On.clone = function (e) { return Qn(e, 4) }, On.cloneDeep = function (e) { return Qn(e, 5) }, On.cloneDeepWith = function (e, t) { return Qn(e, 5, t = "function" == typeof t ? t : void 0) }, On.cloneWith = function (e, t) { return Qn(e, 4, t = "function" == typeof t ? t : void 0) }, On.conformsTo = function (e, t) { return null == t || Jn(e, t, ws(t)) }, On.deburr = Ds, On.defaultTo = function (e, t) { return null == e || e != e ? t : e }, On.divide = cl, On.endsWith = function (e, t, n) { e = ls(e), t = Jr(t); var r = e.length, i = n = void 0 === n ? r : Zn(is(n), 0, r); return (n -= t.length) >= 0 && e.slice(n, i) == t }, On.eq = Ta, On.escape = function (e) { return (e = ls(e)) && L.test(e) ? e.replace(M, zt) : e }, On.escapeRegExp = function (e) { return (e = ls(e)) && W.test(e) ? e.replace(G, "\\$&") : e }, On.every = function (e, t, n) { var r = Ra(e) ? ct : rr; return n && lo(e, t, n) && (t = void 0), r(e, Qi(t, 3)) }, On.find = aa, On.findIndex = Do, On.findKey = function (e, t) { return yt(e, Qi(t, 3), cr) }, On.findLast = sa, On.findLastIndex = Ro, On.findLastKey = function (e, t) { return yt(e, Qi(t, 3), ur) }, On.floor = ul, On.forEach = la, On.forEachRight = ca, On.forIn = function (e, t) { return null == e ? e : sr(e, Qi(t, 3), ks) }, On.forInRight = function (e, t) { return null == e ? e : lr(e, Qi(t, 3), ks) }, On.forOwn = function (e, t) { return e && cr(e, Qi(t, 3)) }, On.forOwnRight = function (e, t) { return e && ur(e, Qi(t, 3)) }, On.get = ms, On.gt = ja, On.gte = Pa, On.has = function (e, t) { return null != e && io(e, t, mr) }, On.hasIn = vs, On.head = No, On.identity = Ws, On.includes = function (e, t, n, r) { e = Na(e) ? e : Ts(e), n = n && !r ? is(n) : 0; var i = e.length; return n < 0 && (n = sn(i + n, 0)), Qa(e) ? n <= i && e.indexOf(t, n) > -1 : !!i && wt(e, t, n) > -1 }, On.indexOf = function (e, t, n) { var r = null == e ? 0 : e.length; if (!r) return -1; var i = null == n ? 0 : is(n); return i < 0 && (i = sn(r + i, 0)), wt(e, t, i) }, On.inRange = function (e, t, n) { return t = rs(t), void 0 === n ? (n = t, t = 0) : n = rs(n), function (e, t, n) { return e >= ln(t, n) && e < sn(t, n) }(e = as(e), t, n) }, On.invoke = xs, On.isArguments = Da, On.isArray = Ra, On.isArrayBuffer = Ia, On.isArrayLike = Na, On.isArrayLikeObject = Ma, On.isBoolean = function (e) { return !0 === e || !1 === e || Ha(e) && hr(e) == u }, On.isBuffer = za, On.isDate = La, On.isElement = function (e) { return Ha(e) && 1 === e.nodeType && !Ya(e) }, On.isEmpty = function (e) { if (null == e) return !0; if (Na(e) && (Ra(e) || "string" == typeof e || "function" == typeof e.splice || za(e) || Ka(e) || Da(e))) return !e.length; var t = ro(e); if (t == g || t == y) return !e.size; if (fo(e)) return !Sr(e).length; for (var n in e) if (Ae.call(e, n)) return !1; return !0 }, On.isEqual = function (e, t) { return wr(e, t) }, On.isEqualWith = function (e, t, n) { var r = (n = "function" == typeof n ? n : void 0) ? n(e, t) : void 0; return void 0 === r ? wr(e, t, void 0, n) : !!r }, On.isError = Ba, On.isFinite = function (e) { return "number" == typeof e && rn(e) }, On.isFunction = Fa, On.isInteger = qa, On.isLength = Va, On.isMap = Ga, On.isMatch = function (e, t) { return e === t || kr(e, t, Ki(t)) }, On.isMatchWith = function (e, t, n) { return n = "function" == typeof n ? n : void 0, kr(e, t, Ki(t), n) }, On.isNaN = function (e) { return Wa(e) && e != +e }, On.isNative = function (e) { if (po(e)) throw new X("Unsupported core-js use. Try https://npms.io/search?q=ponyfill."); return Ar(e) }, On.isNil = function (e) { return null == e }, On.isNull = function (e) { return null === e }, On.isNumber = Wa, On.isObject = Ua, On.isObjectLike = Ha, On.isPlainObject = Ya, On.isRegExp = Xa, On.isSafeInteger = function (e) { return qa(e) && e >= -9007199254740991 && e <= 9007199254740991 }, On.isSet = Za, On.isString = Qa, On.isSymbol = Ja, On.isTypedArray = Ka, On.isUndefined = function (e) { return void 0 === e }, On.isWeakMap = function (e) { return Ha(e) && ro(e) == k }, On.isWeakSet = function (e) { return Ha(e) && "[object WeakSet]" == hr(e) }, On.join = function (e, t) { return null == e ? "" : on.call(e, t) }, On.kebabCase = Rs, On.last = Bo, On.lastIndexOf = function (e, t, n) { var r = null == e ? 0 : e.length; if (!r) return -1; var i = r; return void 0 !== n && (i = (i = is(n)) < 0 ? sn(r + i, 0) : ln(i, r - 1)), t == t ? function (e, t, n) { for (var r = n + 1; r--;)if (e[r] === t) return r; return r }(e, t, i) : xt(e, At, i, !0) }, On.lowerCase = Is, On.lowerFirst = Ns, On.lt = es, On.lte = ts, On.max = function (e) { return e && e.length ? ir(e, Ws, gr) : void 0 }, On.maxBy = function (e, t) { return e && e.length ? ir(e, Qi(t, 2), gr) : void 0 }, On.mean = function (e) { return Et(e, Ws) }, On.meanBy = function (e, t) { return Et(e, Qi(t, 2)) }, On.min = function (e) { return e && e.length ? ir(e, Ws, Cr) : void 0 }, On.minBy = function (e, t) { return e && e.length ? ir(e, Qi(t, 2), Cr) : void 0 }, On.stubArray = ol, On.stubFalse = al, On.stubObject = function () { return {} }, On.stubString = function () { return "" }, On.stubTrue = function () { return !0 }, On.multiply = pl, On.nth = function (e, t) { return e && e.length ? Pr(e, is(t)) : void 0 }, On.noConflict = function () { return We._ === this && (We._ = _e), this }, On.noop = Js, On.now = ma, On.pad = function (e, t, n) { e = ls(e); var r = (t = is(t)) ? Gt(e) : 0; if (!t || r >= t) return e; var i = (t - r) / 2; return Di(en(i), n) + e + Di(Kt(i), n) }, On.padEnd = function (e, t, n) { e = ls(e); var r = (t = is(t)) ? Gt(e) : 0; return t && r < t ? e + Di(t - r, n) : e }, On.padStart = function (e, t, n) { e = ls(e); var r = (t = is(t)) ? Gt(e) : 0; return t && r < t ? Di(t - r, n) + e : e }, On.parseInt = function (e, t, n) { return n || null == t ? t = 0 : t && (t = +t), un(ls(e).replace(Y, ""), t || 0) }, On.random = function (e, t, n) { if (n && "boolean" != typeof n && lo(e, t, n) && (t = n = void 0), void 0 === n && ("boolean" == typeof t ? (n = t, t = void 0) : "boolean" == typeof e && (n = e, e = void 0)), void 0 === e && void 0 === t ? (e = 0, t = 1) : (e = rs(e), void 0 === t ? (t = e, e = 0) : t = rs(t)), e > t) { var r = e; e = t, t = r } if (n || e % 1 || t % 1) { var i = dn(); return ln(e + i * (t - e + Ve("1e-" + ((i + "").length - 1))), t) } return Mr(e, t) }, On.reduce = function (e, t, n) { var r = Ra(e) ? gt : Ct, i = arguments.length < 3; return r(e, Qi(t, 4), n, i, tr) }, On.reduceRight = function (e, t, n) { var r = Ra(e) ? mt : Ct, i = arguments.length < 3; return r(e, Qi(t, 4), n, i, nr) }, On.repeat = function (e, t, n) { return t = (n ? lo(e, t, n) : void 0 === t) ? 1 : is(t), zr(ls(e), t) }, On.replace = function () { var e = arguments, t = ls(e[0]); return e.length < 3 ? t : t.replace(e[1], e[2]) }, On.result = function (e, t, n) { var r = -1, i = (t = li(t, e)).length; for (i || (i = 1, e = void 0); ++r < i;) { var o = null == e ? void 0 : e[Co(t[r])]; void 0 === o && (r = i, o = n), e = Fa(o) ? o.call(e) : o } return e }, On.round = fl, On.runInContext = e, On.sample = function (e) { return (Ra(e) ? Bn : Br)(e) }, On.size = function (e) { if (null == e) return 0; if (Na(e)) return Qa(e) ? Gt(e) : e.length; var t = ro(e); return t == g || t == y ? e.size : Sr(e).length }, On.snakeCase = Ms, On.some = function (e, t, n) { var r = Ra(e) ? vt : Wr; return n && lo(e, t, n) && (t = void 0), r(e, Qi(t, 3)) }, On.sortedIndex = function (e, t) { return Yr(e, t) }, On.sortedIndexBy = function (e, t, n) { return Xr(e, t, Qi(n, 2)) }, On.sortedIndexOf = function (e, t) { var n = null == e ? 0 : e.length; if (n) { var r = Yr(e, t); if (r < n && Ta(e[r], t)) return r } return -1 }, On.sortedLastIndex = function (e, t) { return Yr(e, t, !0) }, On.sortedLastIndexBy = function (e, t, n) { return Xr(e, t, Qi(n, 2), !0) }, On.sortedLastIndexOf = function (e, t) { if (null == e ? 0 : e.length) { var n = Yr(e, t, !0) - 1; if (Ta(e[n], t)) return n } return -1 }, On.startCase = zs, On.startsWith = function (e, t, n) { return e = ls(e), n = null == n ? 0 : Zn(is(n), 0, e.length), t = Jr(t), e.slice(n, n + t.length) == t }, On.subtract = hl, On.sum = function (e) { return e && e.length ? _t(e, Ws) : 0 }, On.sumBy = function (e, t) { return e && e.length ? _t(e, Qi(t, 2)) : 0 }, On.template = function (e, t, n) { var r = On.templateSettings; n && lo(e, t, n) && (t = void 0), e = ls(e), t = ds({}, t, r, Fi); var i, o, a = ds({}, t.imports, r.imports, Fi), s = ws(a), l = Pt(a, s), c = 0, u = t.interpolate || ue, d = "__p += '", p = ge((t.escape || ue).source + "|" + u.source + "|" + (u === q ? ne : ue).source + "|" + (t.evaluate || ue).source + "|$", "g"), f = "//# sourceURL=" + (Ae.call(t, "sourceURL") ? (t.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++Le + "]") + "\n"; e.replace(p, (function (t, n, r, a, s, l) { return r || (r = a), d += e.slice(c, l).replace(de, Lt), n && (i = !0, d += "' +\n__e(" + n + ") +\n'"), s && (o = !0, d += "';\n" + s + ";\n__p += '"), r && (d += "' +\n((__t = (" + r + ")) == null ? '' : __t) +\n'"), c = l + t.length, t })), d += "';\n"; var h = Ae.call(t, "variable") && t.variable; if (h) { if (ee.test(h)) throw new X("Invalid `variable` option passed into `_.template`") } else d = "with (obj) {\n" + d + "\n}\n"; d = (o ? d.replace(D, "") : d).replace(R, "$1").replace(I, "$1;"), d = "function(" + (h || "obj") + ") {\n" + (h ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (i ? ", __e = _.escape" : "") + (o ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + d + "return __p\n}"; var g = qs((function () { return pe(s, f + "return " + d).apply(void 0, l) })); if (g.source = d, Ba(g)) throw g; return g }, On.times = function (e, t) { if ((e = is(e)) < 1 || e > 9007199254740991) return []; var n = 4294967295, r = ln(e, 4294967295); e -= 4294967295; for (var i = Ot(r, t = Qi(t)); ++n < e;)t(n); return i }, On.toFinite = rs, On.toInteger = is, On.toLength = os, On.toLower = function (e) { return ls(e).toLowerCase() }, On.toNumber = as, On.toSafeInteger = function (e) { return e ? Zn(is(e), -9007199254740991, 9007199254740991) : 0 === e ? e : 0 }, On.toString = ls, On.toUpper = function (e) { return ls(e).toUpperCase() }, On.trim = function (e, t, n) { if ((e = ls(e)) && (n || void 0 === t)) return Tt(e); if (!e || !(t = Jr(t))) return e; var r = Wt(e), i = Wt(t); return ui(r, Rt(r, i), It(r, i) + 1).join("") }, On.trimEnd = function (e, t, n) { if ((e = ls(e)) && (n || void 0 === t)) return e.slice(0, Yt(e) + 1); if (!e || !(t = Jr(t))) return e; var r = Wt(e); return ui(r, 0, It(r, Wt(t)) + 1).join("") }, On.trimStart = function (e, t, n) { if ((e = ls(e)) && (n || void 0 === t)) return e.replace(Y, ""); if (!e || !(t = Jr(t))) return e; var r = Wt(e); return ui(r, Rt(r, Wt(t))).join("") }, On.truncate = function (e, t) { var n = 30, r = "..."; if (Ua(t)) { var i = "separator" in t ? t.separator : i; n = "length" in t ? is(t.length) : n, r = "omission" in t ? Jr(t.omission) : r } var o = (e = ls(e)).length; if (Bt(e)) { var a = Wt(e); o = a.length } if (n >= o) return e; var s = n - Gt(r); if (s < 1) return r; var l = a ? ui(a, 0, s).join("") : e.slice(0, s); if (void 0 === i) return l + r; if (a && (s += l.length - s), Xa(i)) { if (e.slice(s).search(i)) { var c, u = l; for (i.global || (i = ge(i.source, ls(re.exec(i)) + "g")), i.lastIndex = 0; c = i.exec(u);)var d = c.index; l = l.slice(0, void 0 === d ? s : d) } } else if (e.indexOf(Jr(i), s) != s) { var p = l.lastIndexOf(i); p > -1 && (l = l.slice(0, p)) } return l + r }, On.unescape = function (e) { return (e = ls(e)) && z.test(e) ? e.replace(N, Xt) : e }, On.uniqueId = function (e) { var t = ++Ee; return ls(e) + t }, On.upperCase = Ls, On.upperFirst = Bs, On.each = la, On.eachRight = ca, On.first = No, Qs(On, (dl = {}, cr(On, (function (e, t) { Ae.call(On.prototype, t) || (dl[t] = e) })), dl), { chain: !1 }), On.VERSION = "4.17.21", st(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], (function (e) { On[e].placeholder = On })), st(["drop", "take"], (function (e, t) { Dn.prototype[e] = function (n) { n = void 0 === n ? 1 : sn(is(n), 0); var r = this.__filtered__ && !t ? new Dn(this) : this.clone(); return r.__filtered__ ? r.__takeCount__ = ln(n, r.__takeCount__) : r.__views__.push({ size: ln(n, 4294967295), type: e + (r.__dir__ < 0 ? "Right" : "") }), r }, Dn.prototype[e + "Right"] = function (t) { return this.reverse()[e](t).reverse() } })), st(["filter", "map", "takeWhile"], (function (e, t) { var n = t + 1, r = 1 == n || 3 == n; Dn.prototype[e] = function (e) { var t = this.clone(); return t.__iteratees__.push({ iteratee: Qi(e, 3), type: n }), t.__filtered__ = t.__filtered__ || r, t } })), st(["head", "last"], (function (e, t) { var n = "take" + (t ? "Right" : ""); Dn.prototype[e] = function () { return this[n](1).value()[0] } })), st(["initial", "tail"], (function (e, t) { var n = "drop" + (t ? "" : "Right"); Dn.prototype[e] = function () { return this.__filtered__ ? new Dn(this) : this[n](1) } })), Dn.prototype.compact = function () { return this.filter(Ws) }, Dn.prototype.find = function (e) { return this.filter(e).head() }, Dn.prototype.findLast = function (e) { return this.reverse().find(e) }, Dn.prototype.invokeMap = Lr((function (e, t) { return "function" == typeof e ? new Dn(this) : this.map((function (n) { return yr(n, e, t) })) })), Dn.prototype.reject = function (e) { return this.filter(Sa(Qi(e))) }, Dn.prototype.slice = function (e, t) { e = is(e); var n = this; return n.__filtered__ && (e > 0 || t < 0) ? new Dn(n) : (e < 0 ? n = n.takeRight(-e) : e && (n = n.drop(e)), void 0 !== t && (n = (t = is(t)) < 0 ? n.dropRight(-t) : n.take(t - e)), n) }, Dn.prototype.takeRightWhile = function (e) { return this.reverse().takeWhile(e).reverse() }, Dn.prototype.toArray = function () { return this.take(4294967295) }, cr(Dn.prototype, (function (e, t) { var n = /^(?:filter|find|map|reject)|While$/.test(t), r = /^(?:head|last)$/.test(t), i = On[r ? "take" + ("last" == t ? "Right" : "") : t], o = r || /^find/.test(t); i && (On.prototype[t] = function () { var t = this.__wrapped__, a = r ? [1] : arguments, s = t instanceof Dn, l = a[0], c = s || Ra(t), u = function (e) { var t = i.apply(On, ht([e], a)); return r && d ? t[0] : t }; c && n && "function" == typeof l && 1 != l.length && (s = c = !1); var d = this.__chain__, p = !!this.__actions__.length, f = o && !d, h = s && !p; if (!o && c) { t = h ? t : new Dn(this); var g = e.apply(t, a); return g.__actions__.push({ func: ra, args: [u], thisArg: void 0 }), new Pn(g, d) } return f && h ? e.apply(this, a) : (g = this.thru(u), f ? r ? g.value()[0] : g.value() : g) }) })), st(["pop", "push", "shift", "sort", "splice", "unshift"], (function (e) { var t = be[e], n = /^(?:push|sort|unshift)$/.test(e) ? "tap" : "thru", r = /^(?:pop|shift)$/.test(e); On.prototype[e] = function () { var e = arguments; if (r && !this.__chain__) { var i = this.value(); return t.apply(Ra(i) ? i : [], e) } return this[n]((function (n) { return t.apply(Ra(n) ? n : [], e) })) } })), cr(Dn.prototype, (function (e, t) { var n = On[t]; if (n) { var r = n.name + ""; Ae.call(xn, r) || (xn[r] = []), xn[r].push({ name: t, func: n }) } })), xn[Oi(void 0, 2).name] = [{ name: "wrapper", func: void 0 }], Dn.prototype.clone = function () { var e = new Dn(this.__wrapped__); return e.__actions__ = bi(this.__actions__), e.__dir__ = this.__dir__, e.__filtered__ = this.__filtered__, e.__iteratees__ = bi(this.__iteratees__), e.__takeCount__ = this.__takeCount__, e.__views__ = bi(this.__views__), e }, Dn.prototype.reverse = function () { if (this.__filtered__) { var e = new Dn(this); e.__dir__ = -1, e.__filtered__ = !0 } else (e = this.clone()).__dir__ *= -1; return e }, Dn.prototype.value = function () { var e = this.__wrapped__.value(), t = this.__dir__, n = Ra(e), r = t < 0, i = n ? e.length : 0, o = function (e, t, n) { var r = -1, i = n.length; for (; ++r < i;) { var o = n[r], a = o.size; switch (o.type) { case "drop": e += a; break; case "dropRight": t -= a; break; case "take": t = ln(t, e + a); break; case "takeRight": e = sn(e, t - a) } } return { start: e, end: t } }(0, i, this.__views__), a = o.start, s = o.end, l = s - a, c = r ? s : a - 1, u = this.__iteratees__, d = u.length, p = 0, f = ln(l, this.__takeCount__); if (!n || !r && i == l && f == l) return ri(e, this.__actions__); var h = []; e: for (; l-- && p < f;) { for (var g = -1, m = e[c += t]; ++g < d;) { var v = u[g], b = v.iteratee, y = v.type, x = b(m); if (2 == y) m = x; else if (!x) { if (1 == y) continue e; break e } } h[p++] = m } return h }, On.prototype.at = ia, On.prototype.chain = function () { return na(this) }, On.prototype.commit = function () { return new Pn(this.value(), this.__chain__) }, On.prototype.next = function () { void 0 === this.__values__ && (this.__values__ = ns(this.value())); var e = this.__index__ >= this.__values__.length; return { done: e, value: e ? void 0 : this.__values__[this.__index__++] } }, On.prototype.plant = function (e) { for (var t, n = this; n instanceof jn;) { var r = Oo(n); r.__index__ = 0, r.__values__ = void 0, t ? i.__wrapped__ = r : t = r; var i = r; n = n.__wrapped__ } return i.__wrapped__ = e, t }, On.prototype.reverse = function () { var e = this.__wrapped__; if (e instanceof Dn) { var t = e; return this.__actions__.length && (t = new Dn(this)), (t = t.reverse()).__actions__.push({ func: ra, args: [Uo], thisArg: void 0 }), new Pn(t, this.__chain__) } return this.thru(Uo) }, On.prototype.toJSON = On.prototype.valueOf = On.prototype.value = function () { return ri(this.__wrapped__, this.__actions__) }, On.prototype.first = On.prototype.head, Qe && (On.prototype[Qe] = function () { return this }), On }(); We._ = Zt, void 0 === (i = function () { return Zt }.call(t, n, t, r)) || (r.exports = i) }).call(this) }).call(this, n(35), n(80)(e)) - }, function (e, t, n) { const r = n(21); function i(e) { return !r.isNull(e) && !r.isUndefined(e) } function o(e, t, n, a) { a || (a = 1); var s = e.predecessors(t); if (!s || 0 == n) return []; var l = s.concat(s.reduce((function (t, r) { return a >= n && i(n) ? t : t.concat(o(e, r, n, a + 1)) }), [])); return r.uniq(l) } function a(e, t, n, o) { o || (o = 1); var s = e.successors(t); if (!s || 0 == n) return []; var l = s.concat(s.reduce((function (t, r) { return o >= n && i(n) ? t : t.concat(a(e, r, n, o + 1)) }), [])); return r.uniq(l) } e.exports = { selectAt: function (e, t) { var n = [t], i = r.union([t], a(e, t)); return r.each(i, (function (t) { var i = o(e, t); n = r.union(n, i, [t]) })), n }, ancestorNodes: o, descendentNodes: a } }, function (e, t) { var n = { utf8: { stringToBytes: function (e) { return n.bin.stringToBytes(unescape(encodeURIComponent(e))) }, bytesToString: function (e) { return decodeURIComponent(escape(n.bin.bytesToString(e))) } }, bin: { stringToBytes: function (e) { for (var t = [], n = 0; n < e.length; n++)t.push(255 & e.charCodeAt(n)); return t }, bytesToString: function (e) { for (var t = [], n = 0; n < e.length; n++)t.push(String.fromCharCode(e[n])); return t.join("") } } }; e.exports = n }, function (e, t) { var n = "/docs/source.html"; window.angular.module("ng").run(["$templateCache", function (e) { e.put(n, '\n\n
\n \n
\n
\n
\n
\n \n
\n\n
\n
\n
\n
Description
\n
\n
\n
\n
This {{ model.resource_type }} is not currently documented
\n
\n
\n
\n
\n
\n
\n
\n
Columns
\n \n
\n
\n\n
\n
\n
\n
Referenced By
\n \n
\n
\n\n
\n
\n
\n \n
\n
\n
\n
\n
\n') }]), e.exports = n }, function (e, t, n) { "use strict"; n.r(t); var r = function (e) { return function (e) { return !!e && "object" == typeof e }(e) && !function (e) { var t = Object.prototype.toString.call(e); return "[object RegExp]" === t || "[object Date]" === t || function (e) { return e.$$typeof === i }(e) }(e) }; var i = "function" == typeof Symbol && Symbol.for ? Symbol.for("react.element") : 60103; function o(e, t) { return !1 !== t.clone && t.isMergeableObject(e) ? s((n = e, Array.isArray(n) ? [] : {}), e, t) : e; var n } function a(e, t, n) { return e.concat(t).map((function (e) { return o(e, n) })) } function s(e, t, n) { (n = n || {}).arrayMerge = n.arrayMerge || a, n.isMergeableObject = n.isMergeableObject || r; var i = Array.isArray(t); return i === Array.isArray(e) ? i ? n.arrayMerge(e, t, n) : function (e, t, n) { var r = {}; return n.isMergeableObject(e) && Object.keys(e).forEach((function (t) { r[t] = o(e[t], n) })), Object.keys(t).forEach((function (i) { n.isMergeableObject(t[i]) && e[i] ? r[i] = s(e[i], t[i], n) : r[i] = o(t[i], n) })), r }(e, t, n) : o(t, n) } s.all = function (e, t) { if (!Array.isArray(e)) throw new Error("first argument should be an array"); return e.reduce((function (e, n) { return s(e, n, t) }), {}) }; var l = s; const c = n(8), u = (n(33), n(202)), { getQuoteChar: d } = n(430); c.module("dbt").factory("project", ["$q", "$http", function (e, t) { var n = { manifest: {"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.11.7", "generated_at": "2026-06-25T21:21:08.903507Z", "invocation_id": "ea2aa608-cebc-4ffd-a44c-a0ce4c2579ed", "invocation_started_at": "2026-06-25T21:19:18.891208+00:00", "env": {}, "project_name": "tamanu_source_dbt", "project_id": "afabe8e537d3a72acd73fa225fed65f4", "user_id": "0cfa0468-841e-40ad-bec7-2b0f9299552d", "send_anonymous_usage_stats": true, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-06-25T21:19:18.891208+00:00"}, "nodes": {"model.tamanu_source_dbt.contributing_death_causes": {"database": "app", "schema": "reporting", "name": "contributing_death_causes", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\contributing_death_causes.sql", "original_file_path": "models\\bases\\contributing_death_causes.sql", "unique_id": "model.tamanu_source_dbt.contributing_death_causes", "fqn": ["tamanu_source_dbt", "bases", "contributing_death_causes"], "alias": "contributing_death_causes", "checksum": {"name": "sha256", "checksum": "11325bae4baf7bc1e117143d6216b6e10d654c77c4363fac83908f3c56dbb200"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Contributing causes recorded with the patient's death data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in contributing_death_causes.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "time_after_onset": {"name": "time_after_onset", "description": "Time between onset of recorded cause and death in minutes.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__time_after_onset"]}, "patient_death_data_id": {"name": "patient_death_data_id", "description": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id"]}, "condition_id": {"name": "condition_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\contributing_death_causes.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.8220615, "relation_name": "\"app\".\"reporting\".\"contributing_death_causes\"", "raw_code": "select\r\n cdc.id,\r\n cdc.time_after_onset,\r\n cdc.patient_death_data_id,\r\n cdc.condition_id\r\nfrom {{ source('tamanu', 'contributing_death_causes') }} cdc\r\njoin {{ source('tamanu', 'patient_death_data') }} pdd on pdd.id = cdc.patient_death_data_id\r\nwhere cdc.deleted_at is null\r\n and pdd.deleted_at is null\r\n and pdd.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__contributing_death_causes"], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\contributing_death_causes.sql", "compiled": true, "compiled_code": "select\n cdc.id,\n cdc.time_after_onset,\n cdc.patient_death_data_id,\n cdc.condition_id\nfrom \"app\".\"public\".\"contributing_death_causes\" cdc\njoin \"app\".\"public\".\"patient_death_data\" pdd on pdd.id = cdc.patient_death_data_id\nwhere cdc.deleted_at is null\n and pdd.deleted_at is null\n and pdd.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.departments": {"database": "app", "schema": "reporting", "name": "departments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\departments.sql", "original_file_path": "models\\bases\\departments.sql", "unique_id": "model.tamanu_source_dbt.departments", "fqn": ["tamanu_source_dbt", "bases", "departments"], "alias": "departments", "checksum": {"name": "sha256", "checksum": "ae8e50577c2f66f3fa2645696b1f638ad9c24bb10d201e0860bad7c1d2a67742"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Basic department info with a reference to parent facility.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in departments.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code for department.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__code"]}, "name": {"name": "name", "description": "Full readable name for department.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__name"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this department is in.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in departments.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\departments.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.8220615, "relation_name": "\"app\".\"reporting\".\"departments\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n facility_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'departments') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__departments"], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\departments.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n facility_id,\n visibility_status\nfrom \"app\".\"public\".\"departments\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.discharges": {"database": "app", "schema": "reporting", "name": "discharges", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\discharges.sql", "original_file_path": "models\\bases\\discharges.sql", "unique_id": "model.tamanu_source_dbt.discharges", "fqn": ["tamanu_source_dbt", "bases", "discharges"], "alias": "discharges", "checksum": {"name": "sha256", "checksum": "1a9d9bd0295380f6b5f8db6f64af64d34ea064c872a40d521547d40b068c06f2"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Information about a discharge.\r\n\r\nA discharge is the end of the lifecycle for an encounter.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in discharges.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "note": {"name": "note", "description": "Free-form notes about the discharge.\r\n\r\nMay include treatment plan and follow-ups, written by the discharging clinician.\r\n\r\nSince v2.0, also see the [`notes`](#!/source/source.tamanu.tamanu.notes) table for encounter and discharge notes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__note"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this discharge is for.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__encounter_id"]}, "discharged_by_id": {"name": "discharged_by_id", "description": "The [discharging clinician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__discharger_id"]}, "disposition_id": {"name": "disposition_id", "description": "The discharge disposition or classification of the discharge ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__disposition_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\discharges.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.8380315, "relation_name": "\"app\".\"reporting\".\"discharges\"", "raw_code": "select distinct on (d.encounter_id)\r\n d.id,\r\n d.note,\r\n d.encounter_id,\r\n d.discharger_id as discharged_by_id,\r\n d.disposition_id\r\nfrom {{ source('tamanu', 'discharges') }} d\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = d.encounter_id\r\nwhere d.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'\r\norder by d.encounter_id asc, d.created_at asc", "doc_blocks": ["doc.tamanu_source_dbt.table__discharges"], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\discharges.sql", "compiled": true, "compiled_code": "select distinct on (d.encounter_id)\n d.id,\n d.note,\n d.encounter_id,\n d.discharger_id as discharged_by_id,\n d.disposition_id\nfrom \"app\".\"public\".\"discharges\" d\njoin \"app\".\"public\".\"encounters\" e on e.id = d.encounter_id\nwhere d.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\norder by d.encounter_id asc, d.created_at asc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.document_metadata": {"database": "app", "schema": "reporting", "name": "document_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\document_metadata.sql", "original_file_path": "models\\bases\\document_metadata.sql", "unique_id": "model.tamanu_source_dbt.document_metadata", "fqn": ["tamanu_source_dbt", "bases", "document_metadata"], "alias": "document_metadata", "checksum": {"name": "sha256", "checksum": "1ea352c3939360a25e45c8f69d35b72537215d6f1b826ad94e6d6ddc95bdb622"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Information about an uploaded document or file, typically attached to an encounter or directly to a patient.\r\n\r\nThe actual file data is stored in [`attachments`](#!/source/source.tamanu.tamanu.attachments).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in document_metadata.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Free-form name of the document.\r\n\r\nOften this is the filename.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__name"]}, "type": {"name": "type", "description": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__type"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in document_metadata.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) the document was uploaded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__patient_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) the document was uploaded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__encounter_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\document_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.8380315, "relation_name": "\"app\".\"reporting\".\"document_metadata\"", "raw_code": "select\r\n id,\r\n name,\r\n type,\r\n created_at::timestamp as created_datetime,\r\n patient_id,\r\n encounter_id\r\nfrom {{ source('tamanu', 'document_metadata') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__document_metadata"], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\document_metadata.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n type,\n created_at::timestamp as created_datetime,\n patient_id,\n encounter_id\nfrom \"app\".\"public\".\"document_metadata\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounters": {"database": "app", "schema": "reporting", "name": "encounters", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounters.sql", "original_file_path": "models\\bases\\encounters.sql", "unique_id": "model.tamanu_source_dbt.encounters", "fqn": ["tamanu_source_dbt", "bases", "encounters"], "alias": "encounters", "checksum": {"name": "sha256", "checksum": "0d4589a4b35a42a013bb90ec2fc327d031e7db11e3e7efc795f9e11455981ebe"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Tracks the basic information of the patient encounters within Tamanu from start to finish", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounters.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_datetime": {"name": "start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "end_datetime": {"name": "end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "reason_for_encounter": {"name": "reason_for_encounter", "description": "Free-form information about the encounter.\r\n\r\nCan include info like type of survey submitted, emergency diagnosis, etc.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__reason_for_encounter"]}, "device_id": {"name": "device_id", "description": "Unique identifier for the device that created the encounter.\r\n\r\nDevice IDs are proper to each device and not globally recorded in e.g. a `devices` table.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__device_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__department_id"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "The billing type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_billing_type_id"]}, "referral_source_id": {"name": "referral_source_id", "description": "The referral source ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__referral_source_id"]}, "planned_location_id": {"name": "planned_location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) that the encounter will transfer to at the\r\n`planned_location_start_time`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__planned_location_id"]}, "planned_location_start_datetime": {"name": "planned_location_start_datetime", "description": "The time that the encounter will transfer to the planned location.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__planned_location_start_time"]}, "discharge_draft": {"name": "discharge_draft", "description": "Draft data of the encounter", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__discharge_draft"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounters.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.8380315, "relation_name": "\"app\".\"reporting\".\"encounters\"", "raw_code": "select\r\n id,\r\n start_date::timestamp as start_datetime,\r\n case\r\n when end_date < start_date then start_date::timestamp\r\n else end_date::timestamp\r\n end as end_datetime,\r\n encounter_type,\r\n reason_for_encounter,\r\n device_id,\r\n patient_id,\r\n department_id,\r\n location_id,\r\n examiner_id as clinician_id,\r\n patient_billing_type_id,\r\n referral_source_id,\r\n planned_location_id,\r\n planned_location_start_time::timestamp as planned_location_start_datetime,\r\n discharge_draft\r\nfrom {{ source('tamanu', 'encounters') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounters"], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounters.sql", "compiled": true, "compiled_code": "select\n id,\n start_date::timestamp as start_datetime,\n case\n when end_date < start_date then start_date::timestamp\n else end_date::timestamp\n end as end_datetime,\n encounter_type,\n reason_for_encounter,\n device_id,\n patient_id,\n department_id,\n location_id,\n examiner_id as clinician_id,\n patient_billing_type_id,\n referral_source_id,\n planned_location_id,\n planned_location_start_time::timestamp as planned_location_start_datetime,\n discharge_draft\nfrom \"app\".\"public\".\"encounters\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounters_metadata": {"database": "app", "schema": "reporting", "name": "encounters_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounters_metadata.sql", "original_file_path": "models\\bases\\encounters_metadata.sql", "unique_id": "model.tamanu_source_dbt.encounters_metadata", "fqn": ["tamanu_source_dbt", "bases", "encounters_metadata"], "alias": "encounters_metadata", "checksum": {"name": "sha256", "checksum": "4f9c9d9eca76532a34e498da28520658b87994e9c517530f53bb2dabee8df666"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for encounters.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounters.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the encounters table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the encounters table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounters_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.8380315, "relation_name": "\"app\".\"reporting\".\"encounters_metadata\"", "raw_code": "{{ get_metadata_from_changes('encounters') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounters_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'encounters'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_diagnoses": {"database": "app", "schema": "reporting", "name": "encounter_diagnoses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_diagnoses.sql", "original_file_path": "models\\bases\\encounter_diagnoses.sql", "unique_id": "model.tamanu_source_dbt.encounter_diagnoses", "fqn": ["tamanu_source_dbt", "bases", "encounter_diagnoses"], "alias": "encounter_diagnoses", "checksum": {"name": "sha256", "checksum": "51f0a5563d98f14a5b0cb5a9f120ee41fb9223312a8255fad207cb75b18d4b22"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Records diagnoses made during an encounter", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diagnoses.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in encounter_diagnoses.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "is_primary": {"name": "is_primary", "description": "A boolean indicating if this is a primary diagnosis", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__is_primary"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__encounter_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id"]}, "certainty": {"name": "certainty", "description": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__certainty"]}, "diagnosed_by_id": {"name": "diagnosed_by_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that diagnosis.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__clinician_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_diagnoses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.8380315, "relation_name": "\"app\".\"reporting\".\"encounter_diagnoses\"", "raw_code": "select\r\n ed.id,\r\n ed.date::timestamp as datetime,\r\n ed.is_primary,\r\n ed.certainty,\r\n ed.encounter_id,\r\n ed.diagnosis_id,\r\n ed.clinician_id as diagnosed_by_id\r\nfrom {{ source('tamanu', 'encounter_diagnoses') }} ed\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ed.encounter_id\r\nwhere ed.deleted_at is null\r\n and ed.certainty not in ('disproven', 'error')\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_diagnoses"], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_diagnoses.sql", "compiled": true, "compiled_code": "select\n ed.id,\n ed.date::timestamp as datetime,\n ed.is_primary,\n ed.certainty,\n ed.encounter_id,\n ed.diagnosis_id,\n ed.clinician_id as diagnosed_by_id\nfrom \"app\".\"public\".\"encounter_diagnoses\" ed\njoin \"app\".\"public\".\"encounters\" e on e.id = ed.encounter_id\nwhere ed.deleted_at is null\n and ed.certainty not in ('disproven', 'error')\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_diagnoses_metadata": {"database": "app", "schema": "reporting", "name": "encounter_diagnoses_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_diagnoses_metadata.sql", "original_file_path": "models\\bases\\encounter_diagnoses_metadata.sql", "unique_id": "model.tamanu_source_dbt.encounter_diagnoses_metadata", "fqn": ["tamanu_source_dbt", "bases", "encounter_diagnoses_metadata"], "alias": "encounter_diagnoses_metadata", "checksum": {"name": "sha256", "checksum": "211e1c8dfa21e1e7b43d3dc49b935775d785d127efa43de2719e56e7d3d236fc"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for encounter_diagnoses.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diagnoses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the encounter_diagnoses table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the encounter_diagnoses table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_diagnoses_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.9139147, "relation_name": "\"app\".\"reporting\".\"encounter_diagnoses_metadata\"", "raw_code": "{{ get_metadata_from_changes('encounter_diagnoses') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_diagnoses_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'encounter_diagnoses'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_diets": {"database": "app", "schema": "reporting", "name": "encounter_diets", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_diets.sql", "original_file_path": "models\\bases\\encounter_diets.sql", "unique_id": "model.tamanu_source_dbt.encounter_diets", "fqn": ["tamanu_source_dbt", "bases", "encounter_diets"], "alias": "encounter_diets", "checksum": {"name": "sha256", "checksum": "63ef437f501dd6ae8046bfc50300e6abbbec1555ba3dbd3bdddb33575c296544"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "A diet associated with an encounter.\r\n\r\nA patient can be placed on a diet for various medical purposes.\r\nDiets are specified in reference data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diets.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diet is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diets__encounter_id"]}, "diet_id": {"name": "diet_id", "description": "The diet ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diet`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diets__diet_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_diets.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782422374.9159217, "relation_name": "\"app\".\"reporting\".\"encounter_diets\"", "raw_code": "select\r\n ed.id,\r\n ed.encounter_id,\r\n ed.diet_id\r\nfrom {{ source('tamanu', 'encounter_diets') }} ed\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ed.encounter_id\r\nwhere ed.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_diets"], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_diets.sql", "compiled": true, "compiled_code": "select\n ed.id,\n ed.encounter_id,\n ed.diet_id\nfrom \"app\".\"public\".\"encounter_diets\" ed\njoin \"app\".\"public\".\"encounters\" e on e.id = ed.encounter_id\nwhere ed.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_history": {"database": "app", "schema": "reporting", "name": "encounter_history", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_history.sql", "original_file_path": "models\\bases\\encounter_history.sql", "unique_id": "model.tamanu_source_dbt.encounter_history", "fqn": ["tamanu_source_dbt", "bases", "encounter_history"], "alias": "encounter_history", "checksum": {"name": "sha256", "checksum": "36ee248d22dccdb96122cde573cea6d4a709ed563ae0195e9eac41c080a9c774"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Records changes to an encounter's basic details.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_history.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "date": {"name": "date", "description": "Local date for the record in encounter_history.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the original [encounter](#!/source/source.tamanu.tamanu.encounters) this history is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__encounter_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the encounter was in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__department_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the encounter was in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__location_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users) for the encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__examiner_id"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__encounter_type"]}, "updated_by_id": {"name": "updated_by_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) made the change.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__actor_id"]}, "change_type": {"name": "change_type", "description": "The field which was changed.\r\n\r\nOne of:\r\n- `encounter_type`\r\n- `location`\r\n- `department`\r\n- `examiner`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__change_type"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_history.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.9174285, "relation_name": "\"app\".\"reporting\".\"encounter_history\"", "raw_code": "select\r\n eh.id,\r\n eh.date::timestamp as datetime,\r\n eh.encounter_id,\r\n eh.department_id,\r\n eh.location_id,\r\n eh.encounter_type,\r\n eh.examiner_id as clinician_id,\r\n eh.actor_id as updated_by_id,\r\n eh.change_type::text[]\r\nfrom {{ source('tamanu', 'encounter_history') }} eh\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = eh.encounter_id\r\nwhere eh.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_history"], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_history.sql", "compiled": true, "compiled_code": "select\n eh.id,\n eh.date::timestamp as datetime,\n eh.encounter_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n eh.examiner_id as clinician_id,\n eh.actor_id as updated_by_id,\n eh.change_type::text[]\nfrom \"app\".\"public\".\"encounter_history\" eh\njoin \"app\".\"public\".\"encounters\" e on e.id = eh.encounter_id\nwhere eh.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_prescriptions": {"database": "app", "schema": "reporting", "name": "encounter_prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_prescriptions.sql", "original_file_path": "models\\bases\\encounter_prescriptions.sql", "unique_id": "model.tamanu_source_dbt.encounter_prescriptions", "fqn": ["tamanu_source_dbt", "bases", "encounter_prescriptions"], "alias": "encounter_prescriptions", "checksum": {"name": "sha256", "checksum": "17f18c83b92fbb8fb44e8a4ab29fd2d64a4eb9817fde51639fa7695729eb7d4b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Association of encounter to prescription", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__encounter_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__prescription_id"]}, "is_selected_for_discharge": {"name": "is_selected_for_discharge", "description": "Whether the prescription is for when the patient is discharged.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422374.9194355, "relation_name": "\"app\".\"reporting\".\"encounter_prescriptions\"", "raw_code": "select\r\n ep.id,\r\n ep.encounter_id,\r\n ep.prescription_id,\r\n ep.is_selected_for_discharge\r\nfrom {{ source('tamanu', 'encounter_prescriptions') }} ep\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ep.encounter_id\r\nwhere ep.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_prescriptions"], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_prescriptions.sql", "compiled": true, "compiled_code": "select\n ep.id,\n ep.encounter_id,\n ep.prescription_id,\n ep.is_selected_for_discharge\nfrom \"app\".\"public\".\"encounter_prescriptions\" ep\njoin \"app\".\"public\".\"encounters\" e on e.id = ep.encounter_id\nwhere ep.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.facilities": {"database": "app", "schema": "reporting", "name": "facilities", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\facilities.sql", "original_file_path": "models\\bases\\facilities.sql", "unique_id": "model.tamanu_source_dbt.facilities", "fqn": ["tamanu_source_dbt", "bases", "facilities"], "alias": "facilities", "checksum": {"name": "sha256", "checksum": "91ccec8ab878468aae2857bd87623c82d5173f7b3579d3307c0d3a19d3676608"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table of facilities.\r\n\r\nFacilities may be either or both of:\r\n\r\n- Any healthcare facility, like hospitals, clinics, mobile vaccination vans, laboratories, etc\r\n- A Tamanu Facility deployment.\r\n\r\nWhen syncing, patient and related records are scoped to a facility, according to the\r\n[`patient_facilities`](#!/source/source.tamanu.tamanu.patient_facilities) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in facilities.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code (identifier) for the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__code"]}, "name": {"name": "name", "description": "Full readable name.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}, "division": {"name": "division", "description": "Administrative division this facility lives in.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__division"]}, "type": {"name": "type", "description": "Type of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__type"]}, "email": {"name": "email", "description": "Administrative email address of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__email"]}, "contact_number": {"name": "contact_number", "description": "Administrative contact number of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__contact_number"]}, "city_town": {"name": "city_town", "description": "City or town of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__city_town"]}, "street_address": {"name": "street_address", "description": "Street address of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__street_address"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in facilities.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "catchment_id": {"name": "catchment_id", "description": "Catchment area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__catchment_id"]}, "is_sensitive": {"name": "is_sensitive", "description": "If set to `true`, encounters created on this facility will only be viewable when logged into this facility", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__is_sensitive"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\facilities.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.9214427, "relation_name": "\"app\".\"reporting\".\"facilities\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n division,\r\n type,\r\n email,\r\n contact_number,\r\n city_town,\r\n street_address,\r\n catchment_id,\r\n visibility_status,\r\n is_sensitive\r\nfrom {{ source('tamanu', 'facilities') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__facilities"], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\facilities.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n division,\n type,\n email,\n contact_number,\n city_town,\n street_address,\n catchment_id,\n visibility_status,\n is_sensitive\nfrom \"app\".\"public\".\"facilities\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging_area_external_codes": {"database": "app", "schema": "reporting", "name": "imaging_area_external_codes", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\imaging_area_external_codes.sql", "original_file_path": "models\\bases\\imaging_area_external_codes.sql", "unique_id": "model.tamanu_source_dbt.imaging_area_external_codes", "fqn": ["tamanu_source_dbt", "bases", "imaging_area_external_codes"], "alias": "imaging_area_external_codes", "checksum": {"name": "sha256", "checksum": "a460bc0a0959ae44a5adfcad856aea5e5894190609c185926970aa977ce53c6e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "External codes for imaging areas (such as for [PACS](https://en.wikipedia.org/wiki/Picture_archiving_and_communication_system)).\r\n\r\nImaging areas are stored in [Reference Data](#!/source/source.tamanu.tamanu.reference_data), this\r\ntable adds additional (external) codes.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_area_external_codes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "area_id": {"name": "area_id", "description": "Reference to the imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__area_id"]}, "code": {"name": "code", "description": "External code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__code"]}, "description": {"name": "description", "description": "Human-friendly description for the area/code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__description"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_area_external_codes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\imaging_area_external_codes.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.9214427, "relation_name": "\"app\".\"reporting\".\"imaging_area_external_codes\"", "raw_code": "select\r\n id,\r\n area_id,\r\n code,\r\n description,\r\n visibility_status\r\nfrom {{ source('tamanu', 'imaging_area_external_codes') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_area_external_codes"], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\imaging_area_external_codes.sql", "compiled": true, "compiled_code": "select\n id,\n area_id,\n code,\n description,\n visibility_status\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging_requests": {"database": "app", "schema": "reporting", "name": "imaging_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\imaging_requests.sql", "original_file_path": "models\\bases\\imaging_requests.sql", "unique_id": "model.tamanu_source_dbt.imaging_requests", "fqn": ["tamanu_source_dbt", "bases", "imaging_requests"], "alias": "imaging_requests", "checksum": {"name": "sha256", "checksum": "1baf61cd5cc899aad620f5cb7cc3f52ee33b8203572ec1f82143df2a3b0c796a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Imaging requests are the entrypoint of imaging workflows in Tamanu.\r\n\r\nEach row is a request for radiology to perform one or more imagings on a patient.\r\n\r\nImagings can have one or more [request areas](#!/source/source.tamanu.tamanu.imaging_request_areas)\r\nattached, and when completed will have [results](#!/source/source.tamanu.tamanu.imaging_results).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_requests.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__display_id"]}, "datetime": {"name": "datetime", "description": "When the imaging was requested.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "priority": {"name": "priority", "description": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__priority"]}, "imaging_type": {"name": "imaging_type", "description": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__imaging_type"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this imaging request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__encounter_id"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "completed_by_id": {"name": "completed_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__completed_by_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) for this imaging request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__location_id"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [location group](#!/source/source.tamanu.tamanu.location_groups) for this imaging request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__location_group_id"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113).", "meta": {}, "data_type": "character varying(1024)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\imaging_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.9214427, "relation_name": "\"app\".\"reporting\".\"imaging_requests\"", "raw_code": "select\r\n ir.id,\r\n ir.display_id,\r\n ir.requested_date::timestamp as datetime,\r\n ir.status,\r\n ir.priority,\r\n ir.imaging_type,\r\n ir.encounter_id,\r\n ir.requested_by_id,\r\n ir.completed_by_id,\r\n ir.location_id,\r\n ir.location_group_id,\r\n ir.reason_for_cancellation\r\nfrom {{ source('tamanu', 'imaging_requests') }} ir\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ir.encounter_id\r\nwhere ir.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_requests"], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\imaging_requests.sql", "compiled": true, "compiled_code": "select\n ir.id,\n ir.display_id,\n ir.requested_date::timestamp as datetime,\n ir.status,\n ir.priority,\n ir.imaging_type,\n ir.encounter_id,\n ir.requested_by_id,\n ir.completed_by_id,\n ir.location_id,\n ir.location_group_id,\n ir.reason_for_cancellation\nfrom \"app\".\"public\".\"imaging_requests\" ir\njoin \"app\".\"public\".\"encounters\" e on e.id = ir.encounter_id\nwhere ir.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging_request_areas": {"database": "app", "schema": "reporting", "name": "imaging_request_areas", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\imaging_request_areas.sql", "original_file_path": "models\\bases\\imaging_request_areas.sql", "unique_id": "model.tamanu_source_dbt.imaging_request_areas", "fqn": ["tamanu_source_dbt", "bases", "imaging_request_areas"], "alias": "imaging_request_areas", "checksum": {"name": "sha256", "checksum": "2c5556ab7a27755c39c8a5559fe8b3b6d221234b3c080cb194351ee18cff5ef3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Areas to be imaged as part of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_request_areas.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "imaging_request_id": {"name": "imaging_request_id", "description": "The [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_request_areas__imaging_request_id"]}, "area_id": {"name": "area_id", "description": "The imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_request_areas__area_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\imaging_request_areas.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.9214427, "relation_name": "\"app\".\"reporting\".\"imaging_request_areas\"", "raw_code": "select\r\n ira.id,\r\n ira.imaging_request_id,\r\n ira.area_id\r\nfrom {{ source('tamanu', 'imaging_request_areas') }} ira\r\njoin {{ source('tamanu', 'imaging_requests') }} ir on ir.id = ira.imaging_request_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ir.encounter_id\r\nwhere ira.deleted_at is null\r\n and ir.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_request_areas"], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"], ["tamanu", "imaging_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas", "source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\imaging_request_areas.sql", "compiled": true, "compiled_code": "select\n ira.id,\n ira.imaging_request_id,\n ira.area_id\nfrom \"app\".\"public\".\"imaging_request_areas\" ira\njoin \"app\".\"public\".\"imaging_requests\" ir on ir.id = ira.imaging_request_id\njoin \"app\".\"public\".\"encounters\" e on e.id = ir.encounter_id\nwhere ira.deleted_at is null\n and ir.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging_results": {"database": "app", "schema": "reporting", "name": "imaging_results", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\imaging_results.sql", "original_file_path": "models\\bases\\imaging_results.sql", "unique_id": "model.tamanu_source_dbt.imaging_results", "fqn": ["tamanu_source_dbt", "bases", "imaging_results"], "alias": "imaging_results", "checksum": {"name": "sha256", "checksum": "6e8c44894b7b7032763b6f466ad97cd9b0d2fc4c757a5a89f4ec9b80f77af31c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Result of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).\r\n\r\nIn practice, there is usually one or two results per request:\r\n- one containing a reference to a PACS image, when imaging integrations are enabled;\r\n- one containing notes from a doctor who analysed the image.\r\n\r\nHowever there is no limit; for example there may be multiple notes from multiple doctors.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_results.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "When this result was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_at"]}, "description": {"name": "description", "description": "Free-form description / notes about this imaging.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__description"]}, "imaging_request_id": {"name": "imaging_request_id", "description": "Reference to the [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__imaging_request_id"]}, "external_code": {"name": "external_code", "description": "External code for this result, used with PACS integration (generally via FHIR).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__external_code"]}, "completed_by_id": {"name": "completed_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_by_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_results.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\imaging_results.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.9343357, "relation_name": "\"app\".\"reporting\".\"imaging_results\"", "raw_code": "select\r\n ires.id,\r\n ires.completed_at::timestamp as datetime,\r\n ires.description,\r\n ires.imaging_request_id,\r\n ires.external_code,\r\n ires.completed_by_id,\r\n ires.visibility_status\r\nfrom {{ source('tamanu', 'imaging_results') }} ires\r\njoin {{ source('tamanu', 'imaging_requests') }} ireq on ireq.id = ires.imaging_request_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ireq.encounter_id\r\nwhere ires.deleted_at is null\r\n and ireq.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_results"], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"], ["tamanu", "imaging_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results", "source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\imaging_results.sql", "compiled": true, "compiled_code": "select\n ires.id,\n ires.completed_at::timestamp as datetime,\n ires.description,\n ires.imaging_request_id,\n ires.external_code,\n ires.completed_by_id,\n ires.visibility_status\nfrom \"app\".\"public\".\"imaging_results\" ires\njoin \"app\".\"public\".\"imaging_requests\" ireq on ireq.id = ires.imaging_request_id\njoin \"app\".\"public\".\"encounters\" e on e.id = ireq.encounter_id\nwhere ires.deleted_at is null\n and ireq.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoices": {"database": "app", "schema": "reporting", "name": "invoices", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoices.sql", "original_file_path": "models\\bases\\invoices.sql", "unique_id": "model.tamanu_source_dbt.invoices", "fqn": ["tamanu_source_dbt", "bases", "invoices"], "alias": "invoices", "checksum": {"name": "sha256", "checksum": "b1cb3a63ad84b76ff9d85008d24d24b522e78521d1a2656079ff2f876f10cb0e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "Invoices related to encounters.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoices.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__display_id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in invoices.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "status": {"name": "status", "description": "Status of the invoice.\r\n\r\nOne of:\r\n- `cancelled`\r\n- `in_progress`\r\n- `finalised`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__status"]}, "patient_payment_status": {"name": "patient_payment_status", "description": "Payment status (patient portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__patient_payment_status"]}, "insurer_payment_status": {"name": "insurer_payment_status", "description": "Payment status (insurer portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__insurer_payment_status"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this invoice is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__encounter_id"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoices.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"]}, "created_at": 1782422374.9343357, "relation_name": "\"app\".\"reporting\".\"invoices\"", "raw_code": "select\r\n i.id,\r\n i.display_id,\r\n i.date::timestamp as datetime,\r\n i.status,\r\n i.patient_payment_status,\r\n i.insurer_payment_status,\r\n i.encounter_id\r\nfrom {{ source('tamanu', 'invoices') }} i\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = i.encounter_id\r\nwhere\r\n i.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__invoices"], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoices.sql", "compiled": true, "compiled_code": "select\n i.id,\n i.display_id,\n i.date::timestamp as datetime,\n i.status,\n i.patient_payment_status,\n i.insurer_payment_status,\n i.encounter_id\nfrom \"app\".\"public\".\"invoices\" i\njoin \"app\".\"public\".\"encounters\" e on e.id = i.encounter_id\nwhere\n i.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_insurance_plans": {"database": "app", "schema": "reporting", "name": "invoice_insurance_plans", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_insurance_plans.sql", "original_file_path": "models\\bases\\invoice_insurance_plans.sql", "unique_id": "model.tamanu_source_dbt.invoice_insurance_plans", "fqn": ["tamanu_source_dbt", "bases", "invoice_insurance_plans"], "alias": "invoice_insurance_plans", "checksum": {"name": "sha256", "checksum": "471b4285a38c7e8b0727f811637ae413954ace0d051689b2962c6c59ef0398fb"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table for insurance contracts used for invoicing.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurance_plans.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Human-readable name of the insurance contract.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__name"]}, "code": {"name": "code", "description": "Unique identifier code for the insurance contract.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__code"]}, "default_coverage": {"name": "default_coverage", "description": "The default coverage (in percentage) of the insurance contract.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__default_coverage"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_insurance_plans.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_insurance_plans.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.9343357, "relation_name": "\"app\".\"reporting\".\"invoice_insurance_plans\"", "raw_code": "select\r\n id,\r\n name,\r\n code,\r\n default_coverage,\r\n visibility_status\r\nfrom {{ source('tamanu', 'invoice_insurance_plans') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurance_plans"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_insurance_plans.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n code,\n default_coverage,\n visibility_status\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_insurance_plan_items": {"database": "app", "schema": "reporting", "name": "invoice_insurance_plan_items", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_insurance_plan_items.sql", "original_file_path": "models\\bases\\invoice_insurance_plan_items.sql", "unique_id": "model.tamanu_source_dbt.invoice_insurance_plan_items", "fqn": ["tamanu_source_dbt", "bases", "invoice_insurance_plan_items"], "alias": "invoice_insurance_plan_items", "checksum": {"name": "sha256", "checksum": "89623349f45d0519cefee8e92ca7e187f8c5692d818a607945ff34957ea7d895"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table for insurance contract items used for invoicing.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurance_plan_items.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_insurance_plan_id": {"name": "invoice_insurance_plan_id", "description": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_insurance_plan_id"]}, "invoice_product_id": {"name": "invoice_product_id", "description": "Reference to the [invoice product](#!/source/source.tamanu.tamanu.invoice_products).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_product_id"]}, "coverage_value": {"name": "coverage_value", "description": "The amount of coverage (in percentage) of the insurance contract item.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__coverage_value"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_insurance_plan_items.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.9343357, "relation_name": "\"app\".\"reporting\".\"invoice_insurance_plan_items\"", "raw_code": "select\r\n id,\r\n invoice_insurance_plan_id,\r\n invoice_product_id,\r\n coverage_value\r\nfrom {{ source('tamanu', 'invoice_insurance_plan_items') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurance_plan_items"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_insurance_plan_items.sql", "compiled": true, "compiled_code": "select\n id,\n invoice_insurance_plan_id,\n invoice_product_id,\n coverage_value\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_items": {"database": "app", "schema": "reporting", "name": "invoice_items", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_items.sql", "original_file_path": "models\\bases\\invoice_items.sql", "unique_id": "model.tamanu_source_dbt.invoice_items", "fqn": ["tamanu_source_dbt", "bases", "invoice_items"], "alias": "invoice_items", "checksum": {"name": "sha256", "checksum": "0c0c4c4544b00c55711e87a79ca52c01dfb6b39d9b4a32e316f3f3b360c50bf1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "Items (products) on invoices.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_items.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_id": {"name": "invoice_id", "description": "The [invoice](#!/source/source.tamanu.tamanu.invoices).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__invoice_id"]}, "date": {"name": "date", "description": "When the item was ordered.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__order_date"]}, "product_id": {"name": "product_id", "description": "The [product](#!/source/source.tamanu.tamanu.invoice_products).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_id"]}, "product_code_final": {"name": "product_code_final", "description": "The final product code used on the invoice. Saved from the product code field when the invoice is finalised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_code_final"]}, "product_name_final": {"name": "product_name_final", "description": "The final product name used on the invoice. Saved from the product name field when the invoice is finalised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_name_final"]}, "price_final": {"name": "price_final", "description": "The final price per unit for this item on the invoice. This is determined by the manual_entry_price if provided, otherwise from the product's price when the invoice is finalised.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__price_final"]}, "manual_entry_price": {"name": "manual_entry_price", "description": "Manually entered price override for this item, if specified. When set, this takes precedence over the product's standard price.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__manual_entry_price"]}, "quantity": {"name": "quantity", "description": "Quantity ordered.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__quantity"]}, "ordered_by_user_id": {"name": "ordered_by_user_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) ordered the item.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__ordered_by_user_id"]}, "approved": {"name": "approved", "description": "A boolean field that enables clinicians to track the approval status of individual invoice line items", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__approved"]}, "source_record_type": {"name": "source_record_type", "description": "The underlying model that the source record belongs to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__source_record_type"]}, "source_record_id": {"name": "source_record_id", "description": "Foreign key relation for record type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__source_record_id"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_items.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"]}, "created_at": 1782422374.9343357, "relation_name": "\"app\".\"reporting\".\"invoice_items\"", "raw_code": "select\r\n ii.id,\r\n ii.invoice_id,\r\n ii.order_date::date as date,\r\n ii.product_id,\r\n ii.product_code_final,\r\n ii.product_name_final,\r\n ii.price_final,\r\n ii.manual_entry_price,\r\n ii.quantity,\r\n ii.ordered_by_user_id,\r\n ii.approved,\r\n ii.source_record_type,\r\n ii.source_record_id\r\nfrom {{ source('tamanu', 'invoice_items') }} ii\r\njoin {{ source('tamanu', 'invoices') }} i on i.id = ii.invoice_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = i.encounter_id\r\nwhere\r\n ii.deleted_at is null\r\n and i.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_items"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"], ["tamanu", "invoices"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_items.sql", "compiled": true, "compiled_code": "select\n ii.id,\n ii.invoice_id,\n ii.order_date::date as date,\n ii.product_id,\n ii.product_code_final,\n ii.product_name_final,\n ii.price_final,\n ii.manual_entry_price,\n ii.quantity,\n ii.ordered_by_user_id,\n ii.approved,\n ii.source_record_type,\n ii.source_record_id\nfrom \"app\".\"public\".\"invoice_items\" ii\njoin \"app\".\"public\".\"invoices\" i on i.id = ii.invoice_id\njoin \"app\".\"public\".\"encounters\" e on e.id = i.encounter_id\nwhere\n ii.deleted_at is null\n and i.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_price_lists": {"database": "app", "schema": "reporting", "name": "invoice_price_lists", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_price_lists.sql", "original_file_path": "models\\bases\\invoice_price_lists.sql", "unique_id": "model.tamanu_source_dbt.invoice_price_lists", "fqn": ["tamanu_source_dbt", "bases", "invoice_price_lists"], "alias": "invoice_price_lists", "checksum": {"name": "sha256", "checksum": "806804413307e4430316c551eff8ed208bd415c97cfee5e7220e3b166c2ed3c2"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Contains price list definitions used for invoice line item pricing. Each price list represents a set of pricing rules that can be applied to different types of invoices, patients, or services.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_price_lists.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Human-readable name of the price list, displayed in user interfaces and reports.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__name"]}, "code": {"name": "code", "description": "Unique identifier code for the price list. Used for referencing the price list in business logic and integrations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__code"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_price_lists.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_price_lists.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.9343357, "relation_name": "\"app\".\"reporting\".\"invoice_price_lists\"", "raw_code": "select\r\n id,\r\n name,\r\n code,\r\n visibility_status\r\nfrom {{ source('tamanu', 'invoice_price_lists') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_price_lists"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_price_lists.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n code,\n visibility_status\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_price_list_items": {"database": "app", "schema": "reporting", "name": "invoice_price_list_items", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_price_list_items.sql", "original_file_path": "models\\bases\\invoice_price_list_items.sql", "unique_id": "model.tamanu_source_dbt.invoice_price_list_items", "fqn": ["tamanu_source_dbt", "bases", "invoice_price_list_items"], "alias": "invoice_price_list_items", "checksum": {"name": "sha256", "checksum": "772933fb0a3ffc10c160b46e1562eb4256962b5108d307284d717fbcba544556"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Contains individual pricing entries for specific products within a price list. Each record defines the price or pricing configuration for a particular product in the context of a specific price list.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_price_list_items.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_price_list_id": {"name": "invoice_price_list_id", "description": "Foreign key reference to the invoice_price_lists table. Links this pricing item to its parent price list.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__invoice_price_list_id"]}, "invoice_product_id": {"name": "invoice_product_id", "description": "Foreign key reference to the invoice products/services that can be priced. Identifies which product or service this pricing item applies to.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__invoice_product_id"]}, "price": {"name": "price", "description": "The price amount for this product in the context of this price list. Stored as a numeric value representing the cost in the system's base currency.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__price"]}, "is_hidden": {"name": "is_hidden", "description": "Determines whether the related invoice product should be hidden from searches on the frontend and also whether it should be automatically added to the invoice.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__is_hidden"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_price_list_items.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.9462528, "relation_name": "\"app\".\"reporting\".\"invoice_price_list_items\"", "raw_code": "select\r\n id,\r\n invoice_price_list_id,\r\n invoice_product_id,\r\n price,\r\n is_hidden\r\nfrom {{ source('tamanu', 'invoice_price_list_items') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_price_list_items"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_price_list_items.sql", "compiled": true, "compiled_code": "select\n id,\n invoice_price_list_id,\n invoice_product_id,\n price,\n is_hidden\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_products": {"database": "app", "schema": "reporting", "name": "invoice_products", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_products.sql", "original_file_path": "models\\bases\\invoice_products.sql", "unique_id": "model.tamanu_source_dbt.invoice_products", "fqn": ["tamanu_source_dbt", "bases", "invoice_products"], "alias": "invoice_products", "checksum": {"name": "sha256", "checksum": "1f70a2324c613ea8aee18c21ee4dc7e657a806b1d87bb5b4ee7241c37bbb4b4c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Products which can be invoiced.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Name of the product.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__name"]}, "insurable": {"name": "insurable", "description": "Whether or not discounts can be applied to a product", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__insurable"]}, "category": {"name": "category", "description": "The category of the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__category"]}, "source_record_id": {"name": "source_record_id", "description": "The id of the source record for the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__source_record_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_products.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.9482682, "relation_name": "\"app\".\"reporting\".\"invoice_products\"", "raw_code": "select\r\n id,\r\n name,\r\n insurable,\r\n category,\r\n source_record_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'invoice_products') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_products"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_products.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n insurable,\n category,\n source_record_id,\n visibility_status\nfrom \"app\".\"public\".\"invoice_products\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_requests": {"database": "app", "schema": "reporting", "name": "lab_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_requests.sql", "original_file_path": "models\\bases\\lab_requests.sql", "unique_id": "model.tamanu_source_dbt.lab_requests", "fqn": ["tamanu_source_dbt", "bases", "lab_requests"], "alias": "lab_requests", "checksum": {"name": "sha256", "checksum": "a98a305e47f4b8c01079b1607e995a92d973c9b7af5594fd446ef27286f420c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Lab requests are the entrypoint of laboratory workflows in Tamanu.\r\n\r\nEach row is a request for a laboratory to perform a group of tests on a sample taken from a patient.\r\n\r\nIt will be updated over the course of the workflow to various statuses, starting with\r\n`reception_pending` (lab has not received the request yet), up to `published` (lab has completed the\r\ntests and has attached verified results).\r\n\r\nSee also: `lab_request_attachments`, `lab_request_logs`, `lab_results`, `lab_tests`,\r\n`lab_test_panels`, and related tables to those.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "is_urgent": {"name": "is_urgent", "description": "Deprecated.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__urgent"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "lab_test_priority_id": {"name": "lab_test_priority_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_priority_id"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ncategory of this request's test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_category_id"]}, "lab_test_panel_request_id": {"name": "lab_test_panel_request_id", "description": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id"]}, "lab_test_laboratory_id": {"name": "lab_test_laboratory_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "is_specimen_collected": {"name": "is_specimen_collected", "description": "Whether a specimen is attached.\r\n\r\nThis implies `specimen_type_id`.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_attached"]}, "specimen_type_id": {"name": "specimen_type_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_type_id"]}, "lab_sample_site_id": {"name": "lab_sample_site_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing where\r\non the patient the sample was taken.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_sample_site_id"]}, "collected_datetime": {"name": "collected_datetime", "description": "When the sample was collected.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time"]}, "collected_by_id": {"name": "collected_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__collected_by_id"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__reason_for_cancellation"]}, "published_date": {"name": "published_date", "description": "When this lab request's results were published.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__published_date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) the request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__encounter_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) the request comes from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__department_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.953252, "relation_name": "\"app\".\"reporting\".\"lab_requests\"", "raw_code": "select\r\n lr.id,\r\n lr.created_at as created_datetime,\r\n lr.updated_at as updated_datetime,\r\n lr.display_id,\r\n lr.urgent as is_urgent,\r\n lr.status,\r\n lr.requested_date::timestamp as requested_datetime,\r\n lr.lab_test_priority_id,\r\n lr.lab_test_category_id,\r\n lr.lab_test_panel_request_id,\r\n lr.lab_test_laboratory_id,\r\n lr.requested_by_id,\r\n lr.specimen_attached as is_specimen_collected,\r\n lr.specimen_type_id,\r\n lr.lab_sample_site_id,\r\n lr.sample_time::timestamp as collected_datetime,\r\n lr.collected_by_id,\r\n lr.reason_for_cancellation,\r\n lr.published_date::timestamp as published_datetime,\r\n lr.encounter_id,\r\n lr.department_id\r\nfrom {{ source('tamanu', 'lab_requests') }} lr\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = lr.encounter_id\r\nwhere lr.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_requests"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_requests.sql", "compiled": true, "compiled_code": "select\n lr.id,\n lr.created_at as created_datetime,\n lr.updated_at as updated_datetime,\n lr.display_id,\n lr.urgent as is_urgent,\n lr.status,\n lr.requested_date::timestamp as requested_datetime,\n lr.lab_test_priority_id,\n lr.lab_test_category_id,\n lr.lab_test_panel_request_id,\n lr.lab_test_laboratory_id,\n lr.requested_by_id,\n lr.specimen_attached as is_specimen_collected,\n lr.specimen_type_id,\n lr.lab_sample_site_id,\n lr.sample_time::timestamp as collected_datetime,\n lr.collected_by_id,\n lr.reason_for_cancellation,\n lr.published_date::timestamp as published_datetime,\n lr.encounter_id,\n lr.department_id\nfrom \"app\".\"public\".\"lab_requests\" lr\njoin \"app\".\"public\".\"encounters\" e on e.id = lr.encounter_id\nwhere lr.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_requests_metadata": {"database": "app", "schema": "reporting", "name": "lab_requests_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_requests_metadata.sql", "original_file_path": "models\\bases\\lab_requests_metadata.sql", "unique_id": "model.tamanu_source_dbt.lab_requests_metadata", "fqn": ["tamanu_source_dbt", "bases", "lab_requests_metadata"], "alias": "lab_requests_metadata", "checksum": {"name": "sha256", "checksum": "299131a3063577bad16e1d88c579b3ae57b60fd52a1c3a9272997343763dccbe"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for lab_requests.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the lab_requests table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the lab_requests table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_requests_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.954253, "relation_name": "\"app\".\"reporting\".\"lab_requests_metadata\"", "raw_code": "{{ get_metadata_from_changes('lab_requests') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_requests_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'lab_requests'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_request_logs": {"database": "app", "schema": "reporting", "name": "lab_request_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_request_logs.sql", "original_file_path": "models\\bases\\lab_request_logs.sql", "unique_id": "model.tamanu_source_dbt.lab_request_logs", "fqn": ["tamanu_source_dbt", "bases", "lab_request_logs"], "alias": "lab_request_logs", "checksum": {"name": "sha256", "checksum": "8e834e648ae8c388a8ea11dc368808362cff0776183dc21089c29abf8566e87d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "This is a log of who changed the status of a lab request when.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_request_logs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "lab_request_id": {"name": "lab_request_id", "description": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__lab_request_id"]}, "status": {"name": "status", "description": "The status the lab request was updated to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__status"]}, "updated_by_id": {"name": "updated_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this lab request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__updated_by_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_request_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.9562526, "relation_name": "\"app\".\"reporting\".\"lab_request_logs\"", "raw_code": "select\r\n lrl.id,\r\n lrl.created_at as created_datetime,\r\n lrl.updated_at as updated_datetime,\r\n lrl.lab_request_id,\r\n lrl.status,\r\n lrl.updated_by_id\r\nfrom {{ source('tamanu', 'lab_request_logs') }} lrl\r\njoin {{ source('tamanu', 'lab_requests') }} lr on lr.id = lrl.lab_request_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = lr.encounter_id\r\nwhere lrl.deleted_at is null\r\n and lr.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_request_logs"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"], ["tamanu", "lab_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs", "source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_request_logs.sql", "compiled": true, "compiled_code": "select\n lrl.id,\n lrl.created_at as created_datetime,\n lrl.updated_at as updated_datetime,\n lrl.lab_request_id,\n lrl.status,\n lrl.updated_by_id\nfrom \"app\".\"public\".\"lab_request_logs\" lrl\njoin \"app\".\"public\".\"lab_requests\" lr on lr.id = lrl.lab_request_id\njoin \"app\".\"public\".\"encounters\" e on e.id = lr.encounter_id\nwhere lrl.deleted_at is null\n and lr.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_request_logs_metadata": {"database": "app", "schema": "reporting", "name": "lab_request_logs_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_request_logs_metadata.sql", "original_file_path": "models\\bases\\lab_request_logs_metadata.sql", "unique_id": "model.tamanu_source_dbt.lab_request_logs_metadata", "fqn": ["tamanu_source_dbt", "bases", "lab_request_logs_metadata"], "alias": "lab_request_logs_metadata", "checksum": {"name": "sha256", "checksum": "44d75727704955a1f90411bf88f01b52b70b9128f4a9a18ba3dd281e502024b6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for lab_request_logs.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_request_logs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the lab_request_logs table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the lab_request_logs table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_request_logs_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.9572508, "relation_name": "\"app\".\"reporting\".\"lab_request_logs_metadata\"", "raw_code": "{{ get_metadata_from_changes('lab_request_logs') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_request_logs_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'lab_request_logs'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_tests": {"database": "app", "schema": "reporting", "name": "lab_tests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_tests.sql", "original_file_path": "models\\bases\\lab_tests.sql", "unique_id": "model.tamanu_source_dbt.lab_tests", "fqn": ["tamanu_source_dbt", "bases", "lab_tests"], "alias": "lab_tests", "checksum": {"name": "sha256", "checksum": "c44e58bdaf17b6177062d662e9e3c9bca35743e05fb6705449f676d3d5d19fa7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A single test as part of a [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_tests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "date": {"name": "date", "description": "Local date for the record in lab_tests.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "result": {"name": "result", "description": "The result of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__result"]}, "lab_request_id": {"name": "lab_request_id", "description": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this test is part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_request_id"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_type_id"]}, "lab_test_method_id": {"name": "lab_test_method_id", "description": "Reference to the method ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_method_id"]}, "laboratory_officer": {"name": "laboratory_officer", "description": "Name of the lab officer performing the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__laboratory_officer"]}, "completed_datetime": {"name": "completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}, "verification": {"name": "verification", "description": "Free-form field for a verification indication.\r\n\r\nMay be a verifying or supervising officer's name, a department, lab notes...", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__verification"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_tests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422374.9612515, "relation_name": "\"app\".\"reporting\".\"lab_tests\"", "raw_code": "select\r\n lt.id,\r\n lt.date::date as date,\r\n lt.result,\r\n lt.lab_request_id,\r\n lt.lab_test_type_id,\r\n lt.lab_test_method_id,\r\n lt.laboratory_officer,\r\n lt.completed_date::timestamp as completed_datetime,\r\n lt.verification\r\nfrom {{ source('tamanu', 'lab_tests') }} lt\r\njoin {{ source('tamanu', 'lab_requests') }} lr on lr.id = lt.lab_request_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = lr.encounter_id\r\nwhere lt.deleted_at is null\r\n and lr.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_tests"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"], ["tamanu", "lab_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests", "source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_tests.sql", "compiled": true, "compiled_code": "select\n lt.id,\n lt.date::date as date,\n lt.result,\n lt.lab_request_id,\n lt.lab_test_type_id,\n lt.lab_test_method_id,\n lt.laboratory_officer,\n lt.completed_date::timestamp as completed_datetime,\n lt.verification\nfrom \"app\".\"public\".\"lab_tests\" lt\njoin \"app\".\"public\".\"lab_requests\" lr on lr.id = lt.lab_request_id\njoin \"app\".\"public\".\"encounters\" e on e.id = lr.encounter_id\nwhere lt.deleted_at is null\n and lr.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_test_panels": {"database": "app", "schema": "reporting", "name": "lab_test_panels", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_test_panels.sql", "original_file_path": "models\\bases\\lab_test_panels.sql", "unique_id": "model.tamanu_source_dbt.lab_test_panels", "fqn": ["tamanu_source_dbt", "bases", "lab_test_panels"], "alias": "lab_test_panels", "checksum": {"name": "sha256", "checksum": "d05a87d54e418862912b5dcb00209e1ac17eb65e9228ebbf3abb127b0acad9f5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "A panel is a collection of lab test types, usually standardised.\r\n\r\nFor example the BMP (basic metabolic panel) is a panel of 8 blood tests. Instead of ordering all 8\r\ntests individually, a clinician can order the panel all at once. This may also used to more\r\nefficiently use samples.\r\n\r\nThis table defines the available test panels, and\r\n[`lab_test_panel_lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_panel_lab_test_types)\r\ncontains the actual test types that are part of each panel. See\r\n[`lab_test_panel_requests`](#!/source/source.tamanu.tamanu.lab_test_panel_requests) for requesting\r\npanels specifically, and [`lab_test_requests`](#!/source/source.tamanu.tamanu.lab_test_requests) for\r\nrequesting lab tests in general.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panels.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Internal Tamanu code of the panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__code"]}, "external_code": {"name": "external_code", "description": "External code, such as for interfacing with LIMS.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__external_code"]}, "name": {"name": "name", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__category_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_panels.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_test_panels.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.9612515, "relation_name": "\"app\".\"reporting\".\"lab_test_panels\"", "raw_code": "select\r\n id,\r\n code,\r\n external_code,\r\n name,\r\n category_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'lab_test_panels') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panels"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_test_panels.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n external_code,\n name,\n category_id,\n visibility_status\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_test_panel_lab_test_types": {"database": "app", "schema": "reporting", "name": "lab_test_panel_lab_test_types", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_test_panel_lab_test_types.sql", "original_file_path": "models\\bases\\lab_test_panel_lab_test_types.sql", "unique_id": "model.tamanu_source_dbt.lab_test_panel_lab_test_types", "fqn": ["tamanu_source_dbt", "bases", "lab_test_panel_lab_test_types"], "alias": "lab_test_panel_lab_test_types", "checksum": {"name": "sha256", "checksum": "2dc5c7e79409a963f17f5cf9fae60074b4da1bc6de21b06bbea1649505c31dce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "The lab tests contained in a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about lab test\r\npanels, and [`lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_types) for the test types.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panel_lab_test_types.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_panel_id"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [test type](#!/source/source.tamanu.tamanu.lab_test_types).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_type_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_test_panel_lab_test_types.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422374.9612515, "relation_name": "\"app\".\"reporting\".\"lab_test_panel_lab_test_types\"", "raw_code": "select\r\n id,\r\n lab_test_panel_id,\r\n lab_test_type_id\r\nfrom {{ source('tamanu', 'lab_test_panel_lab_test_types') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panel_lab_test_types"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_test_panel_lab_test_types.sql", "compiled": true, "compiled_code": "select\n id,\n lab_test_panel_id,\n lab_test_type_id\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_test_panel_requests": {"database": "app", "schema": "reporting", "name": "lab_test_panel_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_test_panel_requests.sql", "original_file_path": "models\\bases\\lab_test_panel_requests.sql", "unique_id": "model.tamanu_source_dbt.lab_test_panel_requests", "fqn": ["tamanu_source_dbt", "bases", "lab_test_panel_requests"], "alias": "lab_test_panel_requests", "checksum": {"name": "sha256", "checksum": "48b25f3f48462937dcf060fb80d9ef1346ec14d6c360d40fd2256141e46118fc"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A request for a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about those.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panel_requests.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_requests__lab_test_panel_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this lab test panel request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_requests__encounter_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_test_panel_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.0540786, "relation_name": "\"app\".\"reporting\".\"lab_test_panel_requests\"", "raw_code": "select\r\n ltpr.id,\r\n ltpr.lab_test_panel_id,\r\n ltpr.encounter_id\r\nfrom {{ source('tamanu', 'lab_test_panel_requests') }} ltpr\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ltpr.encounter_id\r\nwhere ltpr.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panel_requests"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_test_panel_requests.sql", "compiled": true, "compiled_code": "select\n ltpr.id,\n ltpr.lab_test_panel_id,\n ltpr.encounter_id\nfrom \"app\".\"public\".\"lab_test_panel_requests\" ltpr\njoin \"app\".\"public\".\"encounters\" e on e.id = ltpr.encounter_id\nwhere ltpr.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_test_types": {"database": "app", "schema": "reporting", "name": "lab_test_types", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_test_types.sql", "original_file_path": "models\\bases\\lab_test_types.sql", "unique_id": "model.tamanu_source_dbt.lab_test_types", "fqn": ["tamanu_source_dbt", "bases", "lab_test_types"], "alias": "lab_test_types", "checksum": {"name": "sha256", "checksum": "9c715ddbbe8ca0cb7d25aa63b401c2e87001a762e773c1cb1dc29baab423268b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "A kind of test that's possible to request.\r\n\r\nThis includes information about the test itself, and also parameters around result formatting, like\r\ndata type, expected ranges, etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_types.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Internal Tamanu code of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__code"]}, "external_code": {"name": "external_code", "description": "External code for the test (such as for LIMS).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__external_code"]}, "name": {"name": "name", "description": "Human-friendly name of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__name"]}, "unit": {"name": "unit", "description": "Unit the test result is measured in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__unit"]}, "male_min": {"name": "male_min", "description": "Minimum typical range for males.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__male_min"]}, "male_max": {"name": "male_max", "description": "Maximum typical range for males.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__male_max"]}, "female_min": {"name": "female_min", "description": "Minimum typical range for females.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__female_min"]}, "female_max": {"name": "female_max", "description": "Maximum typical range for females.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__female_max"]}, "range_text": {"name": "range_text", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__range_text"]}, "result_type": {"name": "result_type", "description": "Input type of result.\r\n\r\nOne of:\r\n- `FreeText`\r\n- `Number`\r\n- `Select`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__result_type"]}, "options": {"name": "options", "description": "Comma-separated list of options. Unused.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__options"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__lab_test_category_id"]}, "is_sensitive": {"name": "is_sensitive", "description": "Used to indicate if the lab test type is sensitive and should be hidden accordingly.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__is_sensitive"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_types.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_test_types.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.0540786, "relation_name": "\"app\".\"reporting\".\"lab_test_types\"", "raw_code": "select\r\n id,\r\n code,\r\n external_code,\r\n name,\r\n unit,\r\n male_min,\r\n male_max,\r\n female_min,\r\n female_max,\r\n range_text\r\n as result_type,\r\n options,\r\n lab_test_category_id,\r\n visibility_status,\r\n is_sensitive\r\nfrom {{ source('tamanu', 'lab_test_types') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_types"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_test_types.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n external_code,\n name,\n unit,\n male_min,\n male_max,\n female_min,\n female_max,\n range_text\n as result_type,\n options,\n lab_test_category_id,\n visibility_status,\n is_sensitive\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.locations": {"database": "app", "schema": "reporting", "name": "locations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\locations.sql", "original_file_path": "models\\bases\\locations.sql", "unique_id": "model.tamanu_source_dbt.locations", "fqn": ["tamanu_source_dbt", "bases", "locations"], "alias": "locations", "checksum": {"name": "sha256", "checksum": "fbc90b982910ef98f65130092a6066ca40d00bb7f690732e1ab7c792337162d5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Information on the hospital locations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in locations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code for location", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__code"]}, "name": {"name": "name", "description": "Full readable name for location", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__name"]}, "max_occupancy": {"name": "max_occupancy", "description": "The maximum number of patients that can be in this location", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__max_occupancy"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in locations.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\locations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.0540786, "relation_name": "\"app\".\"reporting\".\"locations\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n max_occupancy,\r\n location_group_id,\r\n facility_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'locations') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__locations"], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\locations.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n max_occupancy,\n location_group_id,\n facility_id,\n visibility_status\nfrom \"app\".\"public\".\"locations\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.location_bookings": {"database": "app", "schema": "reporting", "name": "location_bookings", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\location_bookings.sql", "original_file_path": "models\\bases\\location_bookings.sql", "unique_id": "model.tamanu_source_dbt.location_bookings", "fqn": ["tamanu_source_dbt", "bases", "location_bookings"], "alias": "location_bookings", "checksum": {"name": "sha256", "checksum": "246c7546b456b6c751c1d3135c51513658b7d5d472208ea2d9cf689cc0e5b80f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table of appointments. (location bookings)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_datetime": {"name": "start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "end_datetime": {"name": "end_datetime", "description": "When the appointment ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) linked to this appointment", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__encounter_id"]}, "location_id": {"name": "location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_id"]}, "booking_type_id": {"name": "booking_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "is_high_priority": {"name": "is_high_priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "status": {"name": "status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\location_bookings.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.0540786, "relation_name": "\"app\".\"reporting\".\"location_bookings\"", "raw_code": "select\r\n id,\r\n start_time::timestamp as start_datetime,\r\n end_time::timestamp as end_datetime,\r\n patient_id,\r\n clinician_id,\r\n encounter_id,\r\n location_id,\r\n booking_type_id,\r\n is_high_priority,\r\n status\r\nfrom {{ source('tamanu', 'appointments') }}\r\nwhere booking_type_id notnull\r\n and deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__appointments"], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\location_bookings.sql", "compiled": true, "compiled_code": "select\n id,\n start_time::timestamp as start_datetime,\n end_time::timestamp as end_datetime,\n patient_id,\n clinician_id,\n encounter_id,\n location_id,\n booking_type_id,\n is_high_priority,\n status\nfrom \"app\".\"public\".\"appointments\"\nwhere booking_type_id notnull\n and deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.location_groups": {"database": "app", "schema": "reporting", "name": "location_groups", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\location_groups.sql", "original_file_path": "models\\bases\\location_groups.sql", "unique_id": "model.tamanu_source_dbt.location_groups", "fqn": ["tamanu_source_dbt", "bases", "location_groups"], "alias": "location_groups", "checksum": {"name": "sha256", "checksum": "d9776bf31c16b8a797c55ee1727345e6c5802ff83c5e0dee42e47275264dbf0a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "A group of locations managed as a single unit (e.g. a ward in hospital)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in location_groups.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code for location group", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__code"]}, "name": {"name": "name", "description": "Full readable name for location group", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location group is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in location_groups.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\location_groups.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.0540786, "relation_name": "\"app\".\"reporting\".\"location_groups\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n facility_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'location_groups') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__location_groups"], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\location_groups.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n facility_id,\n visibility_status\nfrom \"app\".\"public\".\"location_groups\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.medication_dispenses": {"database": "app", "schema": "reporting", "name": "medication_dispenses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\medication_dispenses.sql", "original_file_path": "models\\bases\\medication_dispenses.sql", "unique_id": "model.tamanu_source_dbt.medication_dispenses", "fqn": ["tamanu_source_dbt", "bases", "medication_dispenses"], "alias": "medication_dispenses", "checksum": {"name": "sha256", "checksum": "7c5c23990be3b0d982f48cc21905ba9eff142264e7863b0faa886bf4416100f8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "reference"], "description": "Records of medication dispensing events, tracking when medications from pharmacy orders are physically dispensed to patients. Each record represents a single dispensing event for a specific prescription within a pharmacy order.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_dispenses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "pharmacy_order_prescription_id": {"name": "pharmacy_order_prescription_id", "description": "Reference to the [pharmacy_order_prescription](#!/source/source.tamanu.tamanu.pharmacy_order_prescriptions) that this dispense record fulfills. Links this dispensing event to the specific medication order being filled.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__pharmacy_order_prescription_id"]}, "quantity": {"name": "quantity", "description": "The quantity of medication units dispensed to the patient in each dispensing.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__quantity"]}, "dispensed_at": {"name": "dispensed_at", "description": "The timestamp indicating when the medication was physically dispensed to the patient.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_at"]}, "dispensed_by_user_id": {"name": "dispensed_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) (typically a pharmacist or pharmacy staff member) who dispensed the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_by_user_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\medication_dispenses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.0540786, "relation_name": "\"app\".\"reporting\".\"medication_dispenses\"", "raw_code": "select\r\n md.id,\r\n md.pharmacy_order_prescription_id,\r\n md.quantity,\r\n md.dispensed_at::timestamp as dispensed_at,\r\n md.dispensed_by_user_id\r\nfrom {{ source('tamanu', 'medication_dispenses') }} md\r\njoin {{ source('tamanu', 'pharmacy_order_prescriptions') }} pop\r\n on pop.id = md.pharmacy_order_prescription_id\r\njoin {{ source('tamanu', 'pharmacy_orders') }} po on po.id = pop.pharmacy_order_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = po.encounter_id\r\nwhere md.deleted_at is null\r\n and pop.deleted_at is null\r\n and po.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__medication_dispenses"], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"], ["tamanu", "pharmacy_order_prescriptions"], ["tamanu", "pharmacy_orders"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses", "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "source.tamanu_source_dbt.tamanu.pharmacy_orders", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\medication_dispenses.sql", "compiled": true, "compiled_code": "select\n md.id,\n md.pharmacy_order_prescription_id,\n md.quantity,\n md.dispensed_at::timestamp as dispensed_at,\n md.dispensed_by_user_id\nfrom \"app\".\"public\".\"medication_dispenses\" md\njoin \"app\".\"public\".\"pharmacy_order_prescriptions\" pop\n on pop.id = md.pharmacy_order_prescription_id\njoin \"app\".\"public\".\"pharmacy_orders\" po on po.id = pop.pharmacy_order_id\njoin \"app\".\"public\".\"encounters\" e on e.id = po.encounter_id\nwhere md.deleted_at is null\n and pop.deleted_at is null\n and po.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.notes": {"database": "app", "schema": "reporting", "name": "notes", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\notes.sql", "original_file_path": "models\\bases\\notes.sql", "unique_id": "model.tamanu_source_dbt.notes", "fqn": ["tamanu_source_dbt", "bases", "notes"], "alias": "notes", "checksum": {"name": "sha256", "checksum": "51522179b1f122b8dba098b0dbab7a782ec2fc298b52fa629d5176489223d957"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Notes recorded by clinicians or system generated.\r\n\r\nAlso see the deprecated [`note_items`](#!/source/source.tamanu.tamanu.note_items),\r\n[`note_pages`](#!/source/source.tamanu.tamanu.note_pages), and the even older\r\n[`notes_legacy`](#!/source/source.tamanu.tamanu.notes_legacy).\r\n\r\nThis is the current version (3) of the notes system.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in notes.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in notes.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "content": {"name": "content", "description": "The content of the note recorded.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__content"]}, "note_type_id": {"name": "note_type_id", "description": "Reference to the note type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = noteType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__note_type_id"]}, "record_type": {"name": "record_type", "description": "Polymorphic relationship to the record to which the note is attached (type).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__record_type"]}, "record_id": {"name": "record_id", "description": "Polymorphic relationship to the record to which the note is attached (id).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__record_id"]}, "authored_by_id": {"name": "authored_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__author_id"]}, "on_behalf_of_id": {"name": "on_behalf_of_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note, if it wasn't the user who published it.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__on_behalf_of_id"]}, "updated_note_id": {"name": "updated_note_id", "description": "Reference to the [note](#!/source/source.tamanu.tamanu.notes) that is being revised.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__revised_by_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in notes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\notes.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.0700617, "relation_name": "\"app\".\"reporting\".\"notes\"", "raw_code": "-- May include notes for the test patient.\r\nselect\r\n n.id,\r\n n.date::timestamp as datetime,\r\n n.content,\r\n n.note_type_id,\r\n rd.name as note_type,\r\n n.record_type,\r\n n.record_id,\r\n n.author_id as authored_by_id,\r\n n.on_behalf_of_id,\r\n n.revised_by_id as updated_note_id,\r\n n.visibility_status\r\nfrom {{ source('tamanu', 'notes') }} n\r\njoin {{ source('tamanu', 'reference_data') }} rd\r\n on rd.id = n.note_type_id\r\nwhere n.deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__notes"], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\notes.sql", "compiled": true, "compiled_code": "-- May include notes for the test patient.\nselect\n n.id,\n n.date::timestamp as datetime,\n n.content,\n n.note_type_id,\n rd.name as note_type,\n n.record_type,\n n.record_id,\n n.author_id as authored_by_id,\n n.on_behalf_of_id,\n n.revised_by_id as updated_note_id,\n n.visibility_status\nfrom \"app\".\"public\".\"notes\" n\njoin \"app\".\"public\".\"reference_data\" rd\n on rd.id = n.note_type_id\nwhere n.deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.outpatient_appointments": {"database": "app", "schema": "reporting", "name": "outpatient_appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments.sql", "original_file_path": "models\\bases\\outpatient_appointments.sql", "unique_id": "model.tamanu_source_dbt.outpatient_appointments", "fqn": ["tamanu_source_dbt", "bases", "outpatient_appointments"], "alias": "outpatient_appointments", "checksum": {"name": "sha256", "checksum": "c1d2ccc04049ba949fb642490b97e353dcc407f32a1a8c205ddc4e7a0732c192"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table of appointments. (outpatient appointment)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_datetime": {"name": "start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "end_datetime": {"name": "end_datetime", "description": "When the appointment ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "status": {"name": "status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__appointment_type_id"]}, "is_high_priority": {"name": "is_high_priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) linked to this appointment", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__encounter_id"]}, "schedule_id": {"name": "schedule_id", "description": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__schedule_id"]}, "until_date": {"name": "until_date", "description": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__until_date"]}, "interval": {"name": "interval", "description": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\"", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__interval"]}, "frequency": {"name": "frequency", "description": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__frequency"]}, "days_of_week": {"name": "days_of_week", "description": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__days_of_week"]}, "nth_weekday": {"name": "nth_weekday", "description": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__nth_weekday"]}, "occurrence_count": {"name": "occurrence_count", "description": "When this value is set, the recurrence ends after generating the specified number of occurrences\r\nAt least one of `occurrence_count` or `until_date` must be set.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__occurrence_count"]}, "is_fully_generated": {"name": "is_fully_generated", "description": "Whether or not all repeating appointments have been created for a schedule", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__is_fully_generated"]}, "generated_until_date": {"name": "generated_until_date", "description": "The date of the most recent appointment in a schedule, this is set after generation of the repeated appointment and then updated if it is necessary to generate further appointments.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__generated_until_date"]}, "cancelled_at_date": {"name": "cancelled_at_date", "description": "The date from which appointments in a schedule have been cancelled, this is set when cancelling 'this and all future appointments'.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__cancelled_at_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\outpatient_appointments.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.0700617, "relation_name": "\"app\".\"reporting\".\"outpatient_appointments\"", "raw_code": "select\r\n a.id,\r\n a.start_time::timestamp as start_datetime,\r\n a.end_time::timestamp as end_datetime,\r\n a.patient_id,\r\n a.clinician_id,\r\n a.encounter_id,\r\n a.schedule_id,\r\n a.location_group_id,\r\n a.appointment_type_id,\r\n case\r\n when a.is_high_priority then 'Yes' else 'No'\r\n end as priority,\r\n a.status,\r\n s.until_date::date as until_date,\r\n s.interval,\r\n s.days_of_week,\r\n s.frequency,\r\n s.nth_weekday,\r\n s.occurrence_count,\r\n s.is_fully_generated,\r\n s.generated_until_date,\r\n s.cancelled_at_date\r\nfrom {{ source('tamanu', 'appointments') }} a\r\nleft join {{ source('tamanu', 'appointment_schedules') }} s on s.id = a.schedule_id\r\nwhere a.deleted_at is null\r\n and a.patient_id != '{{ var(\"test_patient\") }}'\r\n and a.appointment_type_id notnull", "doc_blocks": ["doc.tamanu_source_dbt.table__appointments"], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"], ["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\outpatient_appointments.sql", "compiled": true, "compiled_code": "select\n a.id,\n a.start_time::timestamp as start_datetime,\n a.end_time::timestamp as end_datetime,\n a.patient_id,\n a.clinician_id,\n a.encounter_id,\n a.schedule_id,\n a.location_group_id,\n a.appointment_type_id,\n case\n when a.is_high_priority then 'Yes' else 'No'\n end as priority,\n a.status,\n s.until_date::date as until_date,\n s.interval,\n s.days_of_week,\n s.frequency,\n s.nth_weekday,\n s.occurrence_count,\n s.is_fully_generated,\n s.generated_until_date,\n s.cancelled_at_date\nfrom \"app\".\"public\".\"appointments\" a\nleft join \"app\".\"public\".\"appointment_schedules\" s on s.id = a.schedule_id\nwhere a.deleted_at is null\n and a.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n and a.appointment_type_id notnull", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.outpatient_appointments_change_logs": {"database": "app", "schema": "reporting", "name": "outpatient_appointments_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.sql", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.sql", "unique_id": "model.tamanu_source_dbt.outpatient_appointments_change_logs", "fqn": ["tamanu_source_dbt", "bases", "outpatient_appointments_change_logs"], "alias": "outpatient_appointments_change_logs", "checksum": {"name": "sha256", "checksum": "b4e8dcfa6fed1e0d00ff4873c669923783956614959bab206314cd35bf98cfde"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "base", "clinical", "audit"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "audit"], "description": "Base model for appointment change logs. Contains all changes to appointments extracted from the logs.changes table, including the initial creation. Each row represents a change event with both current and previous values.\n", "columns": {"change_id": {"name": "change_id", "description": "Unique identifier for the change log entry (UUID from logs.changes).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id"]}, "appointment_id": {"name": "appointment_id", "description": "Reference to the [appointment](#!/model/model.tamanu_source_dbt.outpatient_appointments) that was modified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id"]}, "modified_datetime": {"name": "modified_datetime", "description": "Timestamp when the change was logged (from logs.changes.logged_at).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime"]}, "modified_by_user_id": {"name": "modified_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who made the modification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who originally created the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/model/model.tamanu_source_dbt.patients) associated with the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id"]}, "start_datetime": {"name": "start_datetime", "description": "Current appointment start date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime"]}, "end_datetime": {"name": "end_datetime", "description": "Current appointment end date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime"]}, "clinician_id": {"name": "clinician_id", "description": "Current [clinician](#!/model/model.tamanu_source_dbt.users) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id"]}, "location_group_id": {"name": "location_group_id", "description": "Current [location group](#!/model/model.tamanu_source_dbt.location_groups)/area ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Current [appointment type](#!/model/model.tamanu_source_dbt.reference_data) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id"]}, "is_high_priority": {"name": "is_high_priority", "description": "Current priority status (after the change). Boolean indicating if the appointment is high priority.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority"]}, "status": {"name": "status", "description": "Current appointment status (after the change).\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__status"]}, "schedule_id": {"name": "schedule_id", "description": "Current recurring schedule ID (after the change). References appointment_schedules table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id"]}, "prev_start_datetime": {"name": "prev_start_datetime", "description": "Previous appointment start date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime"]}, "prev_end_datetime": {"name": "prev_end_datetime", "description": "Previous appointment end date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime"]}, "prev_clinician_id": {"name": "prev_clinician_id", "description": "Previous clinician ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id"]}, "prev_location_group_id": {"name": "prev_location_group_id", "description": "Previous location group/area ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id"]}, "prev_appointment_type_id": {"name": "prev_appointment_type_id", "description": "Previous appointment type ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id"]}, "prev_is_high_priority": {"name": "prev_is_high_priority", "description": "Previous priority status (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority"]}, "prev_status": {"name": "prev_status", "description": "Previous appointment status (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_status"]}, "change_sequence": {"name": "change_sequence", "description": "Sequential number of this change for the appointment.\r\n- 1 = initial creation event\r\n- 2+ = subsequent modifications\r\n\r\nUses ROW_NUMBER() partitioned by appointment_id and ordered by logged_at.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_sequence"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\outpatient_appointments_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["base", "clinical", "audit"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.0700617, "relation_name": "\"app\".\"reporting\".\"outpatient_appointments_change_logs\"", "raw_code": "-- Base model for outpatient appointment change logs\r\n-- Extracts appointment modifications from logs.changes table\r\n-- Each row represents a change event to an appointment\r\n\r\nwith appointment_changes as (\r\n select\r\n c.id as change_id,\r\n c.record_id as appointment_id,\r\n c.logged_at as modified_datetime,\r\n c.updated_by_user_id as modified_by_user_id,\r\n -- Extract current values from the change log record_data\r\n (c.record_data ->> 'start_time')::timestamp as start_datetime,\r\n (c.record_data ->> 'end_time')::timestamp as end_datetime,\r\n c.record_data ->> 'patient_id' as patient_id,\r\n c.record_data ->> 'clinician_id' as clinician_id,\r\n c.record_data ->> 'location_group_id' as location_group_id,\r\n c.record_data ->> 'appointment_type_id' as appointment_type_id,\r\n (c.record_data ->> 'is_high_priority')::boolean as is_high_priority,\r\n c.record_data ->> 'status' as status,\r\n (c.record_data ->> 'schedule_id')::uuid as schedule_id,\r\n -- Get creator from the first change_sequence (initial creation)\r\n first_value(c.updated_by_user_id) over (\r\n partition by c.record_id\r\n order by c.logged_at\r\n ) as created_by_user_id,\r\n -- Use LAG to get the previous record state\r\n lag(c.record_data) over (\r\n partition by c.record_id\r\n order by c.logged_at\r\n ) as previous_record_data,\r\n -- Track change sequence\r\n row_number() over (\r\n partition by c.record_id\r\n order by c.logged_at\r\n ) as change_sequence\r\n from {{ source('logs__tamanu', 'changes') }} c\r\n where c.table_name = 'appointments'\r\n and c.record_deleted_at is null\r\n and (c.record_data ->> 'appointment_type_id') is not null\r\n)\r\n\r\nselect\r\n change_id,\r\n appointment_id,\r\n modified_datetime,\r\n modified_by_user_id,\r\n created_by_user_id,\r\n patient_id,\r\n -- Current appointment details\r\n start_datetime,\r\n end_datetime,\r\n clinician_id,\r\n location_group_id,\r\n appointment_type_id,\r\n is_high_priority,\r\n status,\r\n schedule_id,\r\n -- Previous appointment details\r\n (previous_record_data ->> 'start_time')::timestamp as prev_start_datetime,\r\n (previous_record_data ->> 'end_time')::timestamp as prev_end_datetime,\r\n (previous_record_data ->> 'clinician_id') as prev_clinician_id,\r\n (previous_record_data ->> 'location_group_id') as prev_location_group_id,\r\n (previous_record_data ->> 'appointment_type_id') as prev_appointment_type_id,\r\n (previous_record_data ->> 'is_high_priority')::boolean as prev_is_high_priority,\r\n (previous_record_data ->> 'status') as prev_status,\r\n change_sequence\r\nfrom appointment_changes", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\outpatient_appointments_change_logs.sql", "compiled": true, "compiled_code": "-- Base model for outpatient appointment change logs\n-- Extracts appointment modifications from logs.changes table\n-- Each row represents a change event to an appointment\n\nwith appointment_changes as (\n select\n c.id as change_id,\n c.record_id as appointment_id,\n c.logged_at as modified_datetime,\n c.updated_by_user_id as modified_by_user_id,\n -- Extract current values from the change log record_data\n (c.record_data ->> 'start_time')::timestamp as start_datetime,\n (c.record_data ->> 'end_time')::timestamp as end_datetime,\n c.record_data ->> 'patient_id' as patient_id,\n c.record_data ->> 'clinician_id' as clinician_id,\n c.record_data ->> 'location_group_id' as location_group_id,\n c.record_data ->> 'appointment_type_id' as appointment_type_id,\n (c.record_data ->> 'is_high_priority')::boolean as is_high_priority,\n c.record_data ->> 'status' as status,\n (c.record_data ->> 'schedule_id')::uuid as schedule_id,\n -- Get creator from the first change_sequence (initial creation)\n first_value(c.updated_by_user_id) over (\n partition by c.record_id\n order by c.logged_at\n ) as created_by_user_id,\n -- Use LAG to get the previous record state\n lag(c.record_data) over (\n partition by c.record_id\n order by c.logged_at\n ) as previous_record_data,\n -- Track change sequence\n row_number() over (\n partition by c.record_id\n order by c.logged_at\n ) as change_sequence\n from \"app\".\"logs\".\"changes\" c\n where c.table_name = 'appointments'\n and c.record_deleted_at is null\n and (c.record_data ->> 'appointment_type_id') is not null\n)\n\nselect\n change_id,\n appointment_id,\n modified_datetime,\n modified_by_user_id,\n created_by_user_id,\n patient_id,\n -- Current appointment details\n start_datetime,\n end_datetime,\n clinician_id,\n location_group_id,\n appointment_type_id,\n is_high_priority,\n status,\n schedule_id,\n -- Previous appointment details\n (previous_record_data ->> 'start_time')::timestamp as prev_start_datetime,\n (previous_record_data ->> 'end_time')::timestamp as prev_end_datetime,\n (previous_record_data ->> 'clinician_id') as prev_clinician_id,\n (previous_record_data ->> 'location_group_id') as prev_location_group_id,\n (previous_record_data ->> 'appointment_type_id') as prev_appointment_type_id,\n (previous_record_data ->> 'is_high_priority')::boolean as prev_is_high_priority,\n (previous_record_data ->> 'status') as prev_status,\n change_sequence\nfrom appointment_changes", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients": {"database": "app", "schema": "reporting", "name": "patients", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients.sql", "original_file_path": "models\\bases\\patients.sql", "unique_id": "model.tamanu_source_dbt.patients", "fqn": ["tamanu_source_dbt", "bases", "patients"], "alias": "patients", "checksum": {"name": "sha256", "checksum": "6e2d2af9162713cafefd9e038afff857a01dbd1a94ed5d837788a09c6e0a083c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient"], "description": "The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "email": {"name": "email", "description": "Email address of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__email"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.0700617, "relation_name": "\"app\".\"reporting\".\"patients\"", "raw_code": "select\r\n id,\r\n created_at as created_datetime,\r\n updated_at as updated_datetime\r\n {%- set columns = [\r\n {'expr': 'display_id', 'name': 'display_id', 'is_direct_identifier': true},\r\n {'expr': 'first_name', 'name': 'first_name', 'is_direct_identifier': true},\r\n {'expr': 'middle_name', 'name': 'middle_name', 'is_direct_identifier': true},\r\n {'expr': 'last_name', 'name': 'last_name', 'is_direct_identifier': true},\r\n {'expr': 'cultural_name', 'name': 'cultural_name', 'is_direct_identifier': true},\r\n {'expr': 'email', 'name': 'email', 'is_direct_identifier': true},\r\n {'expr': 'initcap(sex::text)', 'name': 'sex', 'is_direct_identifier': false},\r\n {'expr': 'date_of_birth::date', 'name': 'date_of_birth', 'is_direct_identifier': false},\r\n {'expr': 'date_of_death::timestamp', 'name': 'date_of_death', 'is_direct_identifier': false},\r\n {'expr': 'village_id', 'name': 'village_id', 'is_direct_identifier': false}\r\n ] -%}\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom {{ source('tamanu', 'patients') }}\r\nwhere deleted_at is null\r\n and id != '{{ var(\"test_patient\") }}'\r\n and visibility_status != 'merged'", "doc_blocks": ["doc.tamanu_source_dbt.table__patients"], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients.sql", "compiled": true, "compiled_code": "select\n id,\n created_at as created_datetime,\n updated_at as updated_datetime,\n display_id as display_id,\n first_name as first_name,\n middle_name as middle_name,\n last_name as last_name,\n cultural_name as cultural_name,\n email as email,\n initcap(sex::text) as sex,\n date_of_birth::date as date_of_birth,\n date_of_death::timestamp as date_of_death,\n village_id as village_id\nfrom \"app\".\"public\".\"patients\"\nwhere deleted_at is null\n and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n and visibility_status != 'merged'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients_access_logs": {"database": "app", "schema": "reporting", "name": "patients_access_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients_access_logs.sql", "original_file_path": "models\\bases\\patients_access_logs.sql", "unique_id": "model.tamanu_source_dbt.patients_access_logs", "fqn": ["tamanu_source_dbt", "bases", "patients_access_logs"], "alias": "patients_access_logs", "checksum": {"name": "sha256", "checksum": "6a1d0a0ddb46200746dab446cec594f037e828140742c41f875f79dbd5e4574b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration", "log"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration", "log"], "description": "Access logs of patient data", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients_access_logs.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "facility_id": {"name": "facility_id", "description": "The facility that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__facility_id"]}, "logged_at": {"name": "logged_at", "description": "The time string of when the record was accessed", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__logged_at"]}, "session_id": {"name": "session_id", "description": "The user session that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__session_id"]}, "device_id": {"name": "device_id", "description": "The id for the device that the user was accessing the record on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__device_id"]}, "is_mobile": {"name": "is_mobile", "description": "Whether or not the user accessed the record from mobile", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__is_mobile"]}, "version": {"name": "version", "description": "The version of tamanu the record was created on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__version"]}, "front_end_context": {"name": "front_end_context", "description": "A JSON object containing front end information about the record access", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__front_end_context"]}, "back_end_context": {"name": "back_end_context", "description": "A JSON object containing back end information about the record access", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__back_end_context"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients_access_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration", "log"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782422375.086035, "relation_name": "\"app\".\"reporting\".\"patients_access_logs\"", "raw_code": "select\n id,\n user_id,\n record_id as patient_id,\n facility_id,\n logged_at at time zone '{{ var(\"timezone\") }}' as logged_at,\n session_id,\n device_id,\n is_mobile,\n version,\n front_end_context,\n back_end_context\nfrom {{ source(\"logs__tamanu\", \"accesses\") }}\nwhere deleted_at is null\n and record_type = 'Patient'", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients_access_logs.sql", "compiled": true, "compiled_code": "select\n id,\n user_id,\n record_id as patient_id,\n facility_id,\n logged_at at time zone 'Australia/Sydney' as logged_at,\n session_id,\n device_id,\n is_mobile,\n version,\n front_end_context,\n back_end_context\nfrom \"app\".\"logs\".\"accesses\"\nwhere deleted_at is null\n and record_type = 'Patient'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients_change_logs": {"database": "app", "schema": "reporting", "name": "patients_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients_change_logs.sql", "original_file_path": "models\\bases\\patients_change_logs.sql", "unique_id": "model.tamanu_source_dbt.patients_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patients_change_logs"], "alias": "patients_change_logs", "checksum": {"name": "sha256", "checksum": "8632f3b94a79b72db0976148f8f1ec191bc9615129d73c25953149595dd85ae1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient", "log"], "description": "Change logs for The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table).", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in patients history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in patients history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "email": {"name": "email", "description": "Email address of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__email"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other` from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient from history.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patients history which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.0890193, "relation_name": "\"app\".\"reporting\".\"patients_change_logs\"", "raw_code": "{%- set columns = [\r\n {'expr': \"fc.record_data ->> 'display_id'\", 'name': 'display_id', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'first_name'\", 'name': 'first_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'middle_name'\", 'name': 'middle_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'last_name'\", 'name': 'last_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'cultural_name'\", 'name': 'cultural_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'email'\", 'name': 'email', 'is_direct_identifier': true},\r\n {'expr': \"initcap(fc.record_data ->> 'sex')\", 'name': 'sex', 'is_direct_identifier': false},\r\n {'expr': \"(fc.record_data ->> 'date_of_birth')::date\", 'name': 'date_of_birth', 'is_direct_identifier': false},\r\n {'expr': \"(fc.record_data ->> 'date_of_death')::timestamp\", 'name': 'date_of_death', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'village_id'\", 'name': 'village_id', 'is_direct_identifier': false},\r\n {'expr': \"(fc.record_data ->> 'created_at')::date\", 'name': 'registration_date', 'is_direct_identifier': false}\r\n] -%}\r\n\r\nwith filtered_changes as (\r\n {{ base_history_from_log('patients') }}\r\n and record_id != '{{ var(\"test_patient\") }}'\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at at time zone '{{ var(\"timezone\") }}' as logged_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as id\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__patients"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"], ["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log", "macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patients'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"patients\" t\n where t.deleted_at notnull\n )\n and record_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n)\n\nselect\n fc.changelog_id,\n fc.logged_at at time zone 'Australia/Sydney' as logged_at,\n fc.updated_by_user_id,\n fc.record_id as id,\n fc.record_data ->> 'display_id' as display_id,\n fc.record_data ->> 'first_name' as first_name,\n fc.record_data ->> 'middle_name' as middle_name,\n fc.record_data ->> 'last_name' as last_name,\n fc.record_data ->> 'cultural_name' as cultural_name,\n fc.record_data ->> 'email' as email,\n initcap(fc.record_data ->> 'sex') as sex,\n (fc.record_data ->> 'date_of_birth')::date as date_of_birth,\n (fc.record_data ->> 'date_of_death')::timestamp as date_of_death,\n fc.record_data ->> 'village_id' as village_id,\n (fc.record_data ->> 'created_at')::date as registration_date\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients_merged": {"database": "app", "schema": "reporting", "name": "patients_merged", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients_merged.sql", "original_file_path": "models\\bases\\patients_merged.sql", "unique_id": "model.tamanu_source_dbt.patients_merged", "fqn": ["tamanu_source_dbt", "bases", "patients_merged"], "alias": "patients_merged", "checksum": {"name": "sha256", "checksum": "608b46511e43c8d0c86454462e7a11e3b10b5b06c3e86208a1954a1da01ea864"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient"], "description": "Only includes patients that have been merged. The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "email": {"name": "email", "description": "Email address of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__email"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patients which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients_merged.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.0890193, "relation_name": "\"app\".\"reporting\".\"patients_merged\"", "raw_code": "select\r\n id\r\n {%- set columns = [\r\n {'expr': 'display_id', 'name': 'display_id', 'is_direct_identifier': true},\r\n {'expr': 'first_name', 'name': 'first_name', 'is_direct_identifier': true},\r\n {'expr': 'middle_name', 'name': 'middle_name', 'is_direct_identifier': true},\r\n {'expr': 'last_name', 'name': 'last_name', 'is_direct_identifier': true},\r\n {'expr': 'cultural_name', 'name': 'cultural_name', 'is_direct_identifier': true},\r\n {'expr': 'email', 'name': 'email', 'is_direct_identifier': true},\r\n {'expr': 'initcap(sex::text)', 'name': 'sex', 'is_direct_identifier': false},\r\n {'expr': 'date_of_birth::date', 'name': 'date_of_birth', 'is_direct_identifier': false},\r\n {'expr': 'date_of_death::timestamp', 'name': 'date_of_death', 'is_direct_identifier': false},\r\n {'expr': 'village_id', 'name': 'village_id', 'is_direct_identifier': false},\r\n {'expr': 'created_at::date', 'name': 'registration_date', 'is_direct_identifier': false}\r\n ] -%}\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom {{ source('tamanu', 'patients') }}\r\nwhere deleted_at is null\r\n and id != '{{ var(\"test_patient\") }}'\r\n and visibility_status = 'merged'", "doc_blocks": ["doc.tamanu_source_dbt.table__patients"], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients_merged.sql", "compiled": true, "compiled_code": "select\n id,\n display_id as display_id,\n first_name as first_name,\n middle_name as middle_name,\n last_name as last_name,\n cultural_name as cultural_name,\n email as email,\n initcap(sex::text) as sex,\n date_of_birth::date as date_of_birth,\n date_of_death::timestamp as date_of_death,\n village_id as village_id,\n created_at::date as registration_date\nfrom \"app\".\"public\".\"patients\"\nwhere deleted_at is null\n and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n and visibility_status = 'merged'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients_metadata": {"database": "app", "schema": "reporting", "name": "patients_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients_metadata.sql", "original_file_path": "models\\bases\\patients_metadata.sql", "unique_id": "model.tamanu_source_dbt.patients_metadata", "fqn": ["tamanu_source_dbt", "bases", "patients_metadata"], "alias": "patients_metadata", "checksum": {"name": "sha256", "checksum": "1d490a12778d1e209b3cb8bd8cee1be564501e0424a6a0ac50d85f40385e0edd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient", "log"], "description": "Metadata information extracted from the change logs for patients.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the patients table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the patients table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.0890193, "relation_name": "\"app\".\"reporting\".\"patients_metadata\"", "raw_code": "{{ get_metadata_from_changes('patients') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patients'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_additional_data": {"database": "app", "schema": "reporting", "name": "patient_additional_data", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_additional_data.sql", "original_file_path": "models\\bases\\patient_additional_data.sql", "unique_id": "model.tamanu_source_dbt.patient_additional_data", "fqn": ["tamanu_source_dbt", "bases", "patient_additional_data"], "alias": "patient_additional_data", "checksum": {"name": "sha256", "checksum": "0a7dcbc4dc0550d29a89c718b6d3ceb7425550e18bd47ade9320ebf6e94c766e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient"], "description": "Core or adjunct patient data that doesn't fit elsewhere, but is only downloaded to a facility once a\r\npatient is marked for sync.\r\n\r\nThis is often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`, `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and specify custom/non-standard data to be stored against patients.", "columns": {"patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) in patient_additional_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "title": {"name": "title", "description": "Patient name: title.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__title"]}, "marital_status": {"name": "marital_status", "description": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__marital_status"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "emergency_contact_name": {"name": "emergency_contact_name", "description": "Name of emergency contact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name"]}, "emergency_contact_number": {"name": "emergency_contact_number", "description": "Phone number of emergency contact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number"]}, "social_media": {"name": "social_media", "description": "Free-form social media contact.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__social_media"]}, "ethnicity_id": {"name": "ethnicity_id", "description": "Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__ethnicity_id"]}, "religion_id": {"name": "religion_id", "description": "Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__religion_id"]}, "nationality_id": {"name": "nationality_id", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "secondary_village_id": {"name": "secondary_village_id", "description": "Reference to patient administrative village of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\nSee also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_village_id"]}, "country_id": {"name": "country_id", "description": "Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_id"]}, "division_id": {"name": "division_id", "description": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__division_id"]}, "subdivision_id": {"name": "subdivision_id", "description": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__subdivision_id"]}, "medical_area_id": {"name": "medical_area_id", "description": "Reference to patient administrative medical area of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__medical_area_id"]}, "nursing_zone_id": {"name": "nursing_zone_id", "description": "Reference to patient administrative nursing zone of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id"]}, "settlement_id": {"name": "settlement_id", "description": "Reference to patient residence settlement ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__settlement_id"]}, "city_town": {"name": "city_town", "description": "Patient current address city or town.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__city_town"]}, "street_village": {"name": "street_village", "description": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__street_village"]}, "country_of_birth_id": {"name": "country_of_birth_id", "description": "Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id"]}, "place_of_birth": {"name": "place_of_birth", "description": "Free-form place of birth (typically a place name or country).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__place_of_birth"]}, "birth_certificate": {"name": "birth_certificate", "description": "Birth certificate identifier.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__birth_certificate"]}, "driving_license": {"name": "driving_license", "description": "Driving licence identifier.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__driving_license"]}, "passport": {"name": "passport", "description": "Passport number.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__passport"]}, "educational_level": {"name": "educational_level", "description": "Highest educational attainment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__educational_level"]}, "occupation_id": {"name": "occupation_id", "description": "Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__occupation_id"]}, "blood_type": {"name": "blood_type", "description": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__blood_type"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "health_center_id": {"name": "health_center_id", "description": "Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__health_center_id"]}, "insurer_id": {"name": "insurer_id", "description": "Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_id"]}, "insurer_policy_number": {"name": "insurer_policy_number", "description": "Policy number of patient insurance.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number"]}, "mother_id": {"name": "mother_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father_id": {"name": "father_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who registered the patient in Tamanu.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__registered_by_id"]}, "updated_by_field": {"name": "updated_by_field", "description": "JSON object recording the updated datetime for individual columns.\r\n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields are edited separately in\r\ndifferent facilities. The default sync strategy is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict, but this can lead to discarding important data in the case of PADs. This field\r\nis used to implement per-field \"last edit wins\" instead.", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patient_additional_data which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_additional_data.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.1027486, "relation_name": "\"app\".\"reporting\".\"patient_additional_data\"", "raw_code": "select\r\n patient_id\r\n {%- set columns = [\r\n {'expr': 'title', 'name': 'title', 'is_direct_identifier': false},\r\n {'expr': 'marital_status', 'name': 'marital_status', 'is_direct_identifier': false},\r\n {'expr': 'primary_contact_number', 'name': 'primary_contact_number', 'is_direct_identifier': true},\r\n {'expr': 'secondary_contact_number', 'name': 'secondary_contact_number', 'is_direct_identifier': true},\r\n {'expr': 'emergency_contact_name', 'name': 'emergency_contact_name', 'is_direct_identifier': true},\r\n {'expr': 'emergency_contact_number', 'name': 'emergency_contact_number', 'is_direct_identifier': true},\r\n {'expr': 'social_media', 'name': 'social_media', 'is_direct_identifier': true},\r\n {'expr': 'ethnicity_id', 'name': 'ethnicity_id', 'is_direct_identifier': false},\r\n {'expr': 'religion_id', 'name': 'religion_id', 'is_direct_identifier': false},\r\n {'expr': 'nationality_id', 'name': 'nationality_id', 'is_direct_identifier': false},\r\n {'expr': 'secondary_village_id', 'name': 'secondary_village_id', 'is_direct_identifier': false},\r\n {'expr': 'country_id', 'name': 'country_id', 'is_direct_identifier': false},\r\n {'expr': 'division_id', 'name': 'division_id', 'is_direct_identifier': false},\r\n {'expr': 'subdivision_id', 'name': 'subdivision_id', 'is_direct_identifier': false},\r\n {'expr': 'medical_area_id', 'name': 'medical_area_id', 'is_direct_identifier': false},\r\n {'expr': 'nursing_zone_id', 'name': 'nursing_zone_id', 'is_direct_identifier': false},\r\n {'expr': 'settlement_id', 'name': 'settlement_id', 'is_direct_identifier': true},\r\n {'expr': 'city_town', 'name': 'city_town', 'is_direct_identifier': true},\r\n {'expr': 'street_village', 'name': 'street_village', 'is_direct_identifier': true},\r\n {'expr': 'country_of_birth_id', 'name': 'country_of_birth_id', 'is_direct_identifier': false},\r\n {'expr': 'place_of_birth', 'name': 'place_of_birth', 'is_direct_identifier': false},\r\n {'expr': 'birth_certificate', 'name': 'birth_certificate', 'is_direct_identifier': true},\r\n {'expr': 'driving_license', 'name': 'driving_license', 'is_direct_identifier': true},\r\n {'expr': 'passport', 'name': 'passport', 'is_direct_identifier': true},\r\n {'expr': 'educational_level', 'name': 'educational_level', 'is_direct_identifier': false},\r\n {'expr': 'occupation_id', 'name': 'occupation_id', 'is_direct_identifier': false},\r\n {'expr': 'blood_type', 'name': 'blood_type', 'is_direct_identifier': false},\r\n {'expr': 'patient_billing_type_id', 'name': 'patient_billing_type_id', 'is_direct_identifier': false},\r\n {'expr': 'health_center_id', 'name': 'health_center_id', 'is_direct_identifier': false},\r\n {'expr': 'insurer_id', 'name': 'insurer_id', 'is_direct_identifier': false},\r\n {'expr': 'insurer_policy_number', 'name': 'insurer_policy_number', 'is_direct_identifier': true},\r\n {'expr': 'mother_id', 'name': 'mother_id', 'is_direct_identifier': false},\r\n {'expr': 'father_id', 'name': 'father_id', 'is_direct_identifier': false},\r\n {'expr': 'registered_by_id', 'name': 'registered_by_id', 'is_direct_identifier': false},\r\n {'expr': 'updated_at_by_field', 'name': 'updated_by_field', 'is_direct_identifier': false},\r\n {'expr': 'created_at::date', 'name': 'registration_date', 'is_direct_identifier': false}\r\n ] -%}\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom {{ source('tamanu', 'patient_additional_data') }}\r\nwhere deleted_at is null\r\n and id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_additional_data"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_additional_data.sql", "compiled": true, "compiled_code": "select\n patient_id,\n title as title,\n marital_status as marital_status,\n primary_contact_number as primary_contact_number,\n secondary_contact_number as secondary_contact_number,\n emergency_contact_name as emergency_contact_name,\n emergency_contact_number as emergency_contact_number,\n social_media as social_media,\n ethnicity_id as ethnicity_id,\n religion_id as religion_id,\n nationality_id as nationality_id,\n secondary_village_id as secondary_village_id,\n country_id as country_id,\n division_id as division_id,\n subdivision_id as subdivision_id,\n medical_area_id as medical_area_id,\n nursing_zone_id as nursing_zone_id,\n settlement_id as settlement_id,\n city_town as city_town,\n street_village as street_village,\n country_of_birth_id as country_of_birth_id,\n place_of_birth as place_of_birth,\n birth_certificate as birth_certificate,\n driving_license as driving_license,\n passport as passport,\n educational_level as educational_level,\n occupation_id as occupation_id,\n blood_type as blood_type,\n patient_billing_type_id as patient_billing_type_id,\n health_center_id as health_center_id,\n insurer_id as insurer_id,\n insurer_policy_number as insurer_policy_number,\n mother_id as mother_id,\n father_id as father_id,\n registered_by_id as registered_by_id,\n updated_at_by_field as updated_by_field,\n created_at::date as registration_date\nfrom \"app\".\"public\".\"patient_additional_data\"\nwhere deleted_at is null\n and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_additional_data_change_logs": {"database": "app", "schema": "reporting", "name": "patient_additional_data_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_additional_data_change_logs.sql", "original_file_path": "models\\bases\\patient_additional_data_change_logs.sql", "unique_id": "model.tamanu_source_dbt.patient_additional_data_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_additional_data_change_logs"], "alias": "patient_additional_data_change_logs", "checksum": {"name": "sha256", "checksum": "16de1cd6976c01dcd7cee4358a77b3d18e623ed54c61c671a89d605320ad47f1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient", "log"], "description": "Change logs of Core or adjunct patient data that doesn't fit elsewhere, but is only downloaded to a facility once a\r\npatient is marked for sync.\r\n\r\nThis is often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`, `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and specify custom/non-standard data to be stored against patients.", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in patient additional data history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in patient additional data history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) in patient_additional_data from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "title": {"name": "title", "description": "Patient name: title. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__title"]}, "marital_status": {"name": "marital_status", "description": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown` from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__marital_status"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "emergency_contact_name": {"name": "emergency_contact_name", "description": "Name of emergency contact. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name"]}, "emergency_contact_number": {"name": "emergency_contact_number", "description": "Phone number of emergency contact. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number"]}, "social_media": {"name": "social_media", "description": "Free-form social media contact.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__social_media"]}, "ethnicity_id": {"name": "ethnicity_id", "description": "Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__ethnicity_id"]}, "religion_id": {"name": "religion_id", "description": "Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__religion_id"]}, "nationality_id": {"name": "nationality_id", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "secondary_village_id": {"name": "secondary_village_id", "description": "Reference to patient administrative village of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\nSee also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_village_id"]}, "country_id": {"name": "country_id", "description": "Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_id"]}, "division_id": {"name": "division_id", "description": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__division_id"]}, "subdivision_id": {"name": "subdivision_id", "description": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__subdivision_id"]}, "medical_area_id": {"name": "medical_area_id", "description": "Reference to patient administrative medical area of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__medical_area_id"]}, "nursing_zone_id": {"name": "nursing_zone_id", "description": "Reference to patient administrative nursing zone of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id"]}, "settlement_id": {"name": "settlement_id", "description": "Reference to patient residence settlement ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__settlement_id"]}, "city_town": {"name": "city_town", "description": "Patient current address city or town.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__city_town"]}, "street_village": {"name": "street_village", "description": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__street_village"]}, "country_of_birth_id": {"name": "country_of_birth_id", "description": "Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id"]}, "place_of_birth": {"name": "place_of_birth", "description": "Free-form place of birth (typically a place name or country). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__place_of_birth"]}, "birth_certificate": {"name": "birth_certificate", "description": "Birth certificate identifier. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__birth_certificate"]}, "driving_license": {"name": "driving_license", "description": "Driving licence identifier. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__driving_license"]}, "passport": {"name": "passport", "description": "Passport number. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__passport"]}, "educational_level": {"name": "educational_level", "description": "Highest educational attainment. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__educational_level"]}, "occupation_id": {"name": "occupation_id", "description": "Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__occupation_id"]}, "blood_type": {"name": "blood_type", "description": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-` from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__blood_type"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "Reference to patient billing type. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "health_center_id": {"name": "health_center_id", "description": "Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__health_center_id"]}, "insurer_id": {"name": "insurer_id", "description": "Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_id"]}, "insurer_policy_number": {"name": "insurer_policy_number", "description": "Policy number of patient insurance. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number"]}, "mother_id": {"name": "mother_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father_id": {"name": "father_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who registered the patient in Tamanu. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__registered_by_id"]}, "updated_by_field": {"name": "updated_by_field", "description": "JSON object recording the updated datetime for individual columns.\r\n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields are edited separately in\r\ndifferent facilities. The default sync strategy is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict, but this can lead to discarding important data in the case of PADs. This field\r\nis used to implement per-field \"last edit wins\" instead. from history.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patient additional data history which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_additional_data_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.1027486, "relation_name": "\"app\".\"reporting\".\"patient_additional_data_change_logs\"", "raw_code": "{%- set columns = [\r\n {'expr': \"fc.record_data ->> 'title'\", 'name': 'title', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'marital_status'\", 'name': 'marital_status', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'primary_contact_number'\", 'name': 'primary_contact_number', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'secondary_contact_number'\", 'name': 'secondary_contact_number', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'emergency_contact_name'\", 'name': 'emergency_contact_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'emergency_contact_number'\", 'name': 'emergency_contact_number', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'social_media'\", 'name': 'social_media', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'ethnicity_id'\", 'name': 'ethnicity_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'religion_id'\", 'name': 'religion_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'nationality_id'\", 'name': 'nationality_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'secondary_village_id'\", 'name': 'secondary_village_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'country_id'\", 'name': 'country_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'division_id'\", 'name': 'division_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'subdivision_id'\", 'name': 'subdivision_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'medical_area_id'\", 'name': 'medical_area_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'nursing_zone_id'\", 'name': 'nursing_zone_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'settlement_id'\", 'name': 'settlement_id', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'city_town'\", 'name': 'city_town', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'street_village'\", 'name': 'street_village', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'country_of_birth_id'\", 'name': 'country_of_birth_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'place_of_birth'\", 'name': 'place_of_birth', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'birth_certificate'\", 'name': 'birth_certificate', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'driving_license'\", 'name': 'driving_license', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'passport'\", 'name': 'passport', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'educational_level'\", 'name': 'educational_level', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'occupation_id'\", 'name': 'occupation_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'blood_type'\", 'name': 'blood_type', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'patient_billing_type_id'\", 'name': 'patient_billing_type_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'health_center_id'\", 'name': 'health_center_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'insurer_id'\", 'name': 'insurer_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'insurer_policy_number'\", 'name': 'insurer_policy_number', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'mother_id'\", 'name': 'mother_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'father_id'\", 'name': 'father_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'registered_by_id'\", 'name': 'registered_by_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data -> 'updated_at_by_field'\", 'name': 'updated_by_field', 'is_direct_identifier': false},\r\n {'expr': \"(fc.record_data ->> 'created_at')::date\", 'name': 'registration_date', 'is_direct_identifier': false}\r\n] -%}\r\n\r\nwith filtered_changes as (\r\n {{ base_history_from_log('patient_additional_data') }}\r\n and record_id != '{{ var(\"test_patient\") }}' -- noqa: ST10\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at at time zone '{{ var(\"timezone\") }}' as logged_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as patient_id\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_additional_data"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"], ["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log", "macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_additional_data_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patient_additional_data'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"patient_additional_data\" t\n where t.deleted_at notnull\n )\n and record_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' -- noqa: ST10\n)\n\nselect\n fc.changelog_id,\n fc.logged_at at time zone 'Australia/Sydney' as logged_at,\n fc.updated_by_user_id,\n fc.record_id as patient_id,\n fc.record_data ->> 'title' as title,\n fc.record_data ->> 'marital_status' as marital_status,\n fc.record_data ->> 'primary_contact_number' as primary_contact_number,\n fc.record_data ->> 'secondary_contact_number' as secondary_contact_number,\n fc.record_data ->> 'emergency_contact_name' as emergency_contact_name,\n fc.record_data ->> 'emergency_contact_number' as emergency_contact_number,\n fc.record_data ->> 'social_media' as social_media,\n fc.record_data ->> 'ethnicity_id' as ethnicity_id,\n fc.record_data ->> 'religion_id' as religion_id,\n fc.record_data ->> 'nationality_id' as nationality_id,\n fc.record_data ->> 'secondary_village_id' as secondary_village_id,\n fc.record_data ->> 'country_id' as country_id,\n fc.record_data ->> 'division_id' as division_id,\n fc.record_data ->> 'subdivision_id' as subdivision_id,\n fc.record_data ->> 'medical_area_id' as medical_area_id,\n fc.record_data ->> 'nursing_zone_id' as nursing_zone_id,\n fc.record_data ->> 'settlement_id' as settlement_id,\n fc.record_data ->> 'city_town' as city_town,\n fc.record_data ->> 'street_village' as street_village,\n fc.record_data ->> 'country_of_birth_id' as country_of_birth_id,\n fc.record_data ->> 'place_of_birth' as place_of_birth,\n fc.record_data ->> 'birth_certificate' as birth_certificate,\n fc.record_data ->> 'driving_license' as driving_license,\n fc.record_data ->> 'passport' as passport,\n fc.record_data ->> 'educational_level' as educational_level,\n fc.record_data ->> 'occupation_id' as occupation_id,\n fc.record_data ->> 'blood_type' as blood_type,\n fc.record_data ->> 'patient_billing_type_id' as patient_billing_type_id,\n fc.record_data ->> 'health_center_id' as health_center_id,\n fc.record_data ->> 'insurer_id' as insurer_id,\n fc.record_data ->> 'insurer_policy_number' as insurer_policy_number,\n fc.record_data ->> 'mother_id' as mother_id,\n fc.record_data ->> 'father_id' as father_id,\n fc.record_data ->> 'registered_by_id' as registered_by_id,\n fc.record_data -> 'updated_at_by_field' as updated_by_field,\n (fc.record_data ->> 'created_at')::date as registration_date\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_allergies": {"database": "app", "schema": "reporting", "name": "patient_allergies", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_allergies.sql", "original_file_path": "models\\bases\\patient_allergies.sql", "unique_id": "model.tamanu_source_dbt.patient_allergies", "fqn": ["tamanu_source_dbt", "bases", "patient_allergies"], "alias": "patient_allergies", "checksum": {"name": "sha256", "checksum": "6685b33a6b5c1b98449620bfb28a079a3bda9bfdb3f3fd9f5de925b9fcfbfeff"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "List of allergies known of the patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Allergies\".\r\n\r\nSee also: `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`, `public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_allergies.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__patient_id"]}, "allergy_id": {"name": "allergy_id", "description": "Reference to an allergy ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__allergy_id"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this allergy was recorded.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__recorded_date"]}, "recorded_by": {"name": "recorded_by", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this allergy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__practitioner_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_allergies.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1027486, "relation_name": "\"app\".\"reporting\".\"patient_allergies\"", "raw_code": "select\r\n id,\r\n patient_id,\r\n allergy_id,\r\n recorded_date::date as recorded_date,\r\n practitioner_id as recorded_by\r\nfrom {{ source('tamanu', 'patient_allergies') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_allergies"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_allergies.sql", "compiled": true, "compiled_code": "select\n id,\n patient_id,\n allergy_id,\n recorded_date::date as recorded_date,\n practitioner_id as recorded_by\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_birth_data": {"database": "app", "schema": "reporting", "name": "patient_birth_data", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_birth_data.sql", "original_file_path": "models\\bases\\patient_birth_data.sql", "unique_id": "model.tamanu_source_dbt.patient_birth_data", "fqn": ["tamanu_source_dbt", "bases", "patient_birth_data"], "alias": "patient_birth_data", "checksum": {"name": "sha256", "checksum": "d884675f759eaf593300b85741ef2b6e017627964a7f5fa887896aa5829062d2"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Information about the birth of the patient, if their birth was recorded into Tamanu.\r\n\r\nThis is specifically data about the newborn, and only the birth-relevant data.\r\nOther patient data is found in the normal tables i.e. `patients`, `patient_additional_data`, etc.", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_birth_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__patient_id"]}, "birth_time": {"name": "birth_time", "description": "Datetime of birth.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__time_of_birth"]}, "gestational_age_estimate": {"name": "gestational_age_estimate", "description": "Gestational age estimate (weeks).", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate"]}, "attendant_at_birth": {"name": "attendant_at_birth", "description": "The type of the attendant at birth.\r\n\r\nOne of:\r\n- `doctor`\r\n- `midwife`\r\n- `nurse`\r\n- `traditional_birth_attentdant`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth"]}, "name_of_attendant_at_birth": {"name": "name_of_attendant_at_birth", "description": "Name of attendant at birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth"]}, "birth_type": {"name": "birth_type", "description": "`single` or `plural` birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_type"]}, "birth_delivery_type": {"name": "birth_delivery_type", "description": "Type of delivery.\r\n\r\nOne of:\r\n- `normal_vaginal_delivery`\r\n- `breech`\r\n- `emergency_c_section`\r\n- `elective_c_section`\r\n- `vacuum_extraction`\r\n- `forceps`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type"]}, "birth_weight": {"name": "birth_weight", "description": "Weight in kg at birth.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_weight"]}, "birth_length": {"name": "birth_length", "description": "Length in cm at birth.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_length"]}, "apgar_score_one_minute": {"name": "apgar_score_one_minute", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) one minute after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute"]}, "apgar_score_five_minutes": {"name": "apgar_score_five_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) five minutes after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes"]}, "apgar_score_ten_minutes": {"name": "apgar_score_ten_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) ten minutes after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes"]}, "registered_birth_place": {"name": "registered_birth_place", "description": "Type of the actual birth place.\r\n\r\nOne of:\r\n- `health_facility`\r\n- `home`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__registered_birth_place"]}, "birth_facility_id": {"name": "birth_facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) the birth was recorded at.\r\n\r\nThis is only required when `registered_birth_place` is `health_facility`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_facility_id"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patient_birth_data.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_birth_data.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1027486, "relation_name": "\"app\".\"reporting\".\"patient_birth_data\"", "raw_code": "select\r\n patient_id,\r\n time_of_birth::time as birth_time,\r\n gestational_age_estimate,\r\n attendant_at_birth,\r\n name_of_attendant_at_birth,\r\n birth_type,\r\n birth_delivery_type,\r\n birth_weight,\r\n birth_length,\r\n apgar_score_one_minute,\r\n apgar_score_five_minutes,\r\n apgar_score_ten_minutes,\r\n registered_birth_place,\r\n birth_facility_id,\r\n created_at::date as registration_date\r\nfrom {{ source('tamanu', 'patient_birth_data') }}\r\nwhere deleted_at is null\r\n and id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_birth_data"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_birth_data.sql", "compiled": true, "compiled_code": "select\n patient_id,\n time_of_birth::time as birth_time,\n gestational_age_estimate,\n attendant_at_birth,\n name_of_attendant_at_birth,\n birth_type,\n birth_delivery_type,\n birth_weight,\n birth_length,\n apgar_score_one_minute,\n apgar_score_five_minutes,\n apgar_score_ten_minutes,\n registered_birth_place,\n birth_facility_id,\n created_at::date as registration_date\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere deleted_at is null\n and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_care_plans": {"database": "app", "schema": "reporting", "name": "patient_care_plans", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_care_plans.sql", "original_file_path": "models\\bases\\patient_care_plans.sql", "unique_id": "model.tamanu_source_dbt.patient_care_plans", "fqn": ["tamanu_source_dbt", "bases", "patient_care_plans"], "alias": "patient_care_plans", "checksum": {"name": "sha256", "checksum": "eb4f2bb1fe1ee00b93e8b84cfcda79699979052f1e9ec69731e4b11ef943e79c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "List of current care plans the patient is on.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Care plans\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_conditions`, `public.patient_family_histories`,\r\n`public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_care_plans.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "care_plan_datetime": {"name": "care_plan_datetime", "description": "Local date for the record in patient_care_plans.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) who prescribed this care plan.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__examiner_id"]}, "care_plan_id": {"name": "care_plan_id", "description": "Reference to the care plan ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__care_plan_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_care_plans.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1027486, "relation_name": "\"app\".\"reporting\".\"patient_care_plans\"", "raw_code": "select\r\n id,\r\n date::timestamp as care_plan_datetime,\r\n patient_id,\r\n examiner_id as clinician_id,\r\n care_plan_id\r\nfrom {{ source('tamanu', 'patient_care_plans') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_care_plans"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_care_plans.sql", "compiled": true, "compiled_code": "select\n id,\n date::timestamp as care_plan_datetime,\n patient_id,\n examiner_id as clinician_id,\n care_plan_id\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_conditions": {"database": "app", "schema": "reporting", "name": "patient_conditions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_conditions.sql", "original_file_path": "models\\bases\\patient_conditions.sql", "unique_id": "model.tamanu_source_dbt.patient_conditions", "fqn": ["tamanu_source_dbt", "bases", "patient_conditions"], "alias": "patient_conditions", "checksum": {"name": "sha256", "checksum": "c0579283389e6bee224848bfec97c60a824a1684ad6153d7a0fb60271213c920"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "List of ongoing conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Ongoing conditions\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`,\r\n`public.patient_family_histories`, `public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "recorded_datetime": {"name": "recorded_datetime", "description": "Datetime at which this issue was recorded.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__recorded_date"]}, "note": {"name": "note", "description": "Free-form description of this condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__note"]}, "condition_id": {"name": "condition_id", "description": "Reference to a diagnosis describing this issue ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__condition_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__patient_id"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording this\r\ncondition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__examiner_id"]}, "is_resolved": {"name": "is_resolved", "description": "Whether the condition has resolved.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolved"]}, "resolved_datetime": {"name": "resolved_datetime", "description": "Datetime at which this issue was resolved.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_date"]}, "resolved_by_id": {"name": "resolved_by_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording the\r\nresolution of this condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_practitioner_id"]}, "resolution_note": {"name": "resolution_note", "description": "Free-form description or notes about the resolution of this condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_note"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_conditions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1180148, "relation_name": "\"app\".\"reporting\".\"patient_conditions\"", "raw_code": "select\r\n id,\r\n recorded_date::timestamp as recorded_datetime,\r\n note,\r\n condition_id,\r\n patient_id,\r\n examiner_id as recorded_by_id,\r\n resolved as is_resolved,\r\n resolution_date::timestamp as resolved_datetime,\r\n resolution_practitioner_id as resolved_by_id,\r\n resolution_note\r\nfrom {{ source('tamanu', 'patient_conditions') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_conditions"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_conditions.sql", "compiled": true, "compiled_code": "select\n id,\n recorded_date::timestamp as recorded_datetime,\n note,\n condition_id,\n patient_id,\n examiner_id as recorded_by_id,\n resolved as is_resolved,\n resolution_date::timestamp as resolved_datetime,\n resolution_practitioner_id as resolved_by_id,\n resolution_note\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_death_contributing_causes": {"database": "app", "schema": "reporting", "name": "patient_death_contributing_causes", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_death_contributing_causes.sql", "original_file_path": "models\\bases\\patient_death_contributing_causes.sql", "unique_id": "model.tamanu_source_dbt.patient_death_contributing_causes", "fqn": ["tamanu_source_dbt", "bases", "patient_death_contributing_causes"], "alias": "patient_death_contributing_causes", "checksum": {"name": "sha256", "checksum": "8dbfe45201dff63b401ccb04dd03429745c9bab36330ff7129277805d4d07c6d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Contributing causes recorded with the patient's death data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in contributing_death_causes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "min_after_onset": {"name": "min_after_onset", "description": "Time between onset of recorded cause and death in minutes.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__time_after_onset"]}, "patient_death_data_id": {"name": "patient_death_data_id", "description": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id"]}, "condition_id": {"name": "condition_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_death_contributing_causes.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1180148, "relation_name": "\"app\".\"reporting\".\"patient_death_contributing_causes\"", "raw_code": "select\r\n cdc.id,\r\n cdc.time_after_onset as mins_after_onset,\r\n cdc.patient_death_data_id,\r\n cdc.condition_id\r\nfrom {{ source('tamanu', 'contributing_death_causes') }} cdc\r\njoin {{ source('tamanu', 'patient_death_data') }} pdd on pdd.id = cdc.patient_death_data_id\r\nwhere cdc.deleted_at is null\r\n and pdd.deleted_at is null\r\n and pdd.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__contributing_death_causes"], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_death_contributing_causes.sql", "compiled": true, "compiled_code": "select\n cdc.id,\n cdc.time_after_onset as mins_after_onset,\n cdc.patient_death_data_id,\n cdc.condition_id\nfrom \"app\".\"public\".\"contributing_death_causes\" cdc\njoin \"app\".\"public\".\"patient_death_data\" pdd on pdd.id = cdc.patient_death_data_id\nwhere cdc.deleted_at is null\n and pdd.deleted_at is null\n and pdd.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_death_data": {"database": "app", "schema": "reporting", "name": "patient_death_data", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_death_data.sql", "original_file_path": "models\\bases\\patient_death_data.sql", "unique_id": "model.tamanu_source_dbt.patient_death_data", "fqn": ["tamanu_source_dbt", "bases", "patient_death_data"], "alias": "patient_death_data", "checksum": {"name": "sha256", "checksum": "0606e5802809c3a219abc95add67dab24a6690c1d318e1caea360fce79b1847a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Information about a patient's death.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_death_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "manner": {"name": "manner", "description": "A descriptive text specifying the manner of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner"]}, "had_recent_surgery": {"name": "had_recent_surgery", "description": "Whether the deceased patient had a recent surgery, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__recent_surgery"]}, "last_surgery_date": {"name": "last_surgery_date", "description": "Datetime of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_date"]}, "last_surgery_reason_id": {"name": "last_surgery_reason_id", "description": "Reference to a `diagnosis` ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) for the\r\nreason of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id"]}, "external_cause_date": {"name": "external_cause_date", "description": "Datetime of external cause of death, if applicable.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_date"]}, "external_cause_location": {"name": "external_cause_location", "description": "Physical location of external cause of death, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_location"]}, "external_cause_notes": {"name": "external_cause_notes", "description": "Free-form description of the location of external cause of death, if applicable.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_notes"]}, "was_pregnant": {"name": "was_pregnant", "description": "Whether the deceased was pregnant.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__was_pregnant"]}, "pregnancy_contributed": {"name": "pregnancy_contributed", "description": "Whether the pregnancy contributed to the death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed"]}, "was_fetal_or_infant": {"name": "was_fetal_or_infant", "description": "Whether the deceased was themselves a foetus or infant.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__fetal_or_infant"]}, "was_stillborn": {"name": "was_stillborn", "description": "Whether the deceased was themselves stillborn.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__stillborn"]}, "birth_weight": {"name": "birth_weight", "description": "If the deceased was a foetus, stillborn, or infant, their birth weight.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__birth_weight"]}, "was_within_day_of_birth": {"name": "was_within_day_of_birth", "description": "If the deceased was a foetus, stillborn, or infant, whether their passing was on the day of their birth.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__within_day_of_birth"]}, "hours_survived_since_birth": {"name": "hours_survived_since_birth", "description": "If the deceased was an infant, how many days since the birth passed before their death.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth"]}, "carrier_age": {"name": "carrier_age", "description": "If the deceased was a foetus, stillborn, or infant, the age of the carrier.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_age"]}, "carrier_pregnancy_weeks": {"name": "carrier_pregnancy_weeks", "description": "If the deceased was a foetus, stillborn, or infant, how many weeks pregnant their carrier was.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks"]}, "was_outside_health_facility": {"name": "was_outside_health_facility", "description": "Whether the death occurred outside of the facility.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__outside_health_facility"]}, "primary_cause_mins_after_onset": {"name": "primary_cause_mins_after_onset", "description": "The time in minutes after onset of the primary cause of death, if known.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset"]}, "primary_cause_condition_id": {"name": "primary_cause_condition_id", "description": "Reference to the primary cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if known.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id"]}, "antecedent_cause1_mins_after_onset": {"name": "antecedent_cause1_mins_after_onset", "description": "The time in minutes after onset of an antecedent (1) cause of death, if applicable.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_time_after_onset"]}, "antecedent_cause1_condition_id": {"name": "antecedent_cause1_condition_id", "description": "Reference to an antecedent (1) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id"]}, "antecedent_cause2_mins_after_onset": {"name": "antecedent_cause2_mins_after_onset", "description": "The time in minutes after onset of an antecedent (2) cause of death, if applicable.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_time_after_onset"]}, "antecedent_cause2_condition_id": {"name": "antecedent_cause2_condition_id", "description": "Reference to an antecedent (2) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id"]}, "antecedent_cause3_mins_after_onset": {"name": "antecedent_cause3_mins_after_onset", "description": "The time in minutes after onset of an antecedent (3) cause of death, if applicable.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_time_after_onset"]}, "antecedent_cause3_condition_id": {"name": "antecedent_cause3_condition_id", "description": "Reference to an antecedent (3) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_condition_id"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients) who died.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__patient_id"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who is recording this death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__clinician_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where this death is being recorded.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__facility_id"]}, "is_final": {"name": "is_final", "description": "Whether this date record is final.\r\n\r\nIn Tamanu, this is set by a supervisor after review, and cannot be reversed; it causes all fields to\r\nbecome read-only. The only way to undo this record is through a `death_revert_logs`.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__is_final"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patient_death_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "autopsy_requested": {"name": "autopsy_requested", "description": "Whether an autopsy was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__autopsy_requested"]}, "autopsy_findings_used": {"name": "autopsy_findings_used", "description": "If an autopsy was requested, whether the findings were used in the death certification.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__autopsy_findings_used"]}, "manner_of_death_description": {"name": "manner_of_death_description", "description": "If an external cause occurred, a text description on how and if applicable, notes of poisoning agent.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner_of_death_description"]}, "pregnancy_moment": {"name": "pregnancy_moment", "description": "The status of the pregnancy of the deceased, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_moment"]}, "multiple_pregnancy": {"name": "multiple_pregnancy", "description": "Whether the deceased infant happened in a multiple pregnancy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__multiple_pregnancy"]}, "mother_condition_description": {"name": "mother_condition_description", "description": "A text description stating the conditions of mother that affected the fetus/newborn, if the death was perinatal.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__mother_condition_description"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_death_data.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1180148, "relation_name": "\"app\".\"reporting\".\"patient_death_data\"", "raw_code": "select\r\n id,\r\n manner,\r\n recent_surgery as had_recent_surgery,\r\n last_surgery_date::date as last_surgery_date,\r\n last_surgery_reason_id,\r\n external_cause_date::date as external_cause_date,\r\n external_cause_location,\r\n external_cause_notes,\r\n was_pregnant,\r\n pregnancy_contributed,\r\n fetal_or_infant as was_fetal_or_infant,\r\n stillborn as was_stillborn,\r\n birth_weight,\r\n within_day_of_birth as was_within_day_of_birth,\r\n hours_survived_since_birth,\r\n carrier_age,\r\n carrier_pregnancy_weeks,\r\n outside_health_facility as was_outside_health_facility,\r\n primary_cause_time_after_onset as primary_cause_mins_after_onset,\r\n primary_cause_condition_id,\r\n antecedent_cause1_time_after_onset as antecedent_cause1_mins_after_onset,\r\n antecedent_cause1_condition_id,\r\n antecedent_cause2_time_after_onset as antecedent_cause2_mins_after_onset,\r\n antecedent_cause2_condition_id,\r\n antecedent_cause3_time_after_onset as antecedent_cause3_mins_after_onset,\r\n antecedent_cause3_condition_id,\r\n patient_id,\r\n clinician_id as recorded_by_id,\r\n facility_id,\r\n is_final,\r\n visibility_status,\r\n autopsy_requested,\r\n autopsy_findings_used,\r\n manner_of_death_description,\r\n pregnancy_moment,\r\n multiple_pregnancy,\r\n mother_condition_description\r\nfrom {{ source('tamanu', 'patient_death_data') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_death_data"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_death_data.sql", "compiled": true, "compiled_code": "select\n id,\n manner,\n recent_surgery as had_recent_surgery,\n last_surgery_date::date as last_surgery_date,\n last_surgery_reason_id,\n external_cause_date::date as external_cause_date,\n external_cause_location,\n external_cause_notes,\n was_pregnant,\n pregnancy_contributed,\n fetal_or_infant as was_fetal_or_infant,\n stillborn as was_stillborn,\n birth_weight,\n within_day_of_birth as was_within_day_of_birth,\n hours_survived_since_birth,\n carrier_age,\n carrier_pregnancy_weeks,\n outside_health_facility as was_outside_health_facility,\n primary_cause_time_after_onset as primary_cause_mins_after_onset,\n primary_cause_condition_id,\n antecedent_cause1_time_after_onset as antecedent_cause1_mins_after_onset,\n antecedent_cause1_condition_id,\n antecedent_cause2_time_after_onset as antecedent_cause2_mins_after_onset,\n antecedent_cause2_condition_id,\n antecedent_cause3_time_after_onset as antecedent_cause3_mins_after_onset,\n antecedent_cause3_condition_id,\n patient_id,\n clinician_id as recorded_by_id,\n facility_id,\n is_final,\n visibility_status,\n autopsy_requested,\n autopsy_findings_used,\n manner_of_death_description,\n pregnancy_moment,\n multiple_pregnancy,\n mother_condition_description\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_facilities": {"database": "app", "schema": "reporting", "name": "patient_facilities", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_facilities.sql", "original_file_path": "models\\bases\\patient_facilities.sql", "unique_id": "model.tamanu_source_dbt.patient_facilities", "fqn": ["tamanu_source_dbt", "bases", "patient_facilities"], "alias": "patient_facilities", "checksum": {"name": "sha256", "checksum": "672bd9c337f992cf9f22c5c9525c266619488dd18cac16fb95a1683268763a12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Tracks which patients are of interest to which facilities.\r\n\r\nThis is used to refine sync data: only patient data related to these patients is synced to a\r\nfacility (plus general data, and some exceptions apply like vaccine data under some conditions).\r\n\r\nIn Tamanu, this can be set manually on the facility server (via the \"mark for sync\" button), or\r\ncentrally (via some labs / vaccine programs, or via bulk-imports).\r\n\r\n_(\"Joe Patient attends X Clinic\" is clinical info; even though an entry in patient facilities\r\ndoesn't necessarily imply this, it often does.)_", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_facilities.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_facilities__patient_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_facilities__facility_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_facilities.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1180148, "relation_name": "\"app\".\"reporting\".\"patient_facilities\"", "raw_code": "select\r\n id,\r\n created_at,\r\n patient_id,\r\n facility_id\r\nfrom {{ source('tamanu', 'patient_facilities') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_facilities"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_facilities.sql", "compiled": true, "compiled_code": "select\n id,\n created_at,\n patient_id,\n facility_id\nfrom \"app\".\"public\".\"patient_facilities\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_family_histories": {"database": "app", "schema": "reporting", "name": "patient_family_histories", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_family_histories.sql", "original_file_path": "models\\bases\\patient_family_histories.sql", "unique_id": "model.tamanu_source_dbt.patient_family_histories", "fqn": ["tamanu_source_dbt", "bases", "patient_family_histories"], "alias": "patient_family_histories", "checksum": {"name": "sha256", "checksum": "a67fc1038c9a348aa4991b8e88a0491dd07cca150cab3d9632dfa56bfc1ca8c0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "List of family history conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Family history\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_family_histories.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "recorded_datetime": {"name": "recorded_datetime", "description": "Datetime at which this issue was recorded.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__recorded_date"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this history.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__practitioner_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "Reference to a diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))\r\ndescribing this issue.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__diagnosis_id"]}, "relationship": {"name": "relationship", "description": "Free-form description of the family relationship.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__relationship"]}, "note": {"name": "note", "description": "Free-form description of this issue.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__note"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_family_histories.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1180148, "relation_name": "\"app\".\"reporting\".\"patient_family_histories\"", "raw_code": "select\r\n id,\r\n recorded_date::timestamp as recorded_datetime,\r\n patient_id,\r\n practitioner_id as clinician_id,\r\n diagnosis_id,\r\n relationship,\r\n note\r\nfrom {{ source('tamanu', 'patient_family_histories') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_family_histories"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_family_histories.sql", "compiled": true, "compiled_code": "select\n id,\n recorded_date::timestamp as recorded_datetime,\n patient_id,\n practitioner_id as clinician_id,\n diagnosis_id,\n relationship,\n note\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_field_values": {"database": "app", "schema": "reporting", "name": "patient_field_values", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_field_values.sql", "original_file_path": "models\\bases\\patient_field_values.sql", "unique_id": "model.tamanu_source_dbt.patient_field_values", "fqn": ["tamanu_source_dbt", "bases", "patient_field_values"], "alias": "patient_field_values", "checksum": {"name": "sha256", "checksum": "f539fcc1d6c3dcf6127e3e6e7dec4a4edd7104e5379459c206ded0b2867d2bf8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient"], "description": "Values recorded in custom patient fields.\r\n\r\nThe `id` column is generated to enforce one value row per field definition per patient.", "columns": {"value": {"name": "value", "description": "Value.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__value"]}, "definition_id": {"name": "definition_id", "description": "The [field definition](#!/source/source.tamanu.tamanu.patient_field_definitions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__definition_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__patient_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_field_values.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.1341033, "relation_name": "\"app\".\"reporting\".\"patient_field_values\"", "raw_code": "select\r\n patient_id,\r\n definition_id,\r\n value\r\nfrom {{ source('tamanu', 'patient_field_values') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_field_values"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_field_values.sql", "compiled": true, "compiled_code": "select\n patient_id,\n definition_id,\n value\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_program_registrations": {"database": "app", "schema": "reporting", "name": "patient_program_registrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registrations.sql", "original_file_path": "models\\bases\\patient_program_registrations.sql", "unique_id": "model.tamanu_source_dbt.patient_program_registrations", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registrations"], "alias": "patient_program_registrations", "checksum": {"name": "sha256", "checksum": "ee4fb8f6fdce789d05d0ba389f948b997e8bfc09d2b2857fe4ec5629b4942c0f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table with information about the program registrations of a patient. This is helpful\r\nto enroll a specific patient within a program that will be followed for an extended\r\nperiod of time.\r\n\r\n**This table is append-only.**\r\nA new record is created every time there is a change to the status of a registration. \r\n\r\nAt the moment, this implies that when merging two patients, both with a registration to the same\r\nregistry, the merged patient ends up with two registrations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registrations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in patient_program_registrations.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "registration_status": {"name": "registration_status", "description": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registration_status"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [Patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__patient_id"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__program_registry_id"]}, "clinical_status_id": {"name": "clinical_status_id", "description": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinician_id"]}, "registering_facility_id": {"name": "registering_facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) this program\r\nregistration is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__facility_id"]}, "village_id": {"name": "village_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=village`) this program registration is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__village_id"]}, "deactivated_by_id": {"name": "deactivated_by_id", "description": "The clinician that removed the patient from the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id"]}, "deactivated_datetime": {"name": "deactivated_datetime", "description": "The date that the patient from the program registry.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_program_registrations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1341033, "relation_name": "\"app\".\"reporting\".\"patient_program_registrations\"", "raw_code": "select\r\n id,\r\n date::timestamp as datetime,\r\n registration_status,\r\n patient_id,\r\n program_registry_id,\r\n clinical_status_id,\r\n clinician_id as registered_by_id,\r\n registering_facility_id,\r\n facility_id,\r\n village_id,\r\n deactivated_clinician_id as deactivated_by_id,\r\n deactivated_date::timestamp as deactivated_datetime\r\nfrom {{ source('tamanu', 'patient_program_registrations') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registrations"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_program_registrations.sql", "compiled": true, "compiled_code": "select\n id,\n date::timestamp as datetime,\n registration_status,\n patient_id,\n program_registry_id,\n clinical_status_id,\n clinician_id as registered_by_id,\n registering_facility_id,\n facility_id,\n village_id,\n deactivated_clinician_id as deactivated_by_id,\n deactivated_date::timestamp as deactivated_datetime\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_program_registrations_change_logs": {"database": "app", "schema": "reporting", "name": "patient_program_registrations_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registrations_change_logs.sql", "original_file_path": "models\\bases\\patient_program_registrations_change_logs.sql", "unique_id": "model.tamanu_source_dbt.patient_program_registrations_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registrations_change_logs"], "alias": "patient_program_registrations_change_logs", "checksum": {"name": "sha256", "checksum": "d29b6e35e35a5ef73209472a4e7ad2af4c0fa7bfe11b6718413dba212509778b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Change logs of Table with information about the program registrations of a patient. This is helpful\r\nto enroll a specific patient within a program that will be followed for an extended\r\nperiod of time.\r\n\r\n**This table is append-only.**\r\nA new record is created every time there is a change to the status of a registration. \r\n\r\nAt the moment, this implies that when merging two patients, both with a registration to the same\r\nregistry, the merged patient ends up with two registrations.", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in patient_program registrations history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in patient_program registrations history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registrations.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in patient_program_registrations history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "registration_status": {"name": "registration_status", "description": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError` from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registration_status"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [Patient](#!/source/source.tamanu.tamanu.patients). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__patient_id"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__program_registry_id"]}, "clinical_status_id": {"name": "clinical_status_id", "description": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinician_id"]}, "registering_facility_id": {"name": "registering_facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) this program\r\nregistration is from. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__facility_id"]}, "village_id": {"name": "village_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=village`) this program registration is from. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__village_id"]}, "deactivated_by_id": {"name": "deactivated_by_id", "description": "The clinician that removed the patient from the program registry. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id"]}, "deactivated_datetime": {"name": "deactivated_datetime", "description": "The date that the patient from the program registry. from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_program_registrations_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.139322, "relation_name": "\"app\".\"reporting\".\"patient_program_registrations_change_logs\"", "raw_code": "with filtered_changes as (\r\n {{ base_history_from_log('patient_program_registrations') }}\r\n and (\r\n version = 'unknown'\r\n or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int []\r\n )\r\n and record_data ->> 'patient_id' != '{{ var(\"test_patient\") }}'\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as id,\r\n (fc.record_data ->> 'date')::timestamp as datetime,\r\n fc.record_data ->> 'registration_status' as registration_status,\r\n fc.record_data ->> 'patient_id' as patient_id,\r\n fc.record_data ->> 'program_registry_id' as program_registry_id,\r\n fc.record_data ->> 'clinical_status_id' as clinical_status_id,\r\n fc.record_data ->> 'clinician_id' as registered_by_id,\r\n fc.record_data ->> 'registering_facility_id' as registering_facility_id,\r\n fc.record_data ->> 'facility_id' as facility_id,\r\n fc.record_data ->> 'village_id' as village_id,\r\n fc.record_data ->> 'deactivated_clinician_id' as deactivated_by_id,\r\n (fc.record_data ->> 'deactivated_date')::timestamp as deactivated_datetime\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registrations"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_program_registrations_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patient_program_registrations'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"patient_program_registrations\" t\n where t.deleted_at notnull\n )\n and (\n version = 'unknown'\n or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int []\n )\n and record_data ->> 'patient_id' != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n)\n\nselect\n fc.changelog_id,\n fc.logged_at,\n fc.updated_by_user_id,\n fc.record_id as id,\n (fc.record_data ->> 'date')::timestamp as datetime,\n fc.record_data ->> 'registration_status' as registration_status,\n fc.record_data ->> 'patient_id' as patient_id,\n fc.record_data ->> 'program_registry_id' as program_registry_id,\n fc.record_data ->> 'clinical_status_id' as clinical_status_id,\n fc.record_data ->> 'clinician_id' as registered_by_id,\n fc.record_data ->> 'registering_facility_id' as registering_facility_id,\n fc.record_data ->> 'facility_id' as facility_id,\n fc.record_data ->> 'village_id' as village_id,\n fc.record_data ->> 'deactivated_clinician_id' as deactivated_by_id,\n (fc.record_data ->> 'deactivated_date')::timestamp as deactivated_datetime\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_program_registration_conditions": {"database": "app", "schema": "reporting", "name": "patient_program_registration_conditions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registration_conditions.sql", "original_file_path": "models\\bases\\patient_program_registration_conditions.sql", "unique_id": "model.tamanu_source_dbt.patient_program_registration_conditions", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registration_conditions"], "alias": "patient_program_registration_conditions", "checksum": {"name": "sha256", "checksum": "464c2040ab7711bcc6a0086fc1bdd5dcc9379f7967ec14e0cdb61928a6bcc98b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table of conditions related to patients in a program registration.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registration_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "program_registry_condition_id": {"name": "program_registry_condition_id", "description": "Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id"]}, "patient_program_registration_id": {"name": "patient_program_registration_id", "description": "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\nof the condition.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id"]}, "program_registry_condition_category_id": {"name": "program_registry_condition_category_id", "description": "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\nof the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id"]}, "reason_for_change": {"name": "reason_for_change", "description": "Optional field for recording the reason for changing the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id"]}, "deleted_datetime": {"name": "deleted_datetime", "description": "Date field which is a timestamp of record being deleted in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deletion_date"]}, "deleted_by_id": {"name": "deleted_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) that removed the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_program_registration_conditions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1499941, "relation_name": "\"app\".\"reporting\".\"patient_program_registration_conditions\"", "raw_code": "select\r\n pprc.id,\r\n pprc.date::timestamp as datetime,\r\n pprc.program_registry_condition_id,\r\n pprc.patient_program_registration_id,\r\n pprc.program_registry_condition_category_id,\r\n pprc.reason_for_change,\r\n pprc.clinician_id as recorded_by_id,\r\n pprc.deletion_date::timestamp as deleted_datetime,\r\n pprc.deletion_clinician_id as deleted_by_id\r\nfrom {{ source('tamanu', 'patient_program_registration_conditions') }} pprc\r\njoin {{ source('tamanu', 'patient_program_registrations') }} ppr\r\n on ppr.id = pprc.patient_program_registration_id\r\nwhere pprc.deleted_at is null\r\n and ppr.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registration_conditions"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_program_registration_conditions.sql", "compiled": true, "compiled_code": "select\n pprc.id,\n pprc.date::timestamp as datetime,\n pprc.program_registry_condition_id,\n pprc.patient_program_registration_id,\n pprc.program_registry_condition_category_id,\n pprc.reason_for_change,\n pprc.clinician_id as recorded_by_id,\n pprc.deletion_date::timestamp as deleted_datetime,\n pprc.deletion_clinician_id as deleted_by_id\nfrom \"app\".\"public\".\"patient_program_registration_conditions\" pprc\njoin \"app\".\"public\".\"patient_program_registrations\" ppr\n on ppr.id = pprc.patient_program_registration_id\nwhere pprc.deleted_at is null\n and ppr.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs": {"database": "app", "schema": "reporting", "name": "patient_program_registration_conditions_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registration_conditions_change_logs.sql", "original_file_path": "models\\bases\\patient_program_registration_conditions_change_logs.sql", "unique_id": "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registration_conditions_change_logs"], "alias": "patient_program_registration_conditions_change_logs", "checksum": {"name": "sha256", "checksum": "f93ec951fb904d5ca0bbfa3df7184ab1a1c52263d7be761940932ac857c99af5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Change logs of Table of conditions related to patients in a program registration.", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in patient program registration condition record.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in patient program registration condition record.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registration_conditions.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in patient_program_registration_conditions history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "program_registry_condition_id": {"name": "program_registry_condition_id", "description": "Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id"]}, "patient_program_registration_id": {"name": "patient_program_registration_id", "description": "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\nof the condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id"]}, "program_registry_condition_category_id": {"name": "program_registry_condition_category_id", "description": "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\nof the condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id"]}, "reason_for_change": {"name": "reason_for_change", "description": "Optional field for recording the reason for changing the condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id"]}, "deleted_datetime": {"name": "deleted_datetime", "description": "Date field which is a timestamp of record being deleted in patient_program_registration_conditions history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deletion_date"]}, "deleted_by_id": {"name": "deleted_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) that removed the condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_program_registration_conditions_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1659558, "relation_name": "\"app\".\"reporting\".\"patient_program_registration_conditions_change_logs\"", "raw_code": "with filtered_changes as (\r\n {{ base_history_from_log('patient_program_registration_conditions') }}\r\n and (\r\n version = 'unknown'\r\n or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int []\r\n )\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as id,\r\n (fc.record_data ->> 'date')::timestamp as datetime,\r\n fc.record_data ->> 'program_registry_condition_id' as program_registry_condition_id,\r\n fc.record_data ->> 'patient_program_registration_id' as patient_program_registration_id,\r\n fc.record_data ->> 'program_registry_condition_category_id' as program_registry_condition_category_id,\r\n fc.record_data ->> 'reason_for_change' as reason_for_change,\r\n fc.record_data ->> 'clinician_id' as recorded_by_id,\r\n (fc.record_data ->> 'deletion_date')::timestamp as deleted_datetime,\r\n fc.record_data ->> 'deletion_clinician_id' as deleted_by_id\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registration_conditions"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"], ["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_program_registration_conditions_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patient_program_registration_conditions'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"patient_program_registration_conditions\" t\n where t.deleted_at notnull\n )\n and (\n version = 'unknown'\n or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int []\n )\n)\n\nselect\n fc.changelog_id,\n fc.logged_at,\n fc.updated_by_user_id,\n fc.record_id as id,\n (fc.record_data ->> 'date')::timestamp as datetime,\n fc.record_data ->> 'program_registry_condition_id' as program_registry_condition_id,\n fc.record_data ->> 'patient_program_registration_id' as patient_program_registration_id,\n fc.record_data ->> 'program_registry_condition_category_id' as program_registry_condition_category_id,\n fc.record_data ->> 'reason_for_change' as reason_for_change,\n fc.record_data ->> 'clinician_id' as recorded_by_id,\n (fc.record_data ->> 'deletion_date')::timestamp as deleted_datetime,\n fc.record_data ->> 'deletion_clinician_id' as deleted_by_id\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_vaccinations_upcoming": {"database": "app", "schema": "reporting", "name": "patient_vaccinations_upcoming", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_vaccinations_upcoming.sql", "original_file_path": "models\\bases\\patient_vaccinations_upcoming.sql", "unique_id": "model.tamanu_source_dbt.patient_vaccinations_upcoming", "fqn": ["tamanu_source_dbt", "bases", "patient_vaccinations_upcoming"], "alias": "patient_vaccinations_upcoming", "checksum": {"name": "sha256", "checksum": "b8ae7fa60356879bfd4fd61bf4d2bcf074a8fe38d0cb135680d219895ae345a3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A **view** which lists patients and next vaccine due for a given vaccine type.\r\n\r\nThe first dose of a vaccine type is based on weeks from birth due whilst subsequent doses are based on weeks from last \r\nvaccination due.\r\n\r\nAge limits in years and thresholds in days for scheduled status are configurable with the following defaults:\r\n\r\n- Age = 15\r\n- Status: Scheduled = 28\r\n- Status: Upcoming = 7\r\n- Status: Due = -7\r\n- Status: Overdue = -55\r\n- Status: Missed = -Infinity", "columns": {"patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__patient_id"]}, "vaccine_schedules_id": {"name": "vaccine_schedules_id", "description": "Reference to the [scheduled vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_category"]}, "vaccine_id": {"name": "vaccine_id", "description": "Reference to the vaccine ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_id"]}, "due_date": {"name": "due_date", "description": "Due date of the scheduled vaccine.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__due_date"]}, "days_till_due": {"name": "days_till_due", "description": "Number of days until the scheduled vaccine is due. Negative numbers indicates the number of days in the past the vaccine\r\nwas due.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__days_till_due"]}, "status": {"name": "status", "description": "Status of the upcoming vaccination listed ['DUE', 'OVERDUE', 'MISSED', 'SCHEDULED', 'UPCOMING']", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_vaccinations_upcoming.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1659558, "relation_name": "\"app\".\"reporting\".\"patient_vaccinations_upcoming\"", "raw_code": "select\r\n patient_id,\r\n scheduled_vaccine_id as vaccine_schedules_id,\r\n vaccine_category,\r\n vaccine_id,\r\n due_date::date,\r\n days_till_due,\r\n status\r\nfrom {{ source('tamanu', 'upcoming_vaccinations') }}\r\nwhere patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__upcoming_vaccinations"], "language": "sql", "refs": [], "sources": [["tamanu", "upcoming_vaccinations"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.upcoming_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_vaccinations_upcoming.sql", "compiled": true, "compiled_code": "select\n patient_id,\n scheduled_vaccine_id as vaccine_schedules_id,\n vaccine_category,\n vaccine_id,\n due_date::date,\n days_till_due,\n status\nfrom \"app\".\"public\".\"upcoming_vaccinations\"\nwhere patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.pharmacy_orders": {"database": "app", "schema": "reporting", "name": "pharmacy_orders", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\pharmacy_orders.sql", "original_file_path": "models\\bases\\pharmacy_orders.sql", "unique_id": "model.tamanu_source_dbt.pharmacy_orders", "fqn": ["tamanu_source_dbt", "bases", "pharmacy_orders"], "alias": "pharmacy_orders", "checksum": {"name": "sha256", "checksum": "682559c607b08c8612cf31db9fafe762c8b11720d8e13c953299383948d6f283"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "reference"], "description": "An order for prescriptions placed by Tamanu to a Pharmacy", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in pharmacy_orders.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) for the order.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__encounter_id"]}, "ordering_clinician_id": {"name": "ordering_clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who placed the order.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__ordering_clinician_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where the pharmacy order was placed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__facility_id"]}, "is_discharge_prescription": {"name": "is_discharge_prescription", "description": "If the patient is being discharged with this prescription.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__is_discharge_prescription"]}, "datetime": {"name": "datetime", "description": "Local date and time for the record in pharmacy_orders.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\pharmacy_orders.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1659558, "relation_name": "\"app\".\"reporting\".\"pharmacy_orders\"", "raw_code": "select\r\n po.id,\r\n po.encounter_id,\r\n po.ordering_clinician_id,\r\n po.facility_id,\r\n po.is_discharge_prescription,\r\n po.date::timestamp as datetime\r\nfrom {{ source('tamanu', 'pharmacy_orders') }} po\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = po.encounter_id\r\nwhere po.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__pharmacy_orders"], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\pharmacy_orders.sql", "compiled": true, "compiled_code": "select\n po.id,\n po.encounter_id,\n po.ordering_clinician_id,\n po.facility_id,\n po.is_discharge_prescription,\n po.date::timestamp as datetime\nfrom \"app\".\"public\".\"pharmacy_orders\" po\njoin \"app\".\"public\".\"encounters\" e on e.id = po.encounter_id\nwhere po.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.pharmacy_order_prescriptions": {"database": "app", "schema": "reporting", "name": "pharmacy_order_prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\pharmacy_order_prescriptions.sql", "original_file_path": "models\\bases\\pharmacy_order_prescriptions.sql", "unique_id": "model.tamanu_source_dbt.pharmacy_order_prescriptions", "fqn": ["tamanu_source_dbt", "bases", "pharmacy_order_prescriptions"], "alias": "pharmacy_order_prescriptions", "checksum": {"name": "sha256", "checksum": "b6a6d2568db0852cf46cab069e8dbea56d465e2bff65c65f980f4fe4f953f1ef"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "reference"], "description": "Individual prescriptions that are included in a [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in pharmacy_order_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "pharmacy_order_id": {"name": "pharmacy_order_id", "description": "Reference to the [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__pharmacy_order_id"]}, "prescription_id": {"name": "prescription_id", "description": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__prescription_id"]}, "ongoing_prescription_id": {"name": "ongoing_prescription_id", "description": "When this pharmacy order prescription was created from an ongoing prescription (send to pharmacy flow), references the ongoing [prescription](#!/source/source.tamanu.tamanu.prescriptions). Null for encounter-based pharmacy orders.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__ongoing_prescription_id"]}, "display_id": {"name": "display_id", "description": "Human-readable request number for this prescription order. A new request number is generated each time a prescription is sent to pharmacy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__display_id"]}, "quantity": {"name": "quantity", "description": "Quantity of medication ordered.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__quantity"]}, "repeats": {"name": "repeats", "description": "Number of repeats for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__repeats"]}, "is_completed": {"name": "is_completed", "description": "Indicates whether this prescription has been fully completed. Set to `true` when all repeats have been dispensed for a discharge prescription (outpatient medication). Used to filter completed prescriptions from active medication request lists.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__is_completed"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\pharmacy_order_prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1659558, "relation_name": "\"app\".\"reporting\".\"pharmacy_order_prescriptions\"", "raw_code": "select\r\n pop.id,\r\n pop.pharmacy_order_id,\r\n pop.prescription_id,\r\n pop.ongoing_prescription_id,\r\n pop.display_id,\r\n pop.quantity,\r\n pop.repeats,\r\n pop.is_completed\r\nfrom {{ source('tamanu', 'pharmacy_order_prescriptions') }} pop\r\njoin {{ source('tamanu', 'pharmacy_orders') }} po on po.id = pop.pharmacy_order_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = po.encounter_id\r\nwhere pop.deleted_at is null\r\n and po.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__pharmacy_order_prescriptions"], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"], ["tamanu", "pharmacy_orders"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "source.tamanu_source_dbt.tamanu.pharmacy_orders", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\pharmacy_order_prescriptions.sql", "compiled": true, "compiled_code": "select\n pop.id,\n pop.pharmacy_order_id,\n pop.prescription_id,\n pop.ongoing_prescription_id,\n pop.display_id,\n pop.quantity,\n pop.repeats,\n pop.is_completed\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\" pop\njoin \"app\".\"public\".\"pharmacy_orders\" po on po.id = pop.pharmacy_order_id\njoin \"app\".\"public\".\"encounters\" e on e.id = po.encounter_id\nwhere pop.deleted_at is null\n and po.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.prescriptions": {"database": "app", "schema": "reporting", "name": "prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\prescriptions.sql", "original_file_path": "models\\bases\\prescriptions.sql", "unique_id": "model.tamanu_source_dbt.prescriptions", "fqn": ["tamanu_source_dbt", "bases", "prescriptions"], "alias": "prescriptions", "checksum": {"name": "sha256", "checksum": "38c7cb130a61d97d686d25759bf535b7dfbe97deb112cfbde60971ad8294c832"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Records prescriptions for medications.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in prescriptions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date and time for the record in prescriptions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "start_datetime": {"name": "start_datetime", "description": "The start date of the prescription", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__start_date"]}, "end_datetime": {"name": "end_datetime", "description": "When the prescription ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__end_date"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "prescriber_id": {"name": "prescriber_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) prescribed the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__prescriber_id"]}, "indication": {"name": "indication", "description": "The [indication of use](https://en.wikipedia.org/wiki/Indication_(medicine)) for the medicine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__indication"]}, "route": {"name": "route", "description": "Administration route for the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__route"]}, "quantity": {"name": "quantity", "description": "Quantity of medicine to dispense.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__quantity"]}, "repeats": {"name": "repeats", "description": "How many times this prescription can be repeatedly dispensed without a new prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__repeats"]}, "is_ongoing": {"name": "is_ongoing", "description": "A flag to determine whether or not the current prescription is ongoing", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_ongoing"]}, "is_prn": {"name": "is_prn", "description": "A flag to determine whether or not the current prescription is prn", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_prn"]}, "is_variable_dose": {"name": "is_variable_dose", "description": "A flag to determine whether or not the current prescription is variable does", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_variable_dose"]}, "dose_amount": {"name": "dose_amount", "description": "Numeric field to record dose amount", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__dose_amount"]}, "units": {"name": "units", "description": "The units of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__units"]}, "frequency": {"name": "frequency", "description": "The frequency of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__frequency"]}, "duration_value": {"name": "duration_value", "description": "The duration value of the prescription", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__duration_value"]}, "duration_unit": {"name": "duration_unit", "description": "The duration unit of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__duration_unit"]}, "is_phone_order": {"name": "is_phone_order", "description": "A flag to determine whether or not the current prescription is phone order", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_phone_order"]}, "ideal_times": {"name": "ideal_times", "description": "Ideal times which are specified by prescriber", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__ideal_times"]}, "is_discontinued": {"name": "is_discontinued", "description": "Whether the prescription was discontinued.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinued"]}, "discontinued_by_id": {"name": "discontinued_by_id", "description": "If the prescription was discontinued, who did it.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinuing_clinician_id"]}, "discontinuing_reason": {"name": "discontinuing_reason", "description": "If the prescription was discontinued, why that happened.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinuing_reason"]}, "discontinued_datetime": {"name": "discontinued_datetime", "description": "If the prescription was discontinued, when that happened.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinued_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.1816163, "relation_name": "\"app\".\"reporting\".\"prescriptions\"", "raw_code": "select\r\n p.id,\r\n p.date::timestamp as datetime,\r\n p.start_date::timestamp as start_datetime,\r\n p.end_date::timestamp as end_datetime,\r\n p.medication_id,\r\n p.prescriber_id,\r\n p.indication,\r\n p.route,\r\n p.quantity,\r\n p.repeats,\r\n p.is_ongoing,\r\n p.is_prn,\r\n p.is_variable_dose,\r\n p.dose_amount,\r\n p.units,\r\n p.frequency,\r\n p.duration_value,\r\n p.duration_unit,\r\n p.is_phone_order,\r\n p.ideal_times,\r\n p.discontinued as is_discontinued,\r\n p.discontinuing_clinician_id as discontinued_by_id,\r\n p.discontinuing_reason,\r\n p.discontinued_date::timestamp as discontinued_datetime\r\nfrom {{ source('tamanu', 'prescriptions') }} p\r\nwhere p.deleted_at is null\r\n and exists (\r\n select 1\r\n from {{ source('tamanu', 'encounter_prescriptions') }} ep\r\n join {{ source('tamanu', 'encounters') }} e on e.id = ep.encounter_id\r\n where ep.prescription_id = p.id\r\n and ep.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'\r\n )", "doc_blocks": ["doc.tamanu_source_dbt.table__prescriptions"], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"], ["tamanu", "encounter_prescriptions"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions", "source.tamanu_source_dbt.tamanu.encounter_prescriptions", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\prescriptions.sql", "compiled": true, "compiled_code": "select\n p.id,\n p.date::timestamp as datetime,\n p.start_date::timestamp as start_datetime,\n p.end_date::timestamp as end_datetime,\n p.medication_id,\n p.prescriber_id,\n p.indication,\n p.route,\n p.quantity,\n p.repeats,\n p.is_ongoing,\n p.is_prn,\n p.is_variable_dose,\n p.dose_amount,\n p.units,\n p.frequency,\n p.duration_value,\n p.duration_unit,\n p.is_phone_order,\n p.ideal_times,\n p.discontinued as is_discontinued,\n p.discontinuing_clinician_id as discontinued_by_id,\n p.discontinuing_reason,\n p.discontinued_date::timestamp as discontinued_datetime\nfrom \"app\".\"public\".\"prescriptions\" p\nwhere p.deleted_at is null\n and exists (\n select 1\n from \"app\".\"public\".\"encounter_prescriptions\" ep\n join \"app\".\"public\".\"encounters\" e on e.id = ep.encounter_id\n where ep.prescription_id = p.id\n and ep.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n )", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.procedures": {"database": "app", "schema": "reporting", "name": "procedures", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\procedures.sql", "original_file_path": "models\\bases\\procedures.sql", "unique_id": "model.tamanu_source_dbt.procedures", "fqn": ["tamanu_source_dbt", "bases", "procedures"], "alias": "procedures", "checksum": {"name": "sha256", "checksum": "d16b70404a0df73a186c61ef5d663fdde7517d67612dc8990fe75c26e118a9e7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Record of each procedure in progress or completed.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedures.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "date": {"name": "date", "description": "Local date for the record in procedures.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "start_time": {"name": "start_time", "description": "When the procedure started.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time"]}, "end_time": {"name": "end_time", "description": "When the procedure ended, if it's completed.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time"]}, "is_completed": {"name": "is_completed", "description": "Whether the procedure has completed.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed"]}, "note": {"name": "note", "description": "Free-form description of the procedure.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__note"]}, "completed_note": {"name": "completed_note", "description": "Free-form notes at completion of the procedure.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed_note"]}, "encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters) this procedure is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__encounter_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the procedure happens in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__location_id"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__procedure_type_id"]}, "anaesthetic_id": {"name": "anaesthetic_id", "description": "Reference to the anaesthetic ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetic_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [physician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__physician_id"]}, "anaesthetist_id": {"name": "anaesthetist_id", "description": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetist_id"]}, "assistant_anaesthetist_id": {"name": "assistant_anaesthetist_id", "description": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id"]}, "time_in": {"name": "time_in", "description": "The time when the patient entered the procedure room or when the procedure setup began.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_in"]}, "time_out": {"name": "time_out", "description": "The time when the patient left the procedure room or when the procedure cleanup was completed.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_out"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\procedures.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1816163, "relation_name": "\"app\".\"reporting\".\"procedures\"", "raw_code": "select\r\n p.id,\r\n p.date::date as date,\r\n p.start_time::timestamp::time as start_time,\r\n p.end_time::timestamp::time as end_time,\r\n p.completed as is_completed,\r\n p.note,\r\n p.completed_note,\r\n p.encounter_id,\r\n p.location_id,\r\n p.procedure_type_id,\r\n p.anaesthetic_id,\r\n p.physician_id as clinician_id,\r\n p.anaesthetist_id,\r\n p.assistant_anaesthetist_id,\r\n p.time_in::time as time_in,\r\n p.time_out::time as time_out\r\nfrom {{ source('tamanu', 'procedures') }} p\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = p.encounter_id\r\nwhere p.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__procedures"], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\procedures.sql", "compiled": true, "compiled_code": "select\n p.id,\n p.date::date as date,\n p.start_time::timestamp::time as start_time,\n p.end_time::timestamp::time as end_time,\n p.completed as is_completed,\n p.note,\n p.completed_note,\n p.encounter_id,\n p.location_id,\n p.procedure_type_id,\n p.anaesthetic_id,\n p.physician_id as clinician_id,\n p.anaesthetist_id,\n p.assistant_anaesthetist_id,\n p.time_in::time as time_in,\n p.time_out::time as time_out\nfrom \"app\".\"public\".\"procedures\" p\njoin \"app\".\"public\".\"encounters\" e on e.id = p.encounter_id\nwhere p.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.procedures_metadata": {"database": "app", "schema": "reporting", "name": "procedures_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\procedures_metadata.sql", "original_file_path": "models\\bases\\procedures_metadata.sql", "unique_id": "model.tamanu_source_dbt.procedures_metadata", "fqn": ["tamanu_source_dbt", "bases", "procedures_metadata"], "alias": "procedures_metadata", "checksum": {"name": "sha256", "checksum": "64134447231619ed044da54c869a5cf3f815409fae95cd53830cf0cab3ee765f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for procedures.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedures.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the procedures table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the procedures table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\procedures_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.1816163, "relation_name": "\"app\".\"reporting\".\"procedures_metadata\"", "raw_code": "{{ get_metadata_from_changes('procedures') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\procedures_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'procedures'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.programs": {"database": "app", "schema": "reporting", "name": "programs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\programs.sql", "original_file_path": "models\\bases\\programs.sql", "unique_id": "model.tamanu_source_dbt.programs", "fqn": ["tamanu_source_dbt", "bases", "programs"], "alias": "programs", "checksum": {"name": "sha256", "checksum": "ebab7a5641a255a2e5eca27d6b209c7f9a93b36498848db4e2939def72331639"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Groups of [surveys](#!/source/source.tamanu.tamanu.surveys) or [program registries](#!/source/source.tamanu.tamanu.program_registries).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in programs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Machine-friendly code.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.programs__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.programs__name"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\programs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.1816163, "relation_name": "\"app\".\"reporting\".\"programs\"", "raw_code": "select\r\n id,\r\n code,\r\n name\r\nfrom {{ source('tamanu', 'programs') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__programs"], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\programs.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name\nfrom \"app\".\"public\".\"programs\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_data_elements": {"database": "app", "schema": "reporting", "name": "program_data_elements", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_data_elements.sql", "original_file_path": "models\\bases\\program_data_elements.sql", "unique_id": "model.tamanu_source_dbt.program_data_elements", "fqn": ["tamanu_source_dbt", "bases", "program_data_elements"], "alias": "program_data_elements", "checksum": {"name": "sha256", "checksum": "e7a2635b7674f9578a72a47d086ee08779c775d719ec067bdd61b1a55f0037e7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Describes how a survey question gets stored.\r\n\r\nSee [survey screen components](#!/source/source.tamanu.tamanu.survey_screen_components), which\r\ndescribes how the question is displayed.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_data_elements.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Machine-friendly short name for the question.\r\n\r\nThis is also used to refer to questions within criteria and such.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__code"]}, "name": {"name": "name", "description": "Human-friendly name", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__name"]}, "type": {"name": "type", "description": "Type of the field.\r\n\r\nTypes are here: ", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__type"]}, "indicator": {"name": "indicator", "description": "Another name for the data element.\r\n\r\nIt's named `indicator` from mimicry of Tupaia.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__indicator"]}, "default_text": {"name": "default_text", "description": "Default value.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__default_text"]}, "default_options": {"name": "default_options", "description": "Default options if this is a dropdown.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__default_options"]}, "visualisation_config": {"name": "visualisation_config", "description": "JSON visualisation configuration.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__visualisation_config"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_data_elements.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.1816163, "relation_name": "\"app\".\"reporting\".\"program_data_elements\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n type,\r\n indicator,\r\n default_text,\r\n default_options,\r\n visualisation_config\r\nfrom {{ source('tamanu', 'program_data_elements') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_data_elements"], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_data_elements.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n type,\n indicator,\n default_text,\n default_options,\n visualisation_config\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_registries": {"database": "app", "schema": "reporting", "name": "program_registries", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_registries.sql", "original_file_path": "models\\bases\\program_registries.sql", "unique_id": "model.tamanu_source_dbt.program_registries", "fqn": ["tamanu_source_dbt", "bases", "program_registries"], "alias": "program_registries", "checksum": {"name": "sha256", "checksum": "42e8b06322eef654ed0045eb1ccc9b151572583b392dde41dfeb9ad08b0e6d84"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table of program registries.\r\n\r\nThis provides functionality to track a patient population defined by a particular disease or\r\ncondition, and follow this population over time.\r\n\r\nThis table defines the different registries available to track users with.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registries.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Machine-friendly identifier.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__name"]}, "currently_at_type": {"name": "currently_at_type", "description": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__currently_at_type"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registries.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_id": {"name": "program_id", "description": "Reference to a [program](#!/source/source.tamanu.tamanu.programs).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__program_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_registries.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.1816163, "relation_name": "\"app\".\"reporting\".\"program_registries\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n currently_at_type,\r\n visibility_status,\r\n program_id\r\nfrom {{ source('tamanu', 'program_registries') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registries"], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_registries.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n currently_at_type,\n visibility_status,\n program_id\nfrom \"app\".\"public\".\"program_registries\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_registry_clinical_statuses": {"database": "app", "schema": "reporting", "name": "program_registry_clinical_statuses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_registry_clinical_statuses.sql", "original_file_path": "models\\bases\\program_registry_clinical_statuses.sql", "unique_id": "model.tamanu_source_dbt.program_registry_clinical_statuses", "fqn": ["tamanu_source_dbt", "bases", "program_registry_clinical_statuses"], "alias": "program_registry_clinical_statuses", "checksum": {"name": "sha256", "checksum": "ed760481a9bb62f58bf8c22aeee3271af189d23d0dc983d5cde496d7b12d43ee"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table of clinical statuses used in program registries.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_clinical_statuses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code (identifier) for the clinical status.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__code"]}, "name": {"name": "name", "description": "The name of the clinical status.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__name"]}, "color": {"name": "color", "description": "A color for the clinical status.\r\n\r\nOne of:\r\n- `purple`\r\n- `pink`\r\n- `orange`\r\n- `yellow`\r\n- `blue`\r\n- `green`\r\n- `grey`\r\n- `red`\r\n- `brown`\r\n- `teal`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__color"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_clinical_statuses.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe status is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__program_registry_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_registry_clinical_statuses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.1816163, "relation_name": "\"app\".\"reporting\".\"program_registry_clinical_statuses\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n color,\r\n visibility_status,\r\n program_registry_id\r\nfrom {{ source('tamanu', 'program_registry_clinical_statuses') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_clinical_statuses"], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_registry_clinical_statuses.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n color,\n visibility_status,\n program_registry_id\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_registry_conditions": {"database": "app", "schema": "reporting", "name": "program_registry_conditions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_registry_conditions.sql", "original_file_path": "models\\bases\\program_registry_conditions.sql", "unique_id": "model.tamanu_source_dbt.program_registry_conditions", "fqn": ["tamanu_source_dbt", "bases", "program_registry_conditions"], "alias": "program_registry_conditions", "checksum": {"name": "sha256", "checksum": "821a2997bc136c1e8c7361c86c679e3a074f3e90a8d650aecbc833644f5cecc9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table of program registry conditions.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code (identifier) for the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__code"]}, "name": {"name": "name", "description": "The name of the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_conditions.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe condition is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__program_registry_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_registry_conditions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.1975374, "relation_name": "\"app\".\"reporting\".\"program_registry_conditions\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n visibility_status,\r\n program_registry_id\r\nfrom {{ source('tamanu', 'program_registry_conditions') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_conditions"], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_registry_conditions.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n visibility_status,\n program_registry_id\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_registry_condition_categories": {"database": "app", "schema": "reporting", "name": "program_registry_condition_categories", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_registry_condition_categories.sql", "original_file_path": "models\\bases\\program_registry_condition_categories.sql", "unique_id": "model.tamanu_source_dbt.program_registry_condition_categories", "fqn": ["tamanu_source_dbt", "bases", "program_registry_condition_categories"], "alias": "program_registry_condition_categories", "checksum": {"name": "sha256", "checksum": "da8b2b96aa51941ff54a0678deede901b9562d5f6dc8e051e60bb7c2726b81ea"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Categories to be set against patient program registry conditions. The categories are configured through the program importer for each program registry. There is a hard-loaded list that is seeded by default in the database for each program registry.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_condition_categories.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "The code for the category.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__code"]}, "name": {"name": "name", "description": "The name for the category.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_condition_categories.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "The id of the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__program_registry_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_registry_condition_categories.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.1975374, "relation_name": "\"app\".\"reporting\".\"program_registry_condition_categories\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n visibility_status,\r\n program_registry_id\r\nfrom {{ source('tamanu', 'program_registry_condition_categories') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_condition_categories"], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_registry_condition_categories.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n visibility_status,\n program_registry_id\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.reference_data": {"database": "app", "schema": "reporting", "name": "reference_data", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\reference_data.sql", "original_file_path": "models\\bases\\reference_data.sql", "unique_id": "model.tamanu_source_dbt.reference_data", "fqn": ["tamanu_source_dbt", "bases", "reference_data"], "alias": "reference_data", "checksum": {"name": "sha256", "checksum": "0b1a8aadda3b4279fca4db92d86cdf488dd9975766fd010e173b0373aa2ab1d3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "User imported reference data for the environment grouped by type.\r\n\r\n- Catch-all for simple reference data types - there are a LOT of kinds of reference data that exist as just an ID, a \r\nstring label, and occasionally a code; these are all grouped into this table to avoid overcomplicating the schema.\r\n- Occasionally a type of simple reference data will gain some complexity, at which point it will be refactored/migrated \r\nout to use its own table.\r\n- Simple reference data types include a code, type, name and visibility status.\r\n- Example types include `diagnosis`, `procedures`", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code of the data item (short value, alphanumerics and hyphens).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__code"]}, "name": {"name": "name", "description": "Actual data", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "type": {"name": "type", "description": "Class of the data (referred to in code).\r\n\r\nWhenever this table is referred to in a relationship, it's to a specific `type` here. For example a\r\ntable might have a `diagnosis_id`, which is a reference to this table, for specifically only the\r\nrows with `type = diagnosis`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__type"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in reference_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\reference_data.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.1975374, "relation_name": "\"app\".\"reporting\".\"reference_data\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n type,\r\n visibility_status\r\nfrom {{ source('tamanu', 'reference_data') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_data"], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\reference_data.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n type,\n visibility_status\nfrom \"app\".\"public\".\"reference_data\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.referrals": {"database": "app", "schema": "reporting", "name": "referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\referrals.sql", "original_file_path": "models\\bases\\referrals.sql", "unique_id": "model.tamanu_source_dbt.referrals", "fqn": ["tamanu_source_dbt", "bases", "referrals"], "alias": "referrals", "checksum": {"name": "sha256", "checksum": "0ed81ae12f4e69f0ee4c7dfdbffc32dc91adcfb85d0e1cf86b983b85fcf45c4d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "[Referrals](https://en.wikipedia.org/wiki/Referral_(medicine)).\r\n\r\nReferrals use a confusing mix of data in the `referrals` table and\r\n[`survey_response_answers`](#!/source/source.tamanu.tamanu.survey_response_answers) identified by\r\nthe text of the question they are for. \r\n\r\nSome additional data is captured in\r\n[survey response answers](#!/source/source.tamanu.tamanu.survey_response_answers), but this is\r\nvariable and not enforced through any validation:\r\n- Where the person is being referred to can be captured by a range of questions, sometimes with a\r\n list of hard coded facility name options, or location groups, or departments.\r\n- Who the referral is \"completed by\" can be captured by a question either the name\r\n 'Referring doctor' or 'Referral completed by'.\r\n- Some referrals are the product of a previous screening survey. In some cases (e.g. Samoa) there is\r\n a SurveyLink question that captures which survey led to this referral, in others (e.g. Nauru)\r\n there is no such question so the two survey responses cannot be reliably linked.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in referrals.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "status": {"name": "status", "description": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__status"]}, "referred_facility": {"name": "referred_facility", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__referred_facility"]}, "initiating_encounter_id": {"name": "initiating_encounter_id", "description": "Reference to the [initiating encounter](#!/source/source.tamanu.tamanu.encounters).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__initiating_encounter_id"]}, "survey_response_id": {"name": "survey_response_id", "description": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) with more data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__survey_response_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\referrals.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.2021942, "relation_name": "\"app\".\"reporting\".\"referrals\"", "raw_code": "select\r\n id,\r\n status,\r\n referred_facility,\r\n initiating_encounter_id,\r\n survey_response_id\r\nfrom {{ source('tamanu', 'referrals') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__referrals"], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\referrals.sql", "compiled": true, "compiled_code": "select\n id,\n status,\n referred_facility,\n initiating_encounter_id,\n survey_response_id\nfrom \"app\".\"public\".\"referrals\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.refresh_tokens": {"database": "app", "schema": "reporting", "name": "refresh_tokens", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\refresh_tokens.sql", "original_file_path": "models\\bases\\refresh_tokens.sql", "unique_id": "model.tamanu_source_dbt.refresh_tokens", "fqn": ["tamanu_source_dbt", "bases", "refresh_tokens"], "alias": "refresh_tokens", "checksum": {"name": "sha256", "checksum": "04fd90e3d6cac266030987bca91678ff1d567a443d89e087a66d3d93d56aac21"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "Refresh tokens are used by API clients to refresh their authentication quickly, within a timeout.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "device_id": {"name": "device_id", "description": "Unique device ID from the client.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__device_id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) being authenticated as.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__user_id"]}, "expires_at": {"name": "expires_at", "description": "When the refresh token expires.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__expires_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\refresh_tokens.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782422375.2021942, "relation_name": "\"app\".\"reporting\".\"refresh_tokens\"", "raw_code": "select\r\n id,\r\n device_id,\r\n user_id,\r\n expires_at,\r\n created_at,\r\n updated_at\r\nfrom\r\n {{ source('tamanu', 'refresh_tokens') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__refresh_tokens"], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\refresh_tokens.sql", "compiled": true, "compiled_code": "select\n id,\n device_id,\n user_id,\n expires_at,\n created_at,\n updated_at\nfrom\n \"app\".\"public\".\"refresh_tokens\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.roles": {"database": "app", "schema": "reporting", "name": "roles", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\roles.sql", "original_file_path": "models\\bases\\roles.sql", "unique_id": "model.tamanu_source_dbt.roles", "fqn": ["tamanu_source_dbt", "bases", "roles"], "alias": "roles", "checksum": {"name": "sha256", "checksum": "7ac5061d54bd4d356160f3050960a352c91dd1b00e7493803e8c126e5f594866"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "These are sets of permissions that are given to users to determine what they can do in Tamanu.\r\n\r\nThe actual permissions are associated to the role in the\r\n[`permissions`](#!/source/source.tamanu.tamanu.permissions) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in roles.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Readable name for the role.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.roles__name"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\roles.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782422375.2021942, "relation_name": "\"app\".\"reporting\".\"roles\"", "raw_code": "select\r\n id,\r\n name\r\nfrom {{ source('tamanu', 'roles') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__roles"], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\roles.sql", "compiled": true, "compiled_code": "select\n id,\n name\nfrom \"app\".\"public\".\"roles\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.surveys": {"database": "app", "schema": "reporting", "name": "surveys", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\surveys.sql", "original_file_path": "models\\bases\\surveys.sql", "unique_id": "model.tamanu_source_dbt.surveys", "fqn": ["tamanu_source_dbt", "bases", "surveys"], "alias": "surveys", "checksum": {"name": "sha256", "checksum": "849a85fd6de0ddb3245c0a18426080696e49f8345db51b3ff6120d5110717e95"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Surveys, aka custom forms that can be filled by practitioners.\r\n\r\nThese are composed of [screen components](#!/source/source.tamanu.tamanu.survey_screen_components).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in surveys.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Machine-friendly code.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__name"]}, "survey_type": {"name": "survey_type", "description": "Type of survey.\r\n\r\nOne of:\r\n- `programs`\r\n- `referral`\r\n- `obsolete`\r\n- `vitals`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__survey_type"]}, "is_sensitive": {"name": "is_sensitive", "description": "Whether the data recorded in the survey is sensitive.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__is_sensitive"]}, "is_notifiable": {"name": "is_notifiable", "description": "Whether filling this survey sends a notification email.\r\n\r\nThese are sent by the `SurveyCompletionNotifierProcessor` scheduled task.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__notifiable"]}, "notify_email_addresses": {"name": "notify_email_addresses", "description": "If `notifiable` is true, where to send the notification.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__notify_email_addresses"]}, "program_id": {"name": "program_id", "description": "The [program](#!/source/source.tamanu.tamanu.programs) grouping this survey.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__program_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in surveys.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\surveys.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.2021942, "relation_name": "\"app\".\"reporting\".\"surveys\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n survey_type,\r\n is_sensitive,\r\n notifiable as is_notifiable,\r\n notify_email_addresses,\r\n program_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'surveys') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__surveys"], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\surveys.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n survey_type,\n is_sensitive,\n notifiable as is_notifiable,\n notify_email_addresses,\n program_id,\n visibility_status\nfrom \"app\".\"public\".\"surveys\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.survey_responses": {"database": "app", "schema": "reporting", "name": "survey_responses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\survey_responses.sql", "original_file_path": "models\\bases\\survey_responses.sql", "unique_id": "model.tamanu_source_dbt.survey_responses", "fqn": ["tamanu_source_dbt", "bases", "survey_responses"], "alias": "survey_responses", "checksum": {"name": "sha256", "checksum": "ae6c270610e2a981a7ccdc13e2d5dd5b404c00de218dcb6026bf6c8893984303"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A response to a survey (as recorded by a practitioner).\r\n\r\nTypically surveys are filled on behalf of patients as part of an encounter.\r\n\r\nBecause there are multiple distinct kinds of dates at play here:\r\n- `created_at`, `updated_at`, `deleted_at` are system data for syncing and cannot be relied on for realtime\r\n- `start_time`, `end_time` are real datetimes automatically recorded when starting and submitting a survey response\r\n- in survey response answers, there could be a data element for targeting the date of when exactly the data is recorded in real time.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_responses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_datetime": {"name": "start_datetime", "description": "When the survey was started.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__start_time"]}, "end_datetime": {"name": "end_datetime", "description": "When the survey was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__end_time"]}, "result_text": {"name": "result_text", "description": "The textual value that is the summary of the survey response.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__result_text"]}, "is_notified": {"name": "is_notified", "description": "If the [survey](#!/source/source.tamanu.tamanu.surveys) is `notifiable`, whether this response's\r\nnotification has been sent.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__notified"]}, "survey_id": {"name": "survey_id", "description": "The [survey](#!/source/source.tamanu.tamanu.surveys) being responded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__survey_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this survey response is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__encounter_id"]}, "submitted_by_id": {"name": "submitted_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) recording this survey response.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__user_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\survey_responses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.2021942, "relation_name": "\"app\".\"reporting\".\"survey_responses\"", "raw_code": "select\r\n id,\r\n start_time::timestamp as start_datetime,\r\n end_time::timestamp as end_datetime,\r\n result_text,\r\n notified as is_notified,\r\n survey_id,\r\n encounter_id,\r\n user_id as submitted_by_id\r\nfrom {{ source('tamanu', 'survey_responses') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_responses"], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\survey_responses.sql", "compiled": true, "compiled_code": "select\n id,\n start_time::timestamp as start_datetime,\n end_time::timestamp as end_datetime,\n result_text,\n notified as is_notified,\n survey_id,\n encounter_id,\n user_id as submitted_by_id\nfrom \"app\".\"public\".\"survey_responses\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.survey_response_answers": {"database": "app", "schema": "reporting", "name": "survey_response_answers", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\survey_response_answers.sql", "original_file_path": "models\\bases\\survey_response_answers.sql", "unique_id": "model.tamanu_source_dbt.survey_response_answers", "fqn": ["tamanu_source_dbt", "bases", "survey_response_answers"], "alias": "survey_response_answers", "checksum": {"name": "sha256", "checksum": "fff314c883c021aea5a91940122a4fd17cae8044ef8c2508216f75a3c2ebbc01"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A single answer as part of a [survey response](#!/source/source.tamanu.tamanu.survey_responses).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_response_answers.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Name of the question.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__name"]}, "body": {"name": "body", "description": "Value of the answer.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__body"]}, "response_id": {"name": "response_id", "description": "The [survey response](#!/source/source.tamanu.tamanu.survey_responses).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__response_id"]}, "data_element_id": {"name": "data_element_id", "description": "Reference to the [question](#!/source/source.tamanu.tamanu.program_data_elements).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__data_element_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\survey_response_answers.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.2021942, "relation_name": "\"app\".\"reporting\".\"survey_response_answers\"", "raw_code": "select\r\n id,\r\n name,\r\n body,\r\n response_id,\r\n data_element_id\r\nfrom {{ source('tamanu', 'survey_response_answers') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_response_answers"], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\survey_response_answers.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n body,\n response_id,\n data_element_id\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.survey_screen_components": {"database": "app", "schema": "reporting", "name": "survey_screen_components", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\survey_screen_components.sql", "original_file_path": "models\\bases\\survey_screen_components.sql", "unique_id": "model.tamanu_source_dbt.survey_screen_components", "fqn": ["tamanu_source_dbt", "bases", "survey_screen_components"], "alias": "survey_screen_components", "checksum": {"name": "sha256", "checksum": "662d5ae56488459829e019f5720133959fb980e540308ade5e8d3dafff44dbb4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Describes how a survey question gets displayed.\r\n\r\nSee [program data element](#!/source/source.tamanu.tamanu.program_data_elements), which describes\r\nhow the data from the question is stored.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_screen_components.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "screen_index": {"name": "screen_index", "description": "Screen this component should appear on.\r\n\r\nSurveys can have multiple \"screens\" or pages, this index sets where this particular question sits.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__screen_index"]}, "component_index": {"name": "component_index", "description": "The absolute index (order) of the component in the survey.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__component_index"]}, "text": {"name": "text", "description": "Description or question of this component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__text"]}, "visibility_criteria": {"name": "visibility_criteria", "description": "JSON criteria that determines when this component is visible.\r\n\r\nA criteria is a list of other components' codes and the value that will make this question show up:\r\n\r\n```json\r\n{\r\n \"otherQuestion\": \"Yes\"\r\n}\r\n```\r\n\r\nThere can also be the special criterium `{\"hidden\": true}` which always hides the question, and the\r\nspecial key `\"_conjunction\": \"or\"` which makes it so _any one_ item in the list is sufficient to\r\nshow the question, instead of the default where _all_ items must match.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__visibility_criteria"]}, "validation_criteria": {"name": "validation_criteria", "description": "JSON criteria that determines whether the value entered in this component is accepted.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__validation_criteria"]}, "detail": {"name": "detail", "description": "Longer description or explanatory text of this component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__detail"]}, "config": {"name": "config", "description": "JSON additional config of the component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__config"]}, "options": {"name": "options", "description": "JSON array of strings of options to be selected.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__options"]}, "calculation": {"name": "calculation", "description": "Math expression to do calculations on the entered value before it's saved.\r\n\r\nFor example `questionCode + 3`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__calculation"]}, "survey_id": {"name": "survey_id", "description": "The [survey](#!/source/source.tamanu.tamanu.surveys).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__survey_id"]}, "data_element_id": {"name": "data_element_id", "description": "Reference to the [data element](#!/source/source.tamanu.tamanu.program_data_elements) configuring\r\nhow the data from the question is stored.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__data_element_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in survey_screen_components.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\survey_screen_components.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.213359, "relation_name": "\"app\".\"reporting\".\"survey_screen_components\"", "raw_code": "select\r\n id,\r\n screen_index,\r\n component_index,\r\n text,\r\n visibility_criteria,\r\n validation_criteria,\r\n detail,\r\n config,\r\n options,\r\n calculation,\r\n survey_id,\r\n data_element_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'survey_screen_components') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_screen_components"], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\survey_screen_components.sql", "compiled": true, "compiled_code": "select\n id,\n screen_index,\n component_index,\n text,\n visibility_criteria,\n validation_criteria,\n detail,\n config,\n options,\n calculation,\n survey_id,\n data_element_id,\n visibility_status\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.translated_strings": {"database": "app", "schema": "reporting", "name": "translated_strings", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\translated_strings.sql", "original_file_path": "models\\bases\\translated_strings.sql", "unique_id": "model.tamanu_source_dbt.translated_strings", "fqn": ["tamanu_source_dbt", "bases", "translated_strings"], "alias": "translated_strings", "checksum": {"name": "sha256", "checksum": "e9ffa528aeeb77ad6526f7845c94cc284cc9109b037f041ff3738fc13dd8d985"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Localisation and translation strings.\r\n\r\nThese are used for two distinct purposes:\r\n- to translate Tamanu in languages other than English\r\n- to adjust the wording of specific items in the UI", "columns": {"string_id": {"name": "string_id", "description": "The internal reference of the item being translated.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__string_id"]}, "language": {"name": "language", "description": "The language code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__language"]}, "text": {"name": "text", "description": "The actual translated text.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__text"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\translated_strings.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782422375.213359, "relation_name": "\"app\".\"reporting\".\"translated_strings\"", "raw_code": "select\r\n string_id,\r\n language,\r\n text\r\nfrom {{ source('tamanu', 'translated_strings') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__translated_strings"], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\translated_strings.sql", "compiled": true, "compiled_code": "select\n string_id,\n language,\n text\nfrom \"app\".\"public\".\"translated_strings\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.triages": {"database": "app", "schema": "reporting", "name": "triages", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\triages.sql", "original_file_path": "models\\bases\\triages.sql", "unique_id": "model.tamanu_source_dbt.triages", "fqn": ["tamanu_source_dbt", "bases", "triages"], "alias": "triages", "checksum": {"name": "sha256", "checksum": "a7fc95c67d4564a688a6b4811274cf5289d3ba93da29d35b796009500b60c85e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Triage data of patients waiting in an emergency department.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in triages.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "arrival_datetime": {"name": "arrival_datetime", "description": "When the patient arrived.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time"]}, "triage_datetime": {"name": "triage_datetime", "description": "When the patient was triaged.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time"]}, "closed_datetime": {"name": "closed_datetime", "description": "When the patient was processed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time"]}, "arrival_mode_id": {"name": "arrival_mode_id", "description": "Reference to how the patient arrived ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = arrivalMode`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_mode_id"]}, "score": {"name": "score", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__encounter_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__practitioner_id"]}, "chief_complaint_id": {"name": "chief_complaint_id", "description": "Reference to the primary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__chief_complaint_id"]}, "secondary_complaint_id": {"name": "secondary_complaint_id", "description": "Reference to the secondary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__secondary_complaint_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\triages.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.213359, "relation_name": "\"app\".\"reporting\".\"triages\"", "raw_code": "select\r\n t.id,\r\n t.arrival_time::timestamp as arrival_datetime,\r\n t.triage_time::timestamp as triage_datetime,\r\n t.closed_time::timestamp as closed_datetime,\r\n t.arrival_mode_id,\r\n t.score,\r\n t.encounter_id,\r\n t.practitioner_id as clinician_id,\r\n t.chief_complaint_id,\r\n t.secondary_complaint_id\r\nfrom {{ source('tamanu', 'triages') }} t\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = t.encounter_id\r\nwhere t.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__triages"], "language": "sql", "refs": [], "sources": [["tamanu", "triages"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.triages", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\triages.sql", "compiled": true, "compiled_code": "select\n t.id,\n t.arrival_time::timestamp as arrival_datetime,\n t.triage_time::timestamp as triage_datetime,\n t.closed_time::timestamp as closed_datetime,\n t.arrival_mode_id,\n t.score,\n t.encounter_id,\n t.practitioner_id as clinician_id,\n t.chief_complaint_id,\n t.secondary_complaint_id\nfrom \"app\".\"public\".\"triages\" t\njoin \"app\".\"public\".\"encounters\" e on e.id = t.encounter_id\nwhere t.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.users": {"database": "app", "schema": "reporting", "name": "users", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\users.sql", "original_file_path": "models\\bases\\users.sql", "unique_id": "model.tamanu_source_dbt.users", "fqn": ["tamanu_source_dbt", "bases", "users"], "alias": "users", "checksum": {"name": "sha256", "checksum": "87cc2c2b62a6259690e0bf7c2ecd50b04c3ab76593058909131c3b07719ceea4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "Records of each user that can login to Tamanu.\r\n\r\nThis includes machine users.\r\n\r\nThere is one special user account with an all-zero `id`, which is the global \"system\" user. This is\r\nused as a pseudo identity where the Tamanu system itself takes an action that normally is performed\r\nby a human or API user.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_id"]}, "display_name": {"name": "display_name", "description": "The human readable display name for the user.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "email": {"name": "email", "description": "Email address for user. This is used to login and receive emails.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__email"]}, "phone_number": {"name": "phone_number", "description": "Phone number for the user.\r\n\r\nThis is not currently available anywhere visible.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__phone_number"]}, "role": {"name": "role", "description": "The role of the user, which sets their permission level.\r\n\r\nThe special values `admin` and `system` indicate a superadmin and a system user respectively.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__role"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\users.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.213359, "relation_name": "\"app\".\"reporting\".\"users\"", "raw_code": "select\r\n id,\r\n display_id,\r\n display_name,\r\n email,\r\n phone_number,\r\n role,\r\n visibility_status\r\nfrom {{ source('tamanu', 'users') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__users"], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\users.sql", "compiled": true, "compiled_code": "select\n id,\n display_id,\n display_name,\n email,\n phone_number,\n role,\n visibility_status\nfrom \"app\".\"public\".\"users\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.users_metadata": {"database": "app", "schema": "reporting", "name": "users_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\users_metadata.sql", "original_file_path": "models\\bases\\users_metadata.sql", "unique_id": "model.tamanu_source_dbt.users_metadata", "fqn": ["tamanu_source_dbt", "bases", "users_metadata"], "alias": "users_metadata", "checksum": {"name": "sha256", "checksum": "52bb5c10702129b47919cc72e6a9d2db0bfd8cf8429be9602a58eb5959dea591"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration", "log"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration", "log"], "description": "Metadata information extracted from the change logs for users.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the users table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the users table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\users_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration", "log"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782422375.213359, "relation_name": "\"app\".\"reporting\".\"users_metadata\"", "raw_code": "{{ get_metadata_from_changes('users') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\users_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'users'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine_administrations": {"database": "app", "schema": "reporting", "name": "vaccine_administrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\vaccine_administrations.sql", "original_file_path": "models\\bases\\vaccine_administrations.sql", "unique_id": "model.tamanu_source_dbt.vaccine_administrations", "fqn": ["tamanu_source_dbt", "bases", "vaccine_administrations"], "alias": "vaccine_administrations", "checksum": {"name": "sha256", "checksum": "123b27c35f50309e5bff15c52527b33b881c63d573983fb3e4a1f0afaf35afd6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table of vaccines administered to patients.\r\n\r\nVaccinations are recorded via the Vaccinations modal; they are selected\r\nfrom a list of Scheduled Vaccines and linked to a Patient via an Encounter.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vaccine_administrations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in vaccine_administrations.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) this vaccine was given in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__encounter_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "status": {"name": "status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "reason": {"name": "reason", "description": "Reason for vaccine administrations `NOT_GIVEN` status. This is a free text field", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__reason"]}, "not_given_reason_id": {"name": "not_given_reason_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "is_consented": {"name": "is_consented", "description": "Consent of the vaccine administrations recorded", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent"]}, "consent_given_by": {"name": "consent_given_by", "description": "Free text field recording who gave consent for the vaccination.\r\nThis is usually the patient themselves, but may differ for children or dependent\r\npersons or other cases.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent_given_by"]}, "injection_site": {"name": "injection_site", "description": "Injection site of the vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__injection_site"]}, "given_by_id": {"name": "given_by_id", "description": "Free text field for the name of the health practitioner who administered the\r\nvaccine. This is defaulted to the `display_name` of the logged-in User, but can\r\nbe changed. It is not a requirement that the administerer is a Tamanu User.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_by"]}, "is_given_elsewhere": {"name": "is_given_elsewhere", "description": "Checks if the vaccine was given elsewhere", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "circumstance_ids": {"name": "circumstance_ids", "description": "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineCircumstance`).", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__circumstance_ids"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [User](#!/source/source.tamanu.tamanu.users) who recorded this vaccination.\r\nThis may differ from the User or person who administered the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__recorder_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\vaccine_administrations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.213359, "relation_name": "\"app\".\"reporting\".\"vaccine_administrations\"", "raw_code": "select\r\n av.id,\r\n av.date::timestamp as datetime,\r\n av.encounter_id,\r\n av.location_id,\r\n av.department_id,\r\n av.scheduled_vaccine_id,\r\n av.status,\r\n av.reason,\r\n av.not_given_reason_id,\r\n av.batch,\r\n av.vaccine_name,\r\n av.vaccine_brand,\r\n av.disease,\r\n av.consent as is_consented,\r\n av.consent_given_by,\r\n av.injection_site,\r\n av.given_by,\r\n av.given_elsewhere as is_given_elsewhere,\r\n av.circumstance_ids,\r\n av.recorder_id as recorded_by_id\r\nfrom {{ source('tamanu', 'administered_vaccines') }} av\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = av.encounter_id\r\nwhere av.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__administered_vaccines"], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\vaccine_administrations.sql", "compiled": true, "compiled_code": "select\n av.id,\n av.date::timestamp as datetime,\n av.encounter_id,\n av.location_id,\n av.department_id,\n av.scheduled_vaccine_id,\n av.status,\n av.reason,\n av.not_given_reason_id,\n av.batch,\n av.vaccine_name,\n av.vaccine_brand,\n av.disease,\n av.consent as is_consented,\n av.consent_given_by,\n av.injection_site,\n av.given_by,\n av.given_elsewhere as is_given_elsewhere,\n av.circumstance_ids,\n av.recorder_id as recorded_by_id\nfrom \"app\".\"public\".\"administered_vaccines\" av\njoin \"app\".\"public\".\"encounters\" e on e.id = av.encounter_id\nwhere av.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine_administrations_change_logs": {"database": "app", "schema": "reporting", "name": "vaccine_administrations_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\vaccine_administrations_change_logs.sql", "original_file_path": "models\\bases\\vaccine_administrations_change_logs.sql", "unique_id": "model.tamanu_source_dbt.vaccine_administrations_change_logs", "fqn": ["tamanu_source_dbt", "bases", "vaccine_administrations_change_logs"], "alias": "vaccine_administrations_change_logs", "checksum": {"name": "sha256", "checksum": "8353f5a246b26eab790c69c0e28861a5d7cacac6a7c6fedcfc92b0638aeeb849"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Change logs of Table of vaccines administered to patients.\r\n\r\nVaccinations are recorded via the Vaccinations modal; they are selected\r\nfrom a list of Scheduled Vaccines and linked to a Patient via an Encounter.", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in vaccine administrations history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in vaccine_administrations from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in vaccine_administrations from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in vaccine administrations history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vaccine_administrations from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in vaccine_administrations from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "is_consented": {"name": "is_consented", "description": "Consent of the vaccine administrations recorded from history.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "given_by": {"name": "given_by", "description": "Free text field for the name of the health practitioner who administered the\r\nvaccine. This is defaulted to the `display_name` of the logged-in User, but can\r\nbe changed. It is not a requirement that the administerer is a Tamanu User. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_by"]}, "is_given_elsewhere": {"name": "is_given_elsewhere", "description": "Checks if the vaccine was given elsewhere from history.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "circumstance_ids": {"name": "circumstance_ids", "description": "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineCircumstance`). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__circumstance_ids"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [User](#!/source/source.tamanu.tamanu.users) who recorded this vaccination.\r\nThis may differ from the User or person who administered the vaccine. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__recorder_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) this vaccine was given in. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__encounter_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "injection_site": {"name": "injection_site", "description": "Injection site of the vaccine administrations recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__injection_site"]}, "consent_given_by": {"name": "consent_given_by", "description": "Free text field recording who gave consent for the vaccination.\r\nThis is usually the patient themselves, but may differ for children or dependent\r\npersons or other cases. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent_given_by"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "status": {"name": "status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "reason": {"name": "reason", "description": "Reason for vaccine administrations `NOT_GIVEN` status. This is a free text field from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__reason"]}, "not_given_reason_id": {"name": "not_given_reason_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\vaccine_administrations_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.2292292, "relation_name": "\"app\".\"reporting\".\"vaccine_administrations_change_logs\"", "raw_code": "with filtered_changes as (\r\n select\r\n av.changelog_id,\r\n av.logged_at,\r\n av.updated_by_user_id,\r\n av.record_created_at,\r\n av.record_updated_at,\r\n av.record_id,\r\n av.record_data\r\n from ({{ base_history_from_log('administered_vaccines') }}) av\r\n join {{ ref(\"encounters\") }} e on e.id = av.record_data ->> 'encounter_id'\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at at time zone '{{ var(\"timezone\") }}' as logged_at,\r\n fc.record_created_at at time zone '{{ var(\"timezone\") }}' as created_at,\r\n fc.record_updated_at at time zone '{{ var(\"timezone\") }}' as updated_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as id,\r\n (fc.record_data ->> 'date')::timestamp as datetime,\r\n fc.record_data ->> 'batch' as batch,\r\n (fc.record_data ->> 'consent')::boolean as is_consented,\r\n fc.record_data ->> 'disease' as disease,\r\n fc.record_data ->> 'given_by' as given_by,\r\n (fc.record_data ->> 'given_elsewhere')::boolean as is_given_elsewhere,\r\n fc.record_data ->> 'circumstance_ids' as circumstance_ids,\r\n fc.record_data ->> 'recorder_id' as recorded_by_id,\r\n fc.record_data ->> 'encounter_id' as encounter_id,\r\n fc.record_data ->> 'location_id' as location_id,\r\n fc.record_data ->> 'department_id' as department_id,\r\n fc.record_data ->> 'vaccine_name' as vaccine_name,\r\n fc.record_data ->> 'vaccine_brand' as vaccine_brand,\r\n fc.record_data ->> 'injection_site' as injection_site,\r\n fc.record_data ->> 'consent_given_by' as consent_given_by,\r\n fc.record_data ->> 'scheduled_vaccine_id' as scheduled_vaccine_id,\r\n fc.record_data ->> 'status' as status,\r\n fc.record_data ->> 'reason' as reason,\r\n fc.record_data ->> 'not_given_reason_id' as not_given_reason_id\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__administered_vaccines"], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}], "sources": [["logs__tamanu", "changes"], ["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.administered_vaccines", "model.tamanu_source_dbt.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\vaccine_administrations_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select\n av.changelog_id,\n av.logged_at,\n av.updated_by_user_id,\n av.record_created_at,\n av.record_updated_at,\n av.record_id,\n av.record_data\n from (select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'administered_vaccines'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"administered_vaccines\" t\n where t.deleted_at notnull\n )) av\n join \"app\".\"reporting\".\"encounters\" e on e.id = av.record_data ->> 'encounter_id'\n)\n\nselect\n fc.changelog_id,\n fc.logged_at at time zone 'Australia/Sydney' as logged_at,\n fc.record_created_at at time zone 'Australia/Sydney' as created_at,\n fc.record_updated_at at time zone 'Australia/Sydney' as updated_at,\n fc.updated_by_user_id,\n fc.record_id as id,\n (fc.record_data ->> 'date')::timestamp as datetime,\n fc.record_data ->> 'batch' as batch,\n (fc.record_data ->> 'consent')::boolean as is_consented,\n fc.record_data ->> 'disease' as disease,\n fc.record_data ->> 'given_by' as given_by,\n (fc.record_data ->> 'given_elsewhere')::boolean as is_given_elsewhere,\n fc.record_data ->> 'circumstance_ids' as circumstance_ids,\n fc.record_data ->> 'recorder_id' as recorded_by_id,\n fc.record_data ->> 'encounter_id' as encounter_id,\n fc.record_data ->> 'location_id' as location_id,\n fc.record_data ->> 'department_id' as department_id,\n fc.record_data ->> 'vaccine_name' as vaccine_name,\n fc.record_data ->> 'vaccine_brand' as vaccine_brand,\n fc.record_data ->> 'injection_site' as injection_site,\n fc.record_data ->> 'consent_given_by' as consent_given_by,\n fc.record_data ->> 'scheduled_vaccine_id' as scheduled_vaccine_id,\n fc.record_data ->> 'status' as status,\n fc.record_data ->> 'reason' as reason,\n fc.record_data ->> 'not_given_reason_id' as not_given_reason_id\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine_schedules": {"database": "app", "schema": "reporting", "name": "vaccine_schedules", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\vaccine_schedules.sql", "original_file_path": "models\\bases\\vaccine_schedules.sql", "unique_id": "model.tamanu_source_dbt.vaccine_schedules", "fqn": ["tamanu_source_dbt", "bases", "vaccine_schedules"], "alias": "vaccine_schedules", "checksum": {"name": "sha256", "checksum": "e936e32720e0849d7838101a275a76d9c5dfec4f21e8204f24e712fd49a41ce5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A vaccine schedule listing all vaccines expected to be given to a child as part of a country wide Expanded Program of \r\nImmunisation can be incorporated into Tamanu to show each dose and due date on the front end of the system. \r\n\r\nFirst dose of a vaccine should use `weeks_from_birth_due` whilst subsequent doses should use \r\n`weeks_from_last_vaccination_due`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vaccine_schedules.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "category": {"name": "category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "vaccine_id": {"name": "vaccine_id", "description": "Use the vaccineId column to link the id column of the Reference Data sheet Drug to the vaccine schedule. Copy the exact \r\nid from the id column in the reference data sheet Drug and paste it in the vaccineId column in the Scheduled Vaccine \r\nsheet.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__vaccine_id"]}, "label": {"name": "label", "description": "Contents of the label column is what will be displayed on the front end of Tamanu \r\nunder fields labelled 'Vaccine'. This is where the vaccine name is listed. E.g. 'BCG'.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__label"]}, "dose_label": {"name": "dose_label", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "index": {"name": "index", "description": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__index"]}, "weeks_from_birth_due": {"name": "weeks_from_birth_due", "description": "This column is used to tell Tamanu how many weeks from the child's date of birth a vaccine is due. This will populate \r\nthe front end within the Vaccine schedule section in the column 'Due date'. For a vaccine to appear in the Vaccine \r\nschedule a dose must have a `weeksFromBirthDue` entered into the reference data. \r\n\r\nThis field should be used only for the first dose of the vaccine. Subsequent doses should use \r\n`weeks_from_last_vaccination_due`", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_birth_due"]}, "weeks_from_last_vaccination_due": {"name": "weeks_from_last_vaccination_due", "description": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given. The order of a vaccine dose is defined at the `index` field. \r\n\r\nThis field should not be used for the first dose but for subsequent doses. First dose should use `weeks_from_birth_due`", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_last_vaccination_due"]}, "sort_index": {"name": "sort_index", "description": "Sort index defaults to 0", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__sort_index"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in vaccine_schedules.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\vaccine_schedules.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.2292292, "relation_name": "\"app\".\"reporting\".\"vaccine_schedules\"", "raw_code": "select\r\n id,\r\n category,\r\n vaccine_id,\r\n label,\r\n dose_label,\r\n index,\r\n weeks_from_birth_due,\r\n weeks_from_last_vaccination_due,\r\n sort_index,\r\n visibility_status\r\nfrom {{ source('tamanu', 'scheduled_vaccines') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__scheduled_vaccines"], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\vaccine_schedules.sql", "compiled": true, "compiled_code": "select\n id,\n category,\n vaccine_id,\n label,\n dose_label,\n index,\n weeks_from_birth_due,\n weeks_from_last_vaccination_due,\n sort_index,\n visibility_status\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__births": {"database": "app", "schema": "reporting", "name": "ds__births", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__births.sql", "original_file_path": "models\\datasets\\admin\\ds__births.sql", "unique_id": "model.tamanu_source_dbt.ds__births", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__births"], "alias": "ds__births", "checksum": {"name": "sha256", "checksum": "20c79be8efc44a3481579c49c81a4f6231d664d25f1ed611b3077bde209852aa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "clinical"], "description": "Births", "columns": {"registration_date": {"name": "registration_date", "description": "Timestamp of when record was created", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "registered_by": {"name": "registered_by", "description": "Display identifier for the user who registered the patient in Tamanu.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "nationality": {"name": "nationality", "description": "Full readable name of the nationality.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "ethnicity": {"name": "ethnicity", "description": "Full readable name of the ethnicity.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "mother": {"name": "mother", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father": {"name": "father", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "birth_time": {"name": "birth_time", "description": "Datetime of birth.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__time_of_birth"]}, "gestational_age_estimate": {"name": "gestational_age_estimate", "description": "Gestational age estimate (weeks).", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate"]}, "registered_birth_place": {"name": "registered_birth_place", "description": "Type of the actual birth place.\r\n\r\nOne of:\r\n- `health_facility`\r\n- `home`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__registered_birth_place"]}, "birth_facility_id": {"name": "birth_facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) the birth was recorded at.\r\n\r\nThis is only required when `registered_birth_place` is `health_facility`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_facility_id"]}, "birth_facility": {"name": "birth_facility", "description": "Full readable name of the facility where the birth was recorded at.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "attendant_at_birth": {"name": "attendant_at_birth", "description": "The type of the attendant at birth.\r\n\r\nOne of:\r\n- `doctor`\r\n- `midwife`\r\n- `nurse`\r\n- `traditional_birth_attentdant`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth"]}, "name_of_attendant_at_birth": {"name": "name_of_attendant_at_birth", "description": "Name of attendant at birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth"]}, "birth_delivery_type": {"name": "birth_delivery_type", "description": "Type of delivery.\r\n\r\nOne of:\r\n- `normal_vaginal_delivery`\r\n- `breech`\r\n- `emergency_c_section`\r\n- `elective_c_section`\r\n- `vacuum_extraction`\r\n- `forceps`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type"]}, "birth_type": {"name": "birth_type", "description": "`single` or `plural` birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_type"]}, "birth_weight": {"name": "birth_weight", "description": "Weight in kg at birth.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_weight"]}, "birth_length": {"name": "birth_length", "description": "Length in cm at birth.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_length"]}, "apgar_score_one_minute": {"name": "apgar_score_one_minute", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) one minute after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute"]}, "apgar_score_five_minutes": {"name": "apgar_score_five_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) five minutes after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes"]}, "apgar_score_ten_minutes": {"name": "apgar_score_ten_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) ten minutes after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__births.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2292292, "relation_name": "\"app\".\"reporting\".\"ds__births\"", "raw_code": "select\r\n pbd.registration_date,\r\n case\r\n when left(pbd.registration_date::text, 10) = left(pad.registration_date::text, 10) then u.display_name\r\n end as registered_by,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n rd_ethnicity.name as ethnicity,\r\n rd_nationality.name as nationality,\r\n p.village_id,\r\n rd_village.name as village,\r\n case\r\n when\r\n p_mother.id is not null\r\n then concat(p_mother.first_name, ' ', p_mother.last_name, ' (', p_mother.display_id, ')')\r\n end as mother,\r\n case\r\n when\r\n p_father.id is not null\r\n then concat(p_father.first_name, ' ', p_father.last_name, ' (', p_father.display_id, ')')\r\n end as father,\r\n pbd.birth_time,\r\n pbd.gestational_age_estimate,\r\n case when pbd.registered_birth_place = 'health_facility' then 'Health facility'\r\n when pbd.registered_birth_place = 'home' then 'Home'\r\n when pbd.registered_birth_place = 'other' then 'Other'\r\n else pbd.registered_birth_place\r\n end as registered_birth_place,\r\n f.id as birth_facility_id,\r\n f.name as birth_facility,\r\n case when pbd.attendant_at_birth = 'doctor' then 'Doctor'\r\n when pbd.attendant_at_birth = 'midwife' then 'Midwife'\r\n when pbd.attendant_at_birth = 'nurse' then 'Nurse'\r\n when pbd.attendant_at_birth = 'traditional_birth_attentdant' then 'Traditional birth attendant'\r\n when pbd.attendant_at_birth = 'other' then 'Other'\r\n else pbd.attendant_at_birth\r\n end as attendant_at_birth,\r\n pbd.name_of_attendant_at_birth,\r\n case\r\n when pbd.birth_delivery_type = 'normal_vaginal_delivery' then 'Normal vaginal delivery'\r\n when pbd.birth_delivery_type = 'breech' then 'Breech'\r\n when pbd.birth_delivery_type = 'emergency_c_section' then 'Emergency C-section'\r\n when pbd.birth_delivery_type = 'elective_c_section' then 'Elective C-section'\r\n when pbd.birth_delivery_type = 'vacuum_extraction' then 'Vacuum extraction'\r\n when pbd.birth_delivery_type = 'forceps' then 'Forceps'\r\n when pbd.birth_delivery_type = 'other' then 'Other'\r\n else pbd.birth_delivery_type\r\n end as birth_delivery_type,\r\n initcap(pbd.birth_type::text) as birth_type,\r\n pbd.birth_weight,\r\n pbd.birth_length,\r\n pbd.apgar_score_one_minute,\r\n pbd.apgar_score_five_minutes,\r\n pbd.apgar_score_ten_minutes\r\nfrom {{ ref(\"patient_birth_data\") }} pbd\r\njoin {{ ref(\"patients\") }} p on p.id = pbd.patient_id\r\nleft join {{ ref(\"reference_data\") }} rd_village on rd_village.id = p.village_id\r\nleft join {{ ref(\"patient_additional_data\") }} pad on pad.patient_id = p.id\r\nleft join {{ ref(\"reference_data\") }} rd_nationality on rd_nationality.id = pad.nationality_id\r\nleft join {{ ref(\"reference_data\") }} rd_ethnicity on rd_ethnicity.id = pad.ethnicity_id\r\nleft join {{ ref(\"patients\") }} p_mother on p_mother.id = pad.mother_id\r\nleft join {{ ref(\"patients\") }} p_father on p_father.id = pad.father_id\r\nleft join {{ ref(\"facilities\") }} f on f.id = pbd.birth_facility_id\r\nleft join {{ ref(\"users\") }} u on u.id = pad.registered_by_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patient_birth_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__births.sql", "compiled": true, "compiled_code": "select\n pbd.registration_date,\n case\n when left(pbd.registration_date::text, 10) = left(pad.registration_date::text, 10) then u.display_name\n end as registered_by,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n rd_ethnicity.name as ethnicity,\n rd_nationality.name as nationality,\n p.village_id,\n rd_village.name as village,\n case\n when\n p_mother.id is not null\n then concat(p_mother.first_name, ' ', p_mother.last_name, ' (', p_mother.display_id, ')')\n end as mother,\n case\n when\n p_father.id is not null\n then concat(p_father.first_name, ' ', p_father.last_name, ' (', p_father.display_id, ')')\n end as father,\n pbd.birth_time,\n pbd.gestational_age_estimate,\n case when pbd.registered_birth_place = 'health_facility' then 'Health facility'\n when pbd.registered_birth_place = 'home' then 'Home'\n when pbd.registered_birth_place = 'other' then 'Other'\n else pbd.registered_birth_place\n end as registered_birth_place,\n f.id as birth_facility_id,\n f.name as birth_facility,\n case when pbd.attendant_at_birth = 'doctor' then 'Doctor'\n when pbd.attendant_at_birth = 'midwife' then 'Midwife'\n when pbd.attendant_at_birth = 'nurse' then 'Nurse'\n when pbd.attendant_at_birth = 'traditional_birth_attentdant' then 'Traditional birth attendant'\n when pbd.attendant_at_birth = 'other' then 'Other'\n else pbd.attendant_at_birth\n end as attendant_at_birth,\n pbd.name_of_attendant_at_birth,\n case\n when pbd.birth_delivery_type = 'normal_vaginal_delivery' then 'Normal vaginal delivery'\n when pbd.birth_delivery_type = 'breech' then 'Breech'\n when pbd.birth_delivery_type = 'emergency_c_section' then 'Emergency C-section'\n when pbd.birth_delivery_type = 'elective_c_section' then 'Elective C-section'\n when pbd.birth_delivery_type = 'vacuum_extraction' then 'Vacuum extraction'\n when pbd.birth_delivery_type = 'forceps' then 'Forceps'\n when pbd.birth_delivery_type = 'other' then 'Other'\n else pbd.birth_delivery_type\n end as birth_delivery_type,\n initcap(pbd.birth_type::text) as birth_type,\n pbd.birth_weight,\n pbd.birth_length,\n pbd.apgar_score_one_minute,\n pbd.apgar_score_five_minutes,\n pbd.apgar_score_ten_minutes\nfrom \"app\".\"reporting\".\"patient_birth_data\" pbd\njoin \"app\".\"reporting\".\"patients\" p on p.id = pbd.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_village on rd_village.id = p.village_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" rd_nationality on rd_nationality.id = pad.nationality_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_ethnicity on rd_ethnicity.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"patients\" p_mother on p_mother.id = pad.mother_id\nleft join \"app\".\"reporting\".\"patients\" p_father on p_father.id = pad.father_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = pbd.birth_facility_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = pad.registered_by_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__deaths": {"database": "app", "schema": "reporting", "name": "ds__deaths", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__deaths.sql", "original_file_path": "models\\datasets\\admin\\ds__deaths.sql", "unique_id": "model.tamanu_source_dbt.ds__deaths", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__deaths"], "alias": "ds__deaths", "checksum": {"name": "sha256", "checksum": "eb02e6f91b83c0a037977614b8483641be6e3419bac67f51a55654e16ac508da"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "clinical"], "description": "Deaths", "columns": {"patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients) who died.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__patient_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "age": {"name": "age", "description": "Patient's age at the time of diagnosis.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "nationality_id": {"name": "nationality_id", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "nationality": {"name": "nationality", "description": "Full readable name of the patient's nationality.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "place_of_death": {"name": "place_of_death", "description": "Whether the death occurred outside of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__outside_health_facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where death occurred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where death occurred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where death occurred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "attending_clinician_id": {"name": "attending_clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who is recording this death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__clinician_id"]}, "attending_clinician": {"name": "attending_clinician", "description": "Full readable name of the clinician who attended the death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "primary_cause_condition_id": {"name": "primary_cause_condition_id", "description": "Reference to the primary cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if known.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id"]}, "primary_cause_condition": {"name": "primary_cause_condition", "description": "Full readable name of the primary cause of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "time_between_onset_and_death": {"name": "time_between_onset_and_death", "description": "The time in minutes after onset of the primary cause of death, if known.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset"]}, "antecedent_cause_1_id": {"name": "antecedent_cause_1_id", "description": "Reference to an antecedent (1) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id"]}, "antecedent_cause_1": {"name": "antecedent_cause_1", "description": "Full readable name of the first antecedent cause of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "antecedent_cause_2_id": {"name": "antecedent_cause_2_id", "description": "Reference to an antecedent (2) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id"]}, "antecedent_cause_2": {"name": "antecedent_cause_2", "description": "Full readable name of the second antecedent cause of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "other_condition_1_id": {"name": "other_condition_1_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "other_condition_1": {"name": "other_condition_1", "description": "Full readable name of the first other contributing condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "other_condition_2_id": {"name": "other_condition_2_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "other_condition_2": {"name": "other_condition_2", "description": "Full readable name of the second other contributing condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "other_condition_3_id": {"name": "other_condition_3_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "other_condition_3": {"name": "other_condition_3", "description": "Full readable name of the third other contributing condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "other_condition_4_id": {"name": "other_condition_4_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "other_condition_4": {"name": "other_condition_4", "description": "Full readable name of the fourth other contributing condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "had_recent_surgery": {"name": "had_recent_surgery", "description": "Whether the deceased patient had a recent surgery, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__recent_surgery"]}, "last_surgery_date": {"name": "last_surgery_date", "description": "Datetime of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_date"]}, "reason_for_surgery_id": {"name": "reason_for_surgery_id", "description": "Reference to a `diagnosis` ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) for the\r\nreason of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id"]}, "reason_for_surgery": {"name": "reason_for_surgery", "description": "Full readable name of the reason for last surgery.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "manner_of_death": {"name": "manner_of_death", "description": "A descriptive text specifying the manner of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner"]}, "external_cause_date": {"name": "external_cause_date", "description": "Datetime of external cause of death, if applicable.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_date"]}, "external_cause_location": {"name": "external_cause_location", "description": "Physical location of external cause of death, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_location"]}, "was_pregnant": {"name": "was_pregnant", "description": "Whether the deceased was pregnant.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__was_pregnant"]}, "pregnancy_contributed": {"name": "pregnancy_contributed", "description": "Whether the pregnancy contributed to the death.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed"]}, "was_fetal_or_infant": {"name": "was_fetal_or_infant", "description": "Whether the deceased was themselves a foetus or infant.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__fetal_or_infant"]}, "was_stillborn": {"name": "was_stillborn", "description": "Whether the deceased was themselves stillborn.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__stillborn"]}, "birth_weight": {"name": "birth_weight", "description": "If the deceased was a foetus, stillborn, or infant, their birth weight.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__birth_weight"]}, "completed_weeks_of_pregnancy": {"name": "completed_weeks_of_pregnancy", "description": "If the deceased was a foetus, stillborn, or infant, how many weeks pregnant their carrier was.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks"]}, "age_of_mother": {"name": "age_of_mother", "description": "If the deceased was a foetus, stillborn, or infant, the age of the carrier.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_age"]}, "condition_in_mother_affecting_fetus_or_newborn": {"name": "condition_in_mother_affecting_fetus_or_newborn", "description": "A text description stating the conditions of mother that affected the fetus/newborn, if the death was perinatal.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__mother_condition_description"]}, "death_within_day_of_birth": {"name": "death_within_day_of_birth", "description": "If the deceased was a foetus, stillborn, or infant, whether their passing was on the day of their birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__within_day_of_birth"]}, "hours_survived_since_birth": {"name": "hours_survived_since_birth", "description": "If the deceased was an infant, how many days since the birth passed before their death.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__deaths.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2449305, "relation_name": "\"app\".\"reporting\".\"ds__deaths\"", "raw_code": "with contributing_death_causes as (\r\n select\r\n cdc.patient_death_data_id,\r\n array_agg(\r\n cdc.condition_id\r\n order by cdc.time_after_onset\r\n ) as other_conditions\r\n from {{ ref(\"contributing_death_causes\") }} cdc\r\n group by cdc.patient_death_data_id\r\n),\r\n\r\nencounters_with_death as (\r\n select distinct on (e.patient_id)\r\n e.patient_id,\r\n e.start_datetime,\r\n e.end_datetime,\r\n e.location_id,\r\n e.department_id,\r\n e.clinician_id\r\n from {{ ref(\"encounters\") }} e\r\n join {{ ref(\"patients\") }} p\r\n on p.id = e.patient_id\r\n and p.date_of_death between e.start_datetime and e.end_datetime\r\n order by e.patient_id asc, e.end_datetime desc\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(p.date_of_death::date, p.date_of_birth::date)) as age,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n nationality.id as nationality_id,\r\n nationality.name as nationality,\r\n case\r\n when pdd.was_outside_health_facility then 'Died outside health facility'\r\n else facility.name\r\n end as place_of_death,\r\n facility.id as facility_id,\r\n department.id as department_id,\r\n department.name as department,\r\n location_group.id as location_group_id,\r\n location_group.name as location_group,\r\n location.id as location_id,\r\n location.name as location,\r\n p.date_of_death,\r\n clinician.id as attending_clinician_id,\r\n clinician.display_name as attending_clinician,\r\n primary_condition.id as primary_cause_condition_id,\r\n primary_condition.name as primary_cause_condition,\r\n case\r\n when pdd.primary_cause_mins_after_onset is null or pdd.primary_cause_mins_after_onset = 0\r\n then '0 minutes'\r\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 365)) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 365), ' years')\r\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 30)) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 30), ' months')\r\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 7)) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 7), ' weeks')\r\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24)) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24), ' days')\r\n when mod(pdd.primary_cause_mins_after_onset, 60) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / 60, ' hours')\r\n else concat(pdd.primary_cause_mins_after_onset, ' minutes')\r\n end as time_between_onset_and_death,\r\n antecedent_condition_1.id as antecedent_cause_1_id,\r\n antecedent_condition_1.name as antecedent_cause_1,\r\n antecedent_condition_2.id as antecedent_cause_2_id,\r\n antecedent_condition_2.name as antecedent_cause_2,\r\n other_condition_1.id as other_condition_1_id,\r\n other_condition_1.name as other_condition_1,\r\n other_condition_2.id as other_condition_2_id,\r\n other_condition_2.name as other_condition_2,\r\n other_condition_3.id as other_condition_3_id,\r\n other_condition_3.name as other_condition_3,\r\n other_condition_4.id as other_condition_4_id,\r\n other_condition_4.name as other_condition_4,\r\n initcap(pdd.had_recent_surgery) as had_recent_surgery,\r\n pdd.last_surgery_date,\r\n surgery_reason.id as reason_for_surgery_id,\r\n surgery_reason.name as reason_for_surgery,\r\n pdd.manner as manner_of_death,\r\n pdd.external_cause_date,\r\n pdd.external_cause_location,\r\n initcap(pdd.was_pregnant) as was_pregnant,\r\n pdd.pregnancy_contributed,\r\n case\r\n when pdd.was_fetal_or_infant then 'Yes'\r\n else 'No'\r\n end as was_fetal_or_infant,\r\n initcap(pdd.was_stillborn) as was_stillborn,\r\n pdd.birth_weight,\r\n pdd.carrier_pregnancy_weeks as completed_weeks_of_pregnancy,\r\n pdd.carrier_age as age_of_mother,\r\n pdd.mother_condition_description as condition_in_mother_affecting_fetus_or_newborn,\r\n case\r\n when pdd.was_within_day_of_birth then 'Yes'\r\n else 'No'\r\n end as death_within_day_of_birth,\r\n pdd.hours_survived_since_birth\r\nfrom {{ ref(\"patient_death_data\") }} pdd\r\njoin {{ ref(\"patients\") }} p\r\n on p.id = pdd.patient_id\r\nleft join {{ ref(\"patient_additional_data\") }} pd\r\n on pd.patient_id = p.id\r\nleft join {{ ref(\"reference_data\") }} village\r\n on village.id = p.village_id\r\nleft join {{ ref(\"reference_data\") }} nationality\r\n on nationality.id = pd.nationality_id\r\nleft join {{ ref(\"reference_data\") }} primary_condition\r\n on primary_condition.id = pdd.primary_cause_condition_id\r\nleft join {{ ref(\"reference_data\") }} antecedent_condition_1\r\n on antecedent_condition_1.id = pdd.antecedent_cause1_condition_id\r\nleft join {{ ref(\"reference_data\") }} antecedent_condition_2\r\n on antecedent_condition_2.id = pdd.antecedent_cause2_condition_id\r\nleft join contributing_death_causes cdc\r\n on cdc.patient_death_data_id = pdd.id\r\nleft join {{ ref(\"reference_data\") }} other_condition_1\r\n on other_condition_1.id = cdc.other_conditions[1]\r\nleft join {{ ref(\"reference_data\") }} other_condition_2\r\n on other_condition_2.id = cdc.other_conditions[2]\r\nleft join {{ ref(\"reference_data\") }} other_condition_3\r\n on other_condition_3.id = cdc.other_conditions[3]\r\nleft join {{ ref(\"reference_data\") }} other_condition_4\r\n on other_condition_4.id = cdc.other_conditions[4]\r\nleft join {{ ref(\"reference_data\") }} surgery_reason\r\n on surgery_reason.id = pdd.last_surgery_reason_id\r\nleft join encounters_with_death ewd\r\n on ewd.patient_id = p.id\r\nleft join {{ ref(\"facilities\") }} facility\r\n on facility.id = pdd.facility_id\r\nleft join {{ ref(\"departments\") }} department\r\n on department.id = ewd.department_id\r\nleft join {{ ref(\"locations\") }} location\r\n on location.id = ewd.location_id\r\nleft join {{ ref(\"location_groups\") }} location_group\r\n on location_group.id = location.location_group_id\r\nleft join {{ ref(\"users\") }} clinician\r\n on clinician.id = pdd.recorded_by_id\r\nwhere pdd.visibility_status = 'current'\r\n and pdd.is_final", "doc_blocks": [], "language": "sql", "refs": [{"name": "contributing_death_causes", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_death_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.contributing_death_causes", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_death_data", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__deaths.sql", "compiled": true, "compiled_code": "with contributing_death_causes as (\n select\n cdc.patient_death_data_id,\n array_agg(\n cdc.condition_id\n order by cdc.time_after_onset\n ) as other_conditions\n from \"app\".\"reporting\".\"contributing_death_causes\" cdc\n group by cdc.patient_death_data_id\n),\n\nencounters_with_death as (\n select distinct on (e.patient_id)\n e.patient_id,\n e.start_datetime,\n e.end_datetime,\n e.location_id,\n e.department_id,\n e.clinician_id\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\n and p.date_of_death between e.start_datetime and e.end_datetime\n order by e.patient_id asc, e.end_datetime desc\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(p.date_of_death::date, p.date_of_birth::date)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n nationality.id as nationality_id,\n nationality.name as nationality,\n case\n when pdd.was_outside_health_facility then 'Died outside health facility'\n else facility.name\n end as place_of_death,\n facility.id as facility_id,\n department.id as department_id,\n department.name as department,\n location_group.id as location_group_id,\n location_group.name as location_group,\n location.id as location_id,\n location.name as location,\n p.date_of_death,\n clinician.id as attending_clinician_id,\n clinician.display_name as attending_clinician,\n primary_condition.id as primary_cause_condition_id,\n primary_condition.name as primary_cause_condition,\n case\n when pdd.primary_cause_mins_after_onset is null or pdd.primary_cause_mins_after_onset = 0\n then '0 minutes'\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 365)) = 0\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 365), ' years')\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 30)) = 0\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 30), ' months')\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 7)) = 0\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 7), ' weeks')\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24)) = 0\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24), ' days')\n when mod(pdd.primary_cause_mins_after_onset, 60) = 0\n then concat(pdd.primary_cause_mins_after_onset / 60, ' hours')\n else concat(pdd.primary_cause_mins_after_onset, ' minutes')\n end as time_between_onset_and_death,\n antecedent_condition_1.id as antecedent_cause_1_id,\n antecedent_condition_1.name as antecedent_cause_1,\n antecedent_condition_2.id as antecedent_cause_2_id,\n antecedent_condition_2.name as antecedent_cause_2,\n other_condition_1.id as other_condition_1_id,\n other_condition_1.name as other_condition_1,\n other_condition_2.id as other_condition_2_id,\n other_condition_2.name as other_condition_2,\n other_condition_3.id as other_condition_3_id,\n other_condition_3.name as other_condition_3,\n other_condition_4.id as other_condition_4_id,\n other_condition_4.name as other_condition_4,\n initcap(pdd.had_recent_surgery) as had_recent_surgery,\n pdd.last_surgery_date,\n surgery_reason.id as reason_for_surgery_id,\n surgery_reason.name as reason_for_surgery,\n pdd.manner as manner_of_death,\n pdd.external_cause_date,\n pdd.external_cause_location,\n initcap(pdd.was_pregnant) as was_pregnant,\n pdd.pregnancy_contributed,\n case\n when pdd.was_fetal_or_infant then 'Yes'\n else 'No'\n end as was_fetal_or_infant,\n initcap(pdd.was_stillborn) as was_stillborn,\n pdd.birth_weight,\n pdd.carrier_pregnancy_weeks as completed_weeks_of_pregnancy,\n pdd.carrier_age as age_of_mother,\n pdd.mother_condition_description as condition_in_mother_affecting_fetus_or_newborn,\n case\n when pdd.was_within_day_of_birth then 'Yes'\n else 'No'\n end as death_within_day_of_birth,\n pdd.hours_survived_since_birth\nfrom \"app\".\"reporting\".\"patient_death_data\" pdd\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = pdd.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd\n on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" village\n on village.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" nationality\n on nationality.id = pd.nationality_id\nleft join \"app\".\"reporting\".\"reference_data\" primary_condition\n on primary_condition.id = pdd.primary_cause_condition_id\nleft join \"app\".\"reporting\".\"reference_data\" antecedent_condition_1\n on antecedent_condition_1.id = pdd.antecedent_cause1_condition_id\nleft join \"app\".\"reporting\".\"reference_data\" antecedent_condition_2\n on antecedent_condition_2.id = pdd.antecedent_cause2_condition_id\nleft join contributing_death_causes cdc\n on cdc.patient_death_data_id = pdd.id\nleft join \"app\".\"reporting\".\"reference_data\" other_condition_1\n on other_condition_1.id = cdc.other_conditions[1]\nleft join \"app\".\"reporting\".\"reference_data\" other_condition_2\n on other_condition_2.id = cdc.other_conditions[2]\nleft join \"app\".\"reporting\".\"reference_data\" other_condition_3\n on other_condition_3.id = cdc.other_conditions[3]\nleft join \"app\".\"reporting\".\"reference_data\" other_condition_4\n on other_condition_4.id = cdc.other_conditions[4]\nleft join \"app\".\"reporting\".\"reference_data\" surgery_reason\n on surgery_reason.id = pdd.last_surgery_reason_id\nleft join encounters_with_death ewd\n on ewd.patient_id = p.id\nleft join \"app\".\"reporting\".\"facilities\" facility\n on facility.id = pdd.facility_id\nleft join \"app\".\"reporting\".\"departments\" department\n on department.id = ewd.department_id\nleft join \"app\".\"reporting\".\"locations\" location\n on location.id = ewd.location_id\nleft join \"app\".\"reporting\".\"location_groups\" location_group\n on location_group.id = location.location_group_id\nleft join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = pdd.recorded_by_id\nwhere pdd.visibility_status = 'current'\n and pdd.is_final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__invoice_products": {"database": "app", "schema": "reporting", "name": "ds__invoice_products", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__invoice_products.sql", "original_file_path": "models\\datasets\\admin\\ds__invoice_products.sql", "unique_id": "model.tamanu_source_dbt.ds__invoice_products", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__invoice_products"], "alias": "ds__invoice_products", "checksum": {"name": "sha256", "checksum": "4dbf560bf699ac3fe327179d9a4d8b05102c360ca679a0092ef216c5d1c4d12c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "reference"], "description": "Invoice products pivoted with their prices across all price lists and insurance coverage across all insurance plans. One row per product.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Name of the product.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__name"]}, "insurable": {"name": "insurable", "description": "Whether or not discounts can be applied to a product", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__insurable"]}, "category": {"name": "category", "description": "The category of the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__category"]}, "source_record_id": {"name": "source_record_id", "description": "The id of the source record for the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__source_record_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "external_code": {"name": "external_code", "description": "External code from the linked lab test type or lab test panel, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__invoice_products.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "internal"}}, "created_at": 1782422375.2449305, "relation_name": "\"app\".\"reporting\".\"ds__invoice_products\"", "raw_code": "{%- set price_lists_query %}\r\n select id, name\r\n from {{ ref('invoice_price_lists') }}\r\n order by name\r\n{%- endset %}\r\n\r\n{%- set insurance_plans_query %}\r\n select id, name, default_coverage\r\n from {{ ref('invoice_insurance_plans') }}\r\n order by name\r\n{%- endset %}\r\n\r\n{%- if execute %}\r\n {%- set price_lists = run_query(price_lists_query) %}\r\n {%- set insurance_plans = run_query(insurance_plans_query) %}\r\n{%- else %}\r\n {%- set price_lists = [] %}\r\n {%- set insurance_plans = [] %}\r\n{%- endif %}\r\n\r\nwith price_pivot as (\r\n select\r\n invoice_product_id\r\n {%- for row in price_lists %}\r\n , max(case when invoice_price_list_id = '{{ row[0] }}' then price end)\r\n as price_{{ loop.index }}\r\n {%- endfor %}\r\n from {{ ref('invoice_price_list_items') }}\r\n where is_hidden = false\r\n group by invoice_product_id\r\n),\r\n\r\ninsurance_pivot as (\r\n select\r\n invoice_product_id\r\n {%- for row in insurance_plans %}\r\n , max(case when invoice_insurance_plan_id = '{{ row[0] }}' then coverage_value end)\r\n as cov_{{ loop.index }}\r\n {%- endfor %}\r\n from {{ ref('invoice_insurance_plan_items') }}\r\n group by invoice_product_id\r\n)\r\n\r\nselect\r\n ip.id,\r\n ip.name,\r\n ip.insurable,\r\n ip.category,\r\n ip.source_record_id,\r\n ip.visibility_status,\r\n coalesce(ltt.external_code, ltp.external_code) as external_code\r\n {%- for row in price_lists %}\r\n , pp.price_{{ loop.index }} as \"Price: {{ row[1] }}\"\r\n {%- endfor %}\r\n {%- for row in insurance_plans %}\r\n , case\r\n when ip.insurable = false then 'n/a'\r\n else cast(\r\n coalesce(\r\n insurp.cov_{{ loop.index }},\r\n {%- if row[2] is not none %}{{ row[2] }}{%- else %}null{%- endif %}\r\n ) as text\r\n )\r\n end as \"Insurance: {{ row[1] }}\"\r\n {%- endfor %}\r\nfrom {{ ref('invoice_products') }} ip\r\nleft join price_pivot pp on pp.invoice_product_id = ip.id\r\nleft join insurance_pivot insurp on insurp.invoice_product_id = ip.id\r\nleft join {{ ref('lab_test_types') }} ltt on ltt.id = ip.source_record_id\r\nleft join {{ ref('lab_test_panels') }} ltp on ltp.id = ip.source_record_id", "doc_blocks": ["doc.tamanu_source_dbt.ds__invoice_products"], "language": "sql", "refs": [{"name": "invoice_price_lists", "package": null, "version": null}, {"name": "invoice_insurance_plans", "package": null, "version": null}, {"name": "invoice_price_list_items", "package": null, "version": null}, {"name": "invoice_insurance_plan_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.run_query"], "nodes": ["model.tamanu_source_dbt.invoice_price_lists", "model.tamanu_source_dbt.invoice_insurance_plans", "model.tamanu_source_dbt.invoice_price_list_items", "model.tamanu_source_dbt.invoice_insurance_plan_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__invoice_products.sql", "compiled": true, "compiled_code": "\n\nwith price_pivot as (\n select\n invoice_product_id\n from \"app\".\"reporting\".\"invoice_price_list_items\"\n where is_hidden = false\n group by invoice_product_id\n),\n\ninsurance_pivot as (\n select\n invoice_product_id\n from \"app\".\"reporting\".\"invoice_insurance_plan_items\"\n group by invoice_product_id\n)\n\nselect\n ip.id,\n ip.name,\n ip.insurable,\n ip.category,\n ip.source_record_id,\n ip.visibility_status,\n coalesce(ltt.external_code, ltp.external_code) as external_code\nfrom \"app\".\"reporting\".\"invoice_products\" ip\nleft join price_pivot pp on pp.invoice_product_id = ip.id\nleft join insurance_pivot insurp on insurp.invoice_product_id = ip.id\nleft join \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = ip.source_record_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ip.source_record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__ongoing_conditions": {"database": "app", "schema": "reporting", "name": "ds__ongoing_conditions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__ongoing_conditions.sql", "original_file_path": "models\\datasets\\admin\\ds__ongoing_conditions.sql", "unique_id": "model.tamanu_source_dbt.ds__ongoing_conditions", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__ongoing_conditions"], "alias": "ds__ongoing_conditions", "checksum": {"name": "sha256", "checksum": "8dab420a4bb3411a2856822e95ca7bfa69d7cdac04a129f82d0711dc47b0c816"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "clinical"], "description": "Ongoing conditions", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "age": {"name": "age", "description": "Patient's age when the condition was recorded.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "condition": {"name": "condition", "description": "Full readable name of the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "condition_id": {"name": "condition_id", "description": "Reference to a diagnosis describing this issue ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__condition_id"]}, "recorded_datetime": {"name": "recorded_datetime", "description": "Datetime at which this issue was recorded.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__recorded_date"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording this\r\ncondition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__examiner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user diagnosing/recording this condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "date_resolved": {"name": "date_resolved", "description": "Datetime at which this issue was resolved.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_date"]}, "clinician_resolving": {"name": "clinician_resolving", "description": "Display identifier for the user who resolved the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__ongoing_conditions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2489467, "relation_name": "\"app\".\"reporting\".\"ds__ongoing_conditions\"", "raw_code": "select\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(pc.recorded_datetime::date, p.date_of_birth)) as age,\r\n p.sex,\r\n village.name as village,\r\n village.id as village_id,\r\n conditions.name as condition,\r\n conditions.id as condition_id,\r\n pc.recorded_datetime,\r\n clinician.id as clinician_id,\r\n clinician.display_name as clinician,\r\n case when pc.is_resolved then pc.resolved_datetime end as date_resolved,\r\n case when pc.is_resolved then resolving_clinician.display_name end as clinician_resolving\r\nfrom {{ ref('patient_conditions') }} pc\r\njoin {{ ref('patients') }} p on p.id = pc.patient_id\r\njoin {{ ref('reference_data') }} conditions on conditions.id = pc.condition_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('users') }} clinician on clinician.id = pc.recorded_by_id\r\nleft join {{ ref('users') }} resolving_clinician\r\n on resolving_clinician.id = pc.resolved_by_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patient_conditions", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_conditions", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__ongoing_conditions.sql", "compiled": true, "compiled_code": "select\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pc.recorded_datetime::date, p.date_of_birth)) as age,\n p.sex,\n village.name as village,\n village.id as village_id,\n conditions.name as condition,\n conditions.id as condition_id,\n pc.recorded_datetime,\n clinician.id as clinician_id,\n clinician.display_name as clinician,\n case when pc.is_resolved then pc.resolved_datetime end as date_resolved,\n case when pc.is_resolved then resolving_clinician.display_name end as clinician_resolving\nfrom \"app\".\"reporting\".\"patient_conditions\" pc\njoin \"app\".\"reporting\".\"patients\" p on p.id = pc.patient_id\njoin \"app\".\"reporting\".\"reference_data\" conditions on conditions.id = pc.condition_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = pc.recorded_by_id\nleft join \"app\".\"reporting\".\"users\" resolving_clinician\n on resolving_clinician.id = pc.resolved_by_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patients": {"database": "app", "schema": "reporting", "name": "ds__patients", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__patients.sql", "original_file_path": "models\\datasets\\admin\\ds__patients.sql", "unique_id": "model.tamanu_source_dbt.ds__patients", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__patients"], "alias": "ds__patients", "checksum": {"name": "sha256", "checksum": "66f9b8ca402db02f876217583e643b915bad1975203bbbeb7b61c4045cdd4938"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "patient"], "description": "Patients", "columns": {"registration_date": {"name": "registration_date", "description": "Timestamp of when record was created from the patients_metadata.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "registered_by": {"name": "registered_by", "description": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number. the patient record is registered by.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {"metrics": {"total_patients_count": {"type": "count"}}}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"metrics": {"total_patients_count": {"type": "count"}}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village": {"name": "village", "description": "Full readable name of the village", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "birth_certificate": {"name": "birth_certificate", "description": "Birth certificate identifier.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__birth_certificate"]}, "driving_license": {"name": "driving_license", "description": "Driving licence identifier.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__driving_license"]}, "passport": {"name": "passport", "description": "Passport number.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__passport"]}, "blood_type": {"name": "blood_type", "description": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__blood_type"]}, "title": {"name": "title", "description": "Patient name: title.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__title"]}, "marital_status": {"name": "marital_status", "description": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__marital_status"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "country_of_birth": {"name": "country_of_birth", "description": "Full readable name of the country of birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "nationality": {"name": "nationality", "description": "Full readable name of the nationality.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "ethnicity": {"name": "ethnicity", "description": "Full readable name of the ethnicity.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "occupation": {"name": "occupation", "description": "Full readable name of the occupation.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "religion": {"name": "religion", "description": "Full readable name of the religion.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "patient_billing_type": {"name": "patient_billing_type", "description": "Full readable name of the patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "mother_id": {"name": "mother_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father_id": {"name": "father_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "street_village": {"name": "street_village", "description": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__street_village"]}, "registration_type": {"name": "registration_type", "description": "Indicates whether the patient was registered as a birth or patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "age": {"name": "age", "description": "Patient's age", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "status": {"name": "status", "description": "Indicates whether the patient is alive or deceased.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__patients.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2509556, "relation_name": "\"app\".\"reporting\".\"ds__patients\"", "raw_code": "select\r\n p.created_datetime as registration_date,\r\n u.display_name as registered_by,\r\n p.id as patient_id,\r\n p.first_name,\r\n p.middle_name,\r\n p.last_name,\r\n p.cultural_name,\r\n p.display_id,\r\n p.sex,\r\n p.village_id,\r\n village.name as village,\r\n p.date_of_birth,\r\n p.date_of_death,\r\n pad.birth_certificate,\r\n pad.driving_license,\r\n pad.passport,\r\n pad.blood_type,\r\n pad.title,\r\n pad.marital_status,\r\n pad.primary_contact_number,\r\n pad.secondary_contact_number,\r\n cob.name as country_of_birth,\r\n nationality.name as nationality,\r\n ethnicity.name as ethnicity,\r\n occupation.name as occupation,\r\n religion.name as religion,\r\n billing.name as patient_billing_type,\r\n pad.mother_id,\r\n pad.father_id,\r\n pad.street_village,\r\n case\r\n when pbd.patient_id is null then 'Patient'\r\n else 'Birth'\r\n end as registration_type,\r\n date_part(\r\n 'year',\r\n age(\r\n coalesce(p.date_of_death::date, current_date),\r\n p.date_of_birth\r\n )\r\n ) as age,\r\n case\r\n when p.date_of_death is not null then 'Deceased'\r\n else 'Alive'\r\n end as status\r\nfrom {{ ref(\"patients\") }} p\r\nleft join {{ ref(\"patient_additional_data\") }} pad on pad.patient_id = p.id\r\nleft join {{ ref(\"patient_birth_data\") }} pbd on pbd.patient_id = p.id\r\nleft join {{ ref(\"users\") }} u on u.id = pad.registered_by_id\r\nleft join {{ ref(\"reference_data\") }} village on village.id = p.village_id and village.type = 'village'\r\nleft join {{ ref(\"reference_data\") }} cob on cob.id = pad.country_of_birth_id and cob.type = 'country'\r\nleft join {{ ref(\"reference_data\") }} nationality on nationality.id = pad.nationality_id and nationality.type = 'nationality'\r\nleft join {{ ref(\"reference_data\") }} ethnicity on ethnicity.id = pad.ethnicity_id and ethnicity.type = 'ethnicity'\r\nleft join {{ ref(\"reference_data\") }} occupation on occupation.id = pad.occupation_id and occupation.type = 'occupation'\r\nleft join {{ ref(\"reference_data\") }} religion on religion.id = pad.religion_id and religion.type = 'religion'\r\nleft join {{ ref(\"reference_data\") }} billing on billing.id = pad.patient_billing_type_id and billing.type = 'patientBillingType'", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "patient_birth_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__patients.sql", "compiled": true, "compiled_code": "select\n p.created_datetime as registration_date,\n u.display_name as registered_by,\n p.id as patient_id,\n p.first_name,\n p.middle_name,\n p.last_name,\n p.cultural_name,\n p.display_id,\n p.sex,\n p.village_id,\n village.name as village,\n p.date_of_birth,\n p.date_of_death,\n pad.birth_certificate,\n pad.driving_license,\n pad.passport,\n pad.blood_type,\n pad.title,\n pad.marital_status,\n pad.primary_contact_number,\n pad.secondary_contact_number,\n cob.name as country_of_birth,\n nationality.name as nationality,\n ethnicity.name as ethnicity,\n occupation.name as occupation,\n religion.name as religion,\n billing.name as patient_billing_type,\n pad.mother_id,\n pad.father_id,\n pad.street_village,\n case\n when pbd.patient_id is null then 'Patient'\n else 'Birth'\n end as registration_type,\n date_part(\n 'year',\n age(\n coalesce(p.date_of_death::date, current_date),\n p.date_of_birth\n )\n ) as age,\n case\n when p.date_of_death is not null then 'Deceased'\n else 'Alive'\n end as status\nfrom \"app\".\"reporting\".\"patients\" p\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"patient_birth_data\" pbd on pbd.patient_id = p.id\nleft join \"app\".\"reporting\".\"users\" u on u.id = pad.registered_by_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id and village.type = 'village'\nleft join \"app\".\"reporting\".\"reference_data\" cob on cob.id = pad.country_of_birth_id and cob.type = 'country'\nleft join \"app\".\"reporting\".\"reference_data\" nationality on nationality.id = pad.nationality_id and nationality.type = 'nationality'\nleft join \"app\".\"reporting\".\"reference_data\" ethnicity on ethnicity.id = pad.ethnicity_id and ethnicity.type = 'ethnicity'\nleft join \"app\".\"reporting\".\"reference_data\" occupation on occupation.id = pad.occupation_id and occupation.type = 'occupation'\nleft join \"app\".\"reporting\".\"reference_data\" religion on religion.id = pad.religion_id and religion.type = 'religion'\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pad.patient_billing_type_id and billing.type = 'patientBillingType'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patients_access_logs": {"database": "app", "schema": "reporting", "name": "ds__patients_access_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__patients_access_logs.sql", "original_file_path": "models\\datasets\\admin\\ds__patients_access_logs.sql", "unique_id": "model.tamanu_source_dbt.ds__patients_access_logs", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__patients_access_logs"], "alias": "ds__patients_access_logs", "checksum": {"name": "sha256", "checksum": "38c690024df58cac627e940c5dc405b92aaca10fe4037f86fe8179560ee065a1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "administration"], "description": "Patient record views tracking which users accessed patient records. If the user's details is blank, it indicates that the user has been deleted from Tamanu.", "columns": {"patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) in patients (UUID format).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu internal identifier (generally a UUID) in reference_data for village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "village": {"name": "village", "description": "Full readable name village name where patient resides.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "viewed_by_user_id": {"name": "viewed_by_user_id", "description": "Tamanu internal identifier (generally a UUID) in users who viewed the patient record.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "viewed_by_user": {"name": "viewed_by_user", "description": "The human readable display name for the user. who viewed the patient record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "user_email": {"name": "user_email", "description": "Email address for user. This is used to login and receive emails. of the user who viewed the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__email"]}, "user_role": {"name": "user_role", "description": "The role of the user, which sets their permission level.\r\n\r\nThe special values `admin` and `system` indicate a superadmin and a system user respectively. of the user who viewed the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__role"]}, "viewed_at_facility": {"name": "viewed_at_facility", "description": "Full readable name. where the user was logged in when viewing the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}, "date_time_viewed": {"name": "date_time_viewed", "description": "Local date and time for the record when the patient record was accessed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the access occurred.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "is_mobile": {"name": "is_mobile", "description": "Whether or not the user accessed the record from mobile", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__is_mobile"]}, "session_id": {"name": "session_id", "description": "The user session that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__session_id"]}, "device_id": {"name": "device_id", "description": "The id for the device that the user was accessing the record on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__device_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__patients_access_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2529626, "relation_name": "\"app\".\"reporting\".\"ds__patients_access_logs\"", "raw_code": "with grouped_access_logs as (\r\n select\r\n lap.patient_id,\r\n lap.user_id,\r\n lap.facility_id,\r\n date_trunc('minute', min(lap.logged_at)) as date_time_viewed,\r\n -- Take the first values for fields that might vary within the same minute\r\n lap.is_mobile,\r\n lap.session_id,\r\n lap.device_id\r\n from {{ ref('patients_access_logs') }} lap\r\n group by\r\n lap.patient_id,\r\n lap.user_id,\r\n lap.facility_id,\r\n lap.is_mobile,\r\n lap.session_id,\r\n lap.device_id\r\n)\r\n\r\nselect\r\n gal.patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n p.village_id,\r\n village.name as village,\r\n gal.user_id as viewed_by_user_id,\r\n u.display_name as viewed_by_user,\r\n u.email as user_email,\r\n u.role as user_role,\r\n f.name as viewed_at_facility,\r\n gal.date_time_viewed,\r\n gal.facility_id,\r\n gal.is_mobile,\r\n gal.session_id,\r\n gal.device_id\r\nfrom grouped_access_logs gal\r\njoin {{ ref('patients') }} p on p.id = gal.patient_id\r\nleft join {{ ref('users') }} u on u.id = gal.user_id\r\nleft join {{ ref('facilities') }} f on f.id = gal.facility_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients_access_logs", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients_access_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__patients_access_logs.sql", "compiled": true, "compiled_code": "with grouped_access_logs as (\n select\n lap.patient_id,\n lap.user_id,\n lap.facility_id,\n date_trunc('minute', min(lap.logged_at)) as date_time_viewed,\n -- Take the first values for fields that might vary within the same minute\n lap.is_mobile,\n lap.session_id,\n lap.device_id\n from \"app\".\"reporting\".\"patients_access_logs\" lap\n group by\n lap.patient_id,\n lap.user_id,\n lap.facility_id,\n lap.is_mobile,\n lap.session_id,\n lap.device_id\n)\n\nselect\n gal.patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village,\n gal.user_id as viewed_by_user_id,\n u.display_name as viewed_by_user,\n u.email as user_email,\n u.role as user_role,\n f.name as viewed_at_facility,\n gal.date_time_viewed,\n gal.facility_id,\n gal.is_mobile,\n gal.session_id,\n gal.device_id\nfrom grouped_access_logs gal\njoin \"app\".\"reporting\".\"patients\" p on p.id = gal.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = gal.user_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = gal.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patients_change_logs": {"database": "app", "schema": "reporting", "name": "ds__patients_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__patients_change_logs.sql", "original_file_path": "models\\datasets\\admin\\ds__patients_change_logs.sql", "unique_id": "model.tamanu_source_dbt.ds__patients_change_logs", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__patients_change_logs"], "alias": "ds__patients_change_logs", "checksum": {"name": "sha256", "checksum": "cc0cab715768647073c8b49b36b636f333d5685c1852174b29d9b6d67f7fa5b2"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "patient", "history"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "patient", "history"], "description": "Patient details edits tracking - lists all users that have edited patient personal details or additional data with timestamps.", "columns": {"patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) of the patient whose details were edited.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table. of the patient whose details were edited.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient at the time of edit.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other` at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Village name where the patient resides at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "edited_by_user_id": {"name": "edited_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. of the user who edited the patient details.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "edited_by_user": {"name": "edited_by_user", "description": "Display name of the user who edited the patient details.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email address of the user who edited the patient details.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_role": {"name": "user_role", "description": "Role of the user who edited the patient details.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "edited_datetime": {"name": "edited_datetime", "description": "Date and time when the patient details were edited.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__patients_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient", "history"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2529626, "relation_name": "\"app\".\"reporting\".\"ds__patients_change_logs\"", "raw_code": "with patient_edits as (\r\n -- Patient details edits\r\n select\r\n lcp.id as patient_id,\r\n lcp.display_id,\r\n lcp.first_name,\r\n lcp.last_name,\r\n lcp.date_of_birth,\r\n lcp.sex,\r\n lcp.village_id,\r\n lcp.updated_by_user_id,\r\n lcp.logged_at\r\n from {{ ref('patients_change_logs') }} lcp\r\n\r\n union all\r\n\r\n -- Patient additional data edits\r\n select\r\n lcpad.patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n p.village_id,\r\n lcpad.updated_by_user_id,\r\n lcpad.logged_at\r\n from {{ ref('patient_additional_data_change_logs') }} lcpad\r\n left join {{ ref('patients') }} p on p.id = lcpad.patient_id\r\n),\r\n\r\ngrouped_edits as (\r\n select\r\n pe.patient_id,\r\n pe.display_id,\r\n pe.first_name,\r\n pe.last_name,\r\n pe.date_of_birth,\r\n pe.sex,\r\n pe.village_id,\r\n pe.updated_by_user_id,\r\n date_trunc('minute', pe.logged_at) as edited_datetime\r\n from patient_edits pe\r\n group by\r\n pe.patient_id,\r\n pe.display_id,\r\n pe.first_name,\r\n pe.last_name,\r\n pe.date_of_birth,\r\n pe.sex,\r\n pe.village_id,\r\n pe.updated_by_user_id,\r\n date_trunc('minute', pe.logged_at)\r\n)\r\n\r\nselect\r\n ge.patient_id,\r\n ge.display_id,\r\n ge.first_name,\r\n ge.last_name,\r\n ge.date_of_birth,\r\n ge.sex,\r\n ge.village_id,\r\n village.name as village,\r\n ge.updated_by_user_id as edited_by_user_id,\r\n u.display_name as edited_by_user,\r\n u.email as user_email,\r\n u.role as user_role,\r\n ge.edited_datetime\r\nfrom grouped_edits ge\r\nleft join {{ ref('users') }} u on u.id = ge.updated_by_user_id\r\nleft join {{ ref('reference_data') }} village on village.id = ge.village_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients_change_logs", "package": null, "version": null}, {"name": "patient_additional_data_change_logs", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients_change_logs", "model.tamanu_source_dbt.patient_additional_data_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__patients_change_logs.sql", "compiled": true, "compiled_code": "with patient_edits as (\n -- Patient details edits\n select\n lcp.id as patient_id,\n lcp.display_id,\n lcp.first_name,\n lcp.last_name,\n lcp.date_of_birth,\n lcp.sex,\n lcp.village_id,\n lcp.updated_by_user_id,\n lcp.logged_at\n from \"app\".\"reporting\".\"patients_change_logs\" lcp\n\n union all\n\n -- Patient additional data edits\n select\n lcpad.patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n lcpad.updated_by_user_id,\n lcpad.logged_at\n from \"app\".\"reporting\".\"patient_additional_data_change_logs\" lcpad\n left join \"app\".\"reporting\".\"patients\" p on p.id = lcpad.patient_id\n),\n\ngrouped_edits as (\n select\n pe.patient_id,\n pe.display_id,\n pe.first_name,\n pe.last_name,\n pe.date_of_birth,\n pe.sex,\n pe.village_id,\n pe.updated_by_user_id,\n date_trunc('minute', pe.logged_at) as edited_datetime\n from patient_edits pe\n group by\n pe.patient_id,\n pe.display_id,\n pe.first_name,\n pe.last_name,\n pe.date_of_birth,\n pe.sex,\n pe.village_id,\n pe.updated_by_user_id,\n date_trunc('minute', pe.logged_at)\n)\n\nselect\n ge.patient_id,\n ge.display_id,\n ge.first_name,\n ge.last_name,\n ge.date_of_birth,\n ge.sex,\n ge.village_id,\n village.name as village,\n ge.updated_by_user_id as edited_by_user_id,\n u.display_name as edited_by_user,\n u.email as user_email,\n u.role as user_role,\n ge.edited_datetime\nfrom grouped_edits ge\nleft join \"app\".\"reporting\".\"users\" u on u.id = ge.updated_by_user_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = ge.village_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patient_program_registrations": {"database": "app", "schema": "reporting", "name": "ds__patient_program_registrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__patient_program_registrations.sql", "original_file_path": "models\\datasets\\admin\\ds__patient_program_registrations.sql", "unique_id": "model.tamanu_source_dbt.ds__patient_program_registrations", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__patient_program_registrations"], "alias": "ds__patient_program_registrations", "checksum": {"name": "sha256", "checksum": "eb450c33b13d2d7a37deab6c2623e15c772ba96299e016b9c2fa9b15ad601392"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "clinical"], "description": "Patient program registrations", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "registering_facility_id": {"name": "registering_facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id"]}, "registering_facility": {"name": "registering_facility", "description": "Full readable name of the facility where the patient was registered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinician_id"]}, "registered_by": {"name": "registered_by", "description": "Display identifier for the user who registered the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "currently_at": {"name": "currently_at", "description": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__currently_at_type"]}, "currently_at_type": {"name": "currently_at_type", "description": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__currently_at_type"]}, "related_conditions": {"name": "related_conditions", "description": "Full list of conditions", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patient_conditions"]}, "clinical_status_id": {"name": "clinical_status_id", "description": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id"]}, "clinical_status": {"name": "clinical_status", "description": "Full readable name of the clinical status.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "registration_status": {"name": "registration_status", "description": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registration_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__program_registry_id"]}, "subdivision_id": {"name": "subdivision_id", "description": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__subdivision_id"]}, "subdivision": {"name": "subdivision", "description": "Full readable name of the patient's subdivision.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "division_id": {"name": "division_id", "description": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__division_id"]}, "division": {"name": "division", "description": "Full readable name of the patient's division.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "registration_datetime": {"name": "registration_datetime", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "deactivated_by_id": {"name": "deactivated_by_id", "description": "The clinician that removed the patient from the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id"]}, "deactivated_by": {"name": "deactivated_by", "description": "Display identifier for the user who deactivated the patient program registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "deactivated_datetime": {"name": "deactivated_datetime", "description": "The date that the patient from the program registry.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_date"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "emergency_contact_name": {"name": "emergency_contact_name", "description": "Name of emergency contact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name"]}, "emergency_contact_number": {"name": "emergency_contact_number", "description": "Phone number of emergency contact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__patient_program_registrations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2605596, "relation_name": "\"app\".\"reporting\".\"ds__patient_program_registrations\"", "raw_code": "with related_conditions as (\r\n select\r\n ppr.id as patient_program_registration_id,\r\n string_agg(\r\n prc.name, '; '\r\n order by pprc.datetime\r\n ) as conditions,\r\n array_agg(\r\n pprc.program_registry_condition_id\r\n order by pprc.datetime\r\n ) as condition_ids,\r\n string_agg(\r\n prcc.name, '; '\r\n order by pprc.datetime\r\n ) as condition_categories,\r\n array_agg(\r\n pprc.program_registry_condition_category_id\r\n order by pprc.datetime\r\n ) as condition_category_ids\r\n from {{ ref('patient_program_registration_conditions') }} pprc\r\n join {{ ref('patient_program_registrations') }} ppr on ppr.id = pprc.patient_program_registration_id\r\n left join {{ ref('program_registry_conditions') }} prc on prc.id = pprc.program_registry_condition_id\r\n left join {{ ref('program_registry_condition_categories') }} prcc on prcc.id = pprc.program_registry_condition_category_id\r\n group by ppr.id\r\n)\r\n\r\nselect\r\n ppr.id as patient_program_registration_id,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n registering_facility.id as registering_facility_id,\r\n registering_facility.name as registering_facility,\r\n registered_by.id as registered_by_id,\r\n registered_by.display_name as registered_by,\r\n case\r\n when pr.currently_at_type = 'facility' then currently_at_facility.name\r\n when pr.currently_at_type = 'village' then currently_at_village.name\r\n end as currently_at,\r\n pr.currently_at_type,\r\n c.condition_ids as related_condition_ids,\r\n c.conditions as related_conditions,\r\n c.condition_category_ids as related_condition_category_ids,\r\n c.condition_categories as related_condition_categories,\r\n prcs.id as clinical_status_id,\r\n prcs.name as clinical_status,\r\n ppr.registration_status,\r\n ppr.program_registry_id,\r\n subdivision.id as subdivision_id,\r\n subdivision.name as subdivision,\r\n division.id as division_id,\r\n division.name as division,\r\n ppr.datetime as registration_datetime,\r\n ppr.deactivated_by_id,\r\n deactivated_by.display_name as deactivated_by,\r\n ppr.deactivated_datetime,\r\n pad.primary_contact_number,\r\n pad.secondary_contact_number,\r\n pad.emergency_contact_name,\r\n pad.emergency_contact_number\r\nfrom {{ ref('patient_program_registrations') }} ppr\r\njoin {{ ref('program_registries') }} pr on pr.id = ppr.program_registry_id\r\njoin {{ ref('patients') }} p on p.id = ppr.patient_id\r\nleft join {{ ref(\"patient_additional_data\") }} pad on pad.patient_id = p.id\r\nleft join {{ ref('facilities') }} registering_facility on registering_facility.id = ppr.registering_facility_id\r\nleft join {{ ref('users') }} registered_by on registered_by.id = ppr.registered_by_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('facilities') }} currently_at_facility on currently_at_facility.id = ppr.facility_id\r\nleft join {{ ref('reference_data') }} subdivision on subdivision.id = pad.subdivision_id\r\nleft join {{ ref('reference_data') }} division on division.id = pad.division_id\r\nleft join {{ ref('reference_data') }} currently_at_village on currently_at_village.id = ppr.village_id\r\nleft join related_conditions c on c.patient_program_registration_id = ppr.id\r\nleft join {{ ref('program_registry_clinical_statuses') }} prcs on prcs.id = ppr.clinical_status_id\r\nleft join {{ ref('users') }} deactivated_by on deactivated_by.id = ppr.deactivated_by_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patient_program_registration_conditions", "package": null, "version": null}, {"name": "patient_program_registrations", "package": null, "version": null}, {"name": "program_registry_conditions", "package": null, "version": null}, {"name": "program_registry_condition_categories", "package": null, "version": null}, {"name": "patient_program_registrations", "package": null, "version": null}, {"name": "program_registries", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "program_registry_clinical_statuses", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_program_registration_conditions", "model.tamanu_source_dbt.patient_program_registrations", "model.tamanu_source_dbt.program_registry_conditions", "model.tamanu_source_dbt.program_registry_condition_categories", "model.tamanu_source_dbt.program_registries", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__patient_program_registrations.sql", "compiled": true, "compiled_code": "with related_conditions as (\n select\n ppr.id as patient_program_registration_id,\n string_agg(\n prc.name, '; '\n order by pprc.datetime\n ) as conditions,\n array_agg(\n pprc.program_registry_condition_id\n order by pprc.datetime\n ) as condition_ids,\n string_agg(\n prcc.name, '; '\n order by pprc.datetime\n ) as condition_categories,\n array_agg(\n pprc.program_registry_condition_category_id\n order by pprc.datetime\n ) as condition_category_ids\n from \"app\".\"reporting\".\"patient_program_registration_conditions\" pprc\n join \"app\".\"reporting\".\"patient_program_registrations\" ppr on ppr.id = pprc.patient_program_registration_id\n left join \"app\".\"reporting\".\"program_registry_conditions\" prc on prc.id = pprc.program_registry_condition_id\n left join \"app\".\"reporting\".\"program_registry_condition_categories\" prcc on prcc.id = pprc.program_registry_condition_category_id\n group by ppr.id\n)\n\nselect\n ppr.id as patient_program_registration_id,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n village.id as village_id,\n village.name as village,\n registering_facility.id as registering_facility_id,\n registering_facility.name as registering_facility,\n registered_by.id as registered_by_id,\n registered_by.display_name as registered_by,\n case\n when pr.currently_at_type = 'facility' then currently_at_facility.name\n when pr.currently_at_type = 'village' then currently_at_village.name\n end as currently_at,\n pr.currently_at_type,\n c.condition_ids as related_condition_ids,\n c.conditions as related_conditions,\n c.condition_category_ids as related_condition_category_ids,\n c.condition_categories as related_condition_categories,\n prcs.id as clinical_status_id,\n prcs.name as clinical_status,\n ppr.registration_status,\n ppr.program_registry_id,\n subdivision.id as subdivision_id,\n subdivision.name as subdivision,\n division.id as division_id,\n division.name as division,\n ppr.datetime as registration_datetime,\n ppr.deactivated_by_id,\n deactivated_by.display_name as deactivated_by,\n ppr.deactivated_datetime,\n pad.primary_contact_number,\n pad.secondary_contact_number,\n pad.emergency_contact_name,\n pad.emergency_contact_number\nfrom \"app\".\"reporting\".\"patient_program_registrations\" ppr\njoin \"app\".\"reporting\".\"program_registries\" pr on pr.id = ppr.program_registry_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = ppr.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"facilities\" registering_facility on registering_facility.id = ppr.registering_facility_id\nleft join \"app\".\"reporting\".\"users\" registered_by on registered_by.id = ppr.registered_by_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"facilities\" currently_at_facility on currently_at_facility.id = ppr.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" subdivision on subdivision.id = pad.subdivision_id\nleft join \"app\".\"reporting\".\"reference_data\" division on division.id = pad.division_id\nleft join \"app\".\"reporting\".\"reference_data\" currently_at_village on currently_at_village.id = ppr.village_id\nleft join related_conditions c on c.patient_program_registration_id = ppr.id\nleft join \"app\".\"reporting\".\"program_registry_clinical_statuses\" prcs on prcs.id = ppr.clinical_status_id\nleft join \"app\".\"reporting\".\"users\" deactivated_by on deactivated_by.id = ppr.deactivated_by_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming": {"database": "app", "schema": "reporting", "name": "ds__patient_vaccinations_upcoming", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__patient_vaccinations_upcoming.sql", "original_file_path": "models\\datasets\\admin\\ds__patient_vaccinations_upcoming.sql", "unique_id": "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__patient_vaccinations_upcoming"], "alias": "ds__patient_vaccinations_upcoming", "checksum": {"name": "sha256", "checksum": "0d17504b8760eb77fb0ef196270e4035949622cd613ef2b70909921fcc80eda4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "clinical"], "description": "Patient vaccinations upcoming", "columns": {"display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age when patient was vaccinated.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the village", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "due_date": {"name": "due_date", "description": "Due date of the scheduled vaccine.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__due_date"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "vaccine_schedules_id": {"name": "vaccine_schedules_id", "description": "Reference to the [scheduled vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id"]}, "vaccine_name": {"name": "vaccine_name", "description": "Contents of the label column is what will be displayed on the front end of Tamanu \r\nunder fields labelled 'Vaccine'. This is where the vaccine name is listed. E.g. 'BCG'.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__label"]}, "vaccine_schedule": {"name": "vaccine_schedule", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "vaccine_status": {"name": "vaccine_status", "description": "Status of the upcoming vaccination listed ['DUE', 'OVERDUE', 'MISSED', 'SCHEDULED', 'UPCOMING']", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__patient_vaccinations_upcoming.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2605596, "relation_name": "\"app\".\"reporting\".\"ds__patient_vaccinations_upcoming\"", "raw_code": "select\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.id as patient_id,\r\n p.date_of_birth,\r\n date_part('year', age(p.date_of_birth)) as age,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n pvu.due_date,\r\n pvu.vaccine_category,\r\n pvu.vaccine_schedules_id,\r\n sv.label as vaccine_name,\r\n sv.dose_label as vaccine_schedule,\r\n pvu.status as vaccine_status\r\nfrom {{ ref(\"patient_vaccinations_upcoming\") }} pvu\r\njoin {{ ref(\"patients\") }} p on p.id = pvu.patient_id\r\njoin {{ ref(\"vaccine_schedules\") }} sv on sv.id = pvu.vaccine_schedules_id\r\nleft join {{ ref(\"reference_data\") }} village on village.id = p.village_id\r\nwhere p.date_of_death is null", "doc_blocks": [], "language": "sql", "refs": [{"name": "patient_vaccinations_upcoming", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_vaccinations_upcoming", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__patient_vaccinations_upcoming.sql", "compiled": true, "compiled_code": "select\n p.display_id,\n p.first_name,\n p.last_name,\n p.id as patient_id,\n p.date_of_birth,\n date_part('year', age(p.date_of_birth)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n pvu.due_date,\n pvu.vaccine_category,\n pvu.vaccine_schedules_id,\n sv.label as vaccine_name,\n sv.dose_label as vaccine_schedule,\n pvu.status as vaccine_status\nfrom \"app\".\"reporting\".\"patient_vaccinations_upcoming\" pvu\njoin \"app\".\"reporting\".\"patients\" p on p.id = pvu.patient_id\njoin \"app\".\"reporting\".\"vaccine_schedules\" sv on sv.id = pvu.vaccine_schedules_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nwhere p.date_of_death is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details": {"database": "app", "schema": "reporting", "name": "ds__usage_quality_metrics_patient_details", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__usage_quality_metrics_patient_details.sql", "original_file_path": "models\\datasets\\admin\\ds__usage_quality_metrics_patient_details.sql", "unique_id": "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__usage_quality_metrics_patient_details"], "alias": "ds__usage_quality_metrics_patient_details", "checksum": {"name": "sha256", "checksum": "9110e873bdfe86bd5deb88d8176a2bf12c20dbc172eb04fbb2b9ee80ff82cd41"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "clinical"], "description": "Usage quality metrics - patient details", "columns": {"total_patients": {"name": "total_patients", "description": "Total patients in the database includes merged", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_incomplete_name": {"name": "total_patients_with_incomplete_name", "description": "Total patients with incomplete name (missing first or last name)", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_missing_dob": {"name": "total_patients_with_missing_dob", "description": "Total patients with missing date of birth", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_invalid_dob": {"name": "total_patients_with_invalid_dob", "description": "Total patients with invalid date of birth (on or before 1900-01-01 or after today's date)", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_missing_location": {"name": "total_patients_with_missing_location", "description": "Total patients with missing location information (no entry for village, nursing zone, medical_area, sub-division, division)", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_missing_contact": {"name": "total_patients_with_missing_contact", "description": "Total patients with missing contact information (no entry for primary nor secondary contact)", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_merged": {"name": "total_patients_merged", "description": "Total patients merged", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__usage_quality_metrics_patient_details.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.2669468, "relation_name": "\"app\".\"reporting\".\"ds__usage_quality_metrics_patient_details\"", "raw_code": "with data as (\r\n select\r\n p.id as patient_id,\r\n pm.id as patient_merged_id,\r\n coalesce(nullif(trim(p.first_name), ''), nullif(trim(pm.first_name), '')) as first_name,\r\n coalesce(nullif(trim(p.last_name), ''), nullif(trim(pm.last_name), '')) as last_name,\r\n coalesce(p.date_of_birth, pm.date_of_birth) as date_of_birth,\r\n coalesce(nullif(trim(p.village_id), ''), nullif(trim(pm.village_id), '')) as village_id,\r\n nullif(trim(pad.nursing_zone_id), '') as nursing_zone_id,\r\n nullif(trim(pad.medical_area_id), '') as medical_area_id,\r\n nullif(trim(pad.subdivision_id), '') as subdivision_id,\r\n nullif(trim(pad.division_id), '') as division_id,\r\n nullif(trim(pad.primary_contact_number), '') as primary_contact_number,\r\n nullif(trim(pad.secondary_contact_number), '') as secondary_contact_number\r\n from {{ ref(\"patients\") }} p\r\n full join {{ ref(\"patients_merged\") }} pm\r\n on pm.id = p.id\r\n left join {{ ref(\"patient_additional_data\") }} pad\r\n on pad.patient_id = coalesce(p.id, pm.id)\r\n)\r\n\r\nselect\r\n count(*) as total_patients,\r\n count(*) filter (where first_name is null or last_name is null) as total_patients_with_incomplete_name,\r\n count(*) filter (where date_of_birth is null) as total_patients_with_missing_dob,\r\n count(*) filter (where date_of_birth <= '1900-01-01' or date_of_birth > now()::date) as total_patients_with_invalid_dob,\r\n count(*) filter (where coalesce(village_id, nursing_zone_id, medical_area_id, subdivision_id, division_id) is null) as total_patients_with_missing_location,\r\n count(*) filter (where coalesce(primary_contact_number, secondary_contact_number) is null) as total_patients_with_missing_contact,\r\n count(patient_merged_id) as total_patients_merged\r\nfrom data", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients", "package": null, "version": null}, {"name": "patients_merged", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_merged", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__usage_quality_metrics_patient_details.sql", "compiled": true, "compiled_code": "with data as (\n select\n p.id as patient_id,\n pm.id as patient_merged_id,\n coalesce(nullif(trim(p.first_name), ''), nullif(trim(pm.first_name), '')) as first_name,\n coalesce(nullif(trim(p.last_name), ''), nullif(trim(pm.last_name), '')) as last_name,\n coalesce(p.date_of_birth, pm.date_of_birth) as date_of_birth,\n coalesce(nullif(trim(p.village_id), ''), nullif(trim(pm.village_id), '')) as village_id,\n nullif(trim(pad.nursing_zone_id), '') as nursing_zone_id,\n nullif(trim(pad.medical_area_id), '') as medical_area_id,\n nullif(trim(pad.subdivision_id), '') as subdivision_id,\n nullif(trim(pad.division_id), '') as division_id,\n nullif(trim(pad.primary_contact_number), '') as primary_contact_number,\n nullif(trim(pad.secondary_contact_number), '') as secondary_contact_number\n from \"app\".\"reporting\".\"patients\" p\n full join \"app\".\"reporting\".\"patients_merged\" pm\n on pm.id = p.id\n left join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = coalesce(p.id, pm.id)\n)\n\nselect\n count(*) as total_patients,\n count(*) filter (where first_name is null or last_name is null) as total_patients_with_incomplete_name,\n count(*) filter (where date_of_birth is null) as total_patients_with_missing_dob,\n count(*) filter (where date_of_birth <= '1900-01-01' or date_of_birth > now()::date) as total_patients_with_invalid_dob,\n count(*) filter (where coalesce(village_id, nursing_zone_id, medical_area_id, subdivision_id, division_id) is null) as total_patients_with_missing_location,\n count(*) filter (where coalesce(primary_contact_number, secondary_contact_number) is null) as total_patients_with_missing_contact,\n count(patient_merged_id) as total_patients_merged\nfrom data", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations": {"database": "app", "schema": "reporting", "name": "ds__usage_quality_metrics_patient_registrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__usage_quality_metrics_patient_registrations.sql", "original_file_path": "models\\datasets\\admin\\ds__usage_quality_metrics_patient_registrations.sql", "unique_id": "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations", "fqn": ["tamanu_source_dbt", "datasets", "admin", "ds__usage_quality_metrics_patient_registrations"], "alias": "ds__usage_quality_metrics_patient_registrations", "checksum": {"name": "sha256", "checksum": "e30799ffc774154012b206b5d5e50fd410296f4d26a5c909e965d5c49e713cb8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "admin", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "admin", "clinical"], "description": "Usage quality metrics - patient registrations", "columns": {"registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patients which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "total_patient_registrations": {"name": "total_patient_registrations", "description": "Total patient registrations", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_birth_registrations": {"name": "total_birth_registrations", "description": "Total birth registrations", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_incorrect_registrations_for_patient_under_6mth": {"name": "total_incorrect_registrations_for_patient_under_6mth", "description": "Total registrations for patient under 6 months incorrectly registered as a new patient instead of a birth registration", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\admin\\ds__usage_quality_metrics_patient_registrations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.2691548, "relation_name": "\"app\".\"reporting\".\"ds__usage_quality_metrics_patient_registrations\"", "raw_code": "with data as (\r\n select\r\n p.created_datetime as registration_date,\r\n p.id as registration_patient_id,\r\n pbd.patient_id as birth_patient_id,\r\n p.date_of_birth,\r\n age(p.created_datetime, p.date_of_birth) < interval '6 months' as age_under_6m_at_registration\r\n from {{ ref(\"patients\") }} p\r\n left join {{ ref(\"patient_birth_data\") }} pbd\r\n on pbd.patient_id = p.id\r\n)\r\n\r\nselect\r\n registration_date,\r\n count(*) filter (where birth_patient_id is null) as total_patient_registrations,\r\n count(birth_patient_id) as total_birth_registrations,\r\n count(*) filter (where birth_patient_id is null and age_under_6m_at_registration) as total_incorrect_registrations_for_patient_under_6mth\r\nfrom data\r\ngroup by registration_date", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients", "package": null, "version": null}, {"name": "patient_birth_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\admin\\ds__usage_quality_metrics_patient_registrations.sql", "compiled": true, "compiled_code": "with data as (\n select\n p.created_datetime as registration_date,\n p.id as registration_patient_id,\n pbd.patient_id as birth_patient_id,\n p.date_of_birth,\n age(p.created_datetime, p.date_of_birth) < interval '6 months' as age_under_6m_at_registration\n from \"app\".\"reporting\".\"patients\" p\n left join \"app\".\"reporting\".\"patient_birth_data\" pbd\n on pbd.patient_id = p.id\n)\n\nselect\n registration_date,\n count(*) filter (where birth_patient_id is null) as total_patient_registrations,\n count(birth_patient_id) as total_birth_registrations,\n count(*) filter (where birth_patient_id is null and age_under_6m_at_registration) as total_incorrect_registrations_for_patient_under_6mth\nfrom data\ngroup by registration_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_admissions": {"database": "app", "schema": "reporting", "name": "ds__sensitive_admissions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_admissions.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_admissions.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_admissions", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_admissions"], "alias": "ds__sensitive_admissions", "checksum": {"name": "sha256", "checksum": "b0f9be4b79072d34b987ff3007fe009e9a67936172827c5153515b6f0aee81bd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility admissions", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the appointment.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "admitting_clinician_id": {"name": "admitting_clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "admitting_clinician": {"name": "admitting_clinician", "description": "Display identifier for the user who admitted the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "admission_datetime": {"name": "admission_datetime", "description": "Local date for the record on admission.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "admission_status": {"name": "admission_status", "description": "The current status of the admission.\r\n\r\n- `active` indicates the patient is currently admitted\r\n- `discharged` indicates the patient has been discharged", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__admission_status"]}, "discharge_datetime": {"name": "discharge_datetime", "description": "Local date for the record on discharge.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_ids": {"name": "department_ids", "description": "An array referencing the [department](#!/source/tamanu-source-dbt.tamanu.departments) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_ids"]}, "departments": {"name": "departments", "description": "A comma separated list of names of the departments the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__departments"]}, "department_datetimes": {"name": "department_datetimes", "description": "A comma separated list of dates and times of the departments associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "location_group_ids": {"name": "location_group_ids", "description": "An array referencing the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_ids"]}, "location_groups": {"name": "location_groups", "description": "A comma separated list of names of the location groups the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_groups"]}, "location_group_datetimes": {"name": "location_group_datetimes", "description": "A comma separated list of dates and times of the location groups associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "location_ids": {"name": "location_ids", "description": "An array referencing the [location](#!/source/tamanu-source-dbt.tamanu.locations) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_ids"]}, "locations": {"name": "locations", "description": "A comma separated list of names of the locations the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__locations"]}, "location_datetimes": {"name": "location_datetimes", "description": "A comma separated list of dates and times of the locations associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "primary_diagnoses": {"name": "primary_diagnoses", "description": "Full list of diagnoses that are primary for the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}, "secondary_diagnoses": {"name": "secondary_diagnoses", "description": "Full list of diagnoses that are secondary for the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_admissions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2743115, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_admissions\"", "raw_code": "{{ admissions_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.admissions_dataset"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_admissions.sql", "compiled": true, "compiled_code": "\n\nwith admission_encounters as (\n select\n e.id,\n e.patient_id,\n e.start_datetime,\n e.end_datetime,\n e.location_id,\n e.patient_billing_type_id,\n f.id as facility_id,\n f.name as facility_name\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\n where e.encounter_type = 'admission'\n and f.is_sensitive = True\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n u.display_name as clinician_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n -- Window functions for ordering and lag operations\n row_number() over (\n partition by eh.encounter_id, ('encounter_type' = any(eh.change_type))\n order by eh.datetime\n ) as encounter_type_change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from admission_encounters ae\n left join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = ae.id\n and eh.encounter_type = 'admission'\n and (eh.change_type is null or eh.change_type && array['encounter_type', 'examiner', 'department', 'location'])\n left join \"app\".\"reporting\".\"users\" u\n on u.id = eh.clinician_id\n left join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n left join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\n-- Clinician changes and admitting clinician logic\nclinician_data as (\n select\n encounter_id,\n bool_or('encounter_type' = any(change_type) and encounter_type_change_sequence = 1) as is_transfer,\n min(datetime) filter (where change_type is null or change_type && array['encounter_type', 'examiner']) as admission_datetime,\n array_agg(\n datetime\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_datetimes,\n array_agg(\n clinician_id\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_ids,\n array_agg(\n clinician_name\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_names\n from encounter_history_consolidated\n group by encounter_id\n),\n\n-- Admitting clinician determination\nadmitting_clinicians as (\n select\n encounter_id,\n admission_datetime,\n case\n when is_transfer and array_length(clinician_ids, 1) > 1\n then clinician_ids[2]\n else clinician_ids[1]\n end as admitting_clinician_id,\n case\n when is_transfer and array_length(clinician_names, 1) > 1\n then clinician_names[2]\n else clinician_names[1]\n end as admitting_clinician_name\n from clinician_data\n),\n\n-- Department changes aggregation\ndepartment_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) as departments\n from encounter_history_consolidated\n where change_type is null or change_type && array['encounter_type', 'department']\n group by encounter_id\n),\n\n-- Location changes aggregation\nlocation_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) as locations\n from encounter_history_consolidated\n where change_type is null or change_type && array['encounter_type', 'location']\n group by encounter_id\n),\n\n-- Location group changes (deduplicated in single pass)\nlocation_group_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) as location_groups\n from encounter_history_consolidated\n where (change_type is null or change_type && array['encounter_type', 'location'])\n and (location_group_id != prev_location_group_id or prev_location_group_id is null)\n group by encounter_id\n),\n\n-- Diagnoses aggregation\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n case when ed.is_primary\n then rd.name || ' (' || rd.code || ')'\n end,\n '; '\n order by ed.datetime\n ) as primary_diagnoses,\n string_agg(\n case when not ed.is_primary\n then rd.name || ' (' || rd.code || ')'\n end,\n '; '\n order by ed.datetime\n ) as secondary_diagnoses\n from admission_encounters ae\n inner join \"app\".\"reporting\".\"encounter_diagnoses\" ed\n on ed.encounter_id = ae.id\n inner join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = ed.diagnosis_id\n where ed.certainty not in ('disproven', 'error')\n group by ed.encounter_id\n),\n\n-- Patient and reference data\npatient_data as (\n select\n ae.id as encounter_id,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village_name,\n ae.patient_billing_type_id,\n bt.name as billing_type_name,\n ae.start_datetime,\n ae.end_datetime,\n ae.location_id,\n ae.facility_id,\n ae.facility_name\n from admission_encounters ae\n left join \"app\".\"reporting\".\"patients\" p\n on p.id = ae.patient_id\n left join \"app\".\"reporting\".\"reference_data\" village\n on village.id = p.village_id\n left join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = ae.patient_billing_type_id\n)\n\nselect\n pd.patient_id,\n pd.display_id,\n pd.first_name,\n pd.last_name,\n pd.date_of_birth,\n date_part('year', age(ac.admission_datetime, pd.date_of_birth)) as age,\n initcap(pd.sex::text) as sex,\n pd.village_id,\n pd.village_name as village,\n pd.patient_billing_type_id as billing_type_id,\n pd.billing_type_name as billing_type,\n ac.admitting_clinician_id,\n ac.admitting_clinician_name as admitting_clinician,\n ac.admission_datetime,\n case\n when pd.end_datetime is null then 'active'\n else 'discharged'\n end as admission_status,\n pd.end_datetime as discharge_datetime,\n pd.facility_id,\n pd.facility_name as facility,\n dc.department_ids,\n dc.departments,\n dc.department_datetimes,\n lgc.location_group_ids,\n lgc.location_groups,\n lgc.location_group_datetimes,\n lc.location_ids,\n lc.locations,\n lc.location_datetimes,\n ed.primary_diagnoses,\n ed.secondary_diagnoses\nfrom patient_data pd\nleft join admitting_clinicians ac\n on ac.encounter_id = pd.encounter_id\nleft join department_changes dc\n on dc.encounter_id = pd.encounter_id\nleft join location_changes lc\n on lc.encounter_id = pd.encounter_id\nleft join location_group_changes lgc\n on lgc.encounter_id = pd.encounter_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = pd.encounter_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_diagnoses": {"database": "app", "schema": "reporting", "name": "ds__sensitive_diagnoses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_diagnoses.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_diagnoses.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_diagnoses", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_diagnoses"], "alias": "ds__sensitive_diagnoses", "checksum": {"name": "sha256", "checksum": "4b81533bedec21d9e91cd557e411298d9289af04ddebfa030a9583f0a1b5605d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility diagnoses", "columns": {"encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__encounter_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id"]}, "diagnosis": {"name": "diagnosis", "description": "Full readable name of the diagnosis", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "diagnosis_datetime": {"name": "diagnosis_datetime", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "age": {"name": "age", "description": "Patient's age at the time of diagnosis.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "contact_number": {"name": "contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who diagnosed the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "certainty": {"name": "certainty", "description": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__certainty"]}, "is_primary": {"name": "is_primary", "description": "A boolean indicating if this is a primary diagnosis", "meta": {}, "data_type": "bool", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__is_primary"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_diagnoses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2763171, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_diagnoses\"", "raw_code": "{{ diagnoses_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.diagnoses_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_diagnoses.sql", "compiled": true, "compiled_code": "\n\nselect\n e.id as encounter_id,\n p.id as patient_id,\n diagnosis.id as diagnosis_id,\n diagnosis.name as diagnosis,\n ed.datetime as diagnosis_datetime,\n p.first_name,\n p.last_name,\n p.display_id,\n date_part('year', age(ed.datetime::date, p.date_of_birth)) as age,\n p.sex,\n coalesce(pad.primary_contact_number, pad.secondary_contact_number) as contact_number,\n village.id as village_id,\n village.name as village,\n clinician.id as clinician_id,\n clinician.display_name as clinician,\n d.id as department_id,\n d.name as department,\n l.id as location_id,\n l.name as location,\n f.id as facility_id,\n f.name as facility,\n initcap(ed.certainty) as certainty,\n case when ed.is_primary = true then 'Yes' else 'No' end as is_primary\nfrom \"app\".\"reporting\".\"encounter_diagnoses\" ed\njoin \"app\".\"reporting\".\"reference_data\" diagnosis on diagnosis.id = ed.diagnosis_id\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ed.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = e.clinician_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_encounters_emergency": {"database": "app", "schema": "reporting", "name": "ds__sensitive_encounters_emergency", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_encounters_emergency.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_encounters_emergency.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_encounters_emergency"], "alias": "ds__sensitive_encounters_emergency", "checksum": {"name": "sha256", "checksum": "538862355d9f352377664654562b81f233d36ee0dfa22a68b414ed83e33b6713"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Emergency encounters with triage information from sensitive facilities", "columns": {"triage_id": {"name": "triage_id", "description": "Tamanu internal identifier (generally a UUID) in triages.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "arrival_datetime": {"name": "arrival_datetime", "description": "When the patient arrived.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time"]}, "triage_datetime": {"name": "triage_datetime", "description": "When the patient was triaged.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time"]}, "closed_datetime": {"name": "closed_datetime", "description": "When the patient was processed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time"]}, "score": {"name": "score", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__encounter_id"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "arrival_mode": {"name": "arrival_mode", "description": "Full readable name of the triage arrival mode.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "chief_complaint": {"name": "chief_complaint", "description": "Full readable name of the chief complaint.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "secondary_complaint": {"name": "secondary_complaint", "description": "Full readable name of the secondary complaint.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__practitioner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who triaged the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) the triage is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility the triage is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_encounters_emergency.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2797272, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_encounters_emergency\"", "raw_code": "{{ encounters_emergency_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "triages", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounters_emergency_dataset"], "nodes": ["model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_encounters_emergency.sql", "compiled": true, "compiled_code": "\n\nselect\n t.id as triage_id,\n t.arrival_datetime,\n t.triage_datetime,\n t.closed_datetime,\n t.score,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village,\n e.id as encounter_id,\n e.encounter_type,\n arrival_mode.name as arrival_mode,\n chief_complaint.name as chief_complaint,\n secondary_complaint.name as secondary_complaint,\n clinician.display_name as clinician,\n t.clinician_id,\n f.id as facility_id,\n f.name as facility\nfrom \"app\".\"reporting\".\"triages\" t\njoin \"app\".\"reporting\".\"encounters\" e on e.id = t.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" arrival_mode on arrival_mode.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" chief_complaint on chief_complaint.id = t.chief_complaint_id\nleft join \"app\".\"reporting\".\"reference_data\" secondary_complaint on secondary_complaint.id = t.secondary_complaint_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = t.clinician_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_encounter_diets": {"database": "app", "schema": "reporting", "name": "ds__sensitive_encounter_diets", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_encounter_diets.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_encounter_diets.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_encounter_diets"], "alias": "ds__sensitive_encounter_diets", "checksum": {"name": "sha256", "checksum": "8a88b2033ddb0e472619517ea0192975fbebd85da4bdf21c5c0a2f6502b75edf"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility active encounters with their associated dietary requirements", "columns": {"encounter_id": {"name": "encounter_id", "description": "Tamanu internal identifier (generally a UUID) of encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "patient_name": {"name": "patient_name", "description": "Patient Name", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_name"]}, "age": {"name": "age", "description": "Patient's age at the time of the encounter, formatted with appropriate unit (days/weeks/months/years).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "diets": {"name": "diets", "description": "Full readable name of dietary requirements for the patient during this encounter, comma-separated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "allergies": {"name": "allergies", "description": "Full readable name of allergies for the patient during this encounter, comma-separated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_encounter_diets.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.2797272, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_encounter_diets\"", "raw_code": "{{ encounter_diets_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diets", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patient_allergies", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_diets_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patient_allergies", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_encounter_diets.sql", "compiled": true, "compiled_code": "\n\nwith diets as (\n select\n ed.encounter_id,\n string_agg(\n rd.name, ', '\n order by rd.name\n ) as diets\n from \"app\".\"reporting\".\"encounter_diets\" ed\n join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = ed.diet_id\n group by ed.encounter_id\n),\n\nallergies as (\n select\n pa.patient_id,\n string_agg(\n rd.name, ', '\n order by rd.name\n ) as allergies\n from \"app\".\"reporting\".\"patient_allergies\" pa\n join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = pa.allergy_id\n group by pa.patient_id\n)\n\nselect\n e.id as encounter_id,\n p.id as patient_id,\n p.display_id,\n concat(p.first_name, ' ', p.last_name) as patient_name,\n e.start_datetime,\n case\n when age(current_date, p.date_of_birth) < interval '8 days'\n then concat(extract(day from age(current_date, p.date_of_birth)), ' days')\n when age(current_date, p.date_of_birth) >= interval '8 days'\n and age(current_date, p.date_of_birth) < interval '1 month'\n then concat(extract(week from age(current_date, p.date_of_birth)), ' weeks')\n when age(current_date, p.date_of_birth) >= interval '1 month'\n and age(current_date, p.date_of_birth) < interval '2 years'\n then concat(extract(month from age(current_date, p.date_of_birth)), ' months')\n when age(current_date, p.date_of_birth) >= interval '2 years'\n then concat(extract(year from age(current_date, p.date_of_birth)), ' years')\n end as age,\n l.id as location_id,\n l.name as location,\n lg.id as location_group_id,\n lg.name as location_group,\n d.diets,\n a.allergies\nfrom \"app\".\"reporting\".\"encounters\" e\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join diets d\n on d.encounter_id = e.id\nleft join allergies a\n on a.patient_id = p.id\nwhere e.end_datetime is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions": {"database": "app", "schema": "reporting", "name": "ds__sensitive_encounter_prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_encounter_prescriptions.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_encounter_prescriptions.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_encounter_prescriptions"], "alias": "ds__sensitive_encounter_prescriptions", "checksum": {"name": "sha256", "checksum": "f2365cad836c4dc5f48bd2c4246b63777337ffd1fba3bdd877982bf50ee0b2ba"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility encounter prescriptions", "columns": {"encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__encounter_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__prescription_id"]}, "datetime": {"name": "datetime", "description": "Local date and time for the record in prescriptions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "is_selected_for_discharge": {"name": "is_selected_for_discharge", "description": "Whether the prescription is for when the patient is discharged.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "medication_code": {"name": "medication_code", "description": "Full readable name code of the prescribed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "medication": {"name": "medication", "description": "Full readable name name of the prescribed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "quantity": {"name": "quantity", "description": "Quantity of medicine to dispense.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__quantity"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_encounter_prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2829607, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_encounter_prescriptions\"", "raw_code": "{{ encounter_prescriptions_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_prescriptions_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_encounter_prescriptions.sql", "compiled": true, "compiled_code": "\n\nselect\n ep.encounter_id,\n ep.prescription_id,\n pr.datetime,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pr.datetime, p.date_of_birth)) as age,\n p.sex,\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\n vil.id as village_id,\n vil.name as village,\n l.facility_id,\n f.name as facility,\n ep.is_selected_for_discharge,\n pr.medication_id,\n m.code as medication_code,\n m.name as medication,\n pr.route,\n pr.quantity,\n pr.repeats,\n pr.is_ongoing,\n pr.is_prn,\n pr.is_variable_dose,\n pr.dose_amount,\n pr.units,\n pr.frequency,\n pr.is_discontinued,\n pr.discontinued_by_id,\n pr.discontinuing_reason,\n pr.discontinued_datetime\nfrom \"app\".\"reporting\".\"encounter_prescriptions\" ep\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ep.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"prescriptions\" pr on pr.id = ep.prescription_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f \n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\njoin \"app\".\"reporting\".\"reference_data\" m on m.id = pr.medication_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_imaging_requests": {"database": "app", "schema": "reporting", "name": "ds__sensitive_imaging_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_imaging_requests.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_imaging_requests.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_imaging_requests"], "alias": "ds__sensitive_imaging_requests", "checksum": {"name": "sha256", "checksum": "c88a9d97bb65276116d3727ca959d54928b296b3022b3373720c935b58cf9a70"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility imaging requests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of imaging.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "request_id": {"name": "request_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the imaging was requested.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date"]}, "supervising_clinician_id": {"name": "supervising_clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "supervising_clinician": {"name": "supervising_clinician", "description": "Display identifier for the user where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "requesting_clinician_id": {"name": "requesting_clinician_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "requesting_clinician": {"name": "requesting_clinician", "description": "Display identifier for the user who requested the imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "priority": {"name": "priority", "description": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__priority"]}, "imaging_type": {"name": "imaging_type", "description": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__imaging_type"]}, "imaging_area": {"name": "imaging_area", "description": "Full readable name of the imaging area.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "completed_datetime": {"name": "completed_datetime", "description": "When this result was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_at"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113).", "meta": {}, "data_type": "character varying(1024)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_imaging_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2870195, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_imaging_requests\"", "raw_code": "{{ imaging_requests_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "imaging_results", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.imaging_requests_dataset"], "nodes": ["model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_imaging_requests.sql", "compiled": true, "compiled_code": "\n\nwith results as (\n select\n imaging_request_id,\n min(datetime) as completed_datetime\n from \"app\".\"reporting\".\"imaging_results\"\n group by imaging_request_id\n),\n\nimaging_area_notes as (\n select\n record_id as imaging_request_id,\n string_agg(content, ', ' order by datetime) as imaging_area\n from \"app\".\"reporting\".\"notes\"\n where record_type = 'ImagingRequest'\n and note_type_id = 'notetype-areaToBeImaged'\n group by record_id\n),\n\nimaging_areas as (\n select\n ir.id as imaging_request_id,\n coalesce(\n string_agg(ia.name, ', ' order by ia.name),\n n.imaging_area\n ) as imaging_area\n from \"app\".\"reporting\".\"imaging_requests\" ir\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" ia on ia.id = ira.area_id\n left join imaging_area_notes n on n.imaging_request_id = ir.id\n group by ir.id, n.imaging_area\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(ir.datetime::date, p.date_of_birth)) as age,\n p.sex,\n v.id as village_id,\n v.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n ir.display_id as request_id,\n ir.datetime as requested_datetime,\n su.id as supervising_clinician_id,\n su.display_name as supervising_clinician,\n ru.id as requesting_clinician_id,\n ru.display_name as requesting_clinician,\n case\n when ir.priority = 'routine' then 'Routine'\n when ir.priority = 'urgent' then 'Urgent'\n when ir.priority = 'asap' then 'ASAP'\n when ir.priority = 'stat' then 'STAT'\n when ir.priority = 'today' then 'Today'\n else ir.priority\n end as priority,\n ir.imaging_type,\n areas.imaging_area,\n ir.status as status_id,\n case\n when ir.status = 'pending' then 'Pending'\n when ir.status = 'in_progress' then 'In progress'\n when ir.status = 'completed' then 'Completed'\n when ir.status = 'cancelled' then 'Cancelled'\n when ir.status = 'deleted' then 'Deleted'\n when ir.status = 'entered_in_error' then 'Entered in error'\n else 'Unknown'\n end as status,\n case\n when ir.status = 'completed' then irs.completed_datetime\n end as completed_datetime,\n case\n when ir.reason_for_cancellation = 'clinical' then 'Clinical reason'\n when ir.reason_for_cancellation = 'duplicate' then 'Duplicate'\n when ir.reason_for_cancellation = 'entered-in-error' then 'Entered in error'\n when ir.reason_for_cancellation = 'patient-discharged' then 'Patient discharged'\n when ir.reason_for_cancellation = 'patient-refused' then 'Patient refused'\n when ir.reason_for_cancellation = 'other' then 'Other'\n end as reason_for_cancellation\nfrom \"app\".\"reporting\".\"imaging_requests\" ir\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ir.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"users\" su on su.id = e.clinician_id\nleft join \"app\".\"reporting\".\"users\" ru on ru.id = ir.requested_by_id\nleft join imaging_areas areas on areas.imaging_request_id = ir.id\nleft join \"app\".\"reporting\".\"reference_data\" v on v.id = p.village_id\nleft join results irs on irs.imaging_request_id = ir.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_lab_requests": {"database": "app", "schema": "reporting", "name": "ds__sensitive_lab_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_lab_requests.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_lab_requests.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_lab_requests", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_lab_requests"], "alias": "ds__sensitive_lab_requests", "checksum": {"name": "sha256", "checksum": "f999b55c957b16b9c5a6bd0c9e95e1ee157221c32a837bc3ee7cbb91614453d0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive lab requests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "laboratory_id": {"name": "laboratory_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id"]}, "laboratory": {"name": "laboratory", "description": "Full readable name of the laboratory", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "request_id": {"name": "request_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "requested_by": {"name": "requested_by", "description": "Display identifier for the user who requested the lab test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "requesting_department_id": {"name": "requesting_department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) from which the lab test was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "requesting_department": {"name": "requesting_department", "description": "Full readable name of the department from which the lab test was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "priority_id": {"name": "priority_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_priority_id"]}, "priority": {"name": "priority", "description": "Full readable name of the lab test priority.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__category_id"]}, "category": {"name": "category", "description": "Full readable name of the lab test category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "lab_test_panel": {"name": "lab_test_panel", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "tests": {"name": "tests", "description": "Full list of tests", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__tests"]}, "collected_datetime": {"name": "collected_datetime", "description": "When the sample was collected.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time"]}, "collected_by_id": {"name": "collected_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__collected_by_id"]}, "collected_by": {"name": "collected_by", "description": "Display identifier for the user who collected the specimen.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "specimen_type_id": {"name": "specimen_type_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_type_id"]}, "specimen_type": {"name": "specimen_type", "description": "Used to indicate if the lab test type is sensitive and should be hidden accordingly.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__is_sensitive"]}, "site": {"name": "site", "description": "Full readable name of the specimen collection site.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "completed_datetime": {"name": "completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_lab_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.29204, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_lab_requests\"", "raw_code": "{{ lab_requests_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.lab_requests_dataset"], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_lab_requests.sql", "compiled": true, "compiled_code": "\n\nwith lab_test_data as (\n select\n lr.id as lab_request_id,\n string_agg(ltt.name, ', '\n order by ltt.name\n ) as tests,\n max(lt.completed_datetime) as completed_datetime\n from \"app\".\"reporting\".\"lab_requests\" lr\n join \"app\".\"reporting\".\"lab_tests\" lt on lt.lab_request_id = lr.id\n join \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = lt.lab_test_type_id\n where ltt.is_sensitive = True\n group by lr.id\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(lr.requested_datetime, p.date_of_birth)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n f.id as facility_id,\n f.name as facility,\n d.name as department,\n d.id as department_id,\n l.id as location_id,\n l.name as location,\n lg.id as location_group_id,\n lg.name as location_group,\n laboratory.id as laboratory_id,\n laboratory.name as laboratory,\n lr.display_id as request_id,\n case lr.status\n when 'reception_pending' then 'Reception pending'\n when 'results_pending' then 'Results pending'\n when 'to_be_verified' then 'To be verified'\n when 'verified' then 'Verified'\n when 'published' then 'Published'\n when 'cancelled' then 'Cancelled'\n when 'deleted' then 'Deleted'\n when 'sample-not-collected' then 'Sample not collected'\n when 'entered-in-error' then 'Entered in error'\n else lr.status\n end as status,\n lr.status as status_id,\n lr.requested_datetime,\n req_clinician.id as requested_by_id,\n req_clinician.display_name as requested_by,\n lr.department_id as requesting_department_id,\n req_department.name as requesting_department,\n lr.lab_test_priority_id as priority_id,\n priority.name as priority,\n category.id as lab_test_category_id,\n category.name as lab_test_category,\n ltp.name as lab_test_panel,\n lta.tests,\n lr.collected_datetime,\n lr.collected_by_id,\n collector.display_name as collected_by,\n lr.specimen_type_id,\n specimen.name as specimen_type,\n site.name as site,\n lta.completed_datetime,\n case lr.reason_for_cancellation\n when 'clinical' then 'Clinical reason'\n when 'duplicate' then 'Duplicate'\n when 'entered-in-error' then 'Entered in error'\n when 'patient-discharged' then 'Patient discharged'\n when 'patient-refused' then 'Patient refused'\n when 'other' then 'Other'\n else lr.reason_for_cancellation\n end as reason_for_cancellation\nfrom \"app\".\"reporting\".\"lab_requests\" lr\njoin lab_test_data lta on lta.lab_request_id = lr.id\njoin \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" laboratory on laboratory.id = lr.lab_test_laboratory_id\nleft join \"app\".\"reporting\".\"users\" req_clinician on req_clinician.id = lr.requested_by_id\nleft join \"app\".\"reporting\".\"departments\" req_department on req_department.id = lr.department_id\nleft join \"app\".\"reporting\".\"reference_data\" priority on priority.id = lr.lab_test_priority_id\nleft join \"app\".\"reporting\".\"reference_data\" category on category.id = lr.lab_test_category_id\nleft join \"app\".\"reporting\".\"users\" collector on collector.id = lr.collected_by_id\nleft join \"app\".\"reporting\".\"reference_data\" specimen on specimen.id = lr.specimen_type_id\nleft join \"app\".\"reporting\".\"reference_data\" site on site.id = lr.lab_sample_site_id\nleft join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ltpr.lab_test_panel_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_lab_tests": {"database": "app", "schema": "reporting", "name": "ds__sensitive_lab_tests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_lab_tests.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_lab_tests.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_lab_tests", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_lab_tests"], "alias": "ds__sensitive_lab_tests", "checksum": {"name": "sha256", "checksum": "ea7d9444ce7303e1b0e07544fe519a041a9248a4c5033d79feee2af08c4a3549"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive lab tests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "lab_request_id": {"name": "lab_request_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id"]}, "lab_test_panel": {"name": "lab_test_panel", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__category_id"]}, "lab_test_category": {"name": "lab_test_category", "description": "Full readable name of the lab test category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "requested_by": {"name": "requested_by", "description": "Display identifier for the user who requested the lab test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "lab_request_published_datetime": {"name": "lab_request_published_datetime", "description": "When this lab request's results were published.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__published_date"]}, "lab_test_date": {"name": "lab_test_date", "description": "Local date for the record in lab_tests.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "result": {"name": "result", "description": "The result of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__result"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_type_id"]}, "lab_test_type": {"name": "lab_test_type", "description": "Human-friendly name of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__name"]}, "lab_test_completed_datetime": {"name": "lab_test_completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_lab_tests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2960536, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_lab_tests\"", "raw_code": "{{ lab_tests_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.lab_tests_dataset"], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_lab_tests.sql", "compiled": true, "compiled_code": "\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(lr.requested_datetime, p.date_of_birth::date)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n req_dept.id as requesting_department_id,\n req_dept.name as requesting_department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n lr.display_id as lab_request_id,\n lr.status as status_id,\n case lr.status\n when 'reception_pending' then 'Reception pending'\n when 'results_pending' then 'Results pending'\n when 'to_be_verified' then 'To be verified'\n when 'verified' then 'Verified'\n when 'published' then 'Published'\n when 'cancelled' then 'Cancelled'\n when 'deleted' then 'Deleted'\n when 'sample-not-collected' then 'Sample not collected'\n when 'entered-in-error' then 'Entered in error'\n else lr.status\n end as status,\n ltp.id as lab_test_panel_id,\n ltp.name as lab_test_panel,\n category.id as lab_test_category_id,\n category.name as lab_test_category,\n lr.requested_datetime,\n requester.id as requested_by_id,\n requester.display_name as requested_by,\n lr.published_datetime as lab_request_published_datetime,\n lt.date as lab_test_date,\n lt.result,\n lt.verification,\n ltt.id as lab_test_type_id,\n ltt.name as lab_test_type,\n lt.completed_datetime as lab_test_completed_datetime\nfrom \"app\".\"reporting\".\"lab_requests\" lr\njoin \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"departments\" req_dept on req_dept.id = lr.department_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nleft join \"app\".\"reporting\".\"users\" requester on requester.id = lr.requested_by_id\nleft join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr on ltpr.id = lr.lab_test_panel_request_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ltpr.lab_test_panel_id\nleft join \"app\".\"reporting\".\"reference_data\" category on category.id = lr.lab_test_category_id\njoin \"app\".\"reporting\".\"lab_tests\" lt on lt.lab_request_id = lr.id\njoin \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = lt.lab_test_type_id\nwhere ltt.is_sensitive = True\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_location_bookings": {"database": "app", "schema": "reporting", "name": "ds__sensitive_location_bookings", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_location_bookings.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_location_bookings.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_location_bookings", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_location_bookings"], "alias": "ds__sensitive_location_bookings", "checksum": {"name": "sha256", "checksum": "13d5c0cbf8459c6f8123bff9bce08a28ae460deedcd2db65ba3165a42addc9b5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility location bookings", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the booking.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "booking_start_datetime": {"name": "booking_start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "booking_end_datetime": {"name": "booking_end_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "booking_type_id": {"name": "booking_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "booking_type": {"name": "booking_type", "description": "Full readable name of the booking type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "booking_status": {"name": "booking_status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who booked the location.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_location_bookings.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.2980602, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_location_bookings\"", "raw_code": "{{ location_bookings_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "location_bookings", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.location_bookings_dataset"], "nodes": ["model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_location_bookings.sql", "compiled": true, "compiled_code": "\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(a.start_datetime::date, p.date_of_birth)) as age,\n p.sex,\n vil.id as village_id,\n vil.name as village,\n billing.id as billing_type_id,\n billing.name as billing_type,\n a.start_datetime as booking_start_datetime,\n a.end_datetime as booking_end_datetime,\n a.status as booking_status,\n u.id as clinician_id,\n u.display_name as clinician,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n a.booking_type_id,\n bt.name as booking_type\nfrom \"app\".\"reporting\".\"location_bookings\" a\njoin \"app\".\"reporting\".\"patients\" p on p.id = a.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = a.clinician_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = a.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pd.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" bt on bt.id = a.booking_type_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_medication_dispenses": {"database": "app", "schema": "reporting", "name": "ds__sensitive_medication_dispenses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_medication_dispenses.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_medication_dispenses.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_medication_dispenses", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_medication_dispenses"], "alias": "ds__sensitive_medication_dispenses", "checksum": {"name": "sha256", "checksum": "98703ea5eeee9b576ce68a53fd72b8171044ef32798a7414ba938357b347110a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility medication dispense records", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_dispenses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "quantity": {"name": "quantity", "description": "The quantity of medication units dispensed to the patient in each dispensing.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__quantity"]}, "dispensed_at": {"name": "dispensed_at", "description": "The timestamp indicating when the medication was physically dispensed to the patient.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_at"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the medication was dispensed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the medication was dispensed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "medication_code": {"name": "medication_code", "description": "Full readable name code of the dispensed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "medication": {"name": "medication", "description": "Full readable name name of the dispensed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_medication_dispenses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.3000674, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_medication_dispenses\"", "raw_code": "{{ medication_dispenses_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "medication_dispenses", "package": null, "version": null}, {"name": "pharmacy_order_prescriptions", "package": null, "version": null}, {"name": "pharmacy_orders", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.medication_dispenses_dataset"], "nodes": ["model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_medication_dispenses.sql", "compiled": true, "compiled_code": "\n\nselect\n md.id,\n md.quantity,\n md.dispensed_at,\n po.facility_id,\n f.name as facility,\n pr.medication_id,\n m.code as medication_code,\n m.name as medication\nfrom \"app\".\"reporting\".\"medication_dispenses\" md\njoin \"app\".\"reporting\".\"pharmacy_order_prescriptions\" pop\n on pop.id = md.pharmacy_order_prescription_id\njoin \"app\".\"reporting\".\"pharmacy_orders\" po\n on po.id = pop.pharmacy_order_id\n-- prescription_id is not null on all pharmacy_order_prescriptions rows (enforced by source not_null test).\n-- ongoing_prescription_id is the nullable supplementary reference and is not used for the medication lookup\njoin \"app\".\"reporting\".\"prescriptions\" pr\n on pr.id = pop.prescription_id\njoin \"app\".\"reporting\".\"reference_data\" m\n on m.id = pr.medication_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = po.facility_id\n and f.is_sensitive = True\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments": {"database": "app", "schema": "reporting", "name": "ds__sensitive_outpatient_appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_outpatient_appointments.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_outpatient_appointments"], "alias": "ds__sensitive_outpatient_appointments", "checksum": {"name": "sha256", "checksum": "180009b1081dc495f6748dbd3899fcef44a7593ff95dff557e6698eb2fddacbb"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility appointments", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the appointment.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "contact_number": {"name": "contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. where available otherwise Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number", "doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "appointment_start_datetime": {"name": "appointment_start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "appointment_end_datetime": {"name": "appointment_end_datetime", "description": "When the appointment ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__appointment_type_id"]}, "appointment_type": {"name": "appointment_type", "description": "Full readable name of the appointment type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "appointment_status": {"name": "appointment_status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who booked the appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "priority": {"name": "priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "schedule_id": {"name": "schedule_id", "description": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__schedule_id"]}, "until_date": {"name": "until_date", "description": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__until_date"]}, "interval": {"name": "interval", "description": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\"", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__interval"]}, "frequency": {"name": "frequency", "description": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__frequency"]}, "nth_weekday": {"name": "nth_weekday", "description": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__nth_weekday"]}, "days_of_week": {"name": "days_of_week", "description": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__days_of_week"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Display identifier for the user who created the appointment, sourced from the earliest change log entry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "created_by": {"name": "created_by", "description": "Display name of the user who created the appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.302074, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_outpatient_appointments\"", "raw_code": "{{ outpatient_appointments_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments_change_logs", "package": null, "version": null}, {"name": "outpatient_appointments", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.outpatient_appointments_dataset"], "nodes": ["model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments.sql", "compiled": true, "compiled_code": "\n\nwith appointment_creators as (\n select\n appointment_id,\n created_by_user_id\n from \"app\".\"reporting\".\"outpatient_appointments_change_logs\"\n where change_sequence = 1\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(a.start_datetime, p.date_of_birth)) as age,\n p.sex,\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\n vil.id as village_id,\n vil.name as village,\n billing.id as billing_type_id,\n billing.name as billing_type,\n a.start_datetime as appointment_start_datetime,\n a.end_datetime as appointment_end_datetime,\n a.appointment_type_id,\n apt.name as appointment_type,\n a.status as appointment_status,\n u.id as clinician_id,\n u.display_name as clinician,\n lg.id as location_group_id,\n lg.name as location_group,\n a.priority,\n a.schedule_id,\n a.until_date,\n a.interval,\n a.days_of_week,\n a.frequency,\n a.nth_weekday,\n ac.created_by_user_id,\n creator.display_name as created_by\nfrom \"app\".\"reporting\".\"outpatient_appointments\" a\njoin \"app\".\"reporting\".\"patients\" p on p.id = a.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = a.clinician_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = a.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = lg.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pd.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" apt on apt.id = a.appointment_type_id\nleft join appointment_creators ac on ac.appointment_id = a.id\nleft join \"app\".\"reporting\".\"users\" creator on creator.id = ac.created_by_user_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit": {"database": "app", "schema": "reporting", "name": "ds__sensitive_outpatient_appointments_audit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_outpatient_appointments_audit.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments_audit.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_outpatient_appointments_audit"], "alias": "ds__sensitive_outpatient_appointments_audit", "checksum": {"name": "sha256", "checksum": "a0b6536dfbe25618cf8647940c5dafcd411e311adff58db53c5ea088ef8cf539"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "dataset", "clinical", "audit", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "dataset", "clinical", "audit"], "description": "Sensitive facility dataset for outpatient appointment audit report. Tracks all modifications and cancellations to appointments at sensitive facilities, showing both current and previous values. Excludes status-only changes unless the status changes to 'Cancelled'.\n", "columns": {"change_id": {"name": "change_id", "description": "Unique identifier for the change log entry (UUID from logs.changes).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id"]}, "appointment_id": {"name": "appointment_id", "description": "Reference to the [appointment](#!/model/model.tamanu_source_dbt.outpatient_appointments) that was modified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id"]}, "change_number": {"name": "change_number", "description": "Sequential change number for this appointment where initial creation is excluded. 1 = first modification, 2 = second modification, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__change_number"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/model/model.tamanu_source_dbt.patients) associated with the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "appointment_start_datetime": {"name": "appointment_start_datetime", "description": "Current appointment start date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime"]}, "appointment_end_datetime": {"name": "appointment_end_datetime", "description": "Current appointment end date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime"]}, "appointment_type": {"name": "appointment_type", "description": "Current Actual data for appointment type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Current [appointment type](#!/model/model.tamanu_source_dbt.reference_data) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id"]}, "clinician": {"name": "clinician", "description": "Current The human readable display name for the user. for clinician", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "clinician_id": {"name": "clinician_id", "description": "Current [clinician](#!/model/model.tamanu_source_dbt.users) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id"]}, "location_group": {"name": "location_group", "description": "Current Full readable name for location group for area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "location_group_id": {"name": "location_group_id", "description": "Current [location group](#!/model/model.tamanu_source_dbt.location_groups)/area ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id"]}, "priority": {"name": "priority", "description": "Current Current priority status (after the change). Boolean indicating if the appointment is high priority. formatted as Yes/No", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority"]}, "schedule_id": {"name": "schedule_id", "description": "Current recurring schedule ID (after the change). References appointment_schedules table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id"]}, "is_repeating": {"name": "is_repeating", "description": "Whether the appointment is part of a repeating schedule. Values: Yes (has schedule_id), No (no schedule_id).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_repeating"]}, "created_by": {"name": "created_by", "description": "The human readable display name for the user. who created the appointment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who originally created the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id"]}, "modified_by": {"name": "modified_by", "description": "The human readable display name for the user. who modified the appointment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "modified_by_user_id": {"name": "modified_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who made the modification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id"]}, "modified_datetime": {"name": "modified_datetime", "description": "Timestamp when the change was logged (from logs.changes.logged_at).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime"]}, "is_cancelled": {"name": "is_cancelled", "description": "Whether the appointment status is 'Cancelled'. Values: Yes/No.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_cancelled"]}, "prev_start_datetime": {"name": "prev_start_datetime", "description": "Previous appointment start date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime"]}, "prev_end_datetime": {"name": "prev_end_datetime", "description": "Previous appointment end date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime"]}, "prev_appointment_type": {"name": "prev_appointment_type", "description": "Previous Actual data for appointment type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "prev_appointment_type_id": {"name": "prev_appointment_type_id", "description": "Previous appointment type ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id"]}, "prev_clinician": {"name": "prev_clinician", "description": "Previous The human readable display name for the user. for clinician", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "prev_clinician_id": {"name": "prev_clinician_id", "description": "Previous clinician ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id"]}, "prev_location_group": {"name": "prev_location_group", "description": "Previous Full readable name for location group for area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "prev_location_group_id": {"name": "prev_location_group_id", "description": "Previous location group/area ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id"]}, "prev_priority": {"name": "prev_priority", "description": "Previous Previous priority status (before the change). Null for creation events (change_sequence = 1). formatted as Yes/No", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority"]}, "facility_id": {"name": "facility_id", "description": "Tamanu internal identifier (generally a UUID) in facilities (for filtering)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "facility": {"name": "facility", "description": "Full readable name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments_audit.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["dataset", "clinical", "audit", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3060865, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_outpatient_appointments_audit\"", "raw_code": "{{ outpatient_appointments_audit_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments_change_logs", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [["tamanu", "appointment_schedules"], ["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.outpatient_appointments_audit_dataset"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments_audit.sql", "compiled": true, "compiled_code": "\n\n-- Outpatient Appointments Audit Dataset\n-- This dataset tracks changes/modifications to outpatient appointments\n-- Each row represents a modification event (excludes initial creation)\n--\n-- Included changes:\n-- - Status changed to 'Cancelled' (individual cancellations only)\n-- - Changes to: start/end datetime, clinician, location group, appointment type, priority\n--\n-- Excluded changes:\n-- - Initial appointment creation (change_sequence = 1)\n-- - Status-only changes (unless changing to 'Cancelled')\n-- - Appointments automatically cancelled when their schedule was cancelled\n-- (i.e., bulk cancellations via \"cancel this and all future appointments\")\n--\n-- change_number: starts from 1 for the first modification, increments for subsequent changes\n--\n-- Note: schedule_id never changes on existing appointments in Tamanu.\n-- When a schedule is modified, old appointments are cancelled and new ones are created.\n\nwith change_evaluation as (\n select\n cl.*,\n -- Determine if this change has meaningful field modifications\n case\n -- Status changed to Cancelled\n when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true\n -- Any non-status fields changed\n when (\n cl.prev_start_datetime is distinct from cl.start_datetime\n or cl.prev_end_datetime is distinct from cl.end_datetime\n or cl.prev_clinician_id is distinct from cl.clinician_id\n or cl.prev_location_group_id is distinct from cl.location_group_id\n or cl.prev_appointment_type_id is distinct from cl.appointment_type_id\n or cl.prev_is_high_priority is distinct from cl.is_high_priority\n ) then true\n else false\n end as is_meaningful_change\n from \"app\".\"reporting\".\"outpatient_appointments_change_logs\" cl\n left join \"app\".\"public\".\"appointment_schedules\" s on s.id = cl.schedule_id\n where\n -- Exclude appointments that were automatically cancelled when the schedule was cancelled\n -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule)\n not (\n cl.status = 'Cancelled'\n and s.cancelled_at_date is not null\n and cl.start_datetime::date > s.cancelled_at_date::date\n )\n),\n\nnumbered_changes as (\n select\n ce.*,\n -- Assign change number: starts from 1 for first modification\n row_number() over (\n partition by ce.appointment_id\n order by ce.modified_datetime\n ) as change_number\n from change_evaluation ce\n where ce.is_meaningful_change = true\n and ce.change_sequence > 1 -- Exclude initial creation\n)\n\nselect\n fc.change_id,\n fc.appointment_id,\n fc.change_number,\n -- Patient details\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n -- Current appointment details\n fc.start_datetime as appointment_start_datetime,\n fc.end_datetime as appointment_end_datetime,\n apt.name as appointment_type,\n fc.appointment_type_id,\n clinician.display_name as clinician,\n fc.clinician_id,\n lg.name as location_group,\n fc.location_group_id,\n case when fc.is_high_priority then 'Yes' else 'No' end as priority,\n fc.schedule_id,\n case\n when fc.schedule_id is not null then 'Yes'\n else 'No'\n end as is_repeating,\n -- Modification details\n creator.display_name as created_by,\n fc.created_by_user_id,\n modifier.display_name as modified_by,\n fc.modified_by_user_id,\n fc.modified_datetime,\n case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled,\n -- Previous appointment details (only shown if different from current)\n case\n when fc.prev_start_datetime is distinct from fc.start_datetime\n then fc.prev_start_datetime\n end as prev_start_datetime,\n case\n when fc.prev_end_datetime is distinct from fc.end_datetime\n then fc.prev_end_datetime\n end as prev_end_datetime,\n case\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\n then prev_apt.name\n end as prev_appointment_type,\n case\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\n then fc.prev_appointment_type_id\n end as prev_appointment_type_id,\n case\n when fc.prev_clinician_id is distinct from fc.clinician_id\n then prev_clinician.display_name\n end as prev_clinician,\n case\n when fc.prev_clinician_id is distinct from fc.clinician_id\n then fc.prev_clinician_id\n end as prev_clinician_id,\n case\n when fc.prev_location_group_id is distinct from fc.location_group_id\n then prev_lg.name\n end as prev_location_group,\n case\n when fc.prev_location_group_id is distinct from fc.location_group_id\n then fc.prev_location_group_id\n end as prev_location_group_id,\n case\n when fc.prev_is_high_priority is not null\n and fc.prev_is_high_priority is distinct from fc.is_high_priority\n then case when fc.prev_is_high_priority then 'Yes' else 'No' end\n end as prev_priority,\n -- Facility details for filtering\n f.id as facility_id,\n f.name as facility\nfrom numbered_changes fc\njoin \"app\".\"reporting\".\"patients\" p on p.id = fc.patient_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = fc.clinician_id\nleft join \"app\".\"reporting\".\"users\" prev_clinician on prev_clinician.id = fc.prev_clinician_id\nleft join \"app\".\"reporting\".\"users\" creator on creator.id = fc.created_by_user_id\nleft join \"app\".\"reporting\".\"users\" modifier on modifier.id = fc.modified_by_user_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = fc.location_group_id\nleft join \"app\".\"reporting\".\"location_groups\" prev_lg on prev_lg.id = fc.prev_location_group_id\nleft join \"app\".\"reporting\".\"reference_data\" apt on apt.id = fc.appointment_type_id\nleft join \"app\".\"reporting\".\"reference_data\" prev_apt on prev_apt.id = fc.prev_appointment_type_id\nleft join \"app\".\"public\".\"appointment_schedules\" s on s.id = fc.schedule_id\n-- Join to facility for filtering by sensitivity\njoin \"app\".\"reporting\".\"facilities\" f on f.id = lg.facility_id\n and f.is_sensitive = True\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_procedures": {"database": "app", "schema": "reporting", "name": "ds__sensitive_procedures", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_procedures.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_procedures.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_procedures", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_procedures"], "alias": "ds__sensitive_procedures", "checksum": {"name": "sha256", "checksum": "09ac899a55c011b9b189bd7651cbe3953eb493f9f114bfdf100b7aaaade23fa8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility procedures", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the procedure.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "nationality": {"name": "nationality", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "encounter_facility_id": {"name": "encounter_facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "encounter_facility": {"name": "encounter_facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "encounter_department_id": {"name": "encounter_department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "encounter_department": {"name": "encounter_department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "encounter_start_datetime": {"name": "encounter_start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "encounter_end_datetime": {"name": "encounter_end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "procedure_facility_id": {"name": "procedure_facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "procedure_facility": {"name": "procedure_facility", "description": "Full readable name of the facility where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "procedure_area_id": {"name": "procedure_area_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "procedure_area": {"name": "procedure_area", "description": "Full readable name of the location group where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "procedure_location_id": {"name": "procedure_location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "procedure_location": {"name": "procedure_location", "description": "Full readable name of the location where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__procedure_type_id"]}, "procedure_type": {"name": "procedure_type", "description": "Full readable name of the procedure type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "procedure_start_time": {"name": "procedure_start_time", "description": "When the procedure started.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time"]}, "procedure_end_time": {"name": "procedure_end_time", "description": "When the procedure ended, if it's completed.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time"]}, "procedure_duration": {"name": "procedure_duration", "description": "Duration of the procedure.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__duration"]}, "procedure_clinician_id": {"name": "procedure_clinician_id", "description": "Reference to the [physician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__physician_id"]}, "procedure_clinician": {"name": "procedure_clinician", "description": "Display identifier for the user who performed the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "procedure_anaesthetist_id": {"name": "procedure_anaesthetist_id", "description": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetist_id"]}, "procedure_anaesthetist": {"name": "procedure_anaesthetist", "description": "Display identifier for the user who administered anaesthesia.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "procedure_assistant_anaesthetist_id": {"name": "procedure_assistant_anaesthetist_id", "description": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id"]}, "procedure_assistant_anaesthetist": {"name": "procedure_assistant_anaesthetist", "description": "Display identifier for the user who assisted the anaesthetist in the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "is_completed": {"name": "is_completed", "description": "Whether the procedure has completed.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed"]}, "time_in": {"name": "time_in", "description": "The time when the patient entered the procedure room or when the procedure setup began.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_in"]}, "time_out": {"name": "time_out", "description": "The time when the patient left the procedure room or when the procedure cleanup was completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_out"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_procedures.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3138535, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_procedures\"", "raw_code": "{{ procedures_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "procedures", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.procedures_dataset"], "nodes": ["model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_procedures.sql", "compiled": true, "compiled_code": "\n\nwith filtered_procedure as (\n select\n pc.*,\n eh.department_id,\n eh.encounter_type,\n row_number() over (\n partition by pc.id\n order by eh.datetime desc\n ) as encounter_history_record\n from \"app\".\"reporting\".\"procedures\" pc\n left join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = pc.encounter_id\n and eh.datetime::date <= pc.date\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pc.date, p.date_of_birth)) as age,\n p.sex,\n nationality.name as nationality,\n encounter_facility.id as encounter_facility_id,\n encounter_facility.name as encounter_facility,\n encounter_department.id as encounter_department_id,\n encounter_department.name as encounter_department,\n case\n when coalesce(pc.encounter_type, e.encounter_type) = 'admission' then 'Hospital Admission'\n when coalesce(pc.encounter_type, e.encounter_type) = 'clinic' then 'Clinic'\n when coalesce(pc.encounter_type, e.encounter_type) in ('triage', 'observation', 'emergency') then 'Triage'\n end as encounter_type,\n e.start_datetime as encounter_start_datetime,\n e.end_datetime as encounter_end_datetime,\n procedure_facility.id as procedure_facility_id,\n procedure_facility.name as procedure_facility,\n procedure_area.id as procedure_area_id,\n procedure_area.name as procedure_area,\n procedure_location.id as procedure_location_id,\n procedure_location.name as procedure_location,\n procedure_type.id as procedure_type_id,\n procedure_type.name as procedure_type,\n pc.date as procedure_date,\n pc.start_time as procedure_start_time,\n pc.end_time as procedure_end_time,\n case\n when pc.end_time is not null and pc.start_time is not null then\n concat(\n lpad((\n case\n when pc.end_time < pc.start_time\n then\n (24 + extract(hour from pc.end_time) - extract(hour from pc.start_time))\n else\n extract(hour from (pc.end_time - pc.start_time))\n end\n )::text, 2, '0'), ':',\n lpad((\n case\n when pc.end_time < pc.start_time\n then\n (extract(minute from pc.end_time) - extract(minute from pc.start_time))\n else\n extract(minute from (pc.end_time - pc.start_time))\n end\n )::text, 2, '0')\n )\n end as procedure_duration,\n clinician.id as procedure_clinician_id,\n clinician.display_name as procedure_clinician,\n anaesthetist.id as procedure_anaesthetist_id,\n anaesthetist.display_name as procedure_anaesthetist,\n assistant_anaesthetist.id as procedure_assistant_anaesthetist_id,\n assistant_anaesthetist.display_name as procedure_assistant_anaesthetist,\n case\n when pc.is_completed then 'Y' else 'N'\n end as is_completed,\n pc.time_in,\n pc.time_out\nfrom filtered_procedure pc\njoin \"app\".\"reporting\".\"encounters\" e on e.id = pc.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"reference_data\" procedure_type on procedure_type.id = pc.procedure_type_id\njoin \"app\".\"reporting\".\"locations\" procedure_location\n on procedure_location.id = pc.location_id\nleft join \"app\".\"reporting\".\"location_groups\" procedure_area\n on procedure_area.id = procedure_location.location_group_id\njoin \"app\".\"reporting\".\"facilities\" procedure_facility\n on procedure_facility.id = procedure_location.facility_id\n and procedure_facility.is_sensitive = True\njoin \"app\".\"reporting\".\"locations\" encounter_location\n on encounter_location.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" encounter_facility\n on encounter_facility.id = encounter_location.facility_id\n and encounter_facility.is_sensitive = True\njoin \"app\".\"reporting\".\"departments\" encounter_department\n on encounter_department.id = coalesce(pc.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" nationality on nationality.id = pd.nationality_id\nleft join \"app\".\"reporting\".\"users\" assistant_anaesthetist on assistant_anaesthetist.id = pc.assistant_anaesthetist_id\nleft join \"app\".\"reporting\".\"users\" anaesthetist on anaesthetist.id = pc.anaesthetist_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = pc.clinician_id\nwhere pc.encounter_history_record = 1\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_referrals": {"database": "app", "schema": "reporting", "name": "ds__sensitive_referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_referrals.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_referrals.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_referrals", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_referrals"], "alias": "ds__sensitive_referrals", "checksum": {"name": "sha256", "checksum": "f3e8f4779a07aa7c1285fa3b1ae8039c614863182c60658cf12b85db141a9793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility referrals", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "diagnoses": {"name": "diagnoses", "description": "Full list of diagnoses at the time of referral.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}, "referral_type": {"name": "referral_type", "description": "Full readable name for the referral.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "referring_doctor_id": {"name": "referring_doctor_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "referring_doctor_name": {"name": "referring_doctor_name", "description": "Display identifier for the user who referred the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "referral_datetime": {"name": "referral_datetime", "description": "Local date for the record in encounter_diagnoses.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "status": {"name": "status", "description": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__status"]}, "department": {"name": "department", "description": "Full readable name of the department from which the patient was referred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_referrals.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3158603, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_referrals\"", "raw_code": "{{ referrals_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "referrals", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "survey_responses", "package": null, "version": null}, {"name": "surveys", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.referrals_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.survey_responses", "model.tamanu_source_dbt.surveys", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_referrals.sql", "compiled": true, "compiled_code": "\n\nwith diagnoses as (\n select\n ed.encounter_id,\n string_agg(concat(d.name), '; ') as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n left join \"app\".\"reporting\".\"reference_data\" d on d.id = ed.diagnosis_id\n group by ed.encounter_id\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.village_id,\n ed.diagnoses,\n s.name as referral_type,\n u.id as referring_doctor_id,\n u.display_name as referring_doctor_name,\n sr.end_datetime as referral_datetime,\n rf.status,\n d.name as department\nfrom \"app\".\"reporting\".\"referrals\" rf\njoin \"app\".\"reporting\".\"encounters\" e on e.id = rf.initiating_encounter_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\njoin \"app\".\"reporting\".\"survey_responses\" sr on sr.id = rf.survey_response_id\njoin \"app\".\"reporting\".\"surveys\" s on s.id = sr.survey_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"users\" u on u.id = e.clinician_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join diagnoses ed on ed.encounter_id = rf.initiating_encounter_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_user_audit": {"database": "app", "schema": "reporting", "name": "ds__sensitive_user_audit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_user_audit.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_user_audit.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_user_audit", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_user_audit"], "alias": "ds__sensitive_user_audit", "checksum": {"name": "sha256", "checksum": "4d44b6d0982ec9776d9ae2d29729a6712899b7f83c7ecb5036499ac49a49b370"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility user audit", "columns": {"user_id": {"name": "user_id", "description": "Tamanu internal identifier (generally a UUID) of the user.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_name": {"name": "user_name", "description": "The human readable display name for the user.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "user_role": {"name": "user_role", "description": "Display identifier for the user role.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "patient_category": {"name": "patient_category", "description": "Full readable name of the patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "triage_category": {"name": "triage_category", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "encounter_start_datetime": {"name": "encounter_start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "encounter_end_datetime": {"name": "encounter_end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "first_note_datetime": {"name": "first_note_datetime", "description": "Local date and time for the record of the first note in the encounter.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "last_note_datetime": {"name": "last_note_datetime", "description": "Local date and time for the record of the last note in the encounter.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "is_discharged": {"name": "is_discharged", "description": "Whether the patient has been discharged from the encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "non_discharge_by_clinicians": {"name": "non_discharge_by_clinicians", "description": "Clinician who last wrote a note if the patient was automatically discharged.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_user_audit.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.3178668, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_user_audit\"", "raw_code": "{{ user_audit_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "notes", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "roles", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.user_audit_dataset"], "nodes": ["model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.roles", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_user_audit.sql", "compiled": true, "compiled_code": "\n\nwith non_system_notes as (\n select distinct on (n.record_id)\n n.record_id,\n first_value(n.datetime) over w as first_note_datetime,\n last_value(n.datetime) over w as last_note_datetime,\n last_value(concat_ws(' on behalf of ', author.display_name, on_behalf.display_name)) over w as last_clinician\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"users\" author on author.id = n.authored_by_id\n left join \"app\".\"reporting\".\"users\" on_behalf on on_behalf.id = n.on_behalf_of_id\n where n.note_type_id != 'notetype-system'\n window w as (\n partition by n.record_id\n order by n.datetime\n rows between unbounded preceding and unbounded following\n )\n)\n\nselect\n u.id as user_id,\n u.display_name as user_name,\n r.name as user_role,\n p.id as patient_id,\n p.display_id,\n bt.name as patient_category,\n t.score as triage_category,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n e.start_datetime as encounter_start_datetime,\n e.end_datetime as encounter_end_datetime,\n n.first_note_datetime,\n n.last_note_datetime,\n case when e.end_datetime isnull then 'Patient not discharged'\n else 'Patient discharged'\n end as is_discharged,\n case when ds.note like 'Automatically discharged%' then n.last_clinician\n end as non_discharge_by_clinicians\nfrom \"app\".\"reporting\".\"encounters\" e\nleft join \"app\".\"reporting\".\"users\" u on u.id = e.clinician_id\nleft join \"app\".\"reporting\".\"roles\" r on r.id = u.role\nleft join \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = coalesce(e.patient_billing_type_id, pad.patient_billing_type_id)\nleft join \"app\".\"reporting\".\"triages\" t on t.encounter_id = e.id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"discharges\" ds on ds.encounter_id = e.id\nleft join non_system_notes n on n.record_id = e.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_vaccinations": {"database": "app", "schema": "reporting", "name": "ds__sensitive_vaccinations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_vaccinations.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_vaccinations.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_vaccinations", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_vaccinations"], "alias": "ds__sensitive_vaccinations", "checksum": {"name": "sha256", "checksum": "79c5072bf23c6f4f059193c7d080eab7c0223b2b7ac97602fd2789d0b7f55d34"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility vaccinations", "columns": {"display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of vaccination.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "vaccination_date": {"name": "vaccination_date", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "vaccine_status": {"name": "vaccine_status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "vaccine_schedule": {"name": "vaccine_schedule", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "recorded_by": {"name": "recorded_by", "description": "Display identifier for the user who recorded the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "circumstances": {"name": "circumstances", "description": "Full readable name of the circumstances.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "given_by": {"name": "given_by", "description": "Display identifier for the user who gave the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "given_elsewhere_by": {"name": "given_elsewhere_by", "description": "Checks if the vaccine was given elsewhere", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "not_given_clinician": {"name": "not_given_clinician", "description": "Display identifier for the user who did not give the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "not_given_reason": {"name": "not_given_reason", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}, "modified_by": {"name": "modified_by", "description": "Display identifier for the user who modified the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated for the vaccine administration record, sourced from the change logs.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_vaccinations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3218799, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_vaccinations\"", "raw_code": "{{ vaccinations_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "vaccine_administrations_change_logs", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.vaccinations_dataset"], "nodes": ["model.tamanu_source_dbt.vaccine_administrations_change_logs", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_vaccinations.sql", "compiled": true, "compiled_code": "\n\nwith vaccine_administrations_metadata as (\n select\n id,\n max(updated_at) as updated_at\n from \"app\".\"reporting\".\"vaccine_administrations_change_logs\"\n group by id\n),\n\nadministered_circumstances as (\n select\n a.id,\n string_agg(rd_cir.name, '; ') as circumstance_name\n from \"app\".\"reporting\".\"vaccine_administrations\" a\n cross join lateral unnest(a.circumstance_ids) c (unnest_circumstance_id)\n left join \"app\".\"reporting\".\"reference_data\" rd_cir\n on rd_cir.id = c.unnest_circumstance_id\n group by a.id\n)\n\nselect\n p.display_id,\n p.first_name,\n p.last_name,\n p.id as patient_id,\n p.date_of_birth,\n date_part('year', age(p.date_of_birth)) as age,\n p.sex,\n p.village_id,\n rd_vil.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n av.scheduled_vaccine_id,\n case\n when av.is_given_elsewhere = true and av.datetime is null then null\n else av.datetime::date\n end as vaccination_date,\n sv.category as vaccine_category,\n sv.label as vaccine_name,\n case when sv.category = 'Other' then av.vaccine_brand end as vaccine_brand,\n case when sv.category = 'Other' then av.disease end as disease,\n case\n when av.status = 'GIVEN' then 'Given'\n when av.status = 'NOT_GIVEN' then 'Not given'\n when av.status = 'RECORDED_IN_ERROR' then 'Recorded in error'\n when av.status = 'HISTORICAL' then 'Historical'\n end as vaccine_status,\n sv.dose_label as vaccine_schedule,\n av.batch,\n case\n when av.status in ('GIVEN', 'NOT_GIVEN', 'RECORDED_IN_ERROR') then u.display_name\n end as recorded_by,\n case\n when av.is_given_elsewhere = true then ac.circumstance_name\n end as circumstances,\n case\n when av.status = 'NOT_GIVEN' then null\n when av.status = 'GIVEN' and av.is_given_elsewhere = true then null\n when av.status in ('HISTORICAL', 'RECORDED_IN_ERROR') and av.is_given_elsewhere = true then av.given_by\n when av.status = 'GIVEN' then av.given_by\n end as given_by,\n case when av.is_given_elsewhere = true then av.given_by end as given_elsewhere_by,\n case\n when av.status = 'NOT_GIVEN' then av.given_by\n end as not_given_clinician,\n case\n when av.status = 'NOT_GIVEN' then rd_reason.name\n end as not_given_reason,\n case\n when av.status = 'HISTORICAL' then u.display_name\n end as modified_by,\n vam.updated_at\nfrom \"app\".\"reporting\".\"vaccine_administrations\" av\njoin \"app\".\"reporting\".\"encounters\" e on e.id = av.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join vaccine_administrations_metadata vam on vam.id = av.id\njoin \"app\".\"reporting\".\"locations\" l on l.id = av.location_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = av.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"vaccine_schedules\" sv on sv.id = av.scheduled_vaccine_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = av.recorded_by_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_vil on rd_vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_reason on rd_reason.id = av.not_given_reason_id\nleft join administered_circumstances ac on ac.id = av.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__admissions": {"database": "app", "schema": "reporting", "name": "ds__admissions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__admissions.sql", "original_file_path": "models\\datasets\\standard\\ds__admissions.sql", "unique_id": "model.tamanu_source_dbt.ds__admissions", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__admissions"], "alias": "ds__admissions", "checksum": {"name": "sha256", "checksum": "b2bfeaf96cd315fbd3dced74507daa47c3cec8bb0380fc593b6cb3c2f33c1b30"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Admissions", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the appointment.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "admitting_clinician_id": {"name": "admitting_clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "admitting_clinician": {"name": "admitting_clinician", "description": "Display identifier for the user who admitted the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "admission_datetime": {"name": "admission_datetime", "description": "Local date for the record on admission.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "admission_status": {"name": "admission_status", "description": "The current status of the admission.\r\n\r\n- `active` indicates the patient is currently admitted\r\n- `discharged` indicates the patient has been discharged", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__admission_status"]}, "discharge_datetime": {"name": "discharge_datetime", "description": "Local date for the record on discharge.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_ids": {"name": "department_ids", "description": "An array referencing the [department](#!/source/tamanu-source-dbt.tamanu.departments) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_ids"]}, "departments": {"name": "departments", "description": "A comma separated list of names of the departments the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__departments"]}, "department_datetimes": {"name": "department_datetimes", "description": "A comma separated list of dates and times of the departments associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "location_group_ids": {"name": "location_group_ids", "description": "An array referencing the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_ids"]}, "location_groups": {"name": "location_groups", "description": "A comma separated list of names of the location groups the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_groups"]}, "location_group_datetimes": {"name": "location_group_datetimes", "description": "A comma separated list of dates and times of the location groups associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "location_ids": {"name": "location_ids", "description": "An array referencing the [location](#!/source/tamanu-source-dbt.tamanu.locations) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_ids"]}, "locations": {"name": "locations", "description": "A comma separated list of names of the locations the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__locations"]}, "location_datetimes": {"name": "location_datetimes", "description": "A comma separated list of dates and times of the locations associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "primary_diagnoses": {"name": "primary_diagnoses", "description": "Full list of diagnoses that are primary for the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}, "secondary_diagnoses": {"name": "secondary_diagnoses", "description": "Full list of diagnoses that are secondary for the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__admissions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3236265, "relation_name": "\"app\".\"reporting\".\"ds__admissions\"", "raw_code": "{{ admissions_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.admissions_dataset"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__admissions.sql", "compiled": true, "compiled_code": "\n\nwith admission_encounters as (\n select\n e.id,\n e.patient_id,\n e.start_datetime,\n e.end_datetime,\n e.location_id,\n e.patient_billing_type_id,\n f.id as facility_id,\n f.name as facility_name\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\n where e.encounter_type = 'admission'\n and f.is_sensitive = False\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n u.display_name as clinician_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n -- Window functions for ordering and lag operations\n row_number() over (\n partition by eh.encounter_id, ('encounter_type' = any(eh.change_type))\n order by eh.datetime\n ) as encounter_type_change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from admission_encounters ae\n left join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = ae.id\n and eh.encounter_type = 'admission'\n and (eh.change_type is null or eh.change_type && array['encounter_type', 'examiner', 'department', 'location'])\n left join \"app\".\"reporting\".\"users\" u\n on u.id = eh.clinician_id\n left join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n left join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\n-- Clinician changes and admitting clinician logic\nclinician_data as (\n select\n encounter_id,\n bool_or('encounter_type' = any(change_type) and encounter_type_change_sequence = 1) as is_transfer,\n min(datetime) filter (where change_type is null or change_type && array['encounter_type', 'examiner']) as admission_datetime,\n array_agg(\n datetime\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_datetimes,\n array_agg(\n clinician_id\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_ids,\n array_agg(\n clinician_name\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_names\n from encounter_history_consolidated\n group by encounter_id\n),\n\n-- Admitting clinician determination\nadmitting_clinicians as (\n select\n encounter_id,\n admission_datetime,\n case\n when is_transfer and array_length(clinician_ids, 1) > 1\n then clinician_ids[2]\n else clinician_ids[1]\n end as admitting_clinician_id,\n case\n when is_transfer and array_length(clinician_names, 1) > 1\n then clinician_names[2]\n else clinician_names[1]\n end as admitting_clinician_name\n from clinician_data\n),\n\n-- Department changes aggregation\ndepartment_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) as departments\n from encounter_history_consolidated\n where change_type is null or change_type && array['encounter_type', 'department']\n group by encounter_id\n),\n\n-- Location changes aggregation\nlocation_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) as locations\n from encounter_history_consolidated\n where change_type is null or change_type && array['encounter_type', 'location']\n group by encounter_id\n),\n\n-- Location group changes (deduplicated in single pass)\nlocation_group_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) as location_groups\n from encounter_history_consolidated\n where (change_type is null or change_type && array['encounter_type', 'location'])\n and (location_group_id != prev_location_group_id or prev_location_group_id is null)\n group by encounter_id\n),\n\n-- Diagnoses aggregation\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n case when ed.is_primary\n then rd.name || ' (' || rd.code || ')'\n end,\n '; '\n order by ed.datetime\n ) as primary_diagnoses,\n string_agg(\n case when not ed.is_primary\n then rd.name || ' (' || rd.code || ')'\n end,\n '; '\n order by ed.datetime\n ) as secondary_diagnoses\n from admission_encounters ae\n inner join \"app\".\"reporting\".\"encounter_diagnoses\" ed\n on ed.encounter_id = ae.id\n inner join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = ed.diagnosis_id\n where ed.certainty not in ('disproven', 'error')\n group by ed.encounter_id\n),\n\n-- Patient and reference data\npatient_data as (\n select\n ae.id as encounter_id,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village_name,\n ae.patient_billing_type_id,\n bt.name as billing_type_name,\n ae.start_datetime,\n ae.end_datetime,\n ae.location_id,\n ae.facility_id,\n ae.facility_name\n from admission_encounters ae\n left join \"app\".\"reporting\".\"patients\" p\n on p.id = ae.patient_id\n left join \"app\".\"reporting\".\"reference_data\" village\n on village.id = p.village_id\n left join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = ae.patient_billing_type_id\n)\n\nselect\n pd.patient_id,\n pd.display_id,\n pd.first_name,\n pd.last_name,\n pd.date_of_birth,\n date_part('year', age(ac.admission_datetime, pd.date_of_birth)) as age,\n initcap(pd.sex::text) as sex,\n pd.village_id,\n pd.village_name as village,\n pd.patient_billing_type_id as billing_type_id,\n pd.billing_type_name as billing_type,\n ac.admitting_clinician_id,\n ac.admitting_clinician_name as admitting_clinician,\n ac.admission_datetime,\n case\n when pd.end_datetime is null then 'active'\n else 'discharged'\n end as admission_status,\n pd.end_datetime as discharge_datetime,\n pd.facility_id,\n pd.facility_name as facility,\n dc.department_ids,\n dc.departments,\n dc.department_datetimes,\n lgc.location_group_ids,\n lgc.location_groups,\n lgc.location_group_datetimes,\n lc.location_ids,\n lc.locations,\n lc.location_datetimes,\n ed.primary_diagnoses,\n ed.secondary_diagnoses\nfrom patient_data pd\nleft join admitting_clinicians ac\n on ac.encounter_id = pd.encounter_id\nleft join department_changes dc\n on dc.encounter_id = pd.encounter_id\nleft join location_changes lc\n on lc.encounter_id = pd.encounter_id\nleft join location_group_changes lgc\n on lgc.encounter_id = pd.encounter_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = pd.encounter_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__diagnoses": {"database": "app", "schema": "reporting", "name": "ds__diagnoses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__diagnoses.sql", "original_file_path": "models\\datasets\\standard\\ds__diagnoses.sql", "unique_id": "model.tamanu_source_dbt.ds__diagnoses", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__diagnoses"], "alias": "ds__diagnoses", "checksum": {"name": "sha256", "checksum": "f7d66479638ff25cbf7477b86697b83e291e74875bc55964e492e202b7e00780"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Diagnoses", "columns": {"encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__encounter_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id"]}, "diagnosis": {"name": "diagnosis", "description": "Full readable name of the diagnosis", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "diagnosis_datetime": {"name": "diagnosis_datetime", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "age": {"name": "age", "description": "Patient's age at the time of diagnosis.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "contact_number": {"name": "contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who diagnosed the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "certainty": {"name": "certainty", "description": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__certainty"]}, "is_primary": {"name": "is_primary", "description": "A boolean indicating if this is a primary diagnosis", "meta": {}, "data_type": "bool", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__is_primary"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__diagnoses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3236265, "relation_name": "\"app\".\"reporting\".\"ds__diagnoses\"", "raw_code": "{{ diagnoses_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.diagnoses_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__diagnoses.sql", "compiled": true, "compiled_code": "\n\nselect\n e.id as encounter_id,\n p.id as patient_id,\n diagnosis.id as diagnosis_id,\n diagnosis.name as diagnosis,\n ed.datetime as diagnosis_datetime,\n p.first_name,\n p.last_name,\n p.display_id,\n date_part('year', age(ed.datetime::date, p.date_of_birth)) as age,\n p.sex,\n coalesce(pad.primary_contact_number, pad.secondary_contact_number) as contact_number,\n village.id as village_id,\n village.name as village,\n clinician.id as clinician_id,\n clinician.display_name as clinician,\n d.id as department_id,\n d.name as department,\n l.id as location_id,\n l.name as location,\n f.id as facility_id,\n f.name as facility,\n initcap(ed.certainty) as certainty,\n case when ed.is_primary = true then 'Yes' else 'No' end as is_primary\nfrom \"app\".\"reporting\".\"encounter_diagnoses\" ed\njoin \"app\".\"reporting\".\"reference_data\" diagnosis on diagnosis.id = ed.diagnosis_id\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ed.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = e.clinician_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__encounters_emergency": {"database": "app", "schema": "reporting", "name": "ds__encounters_emergency", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__encounters_emergency.sql", "original_file_path": "models\\datasets\\standard\\ds__encounters_emergency.sql", "unique_id": "model.tamanu_source_dbt.ds__encounters_emergency", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__encounters_emergency"], "alias": "ds__encounters_emergency", "checksum": {"name": "sha256", "checksum": "45f17850fc96bb1747ba1a8c5f523bdc59c893123f8273b0664a9682e4793f04"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Emergency encounters with triage information", "columns": {"triage_id": {"name": "triage_id", "description": "Tamanu internal identifier (generally a UUID) in triages.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "arrival_datetime": {"name": "arrival_datetime", "description": "When the patient arrived.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time"]}, "triage_datetime": {"name": "triage_datetime", "description": "When the patient was triaged.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time"]}, "closed_datetime": {"name": "closed_datetime", "description": "When the patient was processed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time"]}, "score": {"name": "score", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__encounter_id"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "arrival_mode": {"name": "arrival_mode", "description": "Full readable name of the triage arrival mode.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "chief_complaint": {"name": "chief_complaint", "description": "Full readable name of the chief complaint.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "secondary_complaint": {"name": "secondary_complaint", "description": "Full readable name of the secondary complaint.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__practitioner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who triaged the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) the triage is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility the triage is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__encounters_emergency.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3236265, "relation_name": "\"app\".\"reporting\".\"ds__encounters_emergency\"", "raw_code": "{{ encounters_emergency_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "triages", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounters_emergency_dataset"], "nodes": ["model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__encounters_emergency.sql", "compiled": true, "compiled_code": "\n\nselect\n t.id as triage_id,\n t.arrival_datetime,\n t.triage_datetime,\n t.closed_datetime,\n t.score,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village,\n e.id as encounter_id,\n e.encounter_type,\n arrival_mode.name as arrival_mode,\n chief_complaint.name as chief_complaint,\n secondary_complaint.name as secondary_complaint,\n clinician.display_name as clinician,\n t.clinician_id,\n f.id as facility_id,\n f.name as facility\nfrom \"app\".\"reporting\".\"triages\" t\njoin \"app\".\"reporting\".\"encounters\" e on e.id = t.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" arrival_mode on arrival_mode.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" chief_complaint on chief_complaint.id = t.chief_complaint_id\nleft join \"app\".\"reporting\".\"reference_data\" secondary_complaint on secondary_complaint.id = t.secondary_complaint_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = t.clinician_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__encounter_diets": {"database": "app", "schema": "reporting", "name": "ds__encounter_diets", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__encounter_diets.sql", "original_file_path": "models\\datasets\\standard\\ds__encounter_diets.sql", "unique_id": "model.tamanu_source_dbt.ds__encounter_diets", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__encounter_diets"], "alias": "ds__encounter_diets", "checksum": {"name": "sha256", "checksum": "ef4a9682a3710abde0aa9083eb6f1e23269999e63cc043cfbe49fa15b1e8c41e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Active encounters with their associated dietary requirements", "columns": {"encounter_id": {"name": "encounter_id", "description": "Tamanu internal identifier (generally a UUID) of encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "patient_name": {"name": "patient_name", "description": "Patient Name", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_name"]}, "age": {"name": "age", "description": "Patient's age at the time of the encounter, formatted with appropriate unit (days/weeks/months/years).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "diets": {"name": "diets", "description": "Full readable name of dietary requirements for the patient during this encounter, comma-separated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "allergies": {"name": "allergies", "description": "Full readable name of allergies for the patient during this encounter, comma-separated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__encounter_diets.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.3236265, "relation_name": "\"app\".\"reporting\".\"ds__encounter_diets\"", "raw_code": "{{ encounter_diets_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diets", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patient_allergies", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_diets_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patient_allergies", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__encounter_diets.sql", "compiled": true, "compiled_code": "\n\nwith diets as (\n select\n ed.encounter_id,\n string_agg(\n rd.name, ', '\n order by rd.name\n ) as diets\n from \"app\".\"reporting\".\"encounter_diets\" ed\n join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = ed.diet_id\n group by ed.encounter_id\n),\n\nallergies as (\n select\n pa.patient_id,\n string_agg(\n rd.name, ', '\n order by rd.name\n ) as allergies\n from \"app\".\"reporting\".\"patient_allergies\" pa\n join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = pa.allergy_id\n group by pa.patient_id\n)\n\nselect\n e.id as encounter_id,\n p.id as patient_id,\n p.display_id,\n concat(p.first_name, ' ', p.last_name) as patient_name,\n e.start_datetime,\n case\n when age(current_date, p.date_of_birth) < interval '8 days'\n then concat(extract(day from age(current_date, p.date_of_birth)), ' days')\n when age(current_date, p.date_of_birth) >= interval '8 days'\n and age(current_date, p.date_of_birth) < interval '1 month'\n then concat(extract(week from age(current_date, p.date_of_birth)), ' weeks')\n when age(current_date, p.date_of_birth) >= interval '1 month'\n and age(current_date, p.date_of_birth) < interval '2 years'\n then concat(extract(month from age(current_date, p.date_of_birth)), ' months')\n when age(current_date, p.date_of_birth) >= interval '2 years'\n then concat(extract(year from age(current_date, p.date_of_birth)), ' years')\n end as age,\n l.id as location_id,\n l.name as location,\n lg.id as location_group_id,\n lg.name as location_group,\n d.diets,\n a.allergies\nfrom \"app\".\"reporting\".\"encounters\" e\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join diets d\n on d.encounter_id = e.id\nleft join allergies a\n on a.patient_id = p.id\nwhere e.end_datetime is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__encounter_prescriptions": {"database": "app", "schema": "reporting", "name": "ds__encounter_prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__encounter_prescriptions.sql", "original_file_path": "models\\datasets\\standard\\ds__encounter_prescriptions.sql", "unique_id": "model.tamanu_source_dbt.ds__encounter_prescriptions", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__encounter_prescriptions"], "alias": "ds__encounter_prescriptions", "checksum": {"name": "sha256", "checksum": "c931fda430f27105081915009477fabc910ce26c3a3e4da11467af8150d4dc84"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Encounter prescriptions", "columns": {"encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__encounter_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__prescription_id"]}, "datetime": {"name": "datetime", "description": "Local date and time for the record in prescriptions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "is_selected_for_discharge": {"name": "is_selected_for_discharge", "description": "Whether the prescription is for when the patient is discharged.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "medication_code": {"name": "medication_code", "description": "Full readable name code of the prescribed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "medication": {"name": "medication", "description": "Full readable name name of the prescribed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "quantity": {"name": "quantity", "description": "Quantity of medicine to dispense.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__quantity"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__encounter_prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3236265, "relation_name": "\"app\".\"reporting\".\"ds__encounter_prescriptions\"", "raw_code": "{{ encounter_prescriptions_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_prescriptions_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__encounter_prescriptions.sql", "compiled": true, "compiled_code": "\n\nselect\n ep.encounter_id,\n ep.prescription_id,\n pr.datetime,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pr.datetime, p.date_of_birth)) as age,\n p.sex,\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\n vil.id as village_id,\n vil.name as village,\n l.facility_id,\n f.name as facility,\n ep.is_selected_for_discharge,\n pr.medication_id,\n m.code as medication_code,\n m.name as medication,\n pr.route,\n pr.quantity,\n pr.repeats,\n pr.is_ongoing,\n pr.is_prn,\n pr.is_variable_dose,\n pr.dose_amount,\n pr.units,\n pr.frequency,\n pr.is_discontinued,\n pr.discontinued_by_id,\n pr.discontinuing_reason,\n pr.discontinued_datetime\nfrom \"app\".\"reporting\".\"encounter_prescriptions\" ep\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ep.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"prescriptions\" pr on pr.id = ep.prescription_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f \n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\njoin \"app\".\"reporting\".\"reference_data\" m on m.id = pr.medication_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__imaging_requests": {"database": "app", "schema": "reporting", "name": "ds__imaging_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__imaging_requests.sql", "original_file_path": "models\\datasets\\standard\\ds__imaging_requests.sql", "unique_id": "model.tamanu_source_dbt.ds__imaging_requests", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__imaging_requests"], "alias": "ds__imaging_requests", "checksum": {"name": "sha256", "checksum": "bfd2311b5ca832349ca06b3f9aad480a9b603b4f3b3c5eeeb842b500d3e10f3c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Imaging requests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of imaging.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "request_id": {"name": "request_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the imaging was requested.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date"]}, "supervising_clinician_id": {"name": "supervising_clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "supervising_clinician": {"name": "supervising_clinician", "description": "Display identifier for the user where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "requesting_clinician_id": {"name": "requesting_clinician_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "requesting_clinician": {"name": "requesting_clinician", "description": "Display identifier for the user who requested the imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "priority": {"name": "priority", "description": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__priority"]}, "imaging_type": {"name": "imaging_type", "description": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__imaging_type"]}, "imaging_area": {"name": "imaging_area", "description": "Full readable name of the imaging area.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "completed_datetime": {"name": "completed_datetime", "description": "When this result was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_at"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113).", "meta": {}, "data_type": "character varying(1024)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__imaging_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3236265, "relation_name": "\"app\".\"reporting\".\"ds__imaging_requests\"", "raw_code": "{{ imaging_requests_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "imaging_results", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.imaging_requests_dataset"], "nodes": ["model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__imaging_requests.sql", "compiled": true, "compiled_code": "\n\nwith results as (\n select\n imaging_request_id,\n min(datetime) as completed_datetime\n from \"app\".\"reporting\".\"imaging_results\"\n group by imaging_request_id\n),\n\nimaging_area_notes as (\n select\n record_id as imaging_request_id,\n string_agg(content, ', ' order by datetime) as imaging_area\n from \"app\".\"reporting\".\"notes\"\n where record_type = 'ImagingRequest'\n and note_type_id = 'notetype-areaToBeImaged'\n group by record_id\n),\n\nimaging_areas as (\n select\n ir.id as imaging_request_id,\n coalesce(\n string_agg(ia.name, ', ' order by ia.name),\n n.imaging_area\n ) as imaging_area\n from \"app\".\"reporting\".\"imaging_requests\" ir\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" ia on ia.id = ira.area_id\n left join imaging_area_notes n on n.imaging_request_id = ir.id\n group by ir.id, n.imaging_area\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(ir.datetime::date, p.date_of_birth)) as age,\n p.sex,\n v.id as village_id,\n v.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n ir.display_id as request_id,\n ir.datetime as requested_datetime,\n su.id as supervising_clinician_id,\n su.display_name as supervising_clinician,\n ru.id as requesting_clinician_id,\n ru.display_name as requesting_clinician,\n case\n when ir.priority = 'routine' then 'Routine'\n when ir.priority = 'urgent' then 'Urgent'\n when ir.priority = 'asap' then 'ASAP'\n when ir.priority = 'stat' then 'STAT'\n when ir.priority = 'today' then 'Today'\n else ir.priority\n end as priority,\n ir.imaging_type,\n areas.imaging_area,\n ir.status as status_id,\n case\n when ir.status = 'pending' then 'Pending'\n when ir.status = 'in_progress' then 'In progress'\n when ir.status = 'completed' then 'Completed'\n when ir.status = 'cancelled' then 'Cancelled'\n when ir.status = 'deleted' then 'Deleted'\n when ir.status = 'entered_in_error' then 'Entered in error'\n else 'Unknown'\n end as status,\n case\n when ir.status = 'completed' then irs.completed_datetime\n end as completed_datetime,\n case\n when ir.reason_for_cancellation = 'clinical' then 'Clinical reason'\n when ir.reason_for_cancellation = 'duplicate' then 'Duplicate'\n when ir.reason_for_cancellation = 'entered-in-error' then 'Entered in error'\n when ir.reason_for_cancellation = 'patient-discharged' then 'Patient discharged'\n when ir.reason_for_cancellation = 'patient-refused' then 'Patient refused'\n when ir.reason_for_cancellation = 'other' then 'Other'\n end as reason_for_cancellation\nfrom \"app\".\"reporting\".\"imaging_requests\" ir\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ir.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"users\" su on su.id = e.clinician_id\nleft join \"app\".\"reporting\".\"users\" ru on ru.id = ir.requested_by_id\nleft join imaging_areas areas on areas.imaging_request_id = ir.id\nleft join \"app\".\"reporting\".\"reference_data\" v on v.id = p.village_id\nleft join results irs on irs.imaging_request_id = ir.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__lab_requests": {"database": "app", "schema": "reporting", "name": "ds__lab_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__lab_requests.sql", "original_file_path": "models\\datasets\\standard\\ds__lab_requests.sql", "unique_id": "model.tamanu_source_dbt.ds__lab_requests", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__lab_requests"], "alias": "ds__lab_requests", "checksum": {"name": "sha256", "checksum": "4d2ce2f53b05b2324dfc59e20241a37ca4801c67c38a39d50521d45120aeb4f9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Lab requests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "laboratory_id": {"name": "laboratory_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id"]}, "laboratory": {"name": "laboratory", "description": "Full readable name of the laboratory", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "request_id": {"name": "request_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "requested_by": {"name": "requested_by", "description": "Display identifier for the user who requested the lab test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "requesting_department_id": {"name": "requesting_department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) from which the lab test was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "requesting_department": {"name": "requesting_department", "description": "Full readable name of the department from which the lab test was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "priority_id": {"name": "priority_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_priority_id"]}, "priority": {"name": "priority", "description": "Full readable name of the lab test priority.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__category_id"]}, "category": {"name": "category", "description": "Full readable name of the lab test category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "lab_test_panel": {"name": "lab_test_panel", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "tests": {"name": "tests", "description": "Full list of tests", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__tests"]}, "collected_datetime": {"name": "collected_datetime", "description": "When the sample was collected.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time"]}, "collected_by_id": {"name": "collected_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__collected_by_id"]}, "collected_by": {"name": "collected_by", "description": "Display identifier for the user who collected the specimen.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "specimen_type_id": {"name": "specimen_type_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_type_id"]}, "specimen_type": {"name": "specimen_type", "description": "Used to indicate if the lab test type is sensitive and should be hidden accordingly.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__is_sensitive"]}, "site": {"name": "site", "description": "Full readable name of the specimen collection site.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "completed_datetime": {"name": "completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__lab_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3236265, "relation_name": "\"app\".\"reporting\".\"ds__lab_requests\"", "raw_code": "{{ lab_requests_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.lab_requests_dataset"], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__lab_requests.sql", "compiled": true, "compiled_code": "\n\nwith lab_test_data as (\n select\n lr.id as lab_request_id,\n string_agg(ltt.name, ', '\n order by ltt.name\n ) as tests,\n max(lt.completed_datetime) as completed_datetime\n from \"app\".\"reporting\".\"lab_requests\" lr\n join \"app\".\"reporting\".\"lab_tests\" lt on lt.lab_request_id = lr.id\n join \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = lt.lab_test_type_id\n where ltt.is_sensitive = False\n group by lr.id\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(lr.requested_datetime, p.date_of_birth)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n f.id as facility_id,\n f.name as facility,\n d.name as department,\n d.id as department_id,\n l.id as location_id,\n l.name as location,\n lg.id as location_group_id,\n lg.name as location_group,\n laboratory.id as laboratory_id,\n laboratory.name as laboratory,\n lr.display_id as request_id,\n case lr.status\n when 'reception_pending' then 'Reception pending'\n when 'results_pending' then 'Results pending'\n when 'to_be_verified' then 'To be verified'\n when 'verified' then 'Verified'\n when 'published' then 'Published'\n when 'cancelled' then 'Cancelled'\n when 'deleted' then 'Deleted'\n when 'sample-not-collected' then 'Sample not collected'\n when 'entered-in-error' then 'Entered in error'\n else lr.status\n end as status,\n lr.status as status_id,\n lr.requested_datetime,\n req_clinician.id as requested_by_id,\n req_clinician.display_name as requested_by,\n lr.department_id as requesting_department_id,\n req_department.name as requesting_department,\n lr.lab_test_priority_id as priority_id,\n priority.name as priority,\n category.id as lab_test_category_id,\n category.name as lab_test_category,\n ltp.name as lab_test_panel,\n lta.tests,\n lr.collected_datetime,\n lr.collected_by_id,\n collector.display_name as collected_by,\n lr.specimen_type_id,\n specimen.name as specimen_type,\n site.name as site,\n lta.completed_datetime,\n case lr.reason_for_cancellation\n when 'clinical' then 'Clinical reason'\n when 'duplicate' then 'Duplicate'\n when 'entered-in-error' then 'Entered in error'\n when 'patient-discharged' then 'Patient discharged'\n when 'patient-refused' then 'Patient refused'\n when 'other' then 'Other'\n else lr.reason_for_cancellation\n end as reason_for_cancellation\nfrom \"app\".\"reporting\".\"lab_requests\" lr\njoin lab_test_data lta on lta.lab_request_id = lr.id\njoin \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" laboratory on laboratory.id = lr.lab_test_laboratory_id\nleft join \"app\".\"reporting\".\"users\" req_clinician on req_clinician.id = lr.requested_by_id\nleft join \"app\".\"reporting\".\"departments\" req_department on req_department.id = lr.department_id\nleft join \"app\".\"reporting\".\"reference_data\" priority on priority.id = lr.lab_test_priority_id\nleft join \"app\".\"reporting\".\"reference_data\" category on category.id = lr.lab_test_category_id\nleft join \"app\".\"reporting\".\"users\" collector on collector.id = lr.collected_by_id\nleft join \"app\".\"reporting\".\"reference_data\" specimen on specimen.id = lr.specimen_type_id\nleft join \"app\".\"reporting\".\"reference_data\" site on site.id = lr.lab_sample_site_id\nleft join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ltpr.lab_test_panel_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__lab_tests": {"database": "app", "schema": "reporting", "name": "ds__lab_tests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__lab_tests.sql", "original_file_path": "models\\datasets\\standard\\ds__lab_tests.sql", "unique_id": "model.tamanu_source_dbt.ds__lab_tests", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__lab_tests"], "alias": "ds__lab_tests", "checksum": {"name": "sha256", "checksum": "294b1354acbe716e42bfe198c6d31abe317871261363dae78fa362ccb0ea7ae7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Lab tests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "lab_request_id": {"name": "lab_request_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id"]}, "lab_test_panel": {"name": "lab_test_panel", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__category_id"]}, "lab_test_category": {"name": "lab_test_category", "description": "Full readable name of the lab test category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "requested_by": {"name": "requested_by", "description": "Display identifier for the user who requested the lab test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "lab_request_published_datetime": {"name": "lab_request_published_datetime", "description": "When this lab request's results were published.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__published_date"]}, "lab_test_date": {"name": "lab_test_date", "description": "Local date for the record in lab_tests.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "result": {"name": "result", "description": "The result of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__result"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_type_id"]}, "lab_test_type": {"name": "lab_test_type", "description": "Human-friendly name of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__name"]}, "lab_test_completed_datetime": {"name": "lab_test_completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__lab_tests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3236265, "relation_name": "\"app\".\"reporting\".\"ds__lab_tests\"", "raw_code": "{{ lab_tests_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.lab_tests_dataset"], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__lab_tests.sql", "compiled": true, "compiled_code": "\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(lr.requested_datetime, p.date_of_birth::date)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n req_dept.id as requesting_department_id,\n req_dept.name as requesting_department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n lr.display_id as lab_request_id,\n lr.status as status_id,\n case lr.status\n when 'reception_pending' then 'Reception pending'\n when 'results_pending' then 'Results pending'\n when 'to_be_verified' then 'To be verified'\n when 'verified' then 'Verified'\n when 'published' then 'Published'\n when 'cancelled' then 'Cancelled'\n when 'deleted' then 'Deleted'\n when 'sample-not-collected' then 'Sample not collected'\n when 'entered-in-error' then 'Entered in error'\n else lr.status\n end as status,\n ltp.id as lab_test_panel_id,\n ltp.name as lab_test_panel,\n category.id as lab_test_category_id,\n category.name as lab_test_category,\n lr.requested_datetime,\n requester.id as requested_by_id,\n requester.display_name as requested_by,\n lr.published_datetime as lab_request_published_datetime,\n lt.date as lab_test_date,\n lt.result,\n lt.verification,\n ltt.id as lab_test_type_id,\n ltt.name as lab_test_type,\n lt.completed_datetime as lab_test_completed_datetime\nfrom \"app\".\"reporting\".\"lab_requests\" lr\njoin \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"departments\" req_dept on req_dept.id = lr.department_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nleft join \"app\".\"reporting\".\"users\" requester on requester.id = lr.requested_by_id\nleft join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr on ltpr.id = lr.lab_test_panel_request_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ltpr.lab_test_panel_id\nleft join \"app\".\"reporting\".\"reference_data\" category on category.id = lr.lab_test_category_id\njoin \"app\".\"reporting\".\"lab_tests\" lt on lt.lab_request_id = lr.id\njoin \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = lt.lab_test_type_id\nwhere ltt.is_sensitive = False\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__location_bookings": {"database": "app", "schema": "reporting", "name": "ds__location_bookings", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__location_bookings.sql", "original_file_path": "models\\datasets\\standard\\ds__location_bookings.sql", "unique_id": "model.tamanu_source_dbt.ds__location_bookings", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__location_bookings"], "alias": "ds__location_bookings", "checksum": {"name": "sha256", "checksum": "5c2696edaa85adcd9f5115cb6dde7cb7dea86499475c030a39ce73f99c32eed4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Location bookings", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the booking.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "booking_start_datetime": {"name": "booking_start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "booking_end_datetime": {"name": "booking_end_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "booking_type_id": {"name": "booking_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "booking_type": {"name": "booking_type", "description": "Full readable name of the booking type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "booking_status": {"name": "booking_status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who booked the location.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__location_bookings.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3396032, "relation_name": "\"app\".\"reporting\".\"ds__location_bookings\"", "raw_code": "{{ location_bookings_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "location_bookings", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.location_bookings_dataset"], "nodes": ["model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__location_bookings.sql", "compiled": true, "compiled_code": "\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(a.start_datetime::date, p.date_of_birth)) as age,\n p.sex,\n vil.id as village_id,\n vil.name as village,\n billing.id as billing_type_id,\n billing.name as billing_type,\n a.start_datetime as booking_start_datetime,\n a.end_datetime as booking_end_datetime,\n a.status as booking_status,\n u.id as clinician_id,\n u.display_name as clinician,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n a.booking_type_id,\n bt.name as booking_type\nfrom \"app\".\"reporting\".\"location_bookings\" a\njoin \"app\".\"reporting\".\"patients\" p on p.id = a.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = a.clinician_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = a.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pd.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" bt on bt.id = a.booking_type_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__medication_dispenses": {"database": "app", "schema": "reporting", "name": "ds__medication_dispenses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__medication_dispenses.sql", "original_file_path": "models\\datasets\\standard\\ds__medication_dispenses.sql", "unique_id": "model.tamanu_source_dbt.ds__medication_dispenses", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__medication_dispenses"], "alias": "ds__medication_dispenses", "checksum": {"name": "sha256", "checksum": "2742eab92b82d9f0bac6177a2feb8d7812718a5823ad78147e0de2d90c9cf0db"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Medication dispense records", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_dispenses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "quantity": {"name": "quantity", "description": "The quantity of medication units dispensed to the patient in each dispensing.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__quantity"]}, "dispensed_at": {"name": "dispensed_at", "description": "The timestamp indicating when the medication was physically dispensed to the patient.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_at"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the medication was dispensed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the medication was dispensed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "medication_code": {"name": "medication_code", "description": "Full readable name code of the dispensed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "medication": {"name": "medication", "description": "Full readable name name of the dispensed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__medication_dispenses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782422375.3396032, "relation_name": "\"app\".\"reporting\".\"ds__medication_dispenses\"", "raw_code": "{{ medication_dispenses_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "medication_dispenses", "package": null, "version": null}, {"name": "pharmacy_order_prescriptions", "package": null, "version": null}, {"name": "pharmacy_orders", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.medication_dispenses_dataset"], "nodes": ["model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__medication_dispenses.sql", "compiled": true, "compiled_code": "\n\nselect\n md.id,\n md.quantity,\n md.dispensed_at,\n po.facility_id,\n f.name as facility,\n pr.medication_id,\n m.code as medication_code,\n m.name as medication\nfrom \"app\".\"reporting\".\"medication_dispenses\" md\njoin \"app\".\"reporting\".\"pharmacy_order_prescriptions\" pop\n on pop.id = md.pharmacy_order_prescription_id\njoin \"app\".\"reporting\".\"pharmacy_orders\" po\n on po.id = pop.pharmacy_order_id\n-- prescription_id is not null on all pharmacy_order_prescriptions rows (enforced by source not_null test).\n-- ongoing_prescription_id is the nullable supplementary reference and is not used for the medication lookup\njoin \"app\".\"reporting\".\"prescriptions\" pr\n on pr.id = pop.prescription_id\njoin \"app\".\"reporting\".\"reference_data\" m\n on m.id = pr.medication_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = po.facility_id\n and f.is_sensitive = False\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__outpatient_appointments": {"database": "app", "schema": "reporting", "name": "ds__outpatient_appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments.sql", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments.sql", "unique_id": "model.tamanu_source_dbt.ds__outpatient_appointments", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__outpatient_appointments"], "alias": "ds__outpatient_appointments", "checksum": {"name": "sha256", "checksum": "cb748b9c0a17173f8fc925290ff00c2aae824f974f9d1a4efcc3bfdf96228c37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Appointments", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the appointment.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "contact_number": {"name": "contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. where available otherwise Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number", "doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "appointment_start_datetime": {"name": "appointment_start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "appointment_end_datetime": {"name": "appointment_end_datetime", "description": "When the appointment ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__appointment_type_id"]}, "appointment_type": {"name": "appointment_type", "description": "Full readable name of the appointment type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "appointment_status": {"name": "appointment_status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who booked the appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "priority": {"name": "priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "schedule_id": {"name": "schedule_id", "description": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__schedule_id"]}, "until_date": {"name": "until_date", "description": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__until_date"]}, "interval": {"name": "interval", "description": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\"", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__interval"]}, "frequency": {"name": "frequency", "description": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__frequency"]}, "nth_weekday": {"name": "nth_weekday", "description": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__nth_weekday"]}, "days_of_week": {"name": "days_of_week", "description": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__days_of_week"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Display identifier for the user who created the appointment, sourced from the earliest change log entry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "created_by": {"name": "created_by", "description": "Display name of the user who created the appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__outpatient_appointments.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3396032, "relation_name": "\"app\".\"reporting\".\"ds__outpatient_appointments\"", "raw_code": "{{ outpatient_appointments_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments_change_logs", "package": null, "version": null}, {"name": "outpatient_appointments", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.outpatient_appointments_dataset"], "nodes": ["model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__outpatient_appointments.sql", "compiled": true, "compiled_code": "\n\nwith appointment_creators as (\n select\n appointment_id,\n created_by_user_id\n from \"app\".\"reporting\".\"outpatient_appointments_change_logs\"\n where change_sequence = 1\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(a.start_datetime, p.date_of_birth)) as age,\n p.sex,\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\n vil.id as village_id,\n vil.name as village,\n billing.id as billing_type_id,\n billing.name as billing_type,\n a.start_datetime as appointment_start_datetime,\n a.end_datetime as appointment_end_datetime,\n a.appointment_type_id,\n apt.name as appointment_type,\n a.status as appointment_status,\n u.id as clinician_id,\n u.display_name as clinician,\n lg.id as location_group_id,\n lg.name as location_group,\n a.priority,\n a.schedule_id,\n a.until_date,\n a.interval,\n a.days_of_week,\n a.frequency,\n a.nth_weekday,\n ac.created_by_user_id,\n creator.display_name as created_by\nfrom \"app\".\"reporting\".\"outpatient_appointments\" a\njoin \"app\".\"reporting\".\"patients\" p on p.id = a.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = a.clinician_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = a.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = lg.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pd.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" apt on apt.id = a.appointment_type_id\nleft join appointment_creators ac on ac.appointment_id = a.id\nleft join \"app\".\"reporting\".\"users\" creator on creator.id = ac.created_by_user_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__outpatient_appointments_audit": {"database": "app", "schema": "reporting", "name": "ds__outpatient_appointments_audit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments_audit.sql", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments_audit.sql", "unique_id": "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__outpatient_appointments_audit"], "alias": "ds__outpatient_appointments_audit", "checksum": {"name": "sha256", "checksum": "ca5aceba0bb67c1362aeeef99ec4cfa3e97ccdd4d4f104adcf61ce1d8521a3e7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "dataset", "clinical", "audit"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "dataset", "clinical", "audit"], "description": "Dataset for outpatient appointment audit report. Tracks all modifications and cancellations to appointments, showing both current and previous values. Excludes status-only changes unless the status changes to 'Cancelled'.\n", "columns": {"change_id": {"name": "change_id", "description": "Unique identifier for the change log entry (UUID from logs.changes).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id"]}, "appointment_id": {"name": "appointment_id", "description": "Reference to the [appointment](#!/model/model.tamanu_source_dbt.outpatient_appointments) that was modified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id"]}, "change_number": {"name": "change_number", "description": "Sequential change number for this appointment where initial creation is excluded. 1 = first modification, 2 = second modification, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__change_number"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/model/model.tamanu_source_dbt.patients) associated with the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "appointment_start_datetime": {"name": "appointment_start_datetime", "description": "Current appointment start date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime"]}, "appointment_end_datetime": {"name": "appointment_end_datetime", "description": "Current appointment end date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime"]}, "appointment_type": {"name": "appointment_type", "description": "Current Actual data for appointment type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Current [appointment type](#!/model/model.tamanu_source_dbt.reference_data) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id"]}, "clinician": {"name": "clinician", "description": "Current The human readable display name for the user. for clinician", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "clinician_id": {"name": "clinician_id", "description": "Current [clinician](#!/model/model.tamanu_source_dbt.users) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id"]}, "location_group": {"name": "location_group", "description": "Current Full readable name for location group for area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "location_group_id": {"name": "location_group_id", "description": "Current [location group](#!/model/model.tamanu_source_dbt.location_groups)/area ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id"]}, "priority": {"name": "priority", "description": "Current Current priority status (after the change). Boolean indicating if the appointment is high priority. formatted as Yes/No", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority"]}, "schedule_id": {"name": "schedule_id", "description": "Current recurring schedule ID (after the change). References appointment_schedules table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id"]}, "is_repeating": {"name": "is_repeating", "description": "Whether the appointment is part of a repeating schedule. Values: Yes (has schedule_id), No (no schedule_id).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_repeating"]}, "created_by": {"name": "created_by", "description": "The human readable display name for the user. who created the appointment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who originally created the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id"]}, "modified_by": {"name": "modified_by", "description": "The human readable display name for the user. who modified the appointment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "modified_by_user_id": {"name": "modified_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who made the modification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id"]}, "modified_datetime": {"name": "modified_datetime", "description": "Timestamp when the change was logged (from logs.changes.logged_at).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime"]}, "is_cancelled": {"name": "is_cancelled", "description": "Whether the appointment status is 'Cancelled'. Values: Yes/No.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_cancelled"]}, "prev_start_datetime": {"name": "prev_start_datetime", "description": "Previous appointment start date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime"]}, "prev_end_datetime": {"name": "prev_end_datetime", "description": "Previous appointment end date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime"]}, "prev_appointment_type": {"name": "prev_appointment_type", "description": "Previous Actual data for appointment type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "prev_appointment_type_id": {"name": "prev_appointment_type_id", "description": "Previous appointment type ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id"]}, "prev_clinician": {"name": "prev_clinician", "description": "Previous The human readable display name for the user. for clinician", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "prev_clinician_id": {"name": "prev_clinician_id", "description": "Previous clinician ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id"]}, "prev_location_group": {"name": "prev_location_group", "description": "Previous Full readable name for location group for area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "prev_location_group_id": {"name": "prev_location_group_id", "description": "Previous location group/area ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id"]}, "prev_priority": {"name": "prev_priority", "description": "Previous Previous priority status (before the change). Null for creation events (change_sequence = 1). formatted as Yes/No", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority"]}, "facility_id": {"name": "facility_id", "description": "Tamanu internal identifier (generally a UUID) in facilities (for filtering)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "facility": {"name": "facility", "description": "Full readable name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__outpatient_appointments_audit.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["dataset", "clinical", "audit"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3396032, "relation_name": "\"app\".\"reporting\".\"ds__outpatient_appointments_audit\"", "raw_code": "{{ outpatient_appointments_audit_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments_change_logs", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [["tamanu", "appointment_schedules"], ["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.outpatient_appointments_audit_dataset"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__outpatient_appointments_audit.sql", "compiled": true, "compiled_code": "\n\n-- Outpatient Appointments Audit Dataset\n-- This dataset tracks changes/modifications to outpatient appointments\n-- Each row represents a modification event (excludes initial creation)\n--\n-- Included changes:\n-- - Status changed to 'Cancelled' (individual cancellations only)\n-- - Changes to: start/end datetime, clinician, location group, appointment type, priority\n--\n-- Excluded changes:\n-- - Initial appointment creation (change_sequence = 1)\n-- - Status-only changes (unless changing to 'Cancelled')\n-- - Appointments automatically cancelled when their schedule was cancelled\n-- (i.e., bulk cancellations via \"cancel this and all future appointments\")\n--\n-- change_number: starts from 1 for the first modification, increments for subsequent changes\n--\n-- Note: schedule_id never changes on existing appointments in Tamanu.\n-- When a schedule is modified, old appointments are cancelled and new ones are created.\n\nwith change_evaluation as (\n select\n cl.*,\n -- Determine if this change has meaningful field modifications\n case\n -- Status changed to Cancelled\n when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true\n -- Any non-status fields changed\n when (\n cl.prev_start_datetime is distinct from cl.start_datetime\n or cl.prev_end_datetime is distinct from cl.end_datetime\n or cl.prev_clinician_id is distinct from cl.clinician_id\n or cl.prev_location_group_id is distinct from cl.location_group_id\n or cl.prev_appointment_type_id is distinct from cl.appointment_type_id\n or cl.prev_is_high_priority is distinct from cl.is_high_priority\n ) then true\n else false\n end as is_meaningful_change\n from \"app\".\"reporting\".\"outpatient_appointments_change_logs\" cl\n left join \"app\".\"public\".\"appointment_schedules\" s on s.id = cl.schedule_id\n where\n -- Exclude appointments that were automatically cancelled when the schedule was cancelled\n -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule)\n not (\n cl.status = 'Cancelled'\n and s.cancelled_at_date is not null\n and cl.start_datetime::date > s.cancelled_at_date::date\n )\n),\n\nnumbered_changes as (\n select\n ce.*,\n -- Assign change number: starts from 1 for first modification\n row_number() over (\n partition by ce.appointment_id\n order by ce.modified_datetime\n ) as change_number\n from change_evaluation ce\n where ce.is_meaningful_change = true\n and ce.change_sequence > 1 -- Exclude initial creation\n)\n\nselect\n fc.change_id,\n fc.appointment_id,\n fc.change_number,\n -- Patient details\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n -- Current appointment details\n fc.start_datetime as appointment_start_datetime,\n fc.end_datetime as appointment_end_datetime,\n apt.name as appointment_type,\n fc.appointment_type_id,\n clinician.display_name as clinician,\n fc.clinician_id,\n lg.name as location_group,\n fc.location_group_id,\n case when fc.is_high_priority then 'Yes' else 'No' end as priority,\n fc.schedule_id,\n case\n when fc.schedule_id is not null then 'Yes'\n else 'No'\n end as is_repeating,\n -- Modification details\n creator.display_name as created_by,\n fc.created_by_user_id,\n modifier.display_name as modified_by,\n fc.modified_by_user_id,\n fc.modified_datetime,\n case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled,\n -- Previous appointment details (only shown if different from current)\n case\n when fc.prev_start_datetime is distinct from fc.start_datetime\n then fc.prev_start_datetime\n end as prev_start_datetime,\n case\n when fc.prev_end_datetime is distinct from fc.end_datetime\n then fc.prev_end_datetime\n end as prev_end_datetime,\n case\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\n then prev_apt.name\n end as prev_appointment_type,\n case\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\n then fc.prev_appointment_type_id\n end as prev_appointment_type_id,\n case\n when fc.prev_clinician_id is distinct from fc.clinician_id\n then prev_clinician.display_name\n end as prev_clinician,\n case\n when fc.prev_clinician_id is distinct from fc.clinician_id\n then fc.prev_clinician_id\n end as prev_clinician_id,\n case\n when fc.prev_location_group_id is distinct from fc.location_group_id\n then prev_lg.name\n end as prev_location_group,\n case\n when fc.prev_location_group_id is distinct from fc.location_group_id\n then fc.prev_location_group_id\n end as prev_location_group_id,\n case\n when fc.prev_is_high_priority is not null\n and fc.prev_is_high_priority is distinct from fc.is_high_priority\n then case when fc.prev_is_high_priority then 'Yes' else 'No' end\n end as prev_priority,\n -- Facility details for filtering\n f.id as facility_id,\n f.name as facility\nfrom numbered_changes fc\njoin \"app\".\"reporting\".\"patients\" p on p.id = fc.patient_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = fc.clinician_id\nleft join \"app\".\"reporting\".\"users\" prev_clinician on prev_clinician.id = fc.prev_clinician_id\nleft join \"app\".\"reporting\".\"users\" creator on creator.id = fc.created_by_user_id\nleft join \"app\".\"reporting\".\"users\" modifier on modifier.id = fc.modified_by_user_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = fc.location_group_id\nleft join \"app\".\"reporting\".\"location_groups\" prev_lg on prev_lg.id = fc.prev_location_group_id\nleft join \"app\".\"reporting\".\"reference_data\" apt on apt.id = fc.appointment_type_id\nleft join \"app\".\"reporting\".\"reference_data\" prev_apt on prev_apt.id = fc.prev_appointment_type_id\nleft join \"app\".\"public\".\"appointment_schedules\" s on s.id = fc.schedule_id\n-- Join to facility for filtering by sensitivity\njoin \"app\".\"reporting\".\"facilities\" f on f.id = lg.facility_id\n and f.is_sensitive = False\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__procedures": {"database": "app", "schema": "reporting", "name": "ds__procedures", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__procedures.sql", "original_file_path": "models\\datasets\\standard\\ds__procedures.sql", "unique_id": "model.tamanu_source_dbt.ds__procedures", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__procedures"], "alias": "ds__procedures", "checksum": {"name": "sha256", "checksum": "acf1f45ba3c9e1d72e460f02b212ade3438fc78c8961bd6c9b0bb08f12f95745"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Procedures", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the procedure.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "nationality": {"name": "nationality", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "encounter_facility_id": {"name": "encounter_facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "encounter_facility": {"name": "encounter_facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "encounter_department_id": {"name": "encounter_department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "encounter_department": {"name": "encounter_department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "encounter_start_datetime": {"name": "encounter_start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "encounter_end_datetime": {"name": "encounter_end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "procedure_facility_id": {"name": "procedure_facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "procedure_facility": {"name": "procedure_facility", "description": "Full readable name of the facility where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "procedure_area_id": {"name": "procedure_area_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "procedure_area": {"name": "procedure_area", "description": "Full readable name of the location group where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "procedure_location_id": {"name": "procedure_location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "procedure_location": {"name": "procedure_location", "description": "Full readable name of the location where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__procedure_type_id"]}, "procedure_type": {"name": "procedure_type", "description": "Full readable name of the procedure type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "procedure_start_time": {"name": "procedure_start_time", "description": "When the procedure started.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time"]}, "procedure_end_time": {"name": "procedure_end_time", "description": "When the procedure ended, if it's completed.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time"]}, "procedure_duration": {"name": "procedure_duration", "description": "Duration of the procedure.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__duration"]}, "procedure_clinician_id": {"name": "procedure_clinician_id", "description": "Reference to the [physician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__physician_id"]}, "procedure_clinician": {"name": "procedure_clinician", "description": "Display identifier for the user who performed the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "procedure_anaesthetist_id": {"name": "procedure_anaesthetist_id", "description": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetist_id"]}, "procedure_anaesthetist": {"name": "procedure_anaesthetist", "description": "Display identifier for the user who administered anaesthesia.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "procedure_assistant_anaesthetist_id": {"name": "procedure_assistant_anaesthetist_id", "description": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id"]}, "procedure_assistant_anaesthetist": {"name": "procedure_assistant_anaesthetist", "description": "Display identifier for the user who assisted the anaesthetist in the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "is_completed": {"name": "is_completed", "description": "Whether the procedure has completed.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed"]}, "time_in": {"name": "time_in", "description": "The time when the patient entered the procedure room or when the procedure setup began.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_in"]}, "time_out": {"name": "time_out", "description": "The time when the patient left the procedure room or when the procedure cleanup was completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_out"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__procedures.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3396032, "relation_name": "\"app\".\"reporting\".\"ds__procedures\"", "raw_code": "{{ procedures_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "procedures", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.procedures_dataset"], "nodes": ["model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__procedures.sql", "compiled": true, "compiled_code": "\n\nwith filtered_procedure as (\n select\n pc.*,\n eh.department_id,\n eh.encounter_type,\n row_number() over (\n partition by pc.id\n order by eh.datetime desc\n ) as encounter_history_record\n from \"app\".\"reporting\".\"procedures\" pc\n left join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = pc.encounter_id\n and eh.datetime::date <= pc.date\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pc.date, p.date_of_birth)) as age,\n p.sex,\n nationality.name as nationality,\n encounter_facility.id as encounter_facility_id,\n encounter_facility.name as encounter_facility,\n encounter_department.id as encounter_department_id,\n encounter_department.name as encounter_department,\n case\n when coalesce(pc.encounter_type, e.encounter_type) = 'admission' then 'Hospital Admission'\n when coalesce(pc.encounter_type, e.encounter_type) = 'clinic' then 'Clinic'\n when coalesce(pc.encounter_type, e.encounter_type) in ('triage', 'observation', 'emergency') then 'Triage'\n end as encounter_type,\n e.start_datetime as encounter_start_datetime,\n e.end_datetime as encounter_end_datetime,\n procedure_facility.id as procedure_facility_id,\n procedure_facility.name as procedure_facility,\n procedure_area.id as procedure_area_id,\n procedure_area.name as procedure_area,\n procedure_location.id as procedure_location_id,\n procedure_location.name as procedure_location,\n procedure_type.id as procedure_type_id,\n procedure_type.name as procedure_type,\n pc.date as procedure_date,\n pc.start_time as procedure_start_time,\n pc.end_time as procedure_end_time,\n case\n when pc.end_time is not null and pc.start_time is not null then\n concat(\n lpad((\n case\n when pc.end_time < pc.start_time\n then\n (24 + extract(hour from pc.end_time) - extract(hour from pc.start_time))\n else\n extract(hour from (pc.end_time - pc.start_time))\n end\n )::text, 2, '0'), ':',\n lpad((\n case\n when pc.end_time < pc.start_time\n then\n (extract(minute from pc.end_time) - extract(minute from pc.start_time))\n else\n extract(minute from (pc.end_time - pc.start_time))\n end\n )::text, 2, '0')\n )\n end as procedure_duration,\n clinician.id as procedure_clinician_id,\n clinician.display_name as procedure_clinician,\n anaesthetist.id as procedure_anaesthetist_id,\n anaesthetist.display_name as procedure_anaesthetist,\n assistant_anaesthetist.id as procedure_assistant_anaesthetist_id,\n assistant_anaesthetist.display_name as procedure_assistant_anaesthetist,\n case\n when pc.is_completed then 'Y' else 'N'\n end as is_completed,\n pc.time_in,\n pc.time_out\nfrom filtered_procedure pc\njoin \"app\".\"reporting\".\"encounters\" e on e.id = pc.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"reference_data\" procedure_type on procedure_type.id = pc.procedure_type_id\njoin \"app\".\"reporting\".\"locations\" procedure_location\n on procedure_location.id = pc.location_id\nleft join \"app\".\"reporting\".\"location_groups\" procedure_area\n on procedure_area.id = procedure_location.location_group_id\njoin \"app\".\"reporting\".\"facilities\" procedure_facility\n on procedure_facility.id = procedure_location.facility_id\n and procedure_facility.is_sensitive = False\njoin \"app\".\"reporting\".\"locations\" encounter_location\n on encounter_location.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" encounter_facility\n on encounter_facility.id = encounter_location.facility_id\n and encounter_facility.is_sensitive = False\njoin \"app\".\"reporting\".\"departments\" encounter_department\n on encounter_department.id = coalesce(pc.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" nationality on nationality.id = pd.nationality_id\nleft join \"app\".\"reporting\".\"users\" assistant_anaesthetist on assistant_anaesthetist.id = pc.assistant_anaesthetist_id\nleft join \"app\".\"reporting\".\"users\" anaesthetist on anaesthetist.id = pc.anaesthetist_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = pc.clinician_id\nwhere pc.encounter_history_record = 1\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__referrals": {"database": "app", "schema": "reporting", "name": "ds__referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__referrals.sql", "original_file_path": "models\\datasets\\standard\\ds__referrals.sql", "unique_id": "model.tamanu_source_dbt.ds__referrals", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__referrals"], "alias": "ds__referrals", "checksum": {"name": "sha256", "checksum": "be7d976be9bfcdf7945737d021f9edaec87843f491d5579adc68306148ea6246"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Referrals", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {"metrics": {"total_patients_count": {"type": "count"}}}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"metrics": {"total_patients_count": {"type": "count"}}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "diagnoses": {"name": "diagnoses", "description": "Full list of diagnoses at the time of referral.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}, "referral_type": {"name": "referral_type", "description": "Full readable name for the referral.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "referring_doctor_id": {"name": "referring_doctor_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "referring_doctor_name": {"name": "referring_doctor_name", "description": "Display identifier for the user who referred the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "referral_datetime": {"name": "referral_datetime", "description": "Local date for the record in encounter_diagnoses.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "status": {"name": "status", "description": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__status"]}, "department": {"name": "department", "description": "Full readable name of the department from which the patient was referred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__referrals.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3396032, "relation_name": "\"app\".\"reporting\".\"ds__referrals\"", "raw_code": "{{ referrals_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "referrals", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "survey_responses", "package": null, "version": null}, {"name": "surveys", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.referrals_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.survey_responses", "model.tamanu_source_dbt.surveys", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__referrals.sql", "compiled": true, "compiled_code": "\n\nwith diagnoses as (\n select\n ed.encounter_id,\n string_agg(concat(d.name), '; ') as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n left join \"app\".\"reporting\".\"reference_data\" d on d.id = ed.diagnosis_id\n group by ed.encounter_id\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.village_id,\n ed.diagnoses,\n s.name as referral_type,\n u.id as referring_doctor_id,\n u.display_name as referring_doctor_name,\n sr.end_datetime as referral_datetime,\n rf.status,\n d.name as department\nfrom \"app\".\"reporting\".\"referrals\" rf\njoin \"app\".\"reporting\".\"encounters\" e on e.id = rf.initiating_encounter_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\njoin \"app\".\"reporting\".\"survey_responses\" sr on sr.id = rf.survey_response_id\njoin \"app\".\"reporting\".\"surveys\" s on s.id = sr.survey_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"users\" u on u.id = e.clinician_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join diagnoses ed on ed.encounter_id = rf.initiating_encounter_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__user_audit": {"database": "app", "schema": "reporting", "name": "ds__user_audit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__user_audit.sql", "original_file_path": "models\\datasets\\standard\\ds__user_audit.sql", "unique_id": "model.tamanu_source_dbt.ds__user_audit", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__user_audit"], "alias": "ds__user_audit", "checksum": {"name": "sha256", "checksum": "77625673664a8f2ca8bc7ae447e8cfeaed8e7ada97f111d8f3d22e6f3ff2ac32"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "administration"], "description": "User audit", "columns": {"user_id": {"name": "user_id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_name": {"name": "user_name", "description": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_id"]}, "user_role": {"name": "user_role", "description": "Readable name for the role.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.roles__name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "patient_category": {"name": "patient_category", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "triage_category": {"name": "triage_category", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "encounter_start_datetime": {"name": "encounter_start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "encounter_end_datetime": {"name": "encounter_end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "first_note_datetime": {"name": "first_note_datetime", "description": "Local date and time for the record of the first note.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "last_note_datetime": {"name": "last_note_datetime", "description": "Local date and time for the record of the last note.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "is_discharged": {"name": "is_discharged", "description": "Indicates whether the patient has been discharged.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patient_is_discharged"]}, "non_discharge_by_clinicians": {"name": "non_discharge_by_clinicians", "description": "Display identifier for the user who did not discharge the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__user_audit.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "confidential"}}, "created_at": 1782422375.3396032, "relation_name": "\"app\".\"reporting\".\"ds__user_audit\"", "raw_code": "{{ user_audit_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "notes", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "roles", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.user_audit_dataset"], "nodes": ["model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.roles", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__user_audit.sql", "compiled": true, "compiled_code": "\n\nwith non_system_notes as (\n select distinct on (n.record_id)\n n.record_id,\n first_value(n.datetime) over w as first_note_datetime,\n last_value(n.datetime) over w as last_note_datetime,\n last_value(concat_ws(' on behalf of ', author.display_name, on_behalf.display_name)) over w as last_clinician\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"users\" author on author.id = n.authored_by_id\n left join \"app\".\"reporting\".\"users\" on_behalf on on_behalf.id = n.on_behalf_of_id\n where n.note_type_id != 'notetype-system'\n window w as (\n partition by n.record_id\n order by n.datetime\n rows between unbounded preceding and unbounded following\n )\n)\n\nselect\n u.id as user_id,\n u.display_name as user_name,\n r.name as user_role,\n p.id as patient_id,\n p.display_id,\n bt.name as patient_category,\n t.score as triage_category,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n e.start_datetime as encounter_start_datetime,\n e.end_datetime as encounter_end_datetime,\n n.first_note_datetime,\n n.last_note_datetime,\n case when e.end_datetime isnull then 'Patient not discharged'\n else 'Patient discharged'\n end as is_discharged,\n case when ds.note like 'Automatically discharged%' then n.last_clinician\n end as non_discharge_by_clinicians\nfrom \"app\".\"reporting\".\"encounters\" e\nleft join \"app\".\"reporting\".\"users\" u on u.id = e.clinician_id\nleft join \"app\".\"reporting\".\"roles\" r on r.id = u.role\nleft join \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = coalesce(e.patient_billing_type_id, pad.patient_billing_type_id)\nleft join \"app\".\"reporting\".\"triages\" t on t.encounter_id = e.id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"discharges\" ds on ds.encounter_id = e.id\nleft join non_system_notes n on n.record_id = e.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__vaccinations": {"database": "app", "schema": "reporting", "name": "ds__vaccinations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__vaccinations.sql", "original_file_path": "models\\datasets\\standard\\ds__vaccinations.sql", "unique_id": "model.tamanu_source_dbt.ds__vaccinations", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__vaccinations"], "alias": "ds__vaccinations", "checksum": {"name": "sha256", "checksum": "2371b8a1e50ff7a4e175d3ff6a9d47bea6d32f5c99ec97d2ca8382bc5c898ba8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Vaccinations", "columns": {"display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of vaccination.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "vaccination_date": {"name": "vaccination_date", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "vaccine_status": {"name": "vaccine_status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "vaccine_schedule": {"name": "vaccine_schedule", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "recorded_by": {"name": "recorded_by", "description": "Display identifier for the user who recorded the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "circumstances": {"name": "circumstances", "description": "Full readable name of the circumstances.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "given_by": {"name": "given_by", "description": "Display identifier for the user who gave the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "given_elsewhere_by": {"name": "given_elsewhere_by", "description": "Checks if the vaccine was given elsewhere", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "not_given_clinician": {"name": "not_given_clinician", "description": "Display identifier for the user who did not give the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "not_given_reason": {"name": "not_given_reason", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}, "modified_by": {"name": "modified_by", "description": "Display identifier for the user who modified the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated for the vaccine administration record, sourced from the change logs.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__vaccinations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782422375.3396032, "relation_name": "\"app\".\"reporting\".\"ds__vaccinations\"", "raw_code": "{{ vaccinations_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "vaccine_administrations_change_logs", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.vaccinations_dataset"], "nodes": ["model.tamanu_source_dbt.vaccine_administrations_change_logs", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__vaccinations.sql", "compiled": true, "compiled_code": "\n\nwith vaccine_administrations_metadata as (\n select\n id,\n max(updated_at) as updated_at\n from \"app\".\"reporting\".\"vaccine_administrations_change_logs\"\n group by id\n),\n\nadministered_circumstances as (\n select\n a.id,\n string_agg(rd_cir.name, '; ') as circumstance_name\n from \"app\".\"reporting\".\"vaccine_administrations\" a\n cross join lateral unnest(a.circumstance_ids) c (unnest_circumstance_id)\n left join \"app\".\"reporting\".\"reference_data\" rd_cir\n on rd_cir.id = c.unnest_circumstance_id\n group by a.id\n)\n\nselect\n p.display_id,\n p.first_name,\n p.last_name,\n p.id as patient_id,\n p.date_of_birth,\n date_part('year', age(p.date_of_birth)) as age,\n p.sex,\n p.village_id,\n rd_vil.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n av.scheduled_vaccine_id,\n case\n when av.is_given_elsewhere = true and av.datetime is null then null\n else av.datetime::date\n end as vaccination_date,\n sv.category as vaccine_category,\n sv.label as vaccine_name,\n case when sv.category = 'Other' then av.vaccine_brand end as vaccine_brand,\n case when sv.category = 'Other' then av.disease end as disease,\n case\n when av.status = 'GIVEN' then 'Given'\n when av.status = 'NOT_GIVEN' then 'Not given'\n when av.status = 'RECORDED_IN_ERROR' then 'Recorded in error'\n when av.status = 'HISTORICAL' then 'Historical'\n end as vaccine_status,\n sv.dose_label as vaccine_schedule,\n av.batch,\n case\n when av.status in ('GIVEN', 'NOT_GIVEN', 'RECORDED_IN_ERROR') then u.display_name\n end as recorded_by,\n case\n when av.is_given_elsewhere = true then ac.circumstance_name\n end as circumstances,\n case\n when av.status = 'NOT_GIVEN' then null\n when av.status = 'GIVEN' and av.is_given_elsewhere = true then null\n when av.status in ('HISTORICAL', 'RECORDED_IN_ERROR') and av.is_given_elsewhere = true then av.given_by\n when av.status = 'GIVEN' then av.given_by\n end as given_by,\n case when av.is_given_elsewhere = true then av.given_by end as given_elsewhere_by,\n case\n when av.status = 'NOT_GIVEN' then av.given_by\n end as not_given_clinician,\n case\n when av.status = 'NOT_GIVEN' then rd_reason.name\n end as not_given_reason,\n case\n when av.status = 'HISTORICAL' then u.display_name\n end as modified_by,\n vam.updated_at\nfrom \"app\".\"reporting\".\"vaccine_administrations\" av\njoin \"app\".\"reporting\".\"encounters\" e on e.id = av.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join vaccine_administrations_metadata vam on vam.id = av.id\njoin \"app\".\"reporting\".\"locations\" l on l.id = av.location_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = av.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"vaccine_schedules\" sv on sv.id = av.scheduled_vaccine_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = av.recorded_by_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_vil on rd_vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_reason on rd_reason.id = av.not_given_reason_id\nleft join administered_circumstances ac on ac.id = av.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.int__admission_history_department": {"database": "app", "schema": "reporting", "name": "int__admission_history_department", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "intermediate\\standard\\int__admission_history_department.sql", "original_file_path": "models\\intermediate\\standard\\int__admission_history_department.sql", "unique_id": "model.tamanu_source_dbt.int__admission_history_department", "fqn": ["tamanu_source_dbt", "intermediate", "standard", "int__admission_history_department"], "alias": "int__admission_history_department", "checksum": {"name": "sha256", "checksum": "2b1d04e3fb3e2d57dc4a8e82bac99ead2e7cbd3c9bdac731f7582e32a1434f6c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1782422373.9821556, "relation_name": null, "raw_code": "with admission_department_log as (\r\n select\r\n eh.id,\r\n eh.encounter_id,\r\n eh.datetime as start_datetime,\r\n eh.department_id,\r\n case\r\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\r\n else 'transfer-in'\r\n end as type\r\n from {{ ref('encounter_history') }} eh\r\n where (eh.change_type isnull or eh.change_type && array['department', 'encounter_type'])\r\n and eh.encounter_type = 'admission'\r\n)\r\n\r\nselect\r\n dl.encounter_id,\r\n dl.department_id,\r\n d.name as department,\r\n d.facility_id,\r\n f.name as facility,\r\n dl.start_datetime,\r\n coalesce(lead(dl.start_datetime) over w, e.end_datetime) as end_datetime,\r\n case\r\n when coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date < 1 then 1\r\n else coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date\r\n end as length_of_stay,\r\n coalesce(dl.type = 'admission', false) as admission,\r\n coalesce(lead(dl.department_id) over w isnull and e.end_datetime notnull, false) as discharge,\r\n coalesce(dl.type = 'transfer-in', false) as transfer_in,\r\n coalesce(lead(dl.department_id) over w notnull, false) as transfer_out,\r\n coalesce(lead(dl.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\r\nfrom admission_department_log dl\r\njoin {{ ref('encounters') }} e on e.id = dl.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('departments') }} d on d.id = dl.department_id\r\njoin {{ ref('facilities') }} f on f.id = d.facility_id\r\nwindow w as (\r\n partition by encounter_id\r\n order by dl.start_datetime\r\n)", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_history", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\intermediate\\standard\\int__admission_history_department.sql", "compiled": true, "compiled_code": "with admission_department_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.department_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['department', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n dl.encounter_id,\n dl.department_id,\n d.name as department,\n d.facility_id,\n f.name as facility,\n dl.start_datetime,\n coalesce(lead(dl.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date < 1 then 1\n else coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date\n end as length_of_stay,\n coalesce(dl.type = 'admission', false) as admission,\n coalesce(lead(dl.department_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(dl.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(dl.department_id) over w notnull, false) as transfer_out,\n coalesce(lead(dl.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_department_log dl\njoin \"app\".\"reporting\".\"encounters\" e on e.id = dl.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = dl.department_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nwindow w as (\n partition by encounter_id\n order by dl.start_datetime\n)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.int__admission_history_location": {"database": "app", "schema": "reporting", "name": "int__admission_history_location", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "intermediate\\standard\\int__admission_history_location.sql", "original_file_path": "models\\intermediate\\standard\\int__admission_history_location.sql", "unique_id": "model.tamanu_source_dbt.int__admission_history_location", "fqn": ["tamanu_source_dbt", "intermediate", "standard", "int__admission_history_location"], "alias": "int__admission_history_location", "checksum": {"name": "sha256", "checksum": "9bd5b95f97e6eb41cd33e1723c61de27577802c720ea42502c30cd8a074512f7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1782422373.984159, "relation_name": null, "raw_code": "with admission_location_log as (\r\n select\r\n eh.id,\r\n eh.encounter_id,\r\n eh.datetime as start_datetime,\r\n eh.location_id,\r\n case\r\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\r\n else 'transfer-in'\r\n end as type\r\n from {{ ref('encounter_history') }} eh\r\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\r\n and eh.encounter_type = 'admission'\r\n)\r\n\r\nselect\r\n ll.encounter_id,\r\n l.location_group_id,\r\n lg.name as location_group,\r\n ll.location_id,\r\n l.name as location,\r\n l.facility_id,\r\n f.name as facility,\r\n ll.start_datetime,\r\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\r\n case\r\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\r\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\r\n end as length_of_stay,\r\n coalesce(ll.type = 'admission', false) as admission,\r\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\r\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\r\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\r\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\r\nfrom admission_location_log ll\r\njoin {{ ref('encounters') }} e on e.id = ll.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('locations') }} l on l.id = ll.location_id\r\njoin {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\njoin {{ ref('facilities') }} f on f.id = l.facility_id\r\nwindow w as (\r\n partition by ll.encounter_id\r\n order by ll.start_datetime\r\n)", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_history", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\intermediate\\standard\\int__admission_history_location.sql", "compiled": true, "compiled_code": "with admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.int__lab_requests_history": {"database": "app", "schema": "reporting", "name": "int__lab_requests_history", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "intermediate\\standard\\int__lab_requests_history.sql", "original_file_path": "models\\intermediate\\standard\\int__lab_requests_history.sql", "unique_id": "model.tamanu_source_dbt.int__lab_requests_history", "fqn": ["tamanu_source_dbt", "intermediate", "standard", "int__lab_requests_history"], "alias": "int__lab_requests_history", "checksum": {"name": "sha256", "checksum": "bc9c567691b687199b960c05a2c18e13345544686b59c60157b85341df25fe51"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1782422373.98617, "relation_name": null, "raw_code": "select distinct on (lr.id, coalesce(lrl.status, lr.status))\r\n lr.id as request_id,\r\n lr.requested_datetime::date as requested_date,\r\n lr.encounter_id,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n ltc.id as lab_test_category_id,\r\n ltc.name as lab_test_category,\r\n coalesce(lrl.status, lr.status) as status,\r\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date as status_start_date,\r\n case\r\n when coalesce(lrl.status, lr.status) = 'published'\r\n then\r\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date\r\n when lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w is not null\r\n then\r\n case\r\n when coalesce(lrl.updated_datetime, lr.updated_datetime)::date\r\n = (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\r\n then (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\r\n else (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w - interval '1 day')::date\r\n end\r\n else current_date\r\n end as status_end_date\r\nfrom {{ ref('lab_requests') }} lr\r\nleft join {{ ref('lab_request_logs') }} lrl on lrl.lab_request_id = lr.id\r\nleft join {{ ref('encounters') }} e on e.id = lr.encounter_id\r\nleft join {{ ref('departments') }} d on d.id = coalesce(lr.department_id, e.department_id)\r\nleft join {{ ref('facilities') }} f on f.id = d.facility_id\r\nleft join {{ ref('reference_data') }} ltc on ltc.id = lr.lab_test_category_id\r\nwhere lr.status not in ('deleted', 'cancelled', 'entered-in-error')\r\nwindow\r\n w as (\r\n partition by lr.id\r\n order by coalesce(lrl.updated_datetime, lr.updated_datetime)\r\n )\r\norder by lr.id, coalesce(lrl.status, lr.status)", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "lab_request_logs", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_request_logs", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\intermediate\\standard\\int__lab_requests_history.sql", "compiled": true, "compiled_code": "select distinct on (lr.id, coalesce(lrl.status, lr.status))\n lr.id as request_id,\n lr.requested_datetime::date as requested_date,\n lr.encounter_id,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n ltc.id as lab_test_category_id,\n ltc.name as lab_test_category,\n coalesce(lrl.status, lr.status) as status,\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date as status_start_date,\n case\n when coalesce(lrl.status, lr.status) = 'published'\n then\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n when lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w is not null\n then\n case\n when coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n = (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n then (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n else (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w - interval '1 day')::date\n end\n else current_date\n end as status_end_date\nfrom \"app\".\"reporting\".\"lab_requests\" lr\nleft join \"app\".\"reporting\".\"lab_request_logs\" lrl on lrl.lab_request_id = lr.id\nleft join \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = coalesce(lr.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" ltc on ltc.id = lr.lab_test_category_id\nwhere lr.status not in ('deleted', 'cancelled', 'entered-in-error')\nwindow\n w as (\n partition by lr.id\n order by coalesce(lrl.updated_datetime, lr.updated_datetime)\n )\norder by lr.id, coalesce(lrl.status, lr.status)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-admissions-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-admissions-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-admissions-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-admissions-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-admissions-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-admissions-line-list"], "alias": "sensitive-admissions-line-list", "checksum": {"name": "sha256", "checksum": "6966bc718aefee1203b2722918339e748bd1916676c6a356f67179548d2129ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422373.98617, "relation_name": "\"app\".\"reporting\".\"sensitive-admissions-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n admitting_clinician as \"{{ translate_label('admittingClinician') }}\",\r\n to_char(admission_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('admissionDateTime') }}\",\r\n admission_status as \"{{ translate_label('admissionStatus') }}\",\r\n to_char(discharge_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('dischargeDateTime') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n departments as \"{{ translate_label('encounterDepartmentHistory') }}\",\r\n department_datetimes as \"{{ translate_label('encounterDepartmentHistoryDateTimes') }}\",\r\n location_groups as \"{{ translate_label('encounterLocationGroupHistory') }}\",\r\n location_group_datetimes as \"{{ translate_label('encounterLocationGroupHistoryDateTimes') }}\",\r\n locations as \"{{ translate_label('encounterLocationHistory') }}\",\r\n location_datetimes as \"{{ translate_label('encounterLocationHistoryDateTimes') }}\",\r\n primary_diagnoses as \"{{ translate_label('diagnosesPrimary') }}\",\r\n secondary_diagnoses as \"{{ translate_label('diagnosesSecondary') }}\"\r\nfrom {{ ref('ds__sensitive_admissions') }}\r\nwhere\r\n case when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else admission_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else admission_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case when {{ parameter('locationGroupId') }} is null then true\r\n else {{ parameter('locationGroupId') }} = any(location_group_ids::text [])\r\n end\r\n and case when {{ parameter('facilityId') }} is null then true\r\n else {{ parameter('facilityId') }} = facility_id\r\n end\r\n and case when {{ parameter('departmentId') }} is null then true\r\n else {{ parameter('departmentId') }} = any(department_ids::text [])\r\n end\r\n and case when {{ parameter('patientBillingTypeId') }} is null then true\r\n else billing_type_id like {{ parameter('patientBillingTypeId') }}\r\n end\r\n and case when {{ parameter('clinicianId') }} is null then true\r\n else admitting_clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and case when coalesce({{ parameter('admissionStatus') }}) is null then true\r\n else admission_status in ({{ parameter('admissionStatus') }})\r\n end\r\norder by admission_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_admissions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_admissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-admissions-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n billing_type as \"Billing type\",\n admitting_clinician as \"Admitting clinician\",\n to_char(admission_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Admission date and time\",\n admission_status as \"Admission status\",\n to_char(discharge_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Discharge date and time\",\n facility as \"Facility\",\n departments as \"Department history\",\n department_datetimes as \"Department history date and times\",\n location_groups as \"Area history\",\n location_group_datetimes as \"Area history date and times\",\n locations as \"Location history\",\n location_datetimes as \"Location history date and times\",\n primary_diagnoses as \"Primary diagnoses\",\n secondary_diagnoses as \"Secondary diagnoses\"\nfrom \"app\".\"reporting\".\"ds__sensitive_admissions\"\nwhere\n case when nullif('2024-01-01', '')::date is null then true\n else admission_datetime >= nullif('2024-01-01', '')::date\n end\n and case when nullif('2024-01-31', '')::date is null then true\n else admission_datetime <= nullif('2024-01-31', '')::date\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = any(location_group_ids::text [])\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = facility_id\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = any(department_ids::text [])\n end\n and case when nullif('', '')::text is null then true\n else billing_type_id like nullif('', '')::text\n end\n and case when nullif('', '')::text is null then true\n else admitting_clinician_id = nullif('', '')::text\n end\n and case when coalesce(nullif('', '')::text) is null then true\n else admission_status in (nullif('', '')::text)\n end\norder by admission_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments": {"database": "app", "schema": "reporting", "name": "sensitive-audit-outpatient-appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-audit-outpatient-appointments.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-audit-outpatient-appointments.sql", "unique_id": "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-audit-outpatient-appointments"], "alias": "sensitive-audit-outpatient-appointments", "checksum": {"name": "sha256", "checksum": "8440d3a19cf10c5771ac8793b18d5df24891c421e4e44c4753d5e6f213f8c2a9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.030497, "relation_name": "\"app\".\"reporting\".\"sensitive-audit-outpatient-appointments\"", "raw_code": "-- Sensitive Outpatient Appointment Audit Report\r\n-- Shows all modifications and cancellations to outpatient appointments at sensitive facilities\r\n-- Each row represents a change event with both current and previous appointment details\r\n\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n -- Change event details\r\n change_number as \"{{ translate_label('auditChangeNumber') }}\",\r\n -- Current appointment details (at time of report)\r\n to_char(appointment_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentDateTime') }}\",\r\n appointment_type as \"{{ translate_label('appointmentType') }}\",\r\n clinician as \"{{ translate_label('appointmentClinician') }}\",\r\n location_group as \"{{ translate_label('appointmentLocationGroup') }}\",\r\n priority as \"{{ translate_label('appointmentPriority') }}\",\r\n is_repeating as \"{{ translate_label('appointmentIsRepeating') }}\",\r\n -- Modification details\r\n created_by as \"{{ translate_label('auditCreatedBy') }}\",\r\n modified_by as \"{{ translate_label('auditModifiedBy') }}\",\r\n to_char(modified_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('auditModifiedDateTime') }}\",\r\n is_cancelled as \"{{ translate_label('appointmentIsCancelled') }}\",\r\n -- Previous appointment details (prior to changes)\r\n to_char(prev_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('auditPrevAppointmentDateTime') }}\",\r\n prev_appointment_type as \"{{ translate_label('auditPrevAppointmentType') }}\",\r\n prev_clinician as \"{{ translate_label('auditPrevClinician') }}\",\r\n prev_location_group as \"{{ translate_label('auditPrevLocationGroup') }}\",\r\n prev_priority as \"{{ translate_label('auditPrevPriority') }}\"\r\nfrom {{ ref('ds__sensitive_outpatient_appointments_audit') }}\r\nwhere\r\n -- Date range filter on appointment datetime\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else appointment_start_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else appointment_start_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n -- Facility filter\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by display_id, appointment_id, change_number", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_outpatient_appointments_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-audit-outpatient-appointments.sql", "compiled": true, "compiled_code": "-- Sensitive Outpatient Appointment Audit Report\n-- Shows all modifications and cancellations to outpatient appointments at sensitive facilities\n-- Each row represents a change event with both current and previous appointment details\n\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n -- Change event details\n change_number as \"Change number\",\n -- Current appointment details (at time of report)\n to_char(appointment_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment date and time\",\n appointment_type as \"Appointment type\",\n clinician as \"Clinician\",\n location_group as \"Area\",\n priority as \"Priority appointment\",\n is_repeating as \"Repeating appointment\",\n -- Modification details\n created_by as \"Appointment created by\",\n modified_by as \"Appointment modified by\",\n to_char(modified_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment modified date & time\",\n is_cancelled as \"Appointment cancelled\",\n -- Previous appointment details (prior to changes)\n to_char(prev_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Previous appointment date & time\",\n prev_appointment_type as \"Previous appointment type\",\n prev_clinician as \"Previous clinician\",\n prev_location_group as \"Previous area\",\n prev_priority as \"Previous priority appointment\"\nfrom \"app\".\"reporting\".\"ds__sensitive_outpatient_appointments_audit\"\nwhere\n -- Date range filter on appointment datetime\n case\n when nullif('2025-01-01', '')::date is null then true\n else appointment_start_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else appointment_start_datetime <= nullif('2025-01-31', '')::date\n end\n -- Facility filter\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\norder by display_id, appointment_id, change_number", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-encounter-diets-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-encounter-diets-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-encounter-diets-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-encounter-diets-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-encounter-diets-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-encounter-diets-line-list"], "alias": "sensitive-encounter-diets-line-list", "checksum": {"name": "sha256", "checksum": "95f4fdba24f368145a414ed5730c489278e32077575ea0fc2c0de50db75e0e27"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.0365148, "relation_name": "\"app\".\"reporting\".\"sensitive-encounter-diets-line-list\"", "raw_code": "select\r\n to_char(ed.start_datetime, '{{ var(\"date_format\") }}') as \"{{ translate_label('encounterStartDate') }}\",\r\n to_char(ed.start_datetime, '{{ var(\"time_format\") }}') as \"{{ translate_label('encounterStartTime') }}\",\r\n ed.display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n ed.patient_name as \"{{ translate_label('patientName') }}\",\r\n ed.age as \"{{ translate_label('patientAge') }}\",\r\n concat_ws(', ', ed.location_group, ed.location) as \"{{ translate_label('location') }}\",\r\n ed.diets as \"{{ translate_label('encounterDiet') }}\",\r\n ed.allergies as \"{{ translate_label('patientAllergies') }}\"\r\nfrom {{ ref('ds__sensitive_encounter_diets') }} ed\r\nwhere\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else ed.location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else ed.start_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else ed.start_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by ed.location_group, ed.location, ed.patient_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_encounter_diets", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-encounter-diets-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(ed.start_datetime, 'YYYY-MM-DD') as \"Encounter start date\",\n to_char(ed.start_datetime, 'HH24:MI') as \"Encounter start time\",\n ed.display_id as \"Patient ID\",\n ed.patient_name as \"Patient name\",\n ed.age as \"Age\",\n concat_ws(', ', ed.location_group, ed.location) as \"Location\",\n ed.diets as \"Diet\",\n ed.allergies as \"Allergies\"\nfrom \"app\".\"reporting\".\"ds__sensitive_encounter_diets\" ed\nwhere\n case\n when nullif('', '')::text is null then true\n else ed.location_group_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else ed.start_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else ed.start_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by ed.location_group, ed.location, ed.patient_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date": {"database": "app", "schema": "reporting", "name": "sensitive-encounter-summary-by-end-date", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-encounter-summary-by-end-date.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-encounter-summary-by-end-date.sql", "unique_id": "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-encounter-summary-by-end-date"], "alias": "sensitive-encounter-summary-by-end-date", "checksum": {"name": "sha256", "checksum": "3587614d4b822ee4d44c2f246a52cf2e62c9f927bcd90270ea7b62f8f7b44f98"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.0423017, "relation_name": "\"app\".\"reporting\".\"sensitive-encounter-summary-by-end-date\"", "raw_code": "{{ encounter_summary_report('end_datetime', is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "procedures", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "invoices", "package": null, "version": null}, {"name": "invoice_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_summary_report"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-encounter-summary-by-end-date.sql", "compiled": true, "compiled_code": "\n\nwith encounters_in_scope as (\n select\n e.id as encounter_id,\n e.start_datetime,\n e.end_datetime,\n e.patient_id,\n e.location_id,\n e.department_id,\n e.clinician_id,\n e.patient_billing_type_id,\n e.reason_for_encounter,\n f.id as facility_id,\n f.name as facility\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\n where\n e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n \n and e.end_datetime is not null\n \n and case\n when nullif('2024-01-01', '')::date is null then true\n else e.end_datetime >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null then true\n else e.end_datetime <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null then true\n else f.id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.patient_billing_type_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.clinician_id = nullif('', '')::text\n end\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.updated_by_id,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n clinician.display_name as clinician_name,\n actor.display_name as updated_by_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n row_number() over (\n partition by eh.encounter_id, eh.change_type\n order by eh.datetime\n ) as change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from \"app\".\"reporting\".\"encounter_history\" eh\n join encounters_in_scope eis\n on eis.encounter_id = eh.encounter_id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = eh.clinician_id\n join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\nencounter_changes as (\n select\n encounter_id,\n \n -- Location changes: tracks all location changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\n\n -- Location group changes: tracks location group changes (only when group actually changes)\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\n\n -- Department changes: tracks all department changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\n\n -- Encounter type changes: tracks encounter type progression (emergency types)\n string_agg(\n case\n when encounter_type = 'triage' then 'Triage'\n when encounter_type = 'observation' then 'Active ED care'\n when encounter_type = 'emergency' then 'Emergency short stay'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\n\n -- Encounter type changes: tracks encounter type progression (inpatient types)\n string_agg(\n case\n when encounter_type = 'admission' then 'Hospital admission'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\n\n -- Encounter type changes: tracks encounter type progression (outpatient types)\n string_agg(\n case\n when encounter_type = 'clinic' then 'Clinic'\n when encounter_type = 'imaging' then 'Imaging'\n when encounter_type = 'surveyResponse' then 'Survey response'\n when encounter_type = 'vaccination' then 'Vaccination'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\n\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\n from encounter_history_consolidated\n group by encounter_id\n),\n\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n concat(\n 'Name: ', d.name,\n ', Code: ', d.code,\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\n ', Certainty: ', ed.certainty\n ),\n E'\\n'\n order by ed.is_primary desc, ed.datetime asc\n ) as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join encounters_in_scope eis\n on eis.encounter_id = ed.encounter_id\n join \"app\".\"reporting\".\"reference_data\" d\n on d.id = ed.diagnosis_id\n group by ed.encounter_id\n),\n\nencounter_prescriptions as (\n select\n ep.encounter_id,\n string_agg(\n concat(\n 'Name: ', m.name,\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\n ', Discontinuing reason: ', p.discontinuing_reason\n ),\n '' || E'\\n' || ''\n order by p.datetime\n ) as medications\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join encounters_in_scope eis\n on eis.encounter_id = ep.encounter_id\n join \"app\".\"reporting\".\"prescriptions\" p\n on p.id = ep.prescription_id\n join \"app\".\"reporting\".\"reference_data\" m\n on m.id = p.medication_id\n group by ep.encounter_id\n),\n\nencounter_vaccinations as (\n select\n av.encounter_id,\n string_agg(\n concat(\n v.name,\n ', Label: ', sv.label,\n ', Schedule: ', sv.dose_label\n ),\n E'\\n'\n order by av.datetime\n ) as vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" av\n join encounters_in_scope eis\n on eis.encounter_id = av.encounter_id\n join \"app\".\"reporting\".\"vaccine_schedules\" sv\n on sv.id = av.scheduled_vaccine_id\n join \"app\".\"reporting\".\"reference_data\" v\n on v.id = sv.vaccine_id\n group by av.encounter_id\n),\n\nencounter_procedures as (\n select\n p.encounter_id,\n string_agg(\n concat(\n 'Name: ', proc.name,\n ', Date: ', to_char(p.date, 'YYYY-MM-DD'),\n ', Location: ', loc.name,\n ', Notes: ', p.note,\n ', Completed notes: ', p.completed_note\n ),\n E'\\n'\n order by p.date\n ) as procedures\n from \"app\".\"reporting\".\"procedures\" p\n join encounters_in_scope eis\n on eis.encounter_id = p.encounter_id\n left join \"app\".\"reporting\".\"reference_data\" proc\n on proc.id = p.procedure_type_id\n left join \"app\".\"reporting\".\"locations\" loc\n on loc.id = p.location_id\n group by p.encounter_id\n),\n\nencounter_lab_requests as (\n select\n lr.encounter_id,\n string_agg(\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\n order by lr.collected_datetime\n ) as lab_requests\n from \"app\".\"reporting\".\"lab_requests\" lr\n join encounters_in_scope eis\n on eis.encounter_id = lr.encounter_id\n left join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\n left join \"app\".\"reporting\".\"lab_test_panels\" ltp\n on ltp.id = ltpr.lab_test_panel_id\n left join \"app\".\"reporting\".\"lab_tests\" lt\n on lt.lab_request_id = lr.id\n and lr.lab_test_panel_request_id isnull\n left join \"app\".\"reporting\".\"lab_test_types\" ltt\n on ltt.id = lt.lab_test_type_id\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\n group by lr.encounter_id\n),\n\nnotes_raw as (\n select\n n.id,\n n.datetime,\n n.content,\n n.note_type_id,\n n.note_type,\n n.record_type,\n n.record_id,\n n.updated_note_id,\n n.visibility_status\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"imaging_requests\" ir\n on n.record_type = 'ImagingRequest'\n and ir.id = n.record_id\n join encounters_in_scope eis\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\n where n.record_type in ('Encounter', 'ImagingRequest')\n),\n\nencounter_notes_deduped as (\n select\n id,\n datetime,\n content,\n note_type,\n record_id,\n visibility_status,\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\n from notes_raw\n where\n record_type = 'Encounter'\n and note_type_id != 'notetype-system'\n),\n\nimaging_request_areas as (\n select\n ir.encounter_id,\n ira.imaging_request_id,\n case\n when ir.imaging_type = 'xRay' then 'X-Ray'\n when ir.imaging_type = 'ctScan' then 'CT Scan'\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\n when ir.imaging_type = 'mri' then 'MRI'\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\n when ir.imaging_type = 'mammogram' then 'Mammogram'\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\n when ir.imaging_type = 'angiogram' then 'Angiogram'\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\n when ir.imaging_type = 'stressTest' then 'Stress Test'\n else ir.imaging_type\n end as imaging_type,\n coalesce(\n string_agg(\n area.name, ', '\n order by area.name\n ),\n string_agg(case\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\n end, ', '\n order by n.datetime)\n ) as areas_to_be_imaged,\n string_agg(case\n when n.note_type_id = 'notetype-other' then n.content\n end, ','\n order by n.datetime) as notes\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join encounters_in_scope eis\n on eis.encounter_id = ir.encounter_id\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira\n on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" area\n on area.id = ira.area_id\n left join notes_raw n\n on n.record_id = ir.id\n and n.record_type = 'ImagingRequest'\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\n),\n\nencounter_imaging_requests as (\n select\n encounter_id,\n string_agg(\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\n ) as imaging_requests\n from imaging_request_areas\n group by encounter_id\n),\n\nencounter_notes as (\n select\n n.record_id as encounter_id,\n string_agg(concat(\n 'Note type: ',\n n.note_type,\n ', Content: ', n.content,\n ', Note date: ', to_char(n.datetime, 'YYYY-MM-DD HH24:MI:SS')\n ),\n E'\\n'\n order by n.datetime) as notes\n from encounter_notes_deduped n\n where n.row_number = 1\n group by n.record_id\n),\n\ninvoice_data as (\n select\n i.encounter_id,\n max(\n case\n when i.status = 'finalised'\n then to_char(i.datetime, 'YYYY-MM-DD HH24:MI:SS')\n end\n ) as invoice_finalised_datetime,\n string_agg(distinct ip.category, ', ') as invoice_product_categories\n from \"app\".\"reporting\".\"invoices\" i\n join encounters_in_scope eis\n on eis.encounter_id = i.encounter_id\n left join \"app\".\"reporting\".\"invoice_items\" ii\n on ii.invoice_id = i.id\n left join \"app\".\"reporting\".\"invoice_products\" ip\n on ip.id = ii.product_id\n group by i.encounter_id\n)\n\nselect\n p.display_id as \"Patient ID\",\n p.first_name as \"First name\",\n p.last_name as \"Last name\",\n to_char(p.date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"Age\",\n p.sex as \"Sex\",\n eth.name as \"Ethnicity\",\n bt.name as \"Billing type\",\n to_char(eis.start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(eis.end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n case\n when eis.end_datetime is not null then\n case\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\n else eis.end_datetime::date - eis.start_datetime::date\n end\n end as \"Length of stay (days)\",\n eis.facility as \"Facility\",\n ec.encounter_type_emergency as \"Emergency encounter type\",\n ec.encounter_type_inpatient as \"Inpatient encounter type\",\n ec.encounter_type_outpatient as \"Outpatient encounter type\",\n dd.name as \"Discharge disposition\",\n t.score as \"Triage category\",\n am.name as \"Arrival mode\",\n case\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\n then concat(\n lpad((\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\n + extract(hour from (t.closed_datetime - t.triage_datetime))\n )::text, 2, '0'), ':',\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\n lpad(\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\n )\n )\n end as \"Time seen following triage/Waiting time (hh:mm:ss)\",\n ec.encountering_clinician as \"Clinician\",\n c.display_name as \"Supervising clinician\",\n dp.name as \"Discharging department\",\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"Discharge date and time of Discharging department\",\n lg.name as \"Discharging area\",\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"Discharge date and time of Discharging area\",\n l.name as \"Discharging location\",\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"Discharge date and time of Discharging location\",\n ec.departments as \"Department history\",\n array_to_string(ec.department_datetimes, ', ') as \"Department history date and times\",\n ec.location_groups as \"Area history\",\n array_to_string(ec.location_group_datetimes, ', ') as \"Area history date and times\",\n ec.locations as \"Location history\",\n array_to_string(ec.location_datetimes, ', ') as \"Location history date and times\",\n eis.reason_for_encounter as \"Reason for encounter\",\n ed.diagnoses as \"Diagnoses\",\n ep.medications as \"Medications\",\n ev.vaccinations as \"Vaccinations\",\n epr.procedures as \"Procedures\",\n elr.lab_requests as \"Lab requests\",\n eir.imaging_requests as \"Imaging requests\",\n case\n when length(en.notes) > 32000\n then concat(\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\n )\n else en.notes\n end as \"Notes\",\n invd.invoice_finalised_datetime as \"invoiceFinalisedDateTime\",\n invd.invoice_product_categories as \"invoiceProductCategories\"\nfrom encounters_in_scope eis\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = eis.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = eis.location_id\njoin \"app\".\"reporting\".\"departments\" dp\n on dp.id = eis.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"users\" c\n on c.id = eis.clinician_id\njoin encounter_changes ec\n on ec.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"triages\" t\n on t.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"discharges\" d\n on d.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = eis.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" eth\n on eth.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = eis.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" am\n on am.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" dd\n on dd.id = d.disposition_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = eis.encounter_id\nleft join encounter_prescriptions ep\n on ep.encounter_id = eis.encounter_id\nleft join encounter_vaccinations ev\n on ev.encounter_id = eis.encounter_id\nleft join encounter_procedures epr\n on epr.encounter_id = eis.encounter_id\nleft join encounter_lab_requests elr\n on elr.encounter_id = eis.encounter_id\nleft join encounter_imaging_requests eir\n on eir.encounter_id = eis.encounter_id\nleft join encounter_notes en\n on en.encounter_id = eis.encounter_id\nleft join invoice_data invd\n on invd.encounter_id = eis.encounter_id\nwhere\n case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.department_ids::text [])\n end\n and case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.location_group_ids::text [])\n end\norder by eis.end_datetime desc\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date": {"database": "app", "schema": "reporting", "name": "sensitive-encounter-summary-by-start-date", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-encounter-summary-by-start-date.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-encounter-summary-by-start-date.sql", "unique_id": "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-encounter-summary-by-start-date"], "alias": "sensitive-encounter-summary-by-start-date", "checksum": {"name": "sha256", "checksum": "1956b6e18f95f9ad9bddebd0a1a27f5130d2b616e6159264427abc4636ce6efe"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.0623453, "relation_name": "\"app\".\"reporting\".\"sensitive-encounter-summary-by-start-date\"", "raw_code": "{{ encounter_summary_report('start_datetime', is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "procedures", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "invoices", "package": null, "version": null}, {"name": "invoice_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_summary_report"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-encounter-summary-by-start-date.sql", "compiled": true, "compiled_code": "\n\nwith encounters_in_scope as (\n select\n e.id as encounter_id,\n e.start_datetime,\n e.end_datetime,\n e.patient_id,\n e.location_id,\n e.department_id,\n e.clinician_id,\n e.patient_billing_type_id,\n e.reason_for_encounter,\n f.id as facility_id,\n f.name as facility\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\n where\n e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n \n and case\n when nullif('2024-01-01', '')::date is null then true\n else e.start_datetime >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null then true\n else e.start_datetime <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null then true\n else f.id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.patient_billing_type_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.clinician_id = nullif('', '')::text\n end\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.updated_by_id,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n clinician.display_name as clinician_name,\n actor.display_name as updated_by_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n row_number() over (\n partition by eh.encounter_id, eh.change_type\n order by eh.datetime\n ) as change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from \"app\".\"reporting\".\"encounter_history\" eh\n join encounters_in_scope eis\n on eis.encounter_id = eh.encounter_id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = eh.clinician_id\n join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\nencounter_changes as (\n select\n encounter_id,\n \n -- Location changes: tracks all location changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\n\n -- Location group changes: tracks location group changes (only when group actually changes)\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\n\n -- Department changes: tracks all department changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\n\n -- Encounter type changes: tracks encounter type progression (emergency types)\n string_agg(\n case\n when encounter_type = 'triage' then 'Triage'\n when encounter_type = 'observation' then 'Active ED care'\n when encounter_type = 'emergency' then 'Emergency short stay'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\n\n -- Encounter type changes: tracks encounter type progression (inpatient types)\n string_agg(\n case\n when encounter_type = 'admission' then 'Hospital admission'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\n\n -- Encounter type changes: tracks encounter type progression (outpatient types)\n string_agg(\n case\n when encounter_type = 'clinic' then 'Clinic'\n when encounter_type = 'imaging' then 'Imaging'\n when encounter_type = 'surveyResponse' then 'Survey response'\n when encounter_type = 'vaccination' then 'Vaccination'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\n\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\n from encounter_history_consolidated\n group by encounter_id\n),\n\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n concat(\n 'Name: ', d.name,\n ', Code: ', d.code,\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\n ', Certainty: ', ed.certainty\n ),\n E'\\n'\n order by ed.is_primary desc, ed.datetime asc\n ) as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join encounters_in_scope eis\n on eis.encounter_id = ed.encounter_id\n join \"app\".\"reporting\".\"reference_data\" d\n on d.id = ed.diagnosis_id\n group by ed.encounter_id\n),\n\nencounter_prescriptions as (\n select\n ep.encounter_id,\n string_agg(\n concat(\n 'Name: ', m.name,\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\n ', Discontinuing reason: ', p.discontinuing_reason\n ),\n '' || E'\\n' || ''\n order by p.datetime\n ) as medications\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join encounters_in_scope eis\n on eis.encounter_id = ep.encounter_id\n join \"app\".\"reporting\".\"prescriptions\" p\n on p.id = ep.prescription_id\n join \"app\".\"reporting\".\"reference_data\" m\n on m.id = p.medication_id\n group by ep.encounter_id\n),\n\nencounter_vaccinations as (\n select\n av.encounter_id,\n string_agg(\n concat(\n v.name,\n ', Label: ', sv.label,\n ', Schedule: ', sv.dose_label\n ),\n E'\\n'\n order by av.datetime\n ) as vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" av\n join encounters_in_scope eis\n on eis.encounter_id = av.encounter_id\n join \"app\".\"reporting\".\"vaccine_schedules\" sv\n on sv.id = av.scheduled_vaccine_id\n join \"app\".\"reporting\".\"reference_data\" v\n on v.id = sv.vaccine_id\n group by av.encounter_id\n),\n\nencounter_procedures as (\n select\n p.encounter_id,\n string_agg(\n concat(\n 'Name: ', proc.name,\n ', Date: ', to_char(p.date, 'YYYY-MM-DD'),\n ', Location: ', loc.name,\n ', Notes: ', p.note,\n ', Completed notes: ', p.completed_note\n ),\n E'\\n'\n order by p.date\n ) as procedures\n from \"app\".\"reporting\".\"procedures\" p\n join encounters_in_scope eis\n on eis.encounter_id = p.encounter_id\n left join \"app\".\"reporting\".\"reference_data\" proc\n on proc.id = p.procedure_type_id\n left join \"app\".\"reporting\".\"locations\" loc\n on loc.id = p.location_id\n group by p.encounter_id\n),\n\nencounter_lab_requests as (\n select\n lr.encounter_id,\n string_agg(\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\n order by lr.collected_datetime\n ) as lab_requests\n from \"app\".\"reporting\".\"lab_requests\" lr\n join encounters_in_scope eis\n on eis.encounter_id = lr.encounter_id\n left join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\n left join \"app\".\"reporting\".\"lab_test_panels\" ltp\n on ltp.id = ltpr.lab_test_panel_id\n left join \"app\".\"reporting\".\"lab_tests\" lt\n on lt.lab_request_id = lr.id\n and lr.lab_test_panel_request_id isnull\n left join \"app\".\"reporting\".\"lab_test_types\" ltt\n on ltt.id = lt.lab_test_type_id\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\n group by lr.encounter_id\n),\n\nnotes_raw as (\n select\n n.id,\n n.datetime,\n n.content,\n n.note_type_id,\n n.note_type,\n n.record_type,\n n.record_id,\n n.updated_note_id,\n n.visibility_status\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"imaging_requests\" ir\n on n.record_type = 'ImagingRequest'\n and ir.id = n.record_id\n join encounters_in_scope eis\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\n where n.record_type in ('Encounter', 'ImagingRequest')\n),\n\nencounter_notes_deduped as (\n select\n id,\n datetime,\n content,\n note_type,\n record_id,\n visibility_status,\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\n from notes_raw\n where\n record_type = 'Encounter'\n and note_type_id != 'notetype-system'\n),\n\nimaging_request_areas as (\n select\n ir.encounter_id,\n ira.imaging_request_id,\n case\n when ir.imaging_type = 'xRay' then 'X-Ray'\n when ir.imaging_type = 'ctScan' then 'CT Scan'\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\n when ir.imaging_type = 'mri' then 'MRI'\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\n when ir.imaging_type = 'mammogram' then 'Mammogram'\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\n when ir.imaging_type = 'angiogram' then 'Angiogram'\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\n when ir.imaging_type = 'stressTest' then 'Stress Test'\n else ir.imaging_type\n end as imaging_type,\n coalesce(\n string_agg(\n area.name, ', '\n order by area.name\n ),\n string_agg(case\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\n end, ', '\n order by n.datetime)\n ) as areas_to_be_imaged,\n string_agg(case\n when n.note_type_id = 'notetype-other' then n.content\n end, ','\n order by n.datetime) as notes\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join encounters_in_scope eis\n on eis.encounter_id = ir.encounter_id\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira\n on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" area\n on area.id = ira.area_id\n left join notes_raw n\n on n.record_id = ir.id\n and n.record_type = 'ImagingRequest'\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\n),\n\nencounter_imaging_requests as (\n select\n encounter_id,\n string_agg(\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\n ) as imaging_requests\n from imaging_request_areas\n group by encounter_id\n),\n\nencounter_notes as (\n select\n n.record_id as encounter_id,\n string_agg(concat(\n 'Note type: ',\n n.note_type,\n ', Content: ', n.content,\n ', Note date: ', to_char(n.datetime, 'YYYY-MM-DD HH24:MI:SS')\n ),\n E'\\n'\n order by n.datetime) as notes\n from encounter_notes_deduped n\n where n.row_number = 1\n group by n.record_id\n),\n\ninvoice_data as (\n select\n i.encounter_id,\n max(\n case\n when i.status = 'finalised'\n then to_char(i.datetime, 'YYYY-MM-DD HH24:MI:SS')\n end\n ) as invoice_finalised_datetime,\n string_agg(distinct ip.category, ', ') as invoice_product_categories\n from \"app\".\"reporting\".\"invoices\" i\n join encounters_in_scope eis\n on eis.encounter_id = i.encounter_id\n left join \"app\".\"reporting\".\"invoice_items\" ii\n on ii.invoice_id = i.id\n left join \"app\".\"reporting\".\"invoice_products\" ip\n on ip.id = ii.product_id\n group by i.encounter_id\n)\n\nselect\n p.display_id as \"Patient ID\",\n p.first_name as \"First name\",\n p.last_name as \"Last name\",\n to_char(p.date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"Age\",\n p.sex as \"Sex\",\n eth.name as \"Ethnicity\",\n bt.name as \"Billing type\",\n to_char(eis.start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(eis.end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n case\n when eis.end_datetime is not null then\n case\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\n else eis.end_datetime::date - eis.start_datetime::date\n end\n end as \"Length of stay (days)\",\n eis.facility as \"Facility\",\n ec.encounter_type_emergency as \"Emergency encounter type\",\n ec.encounter_type_inpatient as \"Inpatient encounter type\",\n ec.encounter_type_outpatient as \"Outpatient encounter type\",\n dd.name as \"Discharge disposition\",\n t.score as \"Triage category\",\n am.name as \"Arrival mode\",\n case\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\n then concat(\n lpad((\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\n + extract(hour from (t.closed_datetime - t.triage_datetime))\n )::text, 2, '0'), ':',\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\n lpad(\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\n )\n )\n end as \"Time seen following triage/Waiting time (hh:mm:ss)\",\n ec.encountering_clinician as \"Clinician\",\n c.display_name as \"Supervising clinician\",\n dp.name as \"Discharging department\",\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"Discharge date and time of Discharging department\",\n lg.name as \"Discharging area\",\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"Discharge date and time of Discharging area\",\n l.name as \"Discharging location\",\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"Discharge date and time of Discharging location\",\n ec.departments as \"Department history\",\n array_to_string(ec.department_datetimes, ', ') as \"Department history date and times\",\n ec.location_groups as \"Area history\",\n array_to_string(ec.location_group_datetimes, ', ') as \"Area history date and times\",\n ec.locations as \"Location history\",\n array_to_string(ec.location_datetimes, ', ') as \"Location history date and times\",\n eis.reason_for_encounter as \"Reason for encounter\",\n ed.diagnoses as \"Diagnoses\",\n ep.medications as \"Medications\",\n ev.vaccinations as \"Vaccinations\",\n epr.procedures as \"Procedures\",\n elr.lab_requests as \"Lab requests\",\n eir.imaging_requests as \"Imaging requests\",\n case\n when length(en.notes) > 32000\n then concat(\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\n )\n else en.notes\n end as \"Notes\",\n invd.invoice_finalised_datetime as \"invoiceFinalisedDateTime\",\n invd.invoice_product_categories as \"invoiceProductCategories\"\nfrom encounters_in_scope eis\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = eis.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = eis.location_id\njoin \"app\".\"reporting\".\"departments\" dp\n on dp.id = eis.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"users\" c\n on c.id = eis.clinician_id\njoin encounter_changes ec\n on ec.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"triages\" t\n on t.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"discharges\" d\n on d.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = eis.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" eth\n on eth.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = eis.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" am\n on am.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" dd\n on dd.id = d.disposition_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = eis.encounter_id\nleft join encounter_prescriptions ep\n on ep.encounter_id = eis.encounter_id\nleft join encounter_vaccinations ev\n on ev.encounter_id = eis.encounter_id\nleft join encounter_procedures epr\n on epr.encounter_id = eis.encounter_id\nleft join encounter_lab_requests elr\n on elr.encounter_id = eis.encounter_id\nleft join encounter_imaging_requests eir\n on eir.encounter_id = eis.encounter_id\nleft join encounter_notes en\n on en.encounter_id = eis.encounter_id\nleft join invoice_data invd\n on invd.encounter_id = eis.encounter_id\nwhere\n case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.department_ids::text [])\n end\n and case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.location_group_ids::text [])\n end\norder by eis.start_datetime desc\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-imaging-requests-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-imaging-requests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-imaging-requests-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-imaging-requests-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-imaging-requests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-imaging-requests-line-list"], "alias": "sensitive-imaging-requests-line-list", "checksum": {"name": "sha256", "checksum": "9798bf366c63bc1aa8360469ead0269b363faf319be006c65192111763fe8d50"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.0701077, "relation_name": "\"app\".\"reporting\".\"sensitive-imaging-requests-line-list\"", "raw_code": "with _translations as (\r\n {{ get_translation_lookup(prefix_key='IMAGING_TYPES') }}\r\n)\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n request_id as \"{{ translate_label('imagingRequestId') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('imagingRequestDateTime') }}\",\r\n supervising_clinician as \"{{ translate_label('imagingSupervisingClinician') }}\",\r\n requesting_clinician as \"{{ translate_label('imagingRequestingClinician') }}\",\r\n priority as \"{{ translate_label('imagingPriority') }}\",\r\n coalesce(t_imaging_type.text, imaging_type) as \"{{ translate_label('imagingType') }}\",\r\n imaging_area as \"{{ translate_label('imagingArea') }}\",\r\n status as \"{{ translate_label('imagingStatus') }}\",\r\n to_char(completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('imagingCompletedDateTime') }}\",\r\n reason_for_cancellation as \"{{ translate_label('imagingCancellationReason') }}\"\r\nfrom {{ ref('ds__sensitive_imaging_requests') }}\r\nleft join _translations t_imaging_type\r\n on t_imaging_type.string_id = '{{ get_translation_prefix(\"IMAGING_TYPES\") }}.' || imaging_type\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('requestedById') }} is null then true\r\n else requesting_clinician_id = {{ parameter('requestedById') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('imagingType') }} is null then true\r\n else imaging_type = {{ parameter('imagingType') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by requested_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "translated_strings", "package": null, "version": null}, {"name": "ds__sensitive_imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_lookup", "macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_translation_prefix", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.translated_strings", "model.tamanu_source_dbt.ds__sensitive_imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-imaging-requests-line-list.sql", "compiled": true, "compiled_code": "with _translations as (\n select\n string_id,\n max(text) filter (where language = 'default') as text\n from \"app\".\"reporting\".\"translated_strings\"\n where string_id like 'imaging.property.type.%'\n group by string_id\n)\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n request_id as \"Request ID\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Request date and time\",\n supervising_clinician as \"Supervising clinician\",\n requesting_clinician as \"Requesting clinician\",\n priority as \"Priority\",\n coalesce(t_imaging_type.text, imaging_type) as \"Imaging type\",\n imaging_area as \"Area to be imaged\",\n status as \"Status\",\n to_char(completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Completed date and time\",\n reason_for_cancellation as \"Reason for cancellation\"\nfrom \"app\".\"reporting\".\"ds__sensitive_imaging_requests\"\nleft join _translations t_imaging_type\n on t_imaging_type.string_id = 'imaging.property.type.' || imaging_type\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else requesting_clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else imaging_type = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\norder by requested_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-imaging-requests-summary": {"database": "app", "schema": "reporting", "name": "sensitive-imaging-requests-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-imaging-requests-summary.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-imaging-requests-summary.sql", "unique_id": "model.tamanu_source_dbt.sensitive-imaging-requests-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-imaging-requests-summary"], "alias": "sensitive-imaging-requests-summary", "checksum": {"name": "sha256", "checksum": "ca2bfffef6184a7ce3149b4fd16f10df7c680744547ba7a8375fd1a4dcb280bd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.085599, "relation_name": "\"app\".\"reporting\".\"sensitive-imaging-requests-summary\"", "raw_code": "with _translations as (\r\n {{ get_translation_lookup(prefix_key='IMAGING_TYPES') }}\r\n),\r\n\r\nreporting_dates as (\r\n select date::date as date\r\n from generate_series(\r\n {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }},\r\n {{ parameter('toDate', default_value='2024-01-31', data_type='date') }},\r\n '1 day'::interval\r\n ) date\r\n)\r\n\r\nselect\r\n to_char(rd.date, '{{ var(\"date_format\") }}') as \"{{ translate_label('reportingDate') }}\",\r\n ir.facility as \"{{ translate_label('facility') }}\",\r\n ir.department as \"{{ translate_label('department') }}\",\r\n coalesce(t_imaging_type.text, ir.imaging_type) as \"{{ translate_label('imagingType') }}\",\r\n count(distinct ir.request_id) filter (where ir.requested_datetime::date = rd.date) as \"{{ translate_label('imagingTotalRequests') }}\",\r\n count(distinct ir.request_id) filter (\r\n where ir.requested_datetime::date <= rd.date\r\n and (ir.completed_datetime::date > rd.date or ir.completed_datetime is null)\r\n ) as \"{{ translate_label('imagingPendingRequests') }}\",\r\n count(distinct ir.request_id) filter (\r\n where ir.completed_datetime::date = rd.date\r\n ) as \"{{ translate_label('imagingCompletedRequests') }}\"\r\nfrom reporting_dates rd\r\nleft join {{ ref('ds__sensitive_imaging_requests') }} ir\r\n on ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\r\n and ir.requested_datetime::date <= rd.date\r\n and (ir.completed_datetime::date >= rd.date or ir.completed_datetime is null)\r\nleft join _translations t_imaging_type\r\n on t_imaging_type.string_id = '{{ get_translation_prefix(\"IMAGING_TYPES\") }}.' || ir.imaging_type\r\nwhere ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\r\n and (ir.department_id is not null or ir.imaging_type is not null)\r\n and (\r\n {{ parameter('department') }} is null or ir.department_id = {{ parameter('department') }}\r\n )\r\n and (\r\n case\r\n when {{ parameter('imagingType') }} is null then true\r\n else ir.imaging_type = {{ parameter('imagingType') }}\r\n end\r\n )\r\ngroup by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text\r\norder by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text", "doc_blocks": [], "language": "sql", "refs": [{"name": "translated_strings", "package": null, "version": null}, {"name": "ds__sensitive_imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_lookup", "macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_translation_prefix"], "nodes": ["model.tamanu_source_dbt.translated_strings", "model.tamanu_source_dbt.ds__sensitive_imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-imaging-requests-summary.sql", "compiled": true, "compiled_code": "with _translations as (\n select\n string_id,\n max(text) filter (where language = 'default') as text\n from \"app\".\"reporting\".\"translated_strings\"\n where string_id like 'imaging.property.type.%'\n group by string_id\n),\n\nreporting_dates as (\n select date::date as date\n from generate_series(\n nullif('2024-01-01', '')::date,\n nullif('2024-01-31', '')::date,\n '1 day'::interval\n ) date\n)\n\nselect\n to_char(rd.date, 'YYYY-MM-DD') as \"Date\",\n ir.facility as \"Facility\",\n ir.department as \"Department\",\n coalesce(t_imaging_type.text, ir.imaging_type) as \"Imaging type\",\n count(distinct ir.request_id) filter (where ir.requested_datetime::date = rd.date) as \"Total new requests\",\n count(distinct ir.request_id) filter (\n where ir.requested_datetime::date <= rd.date\n and (ir.completed_datetime::date > rd.date or ir.completed_datetime is null)\n ) as \"Total requests with a status of pending\",\n count(distinct ir.request_id) filter (\n where ir.completed_datetime::date = rd.date\n ) as \"Total requests completed\"\nfrom reporting_dates rd\nleft join \"app\".\"reporting\".\"ds__sensitive_imaging_requests\" ir\n on ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\n and ir.requested_datetime::date <= rd.date\n and (ir.completed_datetime::date >= rd.date or ir.completed_datetime is null)\nleft join _translations t_imaging_type\n on t_imaging_type.string_id = 'imaging.property.type.' || ir.imaging_type\nwhere ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\n and (ir.department_id is not null or ir.imaging_type is not null)\n and (\n nullif('', '')::text is null or ir.department_id = nullif('', '')::text\n )\n and (\n case\n when nullif('', '')::text is null then true\n else ir.imaging_type = nullif('', '')::text\n end\n )\ngroup by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text\norder by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-incomplete-referrals": {"database": "app", "schema": "reporting", "name": "sensitive-incomplete-referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-incomplete-referrals.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-incomplete-referrals.sql", "unique_id": "model.tamanu_source_dbt.sensitive-incomplete-referrals", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-incomplete-referrals"], "alias": "sensitive-incomplete-referrals", "checksum": {"name": "sha256", "checksum": "3d7865d95aebb04130db411f55105910af01eb118f47659ee59ca1d1627a93b8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.090285, "relation_name": "\"app\".\"reporting\".\"sensitive-incomplete-referrals\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n diagnoses as \"{{ translate_label('diagnoses') }}\",\r\n referral_type as \"{{ translate_label('referralType') }}\",\r\n referring_doctor_name as \"{{ translate_label('referralCompletedBy') }}\",\r\n to_char(referral_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('referralDate') }}\",\r\n department as \"{{ translate_label('department') }}\"\r\nfrom {{ ref('ds__sensitive_referrals') }}\r\nwhere status in ('pending', 'cancelled')\r\n and case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else referral_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else referral_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('doctorId') }} is null then true\r\n else referring_doctor_id = {{ parameter('doctorId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\norder by referral_datetime, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_referrals", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-incomplete-referrals.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n diagnoses as \"Diagnoses\",\n referral_type as \"Referral name\",\n referring_doctor_name as \"Referring doctor\",\n to_char(referral_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Referral date\",\n department as \"Department\"\nfrom \"app\".\"reporting\".\"ds__sensitive_referrals\"\nwhere status in ('pending', 'cancelled')\n and case\n when nullif('2024-01-01', '')::date is null then true\n else referral_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else referral_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else referring_doctor_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\norder by referral_datetime, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-lab-requests-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-lab-requests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-lab-requests-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-lab-requests-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-lab-requests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-lab-requests-line-list"], "alias": "sensitive-lab-requests-line-list", "checksum": {"name": "sha256", "checksum": "8ddd812e4b6a0940223ef488e38274d9b4b61cd24b1a0ee822f00c0a85b622f4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.0963001, "relation_name": "\"app\".\"reporting\".\"sensitive-lab-requests-line-list\"", "raw_code": "{{ config(tags=[\"restricted\"]) }}\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n concat_ws(', ', location_group, location) as \"{{ translate_label('location') }}\",\r\n laboratory as \"{{ translate_label('labLaboratory') }}\",\r\n request_id as \"{{ translate_label('labRequestId') }}\",\r\n status as \"{{ translate_label('labRequestStatus') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestDateTime') }}\",\r\n requested_by as \"{{ translate_label('labRequestClinician') }}\",\r\n requesting_department as \"{{ translate_label('labRequestDepartment') }}\",\r\n priority as \"{{ translate_label('labRequestPriority') }}\",\r\n lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n tests as \"{{ translate_label('labTestRequested') }}\",\r\n to_char(collected_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestSampleCollectionDateTime') }}\",\r\n collected_by as \"{{ translate_label('labRequestSampleCollectedBy') }}\",\r\n specimen_type as \"{{ translate_label('labRequestSpecimenType') }}\",\r\n site as \"{{ translate_label('labRequestSampleSite') }}\",\r\n to_char(completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestCompletedDateTime') }}\",\r\n reason_for_cancellation as \"{{ translate_label('labRequestCancellationReason') }}\"\r\nfrom {{ ref('ds__sensitive_lab_requests') }}\r\nwhere case\r\n when {{ parameter('requestedById') }} is null then true\r\n else requested_by_id = {{ parameter('requestedById') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('testCategoryId') }} is null then true\r\n else lab_test_category_id = {{ parameter('testCategoryId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by requested_datetime, last_name, first_name, tests", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_lab_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-lab-requests-line-list.sql", "compiled": true, "compiled_code": "\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n concat_ws(', ', location_group, location) as \"Location\",\n laboratory as \"Laboratory\",\n request_id as \"Request ID\",\n status as \"Status\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request date and time\",\n requested_by as \"Requesting clinician\",\n requesting_department as \"Requesting department\",\n priority as \"Priority\",\n lab_test_category as \"Test category\",\n tests as \"Test requested\",\n to_char(collected_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Sample collection date and time\",\n collected_by as \"Sample collected by\",\n specimen_type as \"Specimen type\",\n site as \"Site\",\n to_char(completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Completed date and time\",\n reason_for_cancellation as \"Reason for cancellation\"\nfrom \"app\".\"reporting\".\"ds__sensitive_lab_requests\"\nwhere case\n when nullif('', '')::text is null then true\n else requested_by_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else lab_test_category_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by requested_datetime, last_name, first_name, tests", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-lab-tests-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-lab-tests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-lab-tests-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-lab-tests-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-lab-tests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-lab-tests-line-list"], "alias": "sensitive-lab-tests-line-list", "checksum": {"name": "sha256", "checksum": "23edf7cb3baac1259b5a514543c7dffb089b485ed0a09edcd0d2e76b675545a7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.1051712, "relation_name": "\"app\".\"reporting\".\"sensitive-lab-tests-line-list\"", "raw_code": "{{ config(tags=[\"restricted\"]) }}\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n requesting_department as \"{{ translate_label('requestingDepartment') }}\",\r\n concat_ws(', ', location_group, location) as \"{{ translate_label('location') }}\",\r\n lab_request_id as \"{{ translate_label('labRequestId') }}\",\r\n status as \"{{ translate_label('labRequestStatus') }}\",\r\n lab_test_panel as \"{{ translate_label('labTestPanel') }}\",\r\n lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestDateTime') }}\",\r\n requested_by as \"{{ translate_label('labRequestClinician') }}\",\r\n to_char(lab_request_published_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestPublishedDateTime') }}\",\r\n to_char(lab_test_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('labTestDate') }}\",\r\n result as \"{{ translate_label('labTestResults') }}\",\r\n verification as \"{{ translate_label('labTestVerification') }}\",\r\n lab_test_type as \"{{ translate_label('labTestType') }}\",\r\n to_char(lab_test_completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labTestCompletedDateTime') }}\"\r\nfrom {{ ref('ds__sensitive_lab_tests') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('testCategoryId') }} is null then true\r\n else lab_test_category_id = {{ parameter('testCategoryId') }}\r\n end\r\norder by requested_datetime, last_name, first_name, lab_test_panel", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_lab_tests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-lab-tests-line-list.sql", "compiled": true, "compiled_code": "\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n requesting_department as \"Requesting department\",\n concat_ws(', ', location_group, location) as \"Location\",\n lab_request_id as \"Request ID\",\n status as \"Status\",\n lab_test_panel as \"Lab test panel\",\n lab_test_category as \"Test category\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request date and time\",\n requested_by as \"Requesting clinician\",\n to_char(lab_request_published_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request published date and time\",\n to_char(lab_test_date, 'YYYY-MM-DD') as \"Lab test date\",\n result as \"Result\",\n verification as \"Verification\",\n lab_test_type as \"Lab test type\",\n to_char(lab_test_completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab test completed date and time\"\nfrom \"app\".\"reporting\".\"ds__sensitive_lab_tests\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else lab_test_category_id = nullif('', '')::text\n end\norder by requested_datetime, last_name, first_name, lab_test_panel", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-location-bookings-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-location-bookings-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-location-bookings-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-location-bookings-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-location-bookings-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-location-bookings-line-list"], "alias": "sensitive-location-bookings-line-list", "checksum": {"name": "sha256", "checksum": "c441374001bad4d3ee3efc8a8b41072211a6dfc43f50972139df654006a0e9f6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.1146953, "relation_name": "\"app\".\"reporting\".\"sensitive-location-bookings-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(booking_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('bookingStartDateTime') }}\",\r\n to_char(booking_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('bookingEndDateTime') }}\",\r\n case\r\n when extract(day from age(booking_end_datetime, booking_start_datetime)) >= 1\r\n then extract(day from age(booking_end_datetime, booking_start_datetime)) || ' nights'\r\n when extract(hour from age(booking_end_datetime, booking_start_datetime)) >= 1\r\n then extract(hour from age(booking_end_datetime, booking_start_datetime)) || ' hours'\r\n else extract(minute from age(booking_end_datetime, booking_start_datetime)) || ' minutes'\r\n end as \"{{ translate_label('bookingDuration') }}\",\r\n location_group as \"{{ translate_label('bookingLocationGroup') }}\",\r\n location as \"{{ translate_label('bookingLocation') }}\",\r\n clinician as \"{{ translate_label('bookingClinician') }}\",\r\n booking_type as \"{{ translate_label('bookingType') }}\",\r\n booking_status as \"{{ translate_label('bookingStatus') }}\"\r\nfrom {{ ref('ds__sensitive_location_bookings') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else booking_start_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else booking_end_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('bookingStatus') }} is null then true\r\n else booking_status = {{ parameter('bookingStatus') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('bookingTypeId') }} is null then true\r\n else booking_type_id = {{ parameter('bookingTypeId') }}\r\n end\r\norder by booking_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_location_bookings", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_location_bookings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-location-bookings-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n billing_type as \"Billing type\",\n to_char(booking_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Booking start date and time\",\n to_char(booking_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Booking end date and time\",\n case\n when extract(day from age(booking_end_datetime, booking_start_datetime)) >= 1\n then extract(day from age(booking_end_datetime, booking_start_datetime)) || ' nights'\n when extract(hour from age(booking_end_datetime, booking_start_datetime)) >= 1\n then extract(hour from age(booking_end_datetime, booking_start_datetime)) || ' hours'\n else extract(minute from age(booking_end_datetime, booking_start_datetime)) || ' minutes'\n end as \"Booking duration\",\n location_group as \"Area\",\n location as \"Location\",\n clinician as \"Clinician\",\n booking_type as \"Booking type\",\n booking_status as \"Booking status\"\nfrom \"app\".\"reporting\".\"ds__sensitive_location_bookings\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else booking_start_datetime >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else booking_end_datetime <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else booking_status = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else booking_type_id = nullif('', '')::text\n end\norder by booking_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-medication-dispensed-summary": {"database": "app", "schema": "reporting", "name": "sensitive-medication-dispensed-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-medication-dispensed-summary.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-medication-dispensed-summary.sql", "unique_id": "model.tamanu_source_dbt.sensitive-medication-dispensed-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-medication-dispensed-summary"], "alias": "sensitive-medication-dispensed-summary", "checksum": {"name": "sha256", "checksum": "1d4925289220857f596603693547e069527888f1672bb2dc6d0db3313a2535cd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.180844, "relation_name": "\"app\".\"reporting\".\"sensitive-medication-dispensed-summary\"", "raw_code": "select\r\n md.medication as \"{{ translate_label('prescriptionMedication') }}\",\r\n md.medication_code as \"{{ translate_label('prescriptionMedicationCode') }}\",\r\n sum(md.quantity) as \"{{ translate_label('prescriptionQuantity') }}\"\r\nfrom {{ ref('ds__sensitive_medication_dispenses') }} md\r\nwhere\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else md.facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('medicationId') }} is null then true\r\n else md.medication_id = {{ parameter('medicationId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='timestamp') }} is null then true\r\n else md.dispensed_at\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='timestamp') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='timestamp') }} is null then true\r\n else md.dispensed_at\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='timestamp') }}\r\n end\r\ngroup by md.medication_id, md.medication, md.medication_code", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_medication_dispenses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-medication-dispensed-summary.sql", "compiled": true, "compiled_code": "select\n md.medication as \"Medication\",\n md.medication_code as \"Code\",\n sum(md.quantity) as \"Quantity\"\nfrom \"app\".\"reporting\".\"ds__sensitive_medication_dispenses\" md\nwhere\n case\n when nullif('', '')::text is null then true\n else md.facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else md.medication_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::timestamp is null then true\n else md.dispensed_at\n >= nullif('2024-01-01', '')::timestamp\n end\n and\n case\n when nullif('2024-01-31', '')::timestamp is null then true\n else md.dispensed_at\n <= nullif('2024-01-31', '')::timestamp\n end\ngroup by md.medication_id, md.medication, md.medication_code", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-outpatient-appointments-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-outpatient-appointments-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-outpatient-appointments-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-outpatient-appointments-line-list"], "alias": "sensitive-outpatient-appointments-line-list", "checksum": {"name": "sha256", "checksum": "d76c682837fc49f38b0719d9c0cca20df4da2dffd1ae687123447b11ea22ec47"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.1880076, "relation_name": "\"app\".\"reporting\".\"sensitive-outpatient-appointments-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n contact_number as \"{{ translate_label('patientContactNumber') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(appointment_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentDateTime') }}\",\r\n to_char(appointment_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentEndDateTime') }}\",\r\n appointment_type as \"{{ translate_label('appointmentType') }}\",\r\n appointment_status as \"{{ translate_label('appointmentStatus') }}\",\r\n clinician as \"{{ translate_label('appointmentClinician') }}\",\r\n location_group as \"{{ translate_label('appointmentLocationGroup') }}\",\r\n priority as \"{{ translate_label('appointmentPriority') }}\",\r\n case\r\n when schedule_id notnull then {{ get_recurrence_description('interval', 'frequency', 'days_of_week', 'nth_weekday') }}\r\n else 'No'\r\n end as \"{{ translate_label('appointmentIsRepeating') }}\",\r\n to_char(until_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('appointmentRepeatingEndDate') }}\",\r\n created_by as \"{{ translate_label('appointmentCreatedBy') }}\"\r\nfrom {{ ref('ds__sensitive_outpatient_appointments') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else appointment_start_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else appointment_start_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when coalesce({{ parameter('appointmentStatus') }}) is null then true\r\n else appointment_status in ({{ parameter('appointmentStatus') }})\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('appointmentTypeId') }} is null then true\r\n else appointment_type_id = {{ parameter('appointmentTypeId') }}\r\n end\r\norder by appointment_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_outpatient_appointments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_recurrence_description", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_outpatient_appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-outpatient-appointments-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n contact_number as \"Contact number\",\n village as \"Village\",\n billing_type as \"Billing type\",\n to_char(appointment_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment date and time\",\n to_char(appointment_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment end date and time\",\n appointment_type as \"Appointment type\",\n appointment_status as \"Appointment status\",\n clinician as \"Clinician\",\n location_group as \"Area\",\n priority as \"Priority appointment\",\n case\n when schedule_id notnull then concat(\n concat(\n case when \"interval\" = 1 then\n case frequency\n when 'WEEKLY' then 'Weekly on a '\n when 'MONTHLY' then 'Monthly on the '\n end\n else concat('Every ', \"interval\",\n case frequency\n when 'WEEKLY' then ' weeks on '\n when 'MONTHLY' then ' months on the '\n end\n )\n end\n ),\n case nth_weekday\n when -1 then 'last '\n when 1 then 'first '\n when 2 then 'second '\n when 3 then 'third '\n when 4 then 'fourth ' \n else ''\n end,\n array_to_string(\n array(select case unnest_day\n when 'MO' then 'Monday'\n when 'TU' then 'Tuesday'\n when 'WE' then 'Wednesday'\n when 'TH' then 'Thursday'\n when 'FR' then 'Friday'\n when 'SA' then 'Saturday'\n when 'SU' then 'Sunday'\n else unnest_day\n end from unnest(days_of_week) as unnest_day),\n ', '\n )\n )\n else 'No'\n end as \"Repeating appointment\",\n to_char(until_date, 'YYYY-MM-DD') as \"Repeating appointment end date\",\n created_by as \"Appointment created by\"\nfrom \"app\".\"reporting\".\"ds__sensitive_outpatient_appointments\"\nwhere case\n when nullif('2025-01-01', '')::date is null then true\n else appointment_start_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else appointment_start_datetime <= nullif('2025-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\n and\n case\n when coalesce(nullif('', '')::text) is null then true\n else appointment_status in (nullif('', '')::text)\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else appointment_type_id = nullif('', '')::text\n end\norder by appointment_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary": {"database": "app", "schema": "reporting", "name": "sensitive-patient-emergency-encounters-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-patient-emergency-encounters-summary.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-patient-emergency-encounters-summary.sql", "unique_id": "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-patient-emergency-encounters-summary"], "alias": "sensitive-patient-emergency-encounters-summary", "checksum": {"name": "sha256", "checksum": "9ceef4e6849d3e022398664afd79938ddf5cfed9f280b1b103d3a648e7ea6449"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.2000456, "relation_name": "\"app\".\"reporting\".\"sensitive-patient-emergency-encounters-summary\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n count(*) as \"{{ translate_label('triageRecordCount') }}\"\r\nfrom {{ ref('ds__sensitive_encounters_emergency') }}\r\nwhere case\r\n when {{ parameter('patientId') }} is null then true\r\n else patient_id = {{ parameter('patientId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else triage_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else triage_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\ngroup by\r\n display_id,\r\n first_name,\r\n last_name,\r\n date_of_birth,\r\n sex,\r\n village,\r\n facility\r\norder by last_name, first_name, display_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_encounters_emergency", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_encounters_emergency"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-patient-emergency-encounters-summary.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n count(*) as \"Number of triage records\"\nfrom \"app\".\"reporting\".\"ds__sensitive_encounters_emergency\"\nwhere case\n when nullif('', '')::text is null then true\n else patient_id = nullif('', '')::text\n end\n and\n case\n when nullif('2025-01-01', '')::date is null then true\n else triage_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else triage_datetime <= nullif('2025-01-31', '')::date\n end\ngroup by\n display_id,\n first_name,\n last_name,\n date_of_birth,\n sex,\n village,\n facility\norder by last_name, first_name, display_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-prescription-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-prescription-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-prescription-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-prescription-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-prescription-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-prescription-line-list"], "alias": "sensitive-prescription-line-list", "checksum": {"name": "sha256", "checksum": "8c5c206618963af331d8733870eaf77462ae6dd523c76b59e7242152596e0634"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.2053366, "relation_name": "\"app\".\"reporting\".\"sensitive-prescription-line-list\"", "raw_code": "select\r\n to_char(datetime, '{{ var(\"date_format\") }}') as \"{{ translate_label('prescriptionDate') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n is_selected_for_discharge as \"{{ translate_label('prescriptionSelectedForDischarge') }}\",\r\n medication_code as \"{{ translate_label('prescriptionMedicationCode') }}\",\r\n medication as \"{{ translate_label('prescriptionMedication') }}\",\r\n route as \"{{ translate_label('prescriptionRoute') }}\",\r\n quantity as \"{{ translate_label('prescriptionQuantity') }}\",\r\n repeats as \"{{ translate_label('prescriptionRepeats') }}\",\r\n is_ongoing as \"{{ translate_label('prescriptionIsOngoing') }}\",\r\n is_prn as \"{{ translate_label('prescriptionIsPRN') }}\",\r\n is_variable_dose as \"{{ translate_label('prescriptionIsVariableDose') }}\",\r\n dose_amount as \"{{ translate_label('prescriptionDoseAmount') }}\",\r\n units as \"{{ translate_label('prescriptionUnits') }}\",\r\n frequency as \"{{ translate_label('prescriptionFrequency') }}\"\r\nfrom {{ ref('ds__sensitive_encounter_prescriptions') }}\r\nwhere\r\n case when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case when {{ parameter('facilityId') }} is null then true\r\n else {{ parameter('facilityId') }} = facility_id\r\n end\r\norder by datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_encounter_prescriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-prescription-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(datetime, 'YYYY-MM-DD') as \"Prescription date\",\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n is_selected_for_discharge as \"Prescription selected for discharge\",\n medication_code as \"Code\",\n medication as \"Medication\",\n route as \"Route\",\n quantity as \"Quantity\",\n repeats as \"Repeats\",\n is_ongoing as \"Is ongoing\",\n is_prn as \"Is PRN\",\n is_variable_dose as \"Is variable dose\",\n dose_amount as \"Dose amount\",\n units as \"Units\",\n frequency as \"Frequency\"\nfrom \"app\".\"reporting\".\"ds__sensitive_encounter_prescriptions\"\nwhere\n case when nullif('2024-01-01', '')::date is null then true\n else datetime >= nullif('2024-01-01', '')::date\n end\n and case when nullif('2024-01-31', '')::date is null then true\n else datetime <= nullif('2024-01-31', '')::date\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = facility_id\n end\norder by datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-procedures-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-procedures-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-procedures-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-procedures-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-procedures-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-procedures-line-list"], "alias": "sensitive-procedures-line-list", "checksum": {"name": "sha256", "checksum": "b36f1829612a3a21259eb4bf7839f565f10ebddda472802d9e0cc5199157018a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.2139423, "relation_name": "\"app\".\"reporting\".\"sensitive-procedures-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n encounter_facility as \"{{ translate_label('facility') }}\",\r\n encounter_department as \"{{ translate_label('department') }}\",\r\n encounter_type as \"{{ translate_label('encounterType') }}\",\r\n to_char(encounter_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(encounter_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n procedure_facility as \"{{ translate_label('procedureFacility') }}\",\r\n procedure_area as \"{{ translate_label('procedureLocationGroup') }}\",\r\n procedure_location as \"{{ translate_label('procedureLocation') }}\",\r\n procedure_type as \"{{ translate_label('procedure') }}\",\r\n to_char(procedure_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('procedureDate') }}\",\r\n to_char(procedure_start_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('procedureStartDateTime') }}\",\r\n to_char(procedure_end_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('procedureEndDateTime') }}\",\r\n procedure_duration as \"{{ translate_label('procedureDuration') }}\",\r\n procedure_clinician as \"{{ translate_label('procedureClinician') }}\",\r\n procedure_anaesthetist as \"{{ translate_label('procedureAnaesthetist') }}\",\r\n procedure_assistant_anaesthetist as \"{{ translate_label('procedureAssistantAnaesthetist') }}\",\r\n is_completed as \"{{ translate_label('procedureIsCompleted') }}\",\r\n time_in as \"{{ translate_label('procedureTimeIn') }}\",\r\n time_out as \"{{ translate_label('procedureTimeOut') }}\"\r\nfrom {{ ref('ds__sensitive_procedures') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else procedure_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else procedure_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else procedure_facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else encounter_department_id = {{ parameter('departmentId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else procedure_area_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationId') }} is null then true\r\n else procedure_location_id = {{ parameter('locationId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else procedure_clinician_id = {{ parameter('clinicianId') }}\r\n end\r\norder by procedure_start_time", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_procedures", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-procedures-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n nationality as \"Nationality\",\n encounter_facility as \"Facility\",\n encounter_department as \"Department\",\n encounter_type as \"Type\",\n to_char(encounter_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(encounter_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n procedure_facility as \"Procedure facility\",\n procedure_area as \"Procedure area\",\n procedure_location as \"Procedure location\",\n procedure_type as \"Procedure\",\n to_char(procedure_date, 'YYYY-MM-DD') as \"Procedure date\",\n to_char(procedure_start_time, 'HH24:MI') as \"Procedure start (date and time)\",\n to_char(procedure_end_time, 'HH24:MI') as \"Procedure end (date and time)\",\n procedure_duration as \"Procedure duration\",\n procedure_clinician as \"Procedure clinician\",\n procedure_anaesthetist as \"Procedure anaesthetist\",\n procedure_assistant_anaesthetist as \"Procedure assistant anesthetist\",\n is_completed as \"Procedure marked as completed\",\n time_in as \"Procedure time in\",\n time_out as \"Procedure time out\"\nfrom \"app\".\"reporting\".\"ds__sensitive_procedures\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else procedure_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else procedure_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else encounter_department_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_area_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_location_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_clinician_id = nullif('', '')::text\n end\norder by procedure_start_time", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-recent-diagnoses-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-recent-diagnoses-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-recent-diagnoses-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-recent-diagnoses-line-list"], "alias": "sensitive-recent-diagnoses-line-list", "checksum": {"name": "sha256", "checksum": "5402e8bf8115b7d6b8f61caa4499a3c1e6a0ae4cab986117c28a107d1f4abd26"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.223848, "relation_name": "\"app\".\"reporting\".\"sensitive-recent-diagnoses-line-list\"", "raw_code": "select\r\n to_char(diagnosis_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('diagnosisDateTime') }}\",\r\n diagnosis as \"{{ translate_label('diagnoses') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n contact_number as \"{{ translate_label('patientPrimaryContactNumber') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n clinician as \"{{ translate_label('encounterClinician') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n certainty as \"{{ translate_label('diagnosisCertainty') }}\",\r\n is_primary as \"{{ translate_label('diagnosisIsPrimary') }}\"\r\nfrom {{ ref('ds__sensitive_diagnoses') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else diagnosis_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else diagnosis_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case when\r\n coalesce({{ parameter('diagnosisId') }}, {{ parameter('diagnosis2Id') }}, {{ parameter('diagnosis3Id') }}, {{ parameter('diagnosis4Id') }}, {{ parameter('diagnosis5Id') }}) is null\r\n then true\r\n else diagnosis_id in (\r\n {{ parameter('diagnosisId') }},\r\n {{ parameter('diagnosis2Id') }},\r\n {{ parameter('diagnosis3Id') }},\r\n {{ parameter('diagnosis4Id') }},\r\n {{ parameter('diagnosis5Id') }}\r\n )\r\n end\r\norder by diagnosis_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_diagnoses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-recent-diagnoses-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(diagnosis_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date & time\",\n diagnosis as \"Diagnoses\",\n first_name as \"First name\",\n last_name as \"Last name\",\n display_id as \"Patient ID\",\n age as \"Age\",\n sex as \"Sex\",\n contact_number as \"Primary contact number\",\n village as \"Village\",\n clinician as \"Clinician\",\n department as \"Department\",\n certainty as \"Certainty\",\n is_primary as \"Is primary\"\nfrom \"app\".\"reporting\".\"ds__sensitive_diagnoses\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else diagnosis_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else diagnosis_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case when\n coalesce(nullif('', '')::text, nullif('', '')::text, nullif('', '')::text, nullif('', '')::text, nullif('', '')::text) is null\n then true\n else diagnosis_id in (\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text\n )\n end\norder by diagnosis_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-user-audit-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-user-audit-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-user-audit-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-user-audit-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-user-audit-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-user-audit-line-list"], "alias": "sensitive-user-audit-line-list", "checksum": {"name": "sha256", "checksum": "62232e57983103c669907e7fbd7b7c9eca38e8ace9d5bba67be44714bacc8fb5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.231657, "relation_name": "\"app\".\"reporting\".\"sensitive-user-audit-line-list\"", "raw_code": "select\r\n user_name as \"{{ translate_label('userName') }}\",\r\n user_role as \"{{ translate_label('userRole') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n patient_category as \"{{ translate_label('patientCategory') }}\",\r\n triage_category as \"{{ translate_label('triageCategory') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(encounter_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(encounter_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n to_char(first_note_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('noteStartDateTime') }}\",\r\n to_char(last_note_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('noteEndDateTime') }}\",\r\n is_discharged as \"{{ translate_label('encounterIsDischarged') }}\",\r\n non_discharge_by_clinicians as \"{{ translate_label('encounterNonDischargeClinician') }}\"\r\nfrom {{ ref('ds__sensitive_user_audit') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else encounter_start_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else encounter_start_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else department_id = {{ parameter('departmentId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\norder by encounter_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_user_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_user_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-user-audit-line-list.sql", "compiled": true, "compiled_code": "select\n user_name as \"User name\",\n user_role as \"User role\",\n display_id as \"Patient ID\",\n patient_category as \"Patient category\",\n triage_category as \"Triage category\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(encounter_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(encounter_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n to_char(first_note_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Notes start date and time\",\n to_char(last_note_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Notes end date and time\",\n is_discharged as \"Discharges (has the patient been discharged)\",\n non_discharge_by_clinicians as \"Non-discharge by clinicians\"\nfrom \"app\".\"reporting\".\"ds__sensitive_user_audit\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else encounter_start_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else encounter_start_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else department_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\norder by encounter_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-vaccine-audit-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-vaccine-audit-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-vaccine-audit-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-vaccine-audit-line-list"], "alias": "sensitive-vaccine-audit-line-list", "checksum": {"name": "sha256", "checksum": "1fbd9918275c8bf2f15d3a762be98ce1d5eab59ecc4df73ad6fce0b9836fdd32"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.2414956, "relation_name": "\"app\".\"reporting\".\"sensitive-vaccine-audit-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n to_char(vaccination_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDate') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_brand as \"{{ translate_label('vaccineBrand') }}\",\r\n disease as \"{{ translate_label('vaccineDisease') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n given_by as \"{{ translate_label('vaccinationGivenBy') }}\",\r\n recorded_by as \"{{ translate_label('vaccinationRecordedBy') }}\",\r\n modified_by as \"{{ translate_label('vaccinationModifiedBy') }}\",\r\n to_char(updated_at, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('vaccinationModifiedDate') }}\"\r\nfrom {{ ref(\"ds__sensitive_vaccinations\") }}\r\nwhere\r\n vaccine_status in ('Recorded in error', 'Historical')\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else vaccination_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else vaccination_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('status') }} is null then true\r\n else vaccine_status = {{ parameter('status') }}\r\n end\r\norder by vaccination_date, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-vaccine-audit-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n to_char(vaccination_date, 'YYYY-MM-DD') as \"Vaccination date\",\n vaccine_name as \"Vaccine name\",\n vaccine_brand as \"If category of Other, Vaccine brand\",\n disease as \"If category of Other, Disease\",\n vaccine_status as \"Vaccine status\",\n vaccine_schedule as \"Schedule\",\n given_by as \"Given by\",\n recorded_by as \"Recorded by\",\n modified_by as \"Record modified by\",\n to_char(updated_at, 'YYYY-MM-DD HH24:MI:SS') as \"Record modification date\"\nfrom \"app\".\"reporting\".\"ds__sensitive_vaccinations\"\nwhere\n vaccine_status in ('Recorded in error', 'Historical')\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else vaccination_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else vaccination_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_status = nullif('', '')::text\n end\norder by vaccination_date, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-vaccine-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-vaccine-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-vaccine-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-vaccine-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-vaccine-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-vaccine-line-list"], "alias": "sensitive-vaccine-line-list", "checksum": {"name": "sha256", "checksum": "fb33813b54ec773e71b3f27436510458c958463a8c42d0fd0fc1455a589aff79"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782422374.2414956, "relation_name": "\"app\".\"reporting\".\"sensitive-vaccine-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(vaccination_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDate') }}\",\r\n vaccine_category as \"{{ translate_label('vaccineCategory') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_brand as \"{{ translate_label('vaccineBrand') }}\",\r\n disease as \"{{ translate_label('vaccineDisease') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n batch as \"{{ translate_label('vaccinationBatch') }}\",\r\n given_by as \"{{ translate_label('vaccinationGivenBy') }}\",\r\n recorded_by as \"{{ translate_label('vaccinationRecordedBy') }}\",\r\n circumstances as \"{{ translate_label('vaccinationGivenElseWhereCircumstances') }}\",\r\n given_elsewhere_by as \"{{ translate_label('vaccinationGivenElsewhereCountry') }}\",\r\n not_given_clinician as \"{{ translate_label('vaccinationNotGivenClinician') }}\",\r\n not_given_reason as \"{{ translate_label('vaccinationNotGivenReason') }}\"\r\nfrom {{ ref(\"ds__sensitive_vaccinations\") }}\r\nwhere\r\n vaccine_status in ('Given', 'Not Given')\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else vaccination_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else vaccination_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\norder by vaccination_date, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-vaccine-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(vaccination_date, 'YYYY-MM-DD') as \"Vaccination date\",\n vaccine_category as \"Vaccine category\",\n vaccine_name as \"Vaccine name\",\n vaccine_brand as \"If category of Other, Vaccine brand\",\n disease as \"If category of Other, Disease\",\n vaccine_status as \"Vaccine status\",\n vaccine_schedule as \"Schedule\",\n batch as \"Batch\",\n given_by as \"Given by\",\n recorded_by as \"Recorded by\",\n circumstances as \"If given elsewhere, Circumstances\",\n given_elsewhere_by as \"If given elsewhere, Country\",\n not_given_clinician as \"If not given, Supervising clinician\",\n not_given_reason as \"If not given, Reason not given\"\nfrom \"app\".\"reporting\".\"ds__sensitive_vaccinations\"\nwhere\n vaccine_status in ('Given', 'Not Given')\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else vaccination_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else vaccination_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\norder by vaccination_date, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.admissions-line-list": {"database": "app", "schema": "reporting", "name": "admissions-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\admissions-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\admissions-line-list.sql", "unique_id": "model.tamanu_source_dbt.admissions-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "admissions-line-list"], "alias": "admissions-line-list", "checksum": {"name": "sha256", "checksum": "de9fe366e151f2894de1e8fa64401b03e5d61b90c25ebf45c6a00615c47e4e95"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.2573326, "relation_name": "\"app\".\"reporting\".\"admissions-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n admitting_clinician as \"{{ translate_label('admittingClinician') }}\",\r\n to_char(admission_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('admissionDateTime') }}\",\r\n admission_status as \"{{ translate_label('admissionStatus') }}\",\r\n to_char(discharge_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('dischargeDateTime') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n departments as \"{{ translate_label('encounterDepartmentHistory') }}\",\r\n department_datetimes as \"{{ translate_label('encounterDepartmentHistoryDateTimes') }}\",\r\n location_groups as \"{{ translate_label('encounterLocationGroupHistory') }}\",\r\n location_group_datetimes as \"{{ translate_label('encounterLocationGroupHistoryDateTimes') }}\",\r\n locations as \"{{ translate_label('encounterLocationHistory') }}\",\r\n location_datetimes as \"{{ translate_label('encounterLocationHistoryDateTimes') }}\",\r\n primary_diagnoses as \"{{ translate_label('diagnosesPrimary') }}\",\r\n secondary_diagnoses as \"{{ translate_label('diagnosesSecondary') }}\"\r\nfrom {{ ref('ds__admissions') }}\r\nwhere\r\n case when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else admission_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else admission_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case when {{ parameter('locationGroupId') }} is null then true\r\n else {{ parameter('locationGroupId') }} = any(location_group_ids::text [])\r\n end\r\n and case when {{ parameter('facilityId') }} is null then true\r\n else {{ parameter('facilityId') }} = facility_id\r\n end\r\n and case when {{ parameter('departmentId') }} is null then true\r\n else {{ parameter('departmentId') }} = any(department_ids::text [])\r\n end\r\n and case when {{ parameter('patientBillingTypeId') }} is null then true\r\n else billing_type_id like {{ parameter('patientBillingTypeId') }}\r\n end\r\n and case when {{ parameter('clinicianId') }} is null then true\r\n else admitting_clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and case when coalesce({{ parameter('admissionStatus') }}) is null then true\r\n else admission_status in ({{ parameter('admissionStatus') }})\r\n end\r\norder by admission_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__admissions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\admissions-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n billing_type as \"Billing type\",\n admitting_clinician as \"Admitting clinician\",\n to_char(admission_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Admission date and time\",\n admission_status as \"Admission status\",\n to_char(discharge_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Discharge date and time\",\n facility as \"Facility\",\n departments as \"Department history\",\n department_datetimes as \"Department history date and times\",\n location_groups as \"Area history\",\n location_group_datetimes as \"Area history date and times\",\n locations as \"Location history\",\n location_datetimes as \"Location history date and times\",\n primary_diagnoses as \"Primary diagnoses\",\n secondary_diagnoses as \"Secondary diagnoses\"\nfrom \"app\".\"reporting\".\"ds__admissions\"\nwhere\n case when nullif('2024-01-01', '')::date is null then true\n else admission_datetime >= nullif('2024-01-01', '')::date\n end\n and case when nullif('2024-01-31', '')::date is null then true\n else admission_datetime <= nullif('2024-01-31', '')::date\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = any(location_group_ids::text [])\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = facility_id\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = any(department_ids::text [])\n end\n and case when nullif('', '')::text is null then true\n else billing_type_id like nullif('', '')::text\n end\n and case when nullif('', '')::text is null then true\n else admitting_clinician_id = nullif('', '')::text\n end\n and case when coalesce(nullif('', '')::text) is null then true\n else admission_status in (nullif('', '')::text)\n end\norder by admission_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.audit-outpatient-appointments": {"database": "app", "schema": "reporting", "name": "audit-outpatient-appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\audit-outpatient-appointments.sql", "original_file_path": "models\\reports\\sql\\standard\\audit-outpatient-appointments.sql", "unique_id": "model.tamanu_source_dbt.audit-outpatient-appointments", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "audit-outpatient-appointments"], "alias": "audit-outpatient-appointments", "checksum": {"name": "sha256", "checksum": "998a8f58e2a4de09131545555e284a2fbe0ddcc1ec30eb2aac6c4c6e0013929f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.2675793, "relation_name": "\"app\".\"reporting\".\"audit-outpatient-appointments\"", "raw_code": "-- Outpatient Appointment Audit Report\r\n-- Shows all modifications and cancellations to outpatient appointments\r\n-- Each row represents a change event with both current and previous appointment details\r\n\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n -- Change event details\r\n change_number as \"{{ translate_label('auditChangeNumber') }}\",\r\n -- Current appointment details (at time of report)\r\n to_char(appointment_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentDateTime') }}\",\r\n appointment_type as \"{{ translate_label('appointmentType') }}\",\r\n clinician as \"{{ translate_label('appointmentClinician') }}\",\r\n location_group as \"{{ translate_label('appointmentLocationGroup') }}\",\r\n priority as \"{{ translate_label('appointmentPriority') }}\",\r\n is_repeating as \"{{ translate_label('appointmentIsRepeating') }}\",\r\n -- Modification details\r\n created_by as \"{{ translate_label('auditCreatedBy') }}\",\r\n modified_by as \"{{ translate_label('auditModifiedBy') }}\",\r\n to_char(modified_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('auditModifiedDateTime') }}\",\r\n is_cancelled as \"{{ translate_label('appointmentIsCancelled') }}\",\r\n -- Previous appointment details (prior to changes)\r\n to_char(prev_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('auditPrevAppointmentDateTime') }}\",\r\n prev_appointment_type as \"{{ translate_label('auditPrevAppointmentType') }}\",\r\n prev_clinician as \"{{ translate_label('auditPrevClinician') }}\",\r\n prev_location_group as \"{{ translate_label('auditPrevLocationGroup') }}\",\r\n prev_priority as \"{{ translate_label('auditPrevPriority') }}\"\r\nfrom {{ ref('ds__outpatient_appointments_audit') }}\r\nwhere\r\n -- Date range filter on appointment datetime\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else appointment_start_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else appointment_start_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n -- Facility filter\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by display_id, appointment_id, change_number", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__outpatient_appointments_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__outpatient_appointments_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\audit-outpatient-appointments.sql", "compiled": true, "compiled_code": "-- Outpatient Appointment Audit Report\n-- Shows all modifications and cancellations to outpatient appointments\n-- Each row represents a change event with both current and previous appointment details\n\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n -- Change event details\n change_number as \"Change number\",\n -- Current appointment details (at time of report)\n to_char(appointment_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment date and time\",\n appointment_type as \"Appointment type\",\n clinician as \"Clinician\",\n location_group as \"Area\",\n priority as \"Priority appointment\",\n is_repeating as \"Repeating appointment\",\n -- Modification details\n created_by as \"Appointment created by\",\n modified_by as \"Appointment modified by\",\n to_char(modified_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment modified date & time\",\n is_cancelled as \"Appointment cancelled\",\n -- Previous appointment details (prior to changes)\n to_char(prev_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Previous appointment date & time\",\n prev_appointment_type as \"Previous appointment type\",\n prev_clinician as \"Previous clinician\",\n prev_location_group as \"Previous area\",\n prev_priority as \"Previous priority appointment\"\nfrom \"app\".\"reporting\".\"ds__outpatient_appointments_audit\"\nwhere\n -- Date range filter on appointment datetime\n case\n when nullif('2025-01-01', '')::date is null then true\n else appointment_start_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else appointment_start_datetime <= nullif('2025-01-31', '')::date\n end\n -- Facility filter\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\norder by display_id, appointment_id, change_number", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.audit-patient-details-edit": {"database": "app", "schema": "reporting", "name": "audit-patient-details-edit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\audit-patient-details-edit.sql", "original_file_path": "models\\reports\\sql\\standard\\audit-patient-details-edit.sql", "unique_id": "model.tamanu_source_dbt.audit-patient-details-edit", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "audit-patient-details-edit"], "alias": "audit-patient-details-edit", "checksum": {"name": "sha256", "checksum": "245a800046fc5d89b6c85f982202bae54e5131fea335ba720e433aee712d28ba"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.2771258, "relation_name": "\"app\".\"reporting\".\"audit-patient-details-edit\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n edited_by_user as \"{{ translate_label('logChangeBy') }}\",\r\n user_email as \"{{ translate_label('userEmail') }}\",\r\n user_role as \"{{ translate_label('userRole') }}\",\r\n to_char(edited_datetime, '{{ var(\"datetime_without_seconds_format\") }}') as \"{{ translate_label('logChangeDateTime') }}\"\r\nfrom {{ ref('ds__patients_change_logs') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else edited_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else edited_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('patientId') }} is null then true\r\n else patient_id = {{ parameter('patientId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('userId') }} is null then true\r\n else edited_by_user = {{ parameter('userId') }}\r\n end\r\norder by edited_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients_change_logs", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients_change_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\audit-patient-details-edit.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n edited_by_user as \"Edited by user\",\n user_email as \"User email\",\n user_role as \"User role\",\n to_char(edited_datetime, 'YYYY-MM-DD HH24:MI') as \"Date and time edited\"\nfrom \"app\".\"reporting\".\"ds__patients_change_logs\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else edited_datetime >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else edited_datetime <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else patient_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else edited_by_user = nullif('', '')::text\n end\norder by edited_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.audit-patient-views": {"database": "app", "schema": "reporting", "name": "audit-patient-views", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\audit-patient-views.sql", "original_file_path": "models\\reports\\sql\\standard\\audit-patient-views.sql", "unique_id": "model.tamanu_source_dbt.audit-patient-views", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "audit-patient-views"], "alias": "audit-patient-views", "checksum": {"name": "sha256", "checksum": "dcb58c88b22fa205696f45b2ae749a3a790b4d39786607fd0bdaf88b7d15fad0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.2834835, "relation_name": "\"app\".\"reporting\".\"audit-patient-views\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n date_part('year', age(current_date, date_of_birth))::integer as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n viewed_by_user as \"{{ translate_label('logAccessBy') }}\",\r\n user_email as \"{{ translate_label('userEmail') }}\",\r\n user_role as \"{{ translate_label('userRole') }}\",\r\n viewed_at_facility as \"{{ translate_label('logAccessAtFacility') }}\",\r\n to_char(date_time_viewed, '{{ var(\"datetime_without_seconds_format\") }}') as \"{{ translate_label('logAccessDatetime') }}\"\r\nfrom {{ ref('ds__patients_access_logs') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else date_time_viewed >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else date_time_viewed <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('patientId') }} is null then true\r\n else patient_id = {{ parameter('patientId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('userId') }} is null then true\r\n else viewed_by_user_id = {{ parameter('userId') }}\r\n end\r\norder by date_time_viewed", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients_access_logs", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients_access_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\audit-patient-views.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(current_date, date_of_birth))::integer as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n viewed_by_user as \"Viewed by user\",\n user_email as \"User email\",\n user_role as \"User role\",\n viewed_at_facility as \"Viewed at facility\",\n to_char(date_time_viewed, 'YYYY-MM-DD HH24:MI') as \"Date and time viewed\"\nfrom \"app\".\"reporting\".\"ds__patients_access_logs\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else date_time_viewed >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else date_time_viewed <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else patient_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else viewed_by_user_id = nullif('', '')::text\n end\norder by date_time_viewed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.deceased-patients-line-list": {"database": "app", "schema": "reporting", "name": "deceased-patients-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\deceased-patients-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\deceased-patients-line-list.sql", "unique_id": "model.tamanu_source_dbt.deceased-patients-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "deceased-patients-line-list"], "alias": "deceased-patients-line-list", "checksum": {"name": "sha256", "checksum": "7acd05e86a130edc38303134452430a7f5e47ba856d4cc964fd49bb846c8879b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.2888656, "relation_name": "\"app\".\"reporting\".\"deceased-patients-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n place_of_death as \"{{ translate_label('deathPlaceOfDeath') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(date_of_death, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfDeath') }}\",\r\n attending_clinician as \"{{ translate_label('deathAttendingClinician') }}\",\r\n primary_cause_condition as \"{{ translate_label('deathPrimaryCause') }}\",\r\n time_between_onset_and_death as \"{{ translate_label('deathTimeBetweenOnsetAndDeath') }}\",\r\n antecedent_cause_1 as \"{{ translate_label('deathAntecedentCause1') }}\",\r\n antecedent_cause_2 as \"{{ translate_label('deathAntecedentCause2') }}\",\r\n other_condition_1 as \"{{ translate_label('deathOtherCondition1') }}\",\r\n other_condition_2 as \"{{ translate_label('deathOtherCondition2') }}\",\r\n other_condition_3 as \"{{ translate_label('deathOtherCondition3') }}\",\r\n other_condition_4 as \"{{ translate_label('deathOtherCondition4') }}\",\r\n had_recent_surgery as \"{{ translate_label('deathHadRecentSurgery') }}\",\r\n to_char(last_surgery_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('deathLastSurgeryDate') }}\",\r\n reason_for_surgery as \"{{ translate_label('deathReasonForSurgery') }}\",\r\n manner_of_death as \"{{ translate_label('deathMannerOfDeath') }}\",\r\n to_char(external_cause_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('deathExternalCauseDate') }}\",\r\n external_cause_location as \"{{ translate_label('deathExternalCauseLocation') }}\",\r\n was_pregnant as \"{{ translate_label('deathWasPregnant') }}\",\r\n pregnancy_contributed as \"{{ translate_label('deathPregnancyContributed') }}\",\r\n was_fetal_or_infant as \"{{ translate_label('deathWasFetalOrInfant') }}\",\r\n was_stillborn as \"{{ translate_label('deathWasStillborn') }}\",\r\n birth_weight as \"{{ translate_label('birthWeight') }}\",\r\n completed_weeks_of_pregnancy as \"{{ translate_label('deathCompletedWeeksOfPregnancy') }}\",\r\n age_of_mother as \"{{ translate_label('deathAgeOfMother') }}\",\r\n condition_in_mother_affecting_fetus_or_newborn as \"{{ translate_label('deathConditionInMother') }}\",\r\n death_within_day_of_birth as \"{{ translate_label('deathWithinDayOfBirth') }}\",\r\n hours_survived_since_birth as \"{{ translate_label('deathHoursSurvivedSinceBirth') }}\"\r\nfrom {{ ref('ds__deaths') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null\r\n then true\r\n else date_of_death >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null\r\n then true\r\n else date_of_death <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case\r\n when {{ parameter('causeOfDeath') }} is null\r\n then true\r\n else primary_cause_condition_id = {{ parameter('causeOfDeath') }}\r\n end\r\n and case\r\n when {{ parameter('mannerOfDeath') }} is null\r\n then true\r\n else manner_of_death = {{ parameter('mannerOfDeath') }}\r\n end\r\n and case\r\n when {{ parameter('facilityId') }} is null\r\n then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and case\r\n when {{ parameter('antecedentCause') }} is null\r\n then true\r\n else antecedent_cause_1_id = {{ parameter('antecedentCause') }}\r\n or antecedent_cause_2_id = {{ parameter('antecedentCause') }}\r\n end\r\n and case\r\n when {{ parameter('otherContributingCondition') }} is null\r\n then true\r\n else other_condition_1_id = {{ parameter('otherContributingCondition') }}\r\n or other_condition_2_id = {{ parameter('otherContributingCondition') }}\r\n or other_condition_3_id = {{ parameter('otherContributingCondition') }}\r\n or other_condition_4_id = {{ parameter('otherContributingCondition') }}\r\n end\r\norder by date_of_death", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__deaths", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__deaths"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\deceased-patients-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n nationality as \"Nationality\",\n place_of_death as \"Place of death\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(date_of_death, 'YYYY-MM-DD') as \"Date of death\",\n attending_clinician as \"Attending clinician\",\n primary_cause_condition as \"Primary cause of death\",\n time_between_onset_and_death as \"Time between onset and death\",\n antecedent_cause_1 as \"Antecedent cause 1\",\n antecedent_cause_2 as \"Antecedent cause 2\",\n other_condition_1 as \"Other condition 1\",\n other_condition_2 as \"Other condition 2\",\n other_condition_3 as \"Other condition 3\",\n other_condition_4 as \"Other condition 4\",\n had_recent_surgery as \"Had recent surgery\",\n to_char(last_surgery_date, 'YYYY-MM-DD') as \"Last surgery date\",\n reason_for_surgery as \"Reason for surgery\",\n manner_of_death as \"Manner of death\",\n to_char(external_cause_date, 'YYYY-MM-DD') as \"External cause date\",\n external_cause_location as \"External cause location\",\n was_pregnant as \"Was pregnant\",\n pregnancy_contributed as \"Pregnancy contributed\",\n was_fetal_or_infant as \"Was fetal or infant\",\n was_stillborn as \"Was stillborn\",\n birth_weight as \"Birth weight (kg)\",\n completed_weeks_of_pregnancy as \"Completed weeks of pregnancy\",\n age_of_mother as \"Age of mother\",\n condition_in_mother_affecting_fetus_or_newborn as \"Condition in mother affecting fetus or newborn\",\n death_within_day_of_birth as \"Death within day of birth\",\n hours_survived_since_birth as \"Hours survived since birth\"\nfrom \"app\".\"reporting\".\"ds__deaths\"\nwhere case\n when nullif('2024-01-01', '')::date is null\n then true\n else date_of_death >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null\n then true\n else date_of_death <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null\n then true\n else primary_cause_condition_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null\n then true\n else manner_of_death = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null\n then true\n else facility_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null\n then true\n else antecedent_cause_1_id = nullif('', '')::text\n or antecedent_cause_2_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null\n then true\n else other_condition_1_id = nullif('', '')::text\n or other_condition_2_id = nullif('', '')::text\n or other_condition_3_id = nullif('', '')::text\n or other_condition_4_id = nullif('', '')::text\n end\norder by date_of_death", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter-diets-line-list": {"database": "app", "schema": "reporting", "name": "encounter-diets-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\encounter-diets-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\encounter-diets-line-list.sql", "unique_id": "model.tamanu_source_dbt.encounter-diets-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "encounter-diets-line-list"], "alias": "encounter-diets-line-list", "checksum": {"name": "sha256", "checksum": "d68e6db140e33c17bc47a4ef83c9326563ca922303f33d79129829f5e3e732ad"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.303192, "relation_name": "\"app\".\"reporting\".\"encounter-diets-line-list\"", "raw_code": "select\r\n to_char(ed.start_datetime, '{{ var(\"date_format\") }}') as \"{{ translate_label('encounterStartDate') }}\",\r\n to_char(ed.start_datetime, '{{ var(\"time_format\") }}') as \"{{ translate_label('encounterStartTime') }}\",\r\n ed.display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n ed.patient_name as \"{{ translate_label('patientName') }}\",\r\n ed.age as \"{{ translate_label('patientAge') }}\",\r\n concat_ws(', ', ed.location_group, ed.location) as \"{{ translate_label('location') }}\",\r\n ed.diets as \"{{ translate_label('encounterDiet') }}\",\r\n ed.allergies as \"{{ translate_label('patientAllergies') }}\"\r\nfrom {{ ref('ds__encounter_diets') }} ed\r\nwhere\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else ed.location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else ed.start_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else ed.start_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by ed.location_group, ed.location, ed.patient_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__encounter_diets", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\encounter-diets-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(ed.start_datetime, 'YYYY-MM-DD') as \"Encounter start date\",\n to_char(ed.start_datetime, 'HH24:MI') as \"Encounter start time\",\n ed.display_id as \"Patient ID\",\n ed.patient_name as \"Patient name\",\n ed.age as \"Age\",\n concat_ws(', ', ed.location_group, ed.location) as \"Location\",\n ed.diets as \"Diet\",\n ed.allergies as \"Allergies\"\nfrom \"app\".\"reporting\".\"ds__encounter_diets\" ed\nwhere\n case\n when nullif('', '')::text is null then true\n else ed.location_group_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else ed.start_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else ed.start_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by ed.location_group, ed.location, ed.patient_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter-summary-by-end-date": {"database": "app", "schema": "reporting", "name": "encounter-summary-by-end-date", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\encounter-summary-by-end-date.sql", "original_file_path": "models\\reports\\sql\\standard\\encounter-summary-by-end-date.sql", "unique_id": "model.tamanu_source_dbt.encounter-summary-by-end-date", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "encounter-summary-by-end-date"], "alias": "encounter-summary-by-end-date", "checksum": {"name": "sha256", "checksum": "62df3860c57f0af9a6fcfe94516e4d11f7b6e2667ab79855d286761a5a99e8b7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.308942, "relation_name": "\"app\".\"reporting\".\"encounter-summary-by-end-date\"", "raw_code": "{{ encounter_summary_report('end_datetime', is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "procedures", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "invoices", "package": null, "version": null}, {"name": "invoice_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_summary_report"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\encounter-summary-by-end-date.sql", "compiled": true, "compiled_code": "\n\nwith encounters_in_scope as (\n select\n e.id as encounter_id,\n e.start_datetime,\n e.end_datetime,\n e.patient_id,\n e.location_id,\n e.department_id,\n e.clinician_id,\n e.patient_billing_type_id,\n e.reason_for_encounter,\n f.id as facility_id,\n f.name as facility\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\n where\n e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n \n and e.end_datetime is not null\n \n and case\n when nullif('2024-01-01', '')::date is null then true\n else e.end_datetime >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null then true\n else e.end_datetime <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null then true\n else f.id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.patient_billing_type_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.clinician_id = nullif('', '')::text\n end\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.updated_by_id,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n clinician.display_name as clinician_name,\n actor.display_name as updated_by_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n row_number() over (\n partition by eh.encounter_id, eh.change_type\n order by eh.datetime\n ) as change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from \"app\".\"reporting\".\"encounter_history\" eh\n join encounters_in_scope eis\n on eis.encounter_id = eh.encounter_id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = eh.clinician_id\n join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\nencounter_changes as (\n select\n encounter_id,\n \n -- Location changes: tracks all location changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\n\n -- Location group changes: tracks location group changes (only when group actually changes)\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\n\n -- Department changes: tracks all department changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\n\n -- Encounter type changes: tracks encounter type progression (emergency types)\n string_agg(\n case\n when encounter_type = 'triage' then 'Triage'\n when encounter_type = 'observation' then 'Active ED care'\n when encounter_type = 'emergency' then 'Emergency short stay'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\n\n -- Encounter type changes: tracks encounter type progression (inpatient types)\n string_agg(\n case\n when encounter_type = 'admission' then 'Hospital admission'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\n\n -- Encounter type changes: tracks encounter type progression (outpatient types)\n string_agg(\n case\n when encounter_type = 'clinic' then 'Clinic'\n when encounter_type = 'imaging' then 'Imaging'\n when encounter_type = 'surveyResponse' then 'Survey response'\n when encounter_type = 'vaccination' then 'Vaccination'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\n\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\n from encounter_history_consolidated\n group by encounter_id\n),\n\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n concat(\n 'Name: ', d.name,\n ', Code: ', d.code,\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\n ', Certainty: ', ed.certainty\n ),\n E'\\n'\n order by ed.is_primary desc, ed.datetime asc\n ) as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join encounters_in_scope eis\n on eis.encounter_id = ed.encounter_id\n join \"app\".\"reporting\".\"reference_data\" d\n on d.id = ed.diagnosis_id\n group by ed.encounter_id\n),\n\nencounter_prescriptions as (\n select\n ep.encounter_id,\n string_agg(\n concat(\n 'Name: ', m.name,\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\n ', Discontinuing reason: ', p.discontinuing_reason\n ),\n '' || E'\\n' || ''\n order by p.datetime\n ) as medications\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join encounters_in_scope eis\n on eis.encounter_id = ep.encounter_id\n join \"app\".\"reporting\".\"prescriptions\" p\n on p.id = ep.prescription_id\n join \"app\".\"reporting\".\"reference_data\" m\n on m.id = p.medication_id\n group by ep.encounter_id\n),\n\nencounter_vaccinations as (\n select\n av.encounter_id,\n string_agg(\n concat(\n v.name,\n ', Label: ', sv.label,\n ', Schedule: ', sv.dose_label\n ),\n E'\\n'\n order by av.datetime\n ) as vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" av\n join encounters_in_scope eis\n on eis.encounter_id = av.encounter_id\n join \"app\".\"reporting\".\"vaccine_schedules\" sv\n on sv.id = av.scheduled_vaccine_id\n join \"app\".\"reporting\".\"reference_data\" v\n on v.id = sv.vaccine_id\n group by av.encounter_id\n),\n\nencounter_procedures as (\n select\n p.encounter_id,\n string_agg(\n concat(\n 'Name: ', proc.name,\n ', Date: ', to_char(p.date, 'YYYY-MM-DD'),\n ', Location: ', loc.name,\n ', Notes: ', p.note,\n ', Completed notes: ', p.completed_note\n ),\n E'\\n'\n order by p.date\n ) as procedures\n from \"app\".\"reporting\".\"procedures\" p\n join encounters_in_scope eis\n on eis.encounter_id = p.encounter_id\n left join \"app\".\"reporting\".\"reference_data\" proc\n on proc.id = p.procedure_type_id\n left join \"app\".\"reporting\".\"locations\" loc\n on loc.id = p.location_id\n group by p.encounter_id\n),\n\nencounter_lab_requests as (\n select\n lr.encounter_id,\n string_agg(\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\n order by lr.collected_datetime\n ) as lab_requests\n from \"app\".\"reporting\".\"lab_requests\" lr\n join encounters_in_scope eis\n on eis.encounter_id = lr.encounter_id\n left join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\n left join \"app\".\"reporting\".\"lab_test_panels\" ltp\n on ltp.id = ltpr.lab_test_panel_id\n left join \"app\".\"reporting\".\"lab_tests\" lt\n on lt.lab_request_id = lr.id\n and lr.lab_test_panel_request_id isnull\n left join \"app\".\"reporting\".\"lab_test_types\" ltt\n on ltt.id = lt.lab_test_type_id\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\n group by lr.encounter_id\n),\n\nnotes_raw as (\n select\n n.id,\n n.datetime,\n n.content,\n n.note_type_id,\n n.note_type,\n n.record_type,\n n.record_id,\n n.updated_note_id,\n n.visibility_status\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"imaging_requests\" ir\n on n.record_type = 'ImagingRequest'\n and ir.id = n.record_id\n join encounters_in_scope eis\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\n where n.record_type in ('Encounter', 'ImagingRequest')\n),\n\nencounter_notes_deduped as (\n select\n id,\n datetime,\n content,\n note_type,\n record_id,\n visibility_status,\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\n from notes_raw\n where\n record_type = 'Encounter'\n and note_type_id != 'notetype-system'\n),\n\nimaging_request_areas as (\n select\n ir.encounter_id,\n ira.imaging_request_id,\n case\n when ir.imaging_type = 'xRay' then 'X-Ray'\n when ir.imaging_type = 'ctScan' then 'CT Scan'\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\n when ir.imaging_type = 'mri' then 'MRI'\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\n when ir.imaging_type = 'mammogram' then 'Mammogram'\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\n when ir.imaging_type = 'angiogram' then 'Angiogram'\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\n when ir.imaging_type = 'stressTest' then 'Stress Test'\n else ir.imaging_type\n end as imaging_type,\n coalesce(\n string_agg(\n area.name, ', '\n order by area.name\n ),\n string_agg(case\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\n end, ', '\n order by n.datetime)\n ) as areas_to_be_imaged,\n string_agg(case\n when n.note_type_id = 'notetype-other' then n.content\n end, ','\n order by n.datetime) as notes\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join encounters_in_scope eis\n on eis.encounter_id = ir.encounter_id\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira\n on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" area\n on area.id = ira.area_id\n left join notes_raw n\n on n.record_id = ir.id\n and n.record_type = 'ImagingRequest'\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\n),\n\nencounter_imaging_requests as (\n select\n encounter_id,\n string_agg(\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\n ) as imaging_requests\n from imaging_request_areas\n group by encounter_id\n),\n\nencounter_notes as (\n select\n n.record_id as encounter_id,\n string_agg(concat(\n 'Note type: ',\n n.note_type,\n ', Content: ', n.content,\n ', Note date: ', to_char(n.datetime, 'YYYY-MM-DD HH24:MI:SS')\n ),\n E'\\n'\n order by n.datetime) as notes\n from encounter_notes_deduped n\n where n.row_number = 1\n group by n.record_id\n),\n\ninvoice_data as (\n select\n i.encounter_id,\n max(\n case\n when i.status = 'finalised'\n then to_char(i.datetime, 'YYYY-MM-DD HH24:MI:SS')\n end\n ) as invoice_finalised_datetime,\n string_agg(distinct ip.category, ', ') as invoice_product_categories\n from \"app\".\"reporting\".\"invoices\" i\n join encounters_in_scope eis\n on eis.encounter_id = i.encounter_id\n left join \"app\".\"reporting\".\"invoice_items\" ii\n on ii.invoice_id = i.id\n left join \"app\".\"reporting\".\"invoice_products\" ip\n on ip.id = ii.product_id\n group by i.encounter_id\n)\n\nselect\n p.display_id as \"Patient ID\",\n p.first_name as \"First name\",\n p.last_name as \"Last name\",\n to_char(p.date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"Age\",\n p.sex as \"Sex\",\n eth.name as \"Ethnicity\",\n bt.name as \"Billing type\",\n to_char(eis.start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(eis.end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n case\n when eis.end_datetime is not null then\n case\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\n else eis.end_datetime::date - eis.start_datetime::date\n end\n end as \"Length of stay (days)\",\n eis.facility as \"Facility\",\n ec.encounter_type_emergency as \"Emergency encounter type\",\n ec.encounter_type_inpatient as \"Inpatient encounter type\",\n ec.encounter_type_outpatient as \"Outpatient encounter type\",\n dd.name as \"Discharge disposition\",\n t.score as \"Triage category\",\n am.name as \"Arrival mode\",\n case\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\n then concat(\n lpad((\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\n + extract(hour from (t.closed_datetime - t.triage_datetime))\n )::text, 2, '0'), ':',\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\n lpad(\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\n )\n )\n end as \"Time seen following triage/Waiting time (hh:mm:ss)\",\n ec.encountering_clinician as \"Clinician\",\n c.display_name as \"Supervising clinician\",\n dp.name as \"Discharging department\",\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"Discharge date and time of Discharging department\",\n lg.name as \"Discharging area\",\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"Discharge date and time of Discharging area\",\n l.name as \"Discharging location\",\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"Discharge date and time of Discharging location\",\n ec.departments as \"Department history\",\n array_to_string(ec.department_datetimes, ', ') as \"Department history date and times\",\n ec.location_groups as \"Area history\",\n array_to_string(ec.location_group_datetimes, ', ') as \"Area history date and times\",\n ec.locations as \"Location history\",\n array_to_string(ec.location_datetimes, ', ') as \"Location history date and times\",\n eis.reason_for_encounter as \"Reason for encounter\",\n ed.diagnoses as \"Diagnoses\",\n ep.medications as \"Medications\",\n ev.vaccinations as \"Vaccinations\",\n epr.procedures as \"Procedures\",\n elr.lab_requests as \"Lab requests\",\n eir.imaging_requests as \"Imaging requests\",\n case\n when length(en.notes) > 32000\n then concat(\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\n )\n else en.notes\n end as \"Notes\",\n invd.invoice_finalised_datetime as \"invoiceFinalisedDateTime\",\n invd.invoice_product_categories as \"invoiceProductCategories\"\nfrom encounters_in_scope eis\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = eis.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = eis.location_id\njoin \"app\".\"reporting\".\"departments\" dp\n on dp.id = eis.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"users\" c\n on c.id = eis.clinician_id\njoin encounter_changes ec\n on ec.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"triages\" t\n on t.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"discharges\" d\n on d.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = eis.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" eth\n on eth.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = eis.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" am\n on am.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" dd\n on dd.id = d.disposition_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = eis.encounter_id\nleft join encounter_prescriptions ep\n on ep.encounter_id = eis.encounter_id\nleft join encounter_vaccinations ev\n on ev.encounter_id = eis.encounter_id\nleft join encounter_procedures epr\n on epr.encounter_id = eis.encounter_id\nleft join encounter_lab_requests elr\n on elr.encounter_id = eis.encounter_id\nleft join encounter_imaging_requests eir\n on eir.encounter_id = eis.encounter_id\nleft join encounter_notes en\n on en.encounter_id = eis.encounter_id\nleft join invoice_data invd\n on invd.encounter_id = eis.encounter_id\nwhere\n case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.department_ids::text [])\n end\n and case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.location_group_ids::text [])\n end\norder by eis.end_datetime desc\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter-summary-by-start-date": {"database": "app", "schema": "reporting", "name": "encounter-summary-by-start-date", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\encounter-summary-by-start-date.sql", "original_file_path": "models\\reports\\sql\\standard\\encounter-summary-by-start-date.sql", "unique_id": "model.tamanu_source_dbt.encounter-summary-by-start-date", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "encounter-summary-by-start-date"], "alias": "encounter-summary-by-start-date", "checksum": {"name": "sha256", "checksum": "8f429a30934541abdecb33b990326850c2b773b877d4d92d7f423d6c2464644d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.3149571, "relation_name": "\"app\".\"reporting\".\"encounter-summary-by-start-date\"", "raw_code": "{{ encounter_summary_report('start_datetime', is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "procedures", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "invoices", "package": null, "version": null}, {"name": "invoice_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_summary_report"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\encounter-summary-by-start-date.sql", "compiled": true, "compiled_code": "\n\nwith encounters_in_scope as (\n select\n e.id as encounter_id,\n e.start_datetime,\n e.end_datetime,\n e.patient_id,\n e.location_id,\n e.department_id,\n e.clinician_id,\n e.patient_billing_type_id,\n e.reason_for_encounter,\n f.id as facility_id,\n f.name as facility\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\n where\n e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n \n and case\n when nullif('2024-01-01', '')::date is null then true\n else e.start_datetime >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null then true\n else e.start_datetime <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null then true\n else f.id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.patient_billing_type_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.clinician_id = nullif('', '')::text\n end\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.updated_by_id,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n clinician.display_name as clinician_name,\n actor.display_name as updated_by_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n row_number() over (\n partition by eh.encounter_id, eh.change_type\n order by eh.datetime\n ) as change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from \"app\".\"reporting\".\"encounter_history\" eh\n join encounters_in_scope eis\n on eis.encounter_id = eh.encounter_id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = eh.clinician_id\n join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\nencounter_changes as (\n select\n encounter_id,\n \n -- Location changes: tracks all location changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\n\n -- Location group changes: tracks location group changes (only when group actually changes)\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\n\n -- Department changes: tracks all department changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\n\n -- Encounter type changes: tracks encounter type progression (emergency types)\n string_agg(\n case\n when encounter_type = 'triage' then 'Triage'\n when encounter_type = 'observation' then 'Active ED care'\n when encounter_type = 'emergency' then 'Emergency short stay'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\n\n -- Encounter type changes: tracks encounter type progression (inpatient types)\n string_agg(\n case\n when encounter_type = 'admission' then 'Hospital admission'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\n\n -- Encounter type changes: tracks encounter type progression (outpatient types)\n string_agg(\n case\n when encounter_type = 'clinic' then 'Clinic'\n when encounter_type = 'imaging' then 'Imaging'\n when encounter_type = 'surveyResponse' then 'Survey response'\n when encounter_type = 'vaccination' then 'Vaccination'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\n\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\n from encounter_history_consolidated\n group by encounter_id\n),\n\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n concat(\n 'Name: ', d.name,\n ', Code: ', d.code,\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\n ', Certainty: ', ed.certainty\n ),\n E'\\n'\n order by ed.is_primary desc, ed.datetime asc\n ) as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join encounters_in_scope eis\n on eis.encounter_id = ed.encounter_id\n join \"app\".\"reporting\".\"reference_data\" d\n on d.id = ed.diagnosis_id\n group by ed.encounter_id\n),\n\nencounter_prescriptions as (\n select\n ep.encounter_id,\n string_agg(\n concat(\n 'Name: ', m.name,\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\n ', Discontinuing reason: ', p.discontinuing_reason\n ),\n '' || E'\\n' || ''\n order by p.datetime\n ) as medications\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join encounters_in_scope eis\n on eis.encounter_id = ep.encounter_id\n join \"app\".\"reporting\".\"prescriptions\" p\n on p.id = ep.prescription_id\n join \"app\".\"reporting\".\"reference_data\" m\n on m.id = p.medication_id\n group by ep.encounter_id\n),\n\nencounter_vaccinations as (\n select\n av.encounter_id,\n string_agg(\n concat(\n v.name,\n ', Label: ', sv.label,\n ', Schedule: ', sv.dose_label\n ),\n E'\\n'\n order by av.datetime\n ) as vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" av\n join encounters_in_scope eis\n on eis.encounter_id = av.encounter_id\n join \"app\".\"reporting\".\"vaccine_schedules\" sv\n on sv.id = av.scheduled_vaccine_id\n join \"app\".\"reporting\".\"reference_data\" v\n on v.id = sv.vaccine_id\n group by av.encounter_id\n),\n\nencounter_procedures as (\n select\n p.encounter_id,\n string_agg(\n concat(\n 'Name: ', proc.name,\n ', Date: ', to_char(p.date, 'YYYY-MM-DD'),\n ', Location: ', loc.name,\n ', Notes: ', p.note,\n ', Completed notes: ', p.completed_note\n ),\n E'\\n'\n order by p.date\n ) as procedures\n from \"app\".\"reporting\".\"procedures\" p\n join encounters_in_scope eis\n on eis.encounter_id = p.encounter_id\n left join \"app\".\"reporting\".\"reference_data\" proc\n on proc.id = p.procedure_type_id\n left join \"app\".\"reporting\".\"locations\" loc\n on loc.id = p.location_id\n group by p.encounter_id\n),\n\nencounter_lab_requests as (\n select\n lr.encounter_id,\n string_agg(\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\n order by lr.collected_datetime\n ) as lab_requests\n from \"app\".\"reporting\".\"lab_requests\" lr\n join encounters_in_scope eis\n on eis.encounter_id = lr.encounter_id\n left join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\n left join \"app\".\"reporting\".\"lab_test_panels\" ltp\n on ltp.id = ltpr.lab_test_panel_id\n left join \"app\".\"reporting\".\"lab_tests\" lt\n on lt.lab_request_id = lr.id\n and lr.lab_test_panel_request_id isnull\n left join \"app\".\"reporting\".\"lab_test_types\" ltt\n on ltt.id = lt.lab_test_type_id\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\n group by lr.encounter_id\n),\n\nnotes_raw as (\n select\n n.id,\n n.datetime,\n n.content,\n n.note_type_id,\n n.note_type,\n n.record_type,\n n.record_id,\n n.updated_note_id,\n n.visibility_status\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"imaging_requests\" ir\n on n.record_type = 'ImagingRequest'\n and ir.id = n.record_id\n join encounters_in_scope eis\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\n where n.record_type in ('Encounter', 'ImagingRequest')\n),\n\nencounter_notes_deduped as (\n select\n id,\n datetime,\n content,\n note_type,\n record_id,\n visibility_status,\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\n from notes_raw\n where\n record_type = 'Encounter'\n and note_type_id != 'notetype-system'\n),\n\nimaging_request_areas as (\n select\n ir.encounter_id,\n ira.imaging_request_id,\n case\n when ir.imaging_type = 'xRay' then 'X-Ray'\n when ir.imaging_type = 'ctScan' then 'CT Scan'\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\n when ir.imaging_type = 'mri' then 'MRI'\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\n when ir.imaging_type = 'mammogram' then 'Mammogram'\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\n when ir.imaging_type = 'angiogram' then 'Angiogram'\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\n when ir.imaging_type = 'stressTest' then 'Stress Test'\n else ir.imaging_type\n end as imaging_type,\n coalesce(\n string_agg(\n area.name, ', '\n order by area.name\n ),\n string_agg(case\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\n end, ', '\n order by n.datetime)\n ) as areas_to_be_imaged,\n string_agg(case\n when n.note_type_id = 'notetype-other' then n.content\n end, ','\n order by n.datetime) as notes\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join encounters_in_scope eis\n on eis.encounter_id = ir.encounter_id\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira\n on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" area\n on area.id = ira.area_id\n left join notes_raw n\n on n.record_id = ir.id\n and n.record_type = 'ImagingRequest'\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\n),\n\nencounter_imaging_requests as (\n select\n encounter_id,\n string_agg(\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\n ) as imaging_requests\n from imaging_request_areas\n group by encounter_id\n),\n\nencounter_notes as (\n select\n n.record_id as encounter_id,\n string_agg(concat(\n 'Note type: ',\n n.note_type,\n ', Content: ', n.content,\n ', Note date: ', to_char(n.datetime, 'YYYY-MM-DD HH24:MI:SS')\n ),\n E'\\n'\n order by n.datetime) as notes\n from encounter_notes_deduped n\n where n.row_number = 1\n group by n.record_id\n),\n\ninvoice_data as (\n select\n i.encounter_id,\n max(\n case\n when i.status = 'finalised'\n then to_char(i.datetime, 'YYYY-MM-DD HH24:MI:SS')\n end\n ) as invoice_finalised_datetime,\n string_agg(distinct ip.category, ', ') as invoice_product_categories\n from \"app\".\"reporting\".\"invoices\" i\n join encounters_in_scope eis\n on eis.encounter_id = i.encounter_id\n left join \"app\".\"reporting\".\"invoice_items\" ii\n on ii.invoice_id = i.id\n left join \"app\".\"reporting\".\"invoice_products\" ip\n on ip.id = ii.product_id\n group by i.encounter_id\n)\n\nselect\n p.display_id as \"Patient ID\",\n p.first_name as \"First name\",\n p.last_name as \"Last name\",\n to_char(p.date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"Age\",\n p.sex as \"Sex\",\n eth.name as \"Ethnicity\",\n bt.name as \"Billing type\",\n to_char(eis.start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(eis.end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n case\n when eis.end_datetime is not null then\n case\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\n else eis.end_datetime::date - eis.start_datetime::date\n end\n end as \"Length of stay (days)\",\n eis.facility as \"Facility\",\n ec.encounter_type_emergency as \"Emergency encounter type\",\n ec.encounter_type_inpatient as \"Inpatient encounter type\",\n ec.encounter_type_outpatient as \"Outpatient encounter type\",\n dd.name as \"Discharge disposition\",\n t.score as \"Triage category\",\n am.name as \"Arrival mode\",\n case\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\n then concat(\n lpad((\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\n + extract(hour from (t.closed_datetime - t.triage_datetime))\n )::text, 2, '0'), ':',\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\n lpad(\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\n )\n )\n end as \"Time seen following triage/Waiting time (hh:mm:ss)\",\n ec.encountering_clinician as \"Clinician\",\n c.display_name as \"Supervising clinician\",\n dp.name as \"Discharging department\",\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"Discharge date and time of Discharging department\",\n lg.name as \"Discharging area\",\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"Discharge date and time of Discharging area\",\n l.name as \"Discharging location\",\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"Discharge date and time of Discharging location\",\n ec.departments as \"Department history\",\n array_to_string(ec.department_datetimes, ', ') as \"Department history date and times\",\n ec.location_groups as \"Area history\",\n array_to_string(ec.location_group_datetimes, ', ') as \"Area history date and times\",\n ec.locations as \"Location history\",\n array_to_string(ec.location_datetimes, ', ') as \"Location history date and times\",\n eis.reason_for_encounter as \"Reason for encounter\",\n ed.diagnoses as \"Diagnoses\",\n ep.medications as \"Medications\",\n ev.vaccinations as \"Vaccinations\",\n epr.procedures as \"Procedures\",\n elr.lab_requests as \"Lab requests\",\n eir.imaging_requests as \"Imaging requests\",\n case\n when length(en.notes) > 32000\n then concat(\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\n )\n else en.notes\n end as \"Notes\",\n invd.invoice_finalised_datetime as \"invoiceFinalisedDateTime\",\n invd.invoice_product_categories as \"invoiceProductCategories\"\nfrom encounters_in_scope eis\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = eis.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = eis.location_id\njoin \"app\".\"reporting\".\"departments\" dp\n on dp.id = eis.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"users\" c\n on c.id = eis.clinician_id\njoin encounter_changes ec\n on ec.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"triages\" t\n on t.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"discharges\" d\n on d.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = eis.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" eth\n on eth.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = eis.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" am\n on am.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" dd\n on dd.id = d.disposition_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = eis.encounter_id\nleft join encounter_prescriptions ep\n on ep.encounter_id = eis.encounter_id\nleft join encounter_vaccinations ev\n on ev.encounter_id = eis.encounter_id\nleft join encounter_procedures epr\n on epr.encounter_id = eis.encounter_id\nleft join encounter_lab_requests elr\n on elr.encounter_id = eis.encounter_id\nleft join encounter_imaging_requests eir\n on eir.encounter_id = eis.encounter_id\nleft join encounter_notes en\n on en.encounter_id = eis.encounter_id\nleft join invoice_data invd\n on invd.encounter_id = eis.encounter_id\nwhere\n case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.department_ids::text [])\n end\n and case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.location_group_ids::text [])\n end\norder by eis.start_datetime desc\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.hospital-admissions-by-area-summary": {"database": "app", "schema": "reporting", "name": "hospital-admissions-by-area-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\hospital-admissions-by-area-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\hospital-admissions-by-area-summary.sql", "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-area-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "hospital-admissions-by-area-summary"], "alias": "hospital-admissions-by-area-summary", "checksum": {"name": "sha256", "checksum": "743a7e78daf2773b27026299101bbb5a750753d4901a09a0f5c7bc8a94e8358f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.3227212, "relation_name": "\"app\".\"reporting\".\"hospital-admissions-by-area-summary\"", "raw_code": "with reporting_months as (\r\n select month::date\r\n from generate_series(\r\n concat(left( {{ parameter('fromDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n concat(left( {{ parameter('toDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n '1 month'::interval\r\n ) month\r\n),\r\n\r\narea_capacity as (\r\n select\r\n l.location_group_id,\r\n sum(l.max_occupancy::numeric) as capacity\r\n from {{ ref('locations') }} l\r\n group by l.location_group_id\r\n),\r\n\r\narea_summary as (\r\n select\r\n rm.month,\r\n alh.facility_id,\r\n alh.facility,\r\n alh.location_group_id,\r\n alh.location_group,\r\n lg.capacity,\r\n sum(\r\n case when alh.end_datetime::date = alh.start_datetime::date then 1 else\r\n (least(\r\n coalesce(alh.end_datetime, current_date)::date,\r\n (rm.month + '1 month'::interval)::date\r\n ) - greatest(alh.start_datetime::date, rm.month))\r\n end\r\n )::numeric as occupancy,\r\n count(*) filter (where alh.admission and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as admissions,\r\n count(*) filter (where alh.discharge and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as discharges,\r\n count(*) filter (where alh.death and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as deaths,\r\n count(*) filter (where alh.transfer_in and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_ins,\r\n count(*) filter (where alh.transfer_out and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_outs,\r\n round(avg(alh.length_of_stay) filter (where alh.end_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)), 1) as avg_length_of_stay\r\n from reporting_months rm\r\n join {{ ref('int__admission_history_location') }} alh\r\n on alh.start_datetime::date <= (rm.month + '1 month'::interval - '1 day'::interval)\r\n and (alh.end_datetime::date is null or alh.end_datetime::date >= rm.month)\r\n join area_capacity lg on lg.location_group_id = alh.location_group_id\r\n where rm.month <= current_date\r\n group by\r\n rm.month,\r\n alh.facility_id,\r\n alh.facility,\r\n alh.location_group_id,\r\n alh.location_group,\r\n lg.capacity\r\n)\r\n\r\nselect\r\n to_char(lg.month, '{{ var(\"yearmonth_format\") }}') as \"{{ translate_label('reportingMonth') }}\",\r\n lg.facility as \"{{ translate_label('facility') }}\",\r\n lg.location_group as \"{{ translate_label('locationGroup') }}\",\r\n coalesce(lg.admissions, 0) as \"{{ translate_label('hospitalAdmissionCount') }}\",\r\n coalesce(lg.discharges, 0) as \"{{ translate_label('hospitalDischargeCount') }}\",\r\n coalesce(lg.deaths, 0) as \"{{ translate_label('hospitalDeathCount') }}\",\r\n coalesce(lg.transfer_ins, 0) as \"{{ translate_label('hospitalTransfersIntoLocationCount') }}\",\r\n coalesce(lg.transfer_outs, 0) as \"{{ translate_label('hospitalTransfersOutOfLocationCount') }}\",\r\n coalesce(lg.avg_length_of_stay, 0) as \"{{ translate_label('hospitalAverageLengthOfStay') }}\",\r\n coalesce(lg.occupancy, 0) as \"{{ translate_label('hospitalPatientDayCount') }}\",\r\n case\r\n when lg.occupancy notnull and lg.capacity notnull\r\n then\r\n concat(\r\n round(\r\n lg.occupancy / (\r\n lg.capacity * case\r\n when lg.month > (current_date - '1 month'::interval)\r\n then (current_date - lg.month) + 1\r\n else (lg.month + '1 month'::interval)::date - lg.month\r\n end\r\n ) * 100, 1\r\n )::text, '%'\r\n )\r\n else 'N/A'\r\n end as \"{{ translate_label('hospitalBedOccupancyPercent') }}\"\r\nfrom area_summary lg\r\nwhere\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else lg.location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\norder by lg.month, lg.facility, lg.location_group", "doc_blocks": [], "language": "sql", "refs": [{"name": "locations", "package": null, "version": null}, {"name": "int__admission_history_location", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.int__admission_history_location"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\hospital-admissions-by-area-summary.sql", "compiled": true, "compiled_code": "with __dbt__cte__int__admission_history_location as (\nwith admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)\n), reporting_months as (\n select month::date\n from generate_series(\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n '1 month'::interval\n ) month\n),\n\narea_capacity as (\n select\n l.location_group_id,\n sum(l.max_occupancy::numeric) as capacity\n from \"app\".\"reporting\".\"locations\" l\n group by l.location_group_id\n),\n\narea_summary as (\n select\n rm.month,\n alh.facility_id,\n alh.facility,\n alh.location_group_id,\n alh.location_group,\n lg.capacity,\n sum(\n case when alh.end_datetime::date = alh.start_datetime::date then 1 else\n (least(\n coalesce(alh.end_datetime, current_date)::date,\n (rm.month + '1 month'::interval)::date\n ) - greatest(alh.start_datetime::date, rm.month))\n end\n )::numeric as occupancy,\n count(*) filter (where alh.admission and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as admissions,\n count(*) filter (where alh.discharge and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as discharges,\n count(*) filter (where alh.death and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as deaths,\n count(*) filter (where alh.transfer_in and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_ins,\n count(*) filter (where alh.transfer_out and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_outs,\n round(avg(alh.length_of_stay) filter (where alh.end_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)), 1) as avg_length_of_stay\n from reporting_months rm\n join __dbt__cte__int__admission_history_location alh\n on alh.start_datetime::date <= (rm.month + '1 month'::interval - '1 day'::interval)\n and (alh.end_datetime::date is null or alh.end_datetime::date >= rm.month)\n join area_capacity lg on lg.location_group_id = alh.location_group_id\n where rm.month <= current_date\n group by\n rm.month,\n alh.facility_id,\n alh.facility,\n alh.location_group_id,\n alh.location_group,\n lg.capacity\n)\n\nselect\n to_char(lg.month, 'YYYY-MM') as \"Month\",\n lg.facility as \"Facility\",\n lg.location_group as \"Area\",\n coalesce(lg.admissions, 0) as \"Number of admissions\",\n coalesce(lg.discharges, 0) as \"Number of discharges\",\n coalesce(lg.deaths, 0) as \"Number of deaths\",\n coalesce(lg.transfer_ins, 0) as \"Number of transfers into location\",\n coalesce(lg.transfer_outs, 0) as \"Number of transfers out of location\",\n coalesce(lg.avg_length_of_stay, 0) as \"Average length of stay\",\n coalesce(lg.occupancy, 0) as \"Number of patient days\",\n case\n when lg.occupancy notnull and lg.capacity notnull\n then\n concat(\n round(\n lg.occupancy / (\n lg.capacity * case\n when lg.month > (current_date - '1 month'::interval)\n then (current_date - lg.month) + 1\n else (lg.month + '1 month'::interval)::date - lg.month\n end\n ) * 100, 1\n )::text, '%'\n )\n else 'N/A'\n end as \"Bed occupancy (%)\"\nfrom area_summary lg\nwhere\n case\n when nullif('', '')::text is null then true\n else lg.location_group_id = nullif('', '')::text\n end\norder by lg.month, lg.facility, lg.location_group", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.tamanu_source_dbt.int__admission_history_location", "sql": " __dbt__cte__int__admission_history_location as (\nwith admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.hospital-admissions-by-department-summary": {"database": "app", "schema": "reporting", "name": "hospital-admissions-by-department-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\hospital-admissions-by-department-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\hospital-admissions-by-department-summary.sql", "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-department-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "hospital-admissions-by-department-summary"], "alias": "hospital-admissions-by-department-summary", "checksum": {"name": "sha256", "checksum": "feff1ba4b1606da0bdb6941b7cd83c56f3db431befbd002e002f772443eb3ae1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.327862, "relation_name": "\"app\".\"reporting\".\"hospital-admissions-by-department-summary\"", "raw_code": "with reporting_months as (\r\n select month::date\r\n from generate_series(\r\n concat(left( {{ parameter('fromDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n concat(left( {{ parameter('toDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n '1 month'::interval\r\n ) month\r\n)\r\n\r\nselect\r\n to_char(rm.month, '{{ var(\"yearmonth_format\") }}') as \"{{ translate_label('reportingMonth') }}\",\r\n adh.facility as \"{{ translate_label('facility') }}\",\r\n adh.department as \"{{ translate_label('department') }}\",\r\n count(*) filter (where adh.admission) as \"{{ translate_label('hospitalAdmissionCount') }}\",\r\n count(*) filter (where adh.discharge) as \"{{ translate_label('hospitalDischargeCount') }}\",\r\n count(*) filter (where adh.death) as \"{{ translate_label('hospitalDeathCount') }}\",\r\n count(*) filter (where adh.transfer_in) as \"{{ translate_label('hospitalTransfersIntoDepartmentCount') }}\",\r\n count(*) filter (where adh.transfer_out) as \"{{ translate_label('hospitalTransfersOutOfDepartmentCount') }}\",\r\n round(avg(adh.length_of_stay), 1) as \"{{ translate_label('hospitalAverageLengthOfStay') }}\"\r\nfrom reporting_months rm\r\nleft join {{ ref('int__admission_history_department') }} adh\r\n on adh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)\r\nwhere adh.facility_id notnull\r\n and case\r\n when {{ parameter('departmentId') }} is null then true\r\n else adh.department_id = {{ parameter('departmentId') }}\r\n end\r\ngroup by\r\n rm.month,\r\n adh.facility_id,\r\n adh.facility,\r\n adh.department_id,\r\n adh.department\r\norder by rm.month, adh.facility, adh.department", "doc_blocks": [], "language": "sql", "refs": [{"name": "int__admission_history_department", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.int__admission_history_department"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\hospital-admissions-by-department-summary.sql", "compiled": true, "compiled_code": "with __dbt__cte__int__admission_history_department as (\nwith admission_department_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.department_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['department', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n dl.encounter_id,\n dl.department_id,\n d.name as department,\n d.facility_id,\n f.name as facility,\n dl.start_datetime,\n coalesce(lead(dl.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date < 1 then 1\n else coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date\n end as length_of_stay,\n coalesce(dl.type = 'admission', false) as admission,\n coalesce(lead(dl.department_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(dl.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(dl.department_id) over w notnull, false) as transfer_out,\n coalesce(lead(dl.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_department_log dl\njoin \"app\".\"reporting\".\"encounters\" e on e.id = dl.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = dl.department_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nwindow w as (\n partition by encounter_id\n order by dl.start_datetime\n)\n), reporting_months as (\n select month::date\n from generate_series(\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n '1 month'::interval\n ) month\n)\n\nselect\n to_char(rm.month, 'YYYY-MM') as \"Month\",\n adh.facility as \"Facility\",\n adh.department as \"Department\",\n count(*) filter (where adh.admission) as \"Number of admissions\",\n count(*) filter (where adh.discharge) as \"Number of discharges\",\n count(*) filter (where adh.death) as \"Number of deaths\",\n count(*) filter (where adh.transfer_in) as \"Number of transfers into department\",\n count(*) filter (where adh.transfer_out) as \"Number of transfers out of department\",\n round(avg(adh.length_of_stay), 1) as \"Average length of stay\"\nfrom reporting_months rm\nleft join __dbt__cte__int__admission_history_department adh\n on adh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)\nwhere adh.facility_id notnull\n and case\n when nullif('', '')::text is null then true\n else adh.department_id = nullif('', '')::text\n end\ngroup by\n rm.month,\n adh.facility_id,\n adh.facility,\n adh.department_id,\n adh.department\norder by rm.month, adh.facility, adh.department", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.tamanu_source_dbt.int__admission_history_department", "sql": " __dbt__cte__int__admission_history_department as (\nwith admission_department_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.department_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['department', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n dl.encounter_id,\n dl.department_id,\n d.name as department,\n d.facility_id,\n f.name as facility,\n dl.start_datetime,\n coalesce(lead(dl.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date < 1 then 1\n else coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date\n end as length_of_stay,\n coalesce(dl.type = 'admission', false) as admission,\n coalesce(lead(dl.department_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(dl.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(dl.department_id) over w notnull, false) as transfer_out,\n coalesce(lead(dl.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_department_log dl\njoin \"app\".\"reporting\".\"encounters\" e on e.id = dl.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = dl.department_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nwindow w as (\n partition by encounter_id\n order by dl.start_datetime\n)\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.hospital-admissions-by-location-summary": {"database": "app", "schema": "reporting", "name": "hospital-admissions-by-location-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\hospital-admissions-by-location-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\hospital-admissions-by-location-summary.sql", "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-location-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "hospital-admissions-by-location-summary"], "alias": "hospital-admissions-by-location-summary", "checksum": {"name": "sha256", "checksum": "76ad413de516863e71534fa55cdaf4605eeb08ee4247aca23cde66a1ecdcc5cc"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.333646, "relation_name": "\"app\".\"reporting\".\"hospital-admissions-by-location-summary\"", "raw_code": "with reporting_months as (\r\n select month::date\r\n from generate_series(\r\n concat(left( {{ parameter('fromDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n concat(left( {{ parameter('toDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n '1 month'::interval\r\n ) month\r\n),\r\n\r\nlocation_summary as (\r\n select\r\n rm.month,\r\n alh.facility_id,\r\n alh.facility,\r\n alh.location_id,\r\n alh.location,\r\n alh.location_group_id,\r\n alh.location_group,\r\n l.max_occupancy as capacity,\r\n sum(\r\n case when alh.end_datetime::date = alh.start_datetime::date then 1 else\r\n (least(\r\n coalesce(alh.end_datetime, current_date)::date,\r\n (rm.month + '1 month'::interval)::date\r\n ) - greatest(alh.start_datetime::date, rm.month))\r\n end\r\n )::numeric as occupancy,\r\n count(*) filter (where alh.admission and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as admissions,\r\n count(*) filter (where alh.discharge and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as discharges,\r\n count(*) filter (where alh.death and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as deaths,\r\n count(*) filter (where alh.transfer_in and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_ins,\r\n count(*) filter (where alh.transfer_out and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_outs,\r\n round(avg(alh.length_of_stay) filter (where alh.end_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)), 1) as avg_length_of_stay\r\n from reporting_months rm\r\n join {{ ref('int__admission_history_location') }} alh\r\n on alh.start_datetime::date <= (rm.month + '1 month'::interval - '1 day'::interval)\r\n and (alh.end_datetime::date is null or alh.end_datetime::date >= rm.month)\r\n join {{ ref('locations') }} l on l.id = alh.location_id\r\n where rm.month <= current_date\r\n group by\r\n rm.month,\r\n alh.facility_id,\r\n alh.facility,\r\n alh.location_id,\r\n alh.location,\r\n alh.location_group_id,\r\n alh.location_group,\r\n l.max_occupancy\r\n)\r\n\r\nselect\r\n to_char(ls.month, '{{ var(\"yearmonth_format\") }}') as \"{{ translate_label('reportingMonth') }}\",\r\n ls.facility as \"{{ translate_label('facility') }}\",\r\n ls.location_group as \"{{ translate_label('locationGroup') }}\",\r\n ls.location as \"{{ translate_label('location') }}\",\r\n coalesce(ls.admissions, 0) as \"{{ translate_label('hospitalAdmissionCount') }}\",\r\n coalesce(ls.discharges, 0) as \"{{ translate_label('hospitalDischargeCount') }}\",\r\n coalesce(ls.deaths, 0) as \"{{ translate_label('hospitalDeathCount') }}\",\r\n coalesce(ls.transfer_ins, 0) as \"{{ translate_label('hospitalTransfersIntoLocationCount') }}\",\r\n coalesce(ls.transfer_outs, 0) as \"{{ translate_label('hospitalTransfersOutOfLocationCount') }}\",\r\n coalesce(ls.avg_length_of_stay, 0) as \"{{ translate_label('hospitalAverageLengthOfStay') }}\",\r\n coalesce(ls.occupancy, 0) as \"{{ translate_label('hospitalPatientDayCount') }}\",\r\n case\r\n when ls.occupancy notnull and ls.capacity notnull\r\n then\r\n concat(\r\n round(\r\n ls.occupancy / (\r\n ls.capacity * case\r\n when ls.month > (current_date - '1 month'::interval)\r\n then current_date - ls.month\r\n else (ls.month + '1 month'::interval)::date - ls.month\r\n end\r\n ) * 100, 1\r\n )::text, '%'\r\n )\r\n else 'N/A'\r\n end as \"{{ translate_label('hospitalBedOccupancyPercent') }}\"\r\nfrom location_summary ls\r\nwhere\r\n case\r\n when {{ parameter('locationId') }} is null then true\r\n else ls.location_id = {{ parameter('locationId') }}\r\n end\r\norder by ls.month, ls.facility, ls.location_group, ls.location", "doc_blocks": [], "language": "sql", "refs": [{"name": "int__admission_history_location", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\hospital-admissions-by-location-summary.sql", "compiled": true, "compiled_code": "with __dbt__cte__int__admission_history_location as (\nwith admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)\n), reporting_months as (\n select month::date\n from generate_series(\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n '1 month'::interval\n ) month\n),\n\nlocation_summary as (\n select\n rm.month,\n alh.facility_id,\n alh.facility,\n alh.location_id,\n alh.location,\n alh.location_group_id,\n alh.location_group,\n l.max_occupancy as capacity,\n sum(\n case when alh.end_datetime::date = alh.start_datetime::date then 1 else\n (least(\n coalesce(alh.end_datetime, current_date)::date,\n (rm.month + '1 month'::interval)::date\n ) - greatest(alh.start_datetime::date, rm.month))\n end\n )::numeric as occupancy,\n count(*) filter (where alh.admission and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as admissions,\n count(*) filter (where alh.discharge and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as discharges,\n count(*) filter (where alh.death and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as deaths,\n count(*) filter (where alh.transfer_in and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_ins,\n count(*) filter (where alh.transfer_out and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_outs,\n round(avg(alh.length_of_stay) filter (where alh.end_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)), 1) as avg_length_of_stay\n from reporting_months rm\n join __dbt__cte__int__admission_history_location alh\n on alh.start_datetime::date <= (rm.month + '1 month'::interval - '1 day'::interval)\n and (alh.end_datetime::date is null or alh.end_datetime::date >= rm.month)\n join \"app\".\"reporting\".\"locations\" l on l.id = alh.location_id\n where rm.month <= current_date\n group by\n rm.month,\n alh.facility_id,\n alh.facility,\n alh.location_id,\n alh.location,\n alh.location_group_id,\n alh.location_group,\n l.max_occupancy\n)\n\nselect\n to_char(ls.month, 'YYYY-MM') as \"Month\",\n ls.facility as \"Facility\",\n ls.location_group as \"Area\",\n ls.location as \"Location\",\n coalesce(ls.admissions, 0) as \"Number of admissions\",\n coalesce(ls.discharges, 0) as \"Number of discharges\",\n coalesce(ls.deaths, 0) as \"Number of deaths\",\n coalesce(ls.transfer_ins, 0) as \"Number of transfers into location\",\n coalesce(ls.transfer_outs, 0) as \"Number of transfers out of location\",\n coalesce(ls.avg_length_of_stay, 0) as \"Average length of stay\",\n coalesce(ls.occupancy, 0) as \"Number of patient days\",\n case\n when ls.occupancy notnull and ls.capacity notnull\n then\n concat(\n round(\n ls.occupancy / (\n ls.capacity * case\n when ls.month > (current_date - '1 month'::interval)\n then current_date - ls.month\n else (ls.month + '1 month'::interval)::date - ls.month\n end\n ) * 100, 1\n )::text, '%'\n )\n else 'N/A'\n end as \"Bed occupancy (%)\"\nfrom location_summary ls\nwhere\n case\n when nullif('', '')::text is null then true\n else ls.location_id = nullif('', '')::text\n end\norder by ls.month, ls.facility, ls.location_group, ls.location", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.tamanu_source_dbt.int__admission_history_location", "sql": " __dbt__cte__int__admission_history_location as (\nwith admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging-requests-line-list": {"database": "app", "schema": "reporting", "name": "imaging-requests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\imaging-requests-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\imaging-requests-line-list.sql", "unique_id": "model.tamanu_source_dbt.imaging-requests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "imaging-requests-line-list"], "alias": "imaging-requests-line-list", "checksum": {"name": "sha256", "checksum": "e62981e2d1c14d7f052d8899d5b8e8d26d7a24bcef01181ae0de2d9f96d65938"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.340668, "relation_name": "\"app\".\"reporting\".\"imaging-requests-line-list\"", "raw_code": "with _translations as (\r\n {{ get_translation_lookup(prefix_key='IMAGING_TYPES') }}\r\n)\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n request_id as \"{{ translate_label('imagingRequestId') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('imagingRequestDateTime') }}\",\r\n supervising_clinician as \"{{ translate_label('imagingSupervisingClinician') }}\",\r\n requesting_clinician as \"{{ translate_label('imagingRequestingClinician') }}\",\r\n priority as \"{{ translate_label('imagingPriority') }}\",\r\n coalesce(t_imaging_type.text, imaging_type) as \"{{ translate_label('imagingType') }}\",\r\n imaging_area as \"{{ translate_label('imagingArea') }}\",\r\n status as \"{{ translate_label('imagingStatus') }}\",\r\n to_char(completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('imagingCompletedDateTime') }}\",\r\n reason_for_cancellation as \"{{ translate_label('imagingCancellationReason') }}\"\r\nfrom {{ ref('ds__imaging_requests') }}\r\nleft join _translations t_imaging_type\r\n on t_imaging_type.string_id = '{{ get_translation_prefix(\"IMAGING_TYPES\") }}.' || imaging_type\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('requestedById') }} is null then true\r\n else requesting_clinician_id = {{ parameter('requestedById') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('imagingType') }} is null then true\r\n else imaging_type = {{ parameter('imagingType') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by requested_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "translated_strings", "package": null, "version": null}, {"name": "ds__imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_lookup", "macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_translation_prefix", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.translated_strings", "model.tamanu_source_dbt.ds__imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\imaging-requests-line-list.sql", "compiled": true, "compiled_code": "with _translations as (\n select\n string_id,\n max(text) filter (where language = 'default') as text\n from \"app\".\"reporting\".\"translated_strings\"\n where string_id like 'imaging.property.type.%'\n group by string_id\n)\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n request_id as \"Request ID\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Request date and time\",\n supervising_clinician as \"Supervising clinician\",\n requesting_clinician as \"Requesting clinician\",\n priority as \"Priority\",\n coalesce(t_imaging_type.text, imaging_type) as \"Imaging type\",\n imaging_area as \"Area to be imaged\",\n status as \"Status\",\n to_char(completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Completed date and time\",\n reason_for_cancellation as \"Reason for cancellation\"\nfrom \"app\".\"reporting\".\"ds__imaging_requests\"\nleft join _translations t_imaging_type\n on t_imaging_type.string_id = 'imaging.property.type.' || imaging_type\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else requesting_clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else imaging_type = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\norder by requested_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging-requests-summary": {"database": "app", "schema": "reporting", "name": "imaging-requests-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\imaging-requests-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\imaging-requests-summary.sql", "unique_id": "model.tamanu_source_dbt.imaging-requests-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "imaging-requests-summary"], "alias": "imaging-requests-summary", "checksum": {"name": "sha256", "checksum": "2e75c5ceb25d8d593c314ce6817f5583f54013bb69f204f34beb87ff114258b6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.3488872, "relation_name": "\"app\".\"reporting\".\"imaging-requests-summary\"", "raw_code": "with _translations as (\r\n {{ get_translation_lookup(prefix_key='IMAGING_TYPES') }}\r\n),\r\n\r\nreporting_dates as (\r\n select date::date as date\r\n from generate_series(\r\n {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }},\r\n {{ parameter('toDate', default_value='2024-01-31', data_type='date') }},\r\n '1 day'::interval\r\n ) date\r\n)\r\n\r\nselect\r\n to_char(rd.date, '{{ var(\"date_format\") }}') as \"{{ translate_label('reportingDate') }}\",\r\n ir.facility as \"{{ translate_label('facility') }}\",\r\n ir.department as \"{{ translate_label('department') }}\",\r\n coalesce(t_imaging_type.text, ir.imaging_type) as \"{{ translate_label('imagingType') }}\",\r\n count(distinct ir.request_id) filter (where ir.requested_datetime::date = rd.date) as \"{{ translate_label('imagingTotalRequests') }}\",\r\n count(distinct ir.request_id) filter (\r\n where ir.requested_datetime::date <= rd.date\r\n and (ir.completed_datetime::date > rd.date or ir.completed_datetime is null)\r\n ) as \"{{ translate_label('imagingPendingRequests') }}\",\r\n count(distinct ir.request_id) filter (\r\n where ir.completed_datetime::date = rd.date\r\n ) as \"{{ translate_label('imagingCompletedRequests') }}\"\r\nfrom reporting_dates rd\r\nleft join {{ ref('ds__imaging_requests') }} ir\r\n on ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\r\n and ir.requested_datetime::date <= rd.date\r\n and (ir.completed_datetime::date >= rd.date or ir.completed_datetime is null)\r\nleft join _translations t_imaging_type\r\n on t_imaging_type.string_id = '{{ get_translation_prefix(\"IMAGING_TYPES\") }}.' || ir.imaging_type\r\nwhere ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\r\n and (ir.department_id is not null or ir.imaging_type is not null)\r\n and (\r\n {{ parameter('department') }} is null or ir.department_id = {{ parameter('department') }}\r\n )\r\n and (\r\n case\r\n when {{ parameter('imagingType') }} is null then true\r\n else ir.imaging_type = {{ parameter('imagingType') }}\r\n end\r\n )\r\ngroup by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text\r\norder by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text", "doc_blocks": [], "language": "sql", "refs": [{"name": "translated_strings", "package": null, "version": null}, {"name": "ds__imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_lookup", "macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_translation_prefix"], "nodes": ["model.tamanu_source_dbt.translated_strings", "model.tamanu_source_dbt.ds__imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\imaging-requests-summary.sql", "compiled": true, "compiled_code": "with _translations as (\n select\n string_id,\n max(text) filter (where language = 'default') as text\n from \"app\".\"reporting\".\"translated_strings\"\n where string_id like 'imaging.property.type.%'\n group by string_id\n),\n\nreporting_dates as (\n select date::date as date\n from generate_series(\n nullif('2024-01-01', '')::date,\n nullif('2024-01-31', '')::date,\n '1 day'::interval\n ) date\n)\n\nselect\n to_char(rd.date, 'YYYY-MM-DD') as \"Date\",\n ir.facility as \"Facility\",\n ir.department as \"Department\",\n coalesce(t_imaging_type.text, ir.imaging_type) as \"Imaging type\",\n count(distinct ir.request_id) filter (where ir.requested_datetime::date = rd.date) as \"Total new requests\",\n count(distinct ir.request_id) filter (\n where ir.requested_datetime::date <= rd.date\n and (ir.completed_datetime::date > rd.date or ir.completed_datetime is null)\n ) as \"Total requests with a status of pending\",\n count(distinct ir.request_id) filter (\n where ir.completed_datetime::date = rd.date\n ) as \"Total requests completed\"\nfrom reporting_dates rd\nleft join \"app\".\"reporting\".\"ds__imaging_requests\" ir\n on ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\n and ir.requested_datetime::date <= rd.date\n and (ir.completed_datetime::date >= rd.date or ir.completed_datetime is null)\nleft join _translations t_imaging_type\n on t_imaging_type.string_id = 'imaging.property.type.' || ir.imaging_type\nwhere ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\n and (ir.department_id is not null or ir.imaging_type is not null)\n and (\n nullif('', '')::text is null or ir.department_id = nullif('', '')::text\n )\n and (\n case\n when nullif('', '')::text is null then true\n else ir.imaging_type = nullif('', '')::text\n end\n )\ngroup by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text\norder by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.incomplete-referrals": {"database": "app", "schema": "reporting", "name": "incomplete-referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\incomplete-referrals.sql", "original_file_path": "models\\reports\\sql\\standard\\incomplete-referrals.sql", "unique_id": "model.tamanu_source_dbt.incomplete-referrals", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "incomplete-referrals"], "alias": "incomplete-referrals", "checksum": {"name": "sha256", "checksum": "8b006cf94e21b00580865275aeec2c17fdfc4ca55e6126f2b23356c73eb8d27f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.3546479, "relation_name": "\"app\".\"reporting\".\"incomplete-referrals\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n diagnoses as \"{{ translate_label('diagnoses') }}\",\r\n referral_type as \"{{ translate_label('referralType') }}\",\r\n referring_doctor_name as \"{{ translate_label('referralCompletedBy') }}\",\r\n to_char(referral_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('referralDate') }}\",\r\n department as \"{{ translate_label('department') }}\"\r\nfrom {{ ref('ds__referrals') }}\r\nwhere status in ('pending', 'cancelled')\r\n and case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else referral_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else referral_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('doctorId') }} is null then true\r\n else referring_doctor_id = {{ parameter('doctorId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\norder by referral_datetime, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__referrals", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\incomplete-referrals.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n diagnoses as \"Diagnoses\",\n referral_type as \"Referral name\",\n referring_doctor_name as \"Referring doctor\",\n to_char(referral_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Referral date\",\n department as \"Department\"\nfrom \"app\".\"reporting\".\"ds__referrals\"\nwhere status in ('pending', 'cancelled')\n and case\n when nullif('2024-01-01', '')::date is null then true\n else referral_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else referral_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else referring_doctor_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\norder by referral_datetime, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice-products-summary": {"database": "app", "schema": "reporting", "name": "invoice-products-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\invoice-products-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\invoice-products-summary.sql", "unique_id": "model.tamanu_source_dbt.invoice-products-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "invoice-products-summary"], "alias": "invoice-products-summary", "checksum": {"name": "sha256", "checksum": "5d47c836b0014a7f331b1456d747cc366c6bf04a985f81dca5ea58c4993a39e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.35866, "relation_name": "\"app\".\"reporting\".\"invoice-products-summary\"", "raw_code": "{%- set price_lists_query %}\r\n select name\r\n from {{ ref('invoice_price_lists') }}\r\n order by name\r\n{%- endset %}\r\n\r\n{%- set insurance_plans_query %}\r\n select name\r\n from {{ ref('invoice_insurance_plans') }}\r\n order by name\r\n{%- endset %}\r\n\r\n{%- if execute %}\r\n {%- set price_list_names = run_query(price_lists_query).columns[0].values() %}\r\n {%- set insurance_plan_names = run_query(insurance_plans_query).columns[0].values() %}\r\n{%- else %}\r\n {%- set price_list_names = [] %}\r\n {%- set insurance_plan_names = [] %}\r\n{%- endif %}\r\n\r\nselect\r\n id as \"{{ translate_label('invoiceProductId') }}\",\r\n name as \"{{ translate_label('invoiceProductName') }}\",\r\n insurable as \"{{ translate_label('invoiceProductInsurable') }}\",\r\n category as \"{{ translate_label('invoiceProductCategory') }}\",\r\n source_record_id as \"{{ translate_label('invoiceProductCategoryId') }}\",\r\n visibility_status as \"{{ translate_label('invoiceProductVisibilityStatus') }}\",\r\n external_code as \"{{ translate_label('invoiceProductLabExternalCode') }}\"\r\n {%- for name in price_list_names %}\r\n , \"Price: {{ name }}\"\r\n {%- endfor %}\r\n {%- for name in insurance_plan_names %}\r\n , \"Insurance: {{ name }}\"\r\n {%- endfor %}\r\nfrom {{ ref('ds__invoice_products') }}\r\norder by name", "doc_blocks": [], "language": "sql", "refs": [{"name": "invoice_price_lists", "package": null, "version": null}, {"name": "invoice_insurance_plans", "package": null, "version": null}, {"name": "ds__invoice_products", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.dbt.run_query"], "nodes": ["model.tamanu_source_dbt.invoice_price_lists", "model.tamanu_source_dbt.invoice_insurance_plans", "model.tamanu_source_dbt.ds__invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\invoice-products-summary.sql", "compiled": true, "compiled_code": "\n\nselect\n id as \"ID\",\n name as \"Product name\",\n insurable as \"Insurable\",\n category as \"Category\",\n source_record_id as \"Category ID\",\n visibility_status as \"Visibility status\",\n external_code as \"Lab external code\"\nfrom \"app\".\"reporting\".\"ds__invoice_products\"\norder by name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab-requests-line-list": {"database": "app", "schema": "reporting", "name": "lab-requests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\lab-requests-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\lab-requests-line-list.sql", "unique_id": "model.tamanu_source_dbt.lab-requests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "lab-requests-line-list"], "alias": "lab-requests-line-list", "checksum": {"name": "sha256", "checksum": "6b1963a9204df4bd11a19e26b42caf97f98579694e37710ecd67175a935fbb0d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.3646789, "relation_name": "\"app\".\"reporting\".\"lab-requests-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n concat_ws(', ', location_group, location) as \"{{ translate_label('location') }}\",\r\n laboratory as \"{{ translate_label('labLaboratory') }}\",\r\n request_id as \"{{ translate_label('labRequestId') }}\",\r\n status as \"{{ translate_label('labRequestStatus') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestDateTime') }}\",\r\n requested_by as \"{{ translate_label('labRequestClinician') }}\",\r\n requesting_department as \"{{ translate_label('labRequestDepartment') }}\",\r\n priority as \"{{ translate_label('labRequestPriority') }}\",\r\n lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n tests as \"{{ translate_label('labTestRequested') }}\",\r\n to_char(collected_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestSampleCollectionDateTime') }}\",\r\n collected_by as \"{{ translate_label('labRequestSampleCollectedBy') }}\",\r\n specimen_type as \"{{ translate_label('labRequestSpecimenType') }}\",\r\n site as \"{{ translate_label('labRequestSampleSite') }}\",\r\n to_char(completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestCompletedDateTime') }}\",\r\n reason_for_cancellation as \"{{ translate_label('labRequestCancellationReason') }}\"\r\nfrom {{ ref('ds__lab_requests') }}\r\nwhere case\r\n when {{ parameter('requestedById') }} is null then true\r\n else requested_by_id = {{ parameter('requestedById') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('testCategoryId') }} is null then true\r\n else lab_test_category_id = {{ parameter('testCategoryId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by requested_datetime, last_name, first_name, tests", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__lab_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\lab-requests-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n concat_ws(', ', location_group, location) as \"Location\",\n laboratory as \"Laboratory\",\n request_id as \"Request ID\",\n status as \"Status\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request date and time\",\n requested_by as \"Requesting clinician\",\n requesting_department as \"Requesting department\",\n priority as \"Priority\",\n lab_test_category as \"Test category\",\n tests as \"Test requested\",\n to_char(collected_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Sample collection date and time\",\n collected_by as \"Sample collected by\",\n specimen_type as \"Specimen type\",\n site as \"Site\",\n to_char(completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Completed date and time\",\n reason_for_cancellation as \"Reason for cancellation\"\nfrom \"app\".\"reporting\".\"ds__lab_requests\"\nwhere case\n when nullif('', '')::text is null then true\n else requested_by_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else lab_test_category_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by requested_datetime, last_name, first_name, tests", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab-requests-summary": {"database": "app", "schema": "reporting", "name": "lab-requests-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\lab-requests-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\lab-requests-summary.sql", "unique_id": "model.tamanu_source_dbt.lab-requests-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "lab-requests-summary"], "alias": "lab-requests-summary", "checksum": {"name": "sha256", "checksum": "eb4d3c6ac6112d8a5c2fd7912437e01fea9086ab0e06c739dfefeadc15f83527"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.3763309, "relation_name": "\"app\".\"reporting\".\"lab-requests-summary\"", "raw_code": "with reporting_dates as (\r\n select date::date as reporting_date\r\n from generate_series(\r\n {{ parameter('fromDate', default_value='2024-01-01', data_type='text') }}::date,\r\n {{ parameter('toDate', default_value='2024-01-01', data_type='text') }}::date,\r\n '1 day'::interval\r\n ) date\r\n)\r\n\r\nselect\r\n to_char(rd.reporting_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('reportingDate') }}\",\r\n lrh.facility as \"{{ translate_label('facility') }}\",\r\n lrh.department as \"{{ translate_label('department') }}\",\r\n lrh.lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n count(distinct case\r\n when rd.reporting_date = lrh.requested_date\r\n then lrh.request_id\r\n end) as \"{{ translate_label('labRequestNewCount') }}\",\r\n count(case\r\n when lrh.status = 'results_pending'\r\n then 1\r\n end) as \"{{ translate_label('labRequestPendingCount') }}\",\r\n count(case\r\n when lrh.status = 'published'\r\n then 1\r\n end) as \"{{ translate_label('labRequestPublishedCount') }}\"\r\nfrom reporting_dates rd\r\njoin {{ ref('int__lab_requests_history') }} lrh\r\n on lrh.status_start_date <= rd.reporting_date\r\n and lrh.status_end_date >= rd.reporting_date\r\nwhere case\r\n when {{ parameter('departmentId', default_value='null', data_type='text') }} is null\r\n then true\r\n else lrh.department_id = {{ parameter('departmentId', default_value='null', data_type='text') }}\r\n end\r\n and case\r\n when {{ parameter('facilityId', default_value='null', data_type='text') }} is null\r\n then true\r\n else lrh.facility_id = {{ parameter('facilityId', default_value='null', data_type='text') }}\r\n end\r\n and case\r\n when {{ parameter('labTestCategoryId', default_value='null', data_type='text') }} is null\r\n then true\r\n else lrh.lab_test_category_id = {{ parameter('labTestCategoryId', default_value='null', data_type='text') }}\r\n end\r\ngroup by\r\n rd.reporting_date,\r\n lrh.facility,\r\n lrh.department,\r\n lrh.lab_test_category\r\nhaving count(case\r\n when rd.reporting_date = lrh.requested_date\r\n or lrh.status in ('results_pending', 'published')\r\n then 1\r\n end) > 0", "doc_blocks": [], "language": "sql", "refs": [{"name": "int__lab_requests_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.int__lab_requests_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\lab-requests-summary.sql", "compiled": true, "compiled_code": "with __dbt__cte__int__lab_requests_history as (\nselect distinct on (lr.id, coalesce(lrl.status, lr.status))\n lr.id as request_id,\n lr.requested_datetime::date as requested_date,\n lr.encounter_id,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n ltc.id as lab_test_category_id,\n ltc.name as lab_test_category,\n coalesce(lrl.status, lr.status) as status,\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date as status_start_date,\n case\n when coalesce(lrl.status, lr.status) = 'published'\n then\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n when lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w is not null\n then\n case\n when coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n = (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n then (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n else (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w - interval '1 day')::date\n end\n else current_date\n end as status_end_date\nfrom \"app\".\"reporting\".\"lab_requests\" lr\nleft join \"app\".\"reporting\".\"lab_request_logs\" lrl on lrl.lab_request_id = lr.id\nleft join \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = coalesce(lr.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" ltc on ltc.id = lr.lab_test_category_id\nwhere lr.status not in ('deleted', 'cancelled', 'entered-in-error')\nwindow\n w as (\n partition by lr.id\n order by coalesce(lrl.updated_datetime, lr.updated_datetime)\n )\norder by lr.id, coalesce(lrl.status, lr.status)\n), reporting_dates as (\n select date::date as reporting_date\n from generate_series(\n nullif('2024-01-01', '')::text::date,\n nullif('2024-01-01', '')::text::date,\n '1 day'::interval\n ) date\n)\n\nselect\n to_char(rd.reporting_date, 'YYYY-MM-DD') as \"Date\",\n lrh.facility as \"Facility\",\n lrh.department as \"Department\",\n lrh.lab_test_category as \"Test category\",\n count(distinct case\n when rd.reporting_date = lrh.requested_date\n then lrh.request_id\n end) as \"Total new requests\",\n count(case\n when lrh.status = 'results_pending'\n then 1\n end) as \"Total requests with a status of results pending\",\n count(case\n when lrh.status = 'published'\n then 1\n end) as \"Total requests published\"\nfrom reporting_dates rd\njoin __dbt__cte__int__lab_requests_history lrh\n on lrh.status_start_date <= rd.reporting_date\n and lrh.status_end_date >= rd.reporting_date\nwhere case\n when nullif('null', '')::text is null\n then true\n else lrh.department_id = nullif('null', '')::text\n end\n and case\n when nullif('null', '')::text is null\n then true\n else lrh.facility_id = nullif('null', '')::text\n end\n and case\n when nullif('null', '')::text is null\n then true\n else lrh.lab_test_category_id = nullif('null', '')::text\n end\ngroup by\n rd.reporting_date,\n lrh.facility,\n lrh.department,\n lrh.lab_test_category\nhaving count(case\n when rd.reporting_date = lrh.requested_date\n or lrh.status in ('results_pending', 'published')\n then 1\n end) > 0", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.tamanu_source_dbt.int__lab_requests_history", "sql": " __dbt__cte__int__lab_requests_history as (\nselect distinct on (lr.id, coalesce(lrl.status, lr.status))\n lr.id as request_id,\n lr.requested_datetime::date as requested_date,\n lr.encounter_id,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n ltc.id as lab_test_category_id,\n ltc.name as lab_test_category,\n coalesce(lrl.status, lr.status) as status,\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date as status_start_date,\n case\n when coalesce(lrl.status, lr.status) = 'published'\n then\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n when lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w is not null\n then\n case\n when coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n = (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n then (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n else (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w - interval '1 day')::date\n end\n else current_date\n end as status_end_date\nfrom \"app\".\"reporting\".\"lab_requests\" lr\nleft join \"app\".\"reporting\".\"lab_request_logs\" lrl on lrl.lab_request_id = lr.id\nleft join \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = coalesce(lr.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" ltc on ltc.id = lr.lab_test_category_id\nwhere lr.status not in ('deleted', 'cancelled', 'entered-in-error')\nwindow\n w as (\n partition by lr.id\n order by coalesce(lrl.updated_datetime, lr.updated_datetime)\n )\norder by lr.id, coalesce(lrl.status, lr.status)\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab-tests-line-list": {"database": "app", "schema": "reporting", "name": "lab-tests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\lab-tests-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\lab-tests-line-list.sql", "unique_id": "model.tamanu_source_dbt.lab-tests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "lab-tests-line-list"], "alias": "lab-tests-line-list", "checksum": {"name": "sha256", "checksum": "9617dcd125ac62096f404e068b6c6909cca8497031d5879b718ed0ef7af0d639"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.382087, "relation_name": "\"app\".\"reporting\".\"lab-tests-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n requesting_department as \"{{ translate_label('requestingDepartment') }}\",\r\n concat_ws(', ', location_group, location) as \"{{ translate_label('location') }}\",\r\n lab_request_id as \"{{ translate_label('labRequestId') }}\",\r\n status as \"{{ translate_label('labRequestStatus') }}\",\r\n lab_test_panel as \"{{ translate_label('labTestPanel') }}\",\r\n lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestDateTime') }}\",\r\n requested_by as \"{{ translate_label('labRequestClinician') }}\",\r\n to_char(lab_request_published_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestPublishedDateTime') }}\",\r\n to_char(lab_test_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('labTestDate') }}\",\r\n result as \"{{ translate_label('labTestResults') }}\",\r\n verification as \"{{ translate_label('labTestVerification') }}\",\r\n lab_test_type as \"{{ translate_label('labTestType') }}\",\r\n to_char(lab_test_completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labTestCompletedDateTime') }}\"\r\nfrom {{ ref('ds__lab_tests') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('testCategoryId') }} is null then true\r\n else lab_test_category_id = {{ parameter('testCategoryId') }}\r\n end\r\norder by\r\n requested_datetime,\r\n lab_test_panel,\r\n lab_request_published_datetime,\r\n lab_test_completed_datetime,\r\n lab_test_type", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__lab_tests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\lab-tests-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n requesting_department as \"Requesting department\",\n concat_ws(', ', location_group, location) as \"Location\",\n lab_request_id as \"Request ID\",\n status as \"Status\",\n lab_test_panel as \"Lab test panel\",\n lab_test_category as \"Test category\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request date and time\",\n requested_by as \"Requesting clinician\",\n to_char(lab_request_published_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request published date and time\",\n to_char(lab_test_date, 'YYYY-MM-DD') as \"Lab test date\",\n result as \"Result\",\n verification as \"Verification\",\n lab_test_type as \"Lab test type\",\n to_char(lab_test_completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab test completed date and time\"\nfrom \"app\".\"reporting\".\"ds__lab_tests\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else lab_test_category_id = nullif('', '')::text\n end\norder by\n requested_datetime,\n lab_test_panel,\n lab_request_published_datetime,\n lab_test_completed_datetime,\n lab_test_type", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.location-bookings-line-list": {"database": "app", "schema": "reporting", "name": "location-bookings-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\location-bookings-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\location-bookings-line-list.sql", "unique_id": "model.tamanu_source_dbt.location-bookings-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "location-bookings-line-list"], "alias": "location-bookings-line-list", "checksum": {"name": "sha256", "checksum": "f10e8ff347e1817445ea46235f7547e890ac7b5d25ace2c9768d404654b98a21"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.3840933, "relation_name": "\"app\".\"reporting\".\"location-bookings-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(booking_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('bookingStartDateTime') }}\",\r\n to_char(booking_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('bookingEndDateTime') }}\",\r\n case\r\n when extract(day from age(booking_end_datetime, booking_start_datetime)) >= 1\r\n then extract(day from age(booking_end_datetime, booking_start_datetime)) || ' nights'\r\n when extract(hour from age(booking_end_datetime, booking_start_datetime)) >= 1\r\n then extract(hour from age(booking_end_datetime, booking_start_datetime)) || ' hours'\r\n else extract(minute from age(booking_end_datetime, booking_start_datetime)) || ' minutes'\r\n end as \"{{ translate_label('bookingDuration') }}\",\r\n location_group as \"{{ translate_label('bookingLocationGroup') }}\",\r\n location as \"{{ translate_label('bookingLocation') }}\",\r\n clinician as \"{{ translate_label('bookingClinician') }}\",\r\n booking_type as \"{{ translate_label('bookingType') }}\",\r\n booking_status as \"{{ translate_label('bookingStatus') }}\"\r\nfrom {{ ref('ds__location_bookings') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else booking_start_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else booking_end_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('bookingStatus') }} is null then true\r\n else booking_status = {{ parameter('bookingStatus') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('bookingTypeId') }} is null then true\r\n else booking_type_id = {{ parameter('bookingTypeId') }}\r\n end\r\norder by booking_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__location_bookings", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__location_bookings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\location-bookings-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n billing_type as \"Billing type\",\n to_char(booking_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Booking start date and time\",\n to_char(booking_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Booking end date and time\",\n case\n when extract(day from age(booking_end_datetime, booking_start_datetime)) >= 1\n then extract(day from age(booking_end_datetime, booking_start_datetime)) || ' nights'\n when extract(hour from age(booking_end_datetime, booking_start_datetime)) >= 1\n then extract(hour from age(booking_end_datetime, booking_start_datetime)) || ' hours'\n else extract(minute from age(booking_end_datetime, booking_start_datetime)) || ' minutes'\n end as \"Booking duration\",\n location_group as \"Area\",\n location as \"Location\",\n clinician as \"Clinician\",\n booking_type as \"Booking type\",\n booking_status as \"Booking status\"\nfrom \"app\".\"reporting\".\"ds__location_bookings\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else booking_start_datetime >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else booking_end_datetime <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else booking_status = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else booking_type_id = nullif('', '')::text\n end\norder by booking_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.medication-dispensed-summary": {"database": "app", "schema": "reporting", "name": "medication-dispensed-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\medication-dispensed-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\medication-dispensed-summary.sql", "unique_id": "model.tamanu_source_dbt.medication-dispensed-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "medication-dispensed-summary"], "alias": "medication-dispensed-summary", "checksum": {"name": "sha256", "checksum": "65a110c47ead91b1c12f8d960856a523d76fbf85528b573eec5bf77aea64b03b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.4005902, "relation_name": "\"app\".\"reporting\".\"medication-dispensed-summary\"", "raw_code": "select\r\n md.medication as \"{{ translate_label('prescriptionMedication') }}\",\r\n md.medication_code as \"{{ translate_label('prescriptionMedicationCode') }}\",\r\n sum(md.quantity) as \"{{ translate_label('prescriptionQuantity') }}\"\r\nfrom {{ ref('ds__medication_dispenses') }} md\r\nwhere\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else md.facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('medicationId') }} is null then true\r\n else md.medication_id = {{ parameter('medicationId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='timestamp') }} is null then true\r\n else md.dispensed_at\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='timestamp') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='timestamp') }} is null then true\r\n else md.dispensed_at\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='timestamp') }}\r\n end\r\ngroup by md.medication_id, md.medication, md.medication_code", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__medication_dispenses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\medication-dispensed-summary.sql", "compiled": true, "compiled_code": "select\n md.medication as \"Medication\",\n md.medication_code as \"Code\",\n sum(md.quantity) as \"Quantity\"\nfrom \"app\".\"reporting\".\"ds__medication_dispenses\" md\nwhere\n case\n when nullif('', '')::text is null then true\n else md.facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else md.medication_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::timestamp is null then true\n else md.dispensed_at\n >= nullif('2024-01-01', '')::timestamp\n end\n and\n case\n when nullif('2024-01-31', '')::timestamp is null then true\n else md.dispensed_at\n <= nullif('2024-01-31', '')::timestamp\n end\ngroup by md.medication_id, md.medication, md.medication_code", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ongoing-conditions-line-list": {"database": "app", "schema": "reporting", "name": "ongoing-conditions-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\ongoing-conditions-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\ongoing-conditions-line-list.sql", "unique_id": "model.tamanu_source_dbt.ongoing-conditions-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "ongoing-conditions-line-list"], "alias": "ongoing-conditions-line-list", "checksum": {"name": "sha256", "checksum": "1687de0806192a341d1656c9f06ccdc2c858b21ca2504ec03cfbe18653fa1e91"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.405479, "relation_name": "\"app\".\"reporting\".\"ongoing-conditions-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n condition as \"{{ translate_label('conditionOngoing') }}\",\r\n to_char(recorded_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('conditionRecordedDate') }}\",\r\n clinician as \"{{ translate_label('conditionRecordedBy') }}\",\r\n to_char(date_resolved, '{{ var(\"date_format\") }}') as \"{{ translate_label('conditionResolvedDate') }}\",\r\n clinician_resolving as \"{{ translate_label('conditionResolvedBy') }}\"\r\nfrom {{ ref('ds__ongoing_conditions') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else recorded_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else recorded_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by recorded_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__ongoing_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__ongoing_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\ongoing-conditions-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n condition as \"Ongoing condition\",\n to_char(recorded_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date recorded\",\n clinician as \"Clinician\",\n to_char(date_resolved, 'YYYY-MM-DD') as \"Date resolved\",\n clinician_resolving as \"Clinician confirming resolution\"\nfrom \"app\".\"reporting\".\"ds__ongoing_conditions\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else recorded_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else recorded_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by recorded_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.outpatient-appointments-line-list": {"database": "app", "schema": "reporting", "name": "outpatient-appointments-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\outpatient-appointments-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\outpatient-appointments-line-list.sql", "unique_id": "model.tamanu_source_dbt.outpatient-appointments-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "outpatient-appointments-line-list"], "alias": "outpatient-appointments-line-list", "checksum": {"name": "sha256", "checksum": "5500b7bfc6108c9c2de4621849e0d34c7bcbd866bafd16e8cf130d81bc03ebf7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.4120748, "relation_name": "\"app\".\"reporting\".\"outpatient-appointments-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n contact_number as \"{{ translate_label('patientContactNumber') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(appointment_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentDateTime') }}\",\r\n to_char(appointment_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentEndDateTime') }}\",\r\n appointment_type as \"{{ translate_label('appointmentType') }}\",\r\n appointment_status as \"{{ translate_label('appointmentStatus') }}\",\r\n clinician as \"{{ translate_label('appointmentClinician') }}\",\r\n location_group as \"{{ translate_label('appointmentLocationGroup') }}\",\r\n priority as \"{{ translate_label('appointmentPriority') }}\",\r\n case\r\n when schedule_id notnull then {{ get_recurrence_description('interval', 'frequency', 'days_of_week', 'nth_weekday') }}\r\n else 'No'\r\n end as \"{{ translate_label('appointmentIsRepeating') }}\",\r\n to_char(until_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('appointmentRepeatingEndDate') }}\",\r\n created_by as \"{{ translate_label('appointmentCreatedBy') }}\"\r\nfrom {{ ref('ds__outpatient_appointments') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else appointment_start_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else appointment_start_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when coalesce({{ parameter('appointmentStatus') }}) is null then true\r\n else appointment_status in ({{ parameter('appointmentStatus') }})\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('appointmentTypeId') }} is null then true\r\n else appointment_type_id = {{ parameter('appointmentTypeId') }}\r\n end\r\norder by appointment_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__outpatient_appointments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_recurrence_description", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__outpatient_appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\outpatient-appointments-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n contact_number as \"Contact number\",\n village as \"Village\",\n billing_type as \"Billing type\",\n to_char(appointment_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment date and time\",\n to_char(appointment_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment end date and time\",\n appointment_type as \"Appointment type\",\n appointment_status as \"Appointment status\",\n clinician as \"Clinician\",\n location_group as \"Area\",\n priority as \"Priority appointment\",\n case\n when schedule_id notnull then concat(\n concat(\n case when \"interval\" = 1 then\n case frequency\n when 'WEEKLY' then 'Weekly on a '\n when 'MONTHLY' then 'Monthly on the '\n end\n else concat('Every ', \"interval\",\n case frequency\n when 'WEEKLY' then ' weeks on '\n when 'MONTHLY' then ' months on the '\n end\n )\n end\n ),\n case nth_weekday\n when -1 then 'last '\n when 1 then 'first '\n when 2 then 'second '\n when 3 then 'third '\n when 4 then 'fourth ' \n else ''\n end,\n array_to_string(\n array(select case unnest_day\n when 'MO' then 'Monday'\n when 'TU' then 'Tuesday'\n when 'WE' then 'Wednesday'\n when 'TH' then 'Thursday'\n when 'FR' then 'Friday'\n when 'SA' then 'Saturday'\n when 'SU' then 'Sunday'\n else unnest_day\n end from unnest(days_of_week) as unnest_day),\n ', '\n )\n )\n else 'No'\n end as \"Repeating appointment\",\n to_char(until_date, 'YYYY-MM-DD') as \"Repeating appointment end date\",\n created_by as \"Appointment created by\"\nfrom \"app\".\"reporting\".\"ds__outpatient_appointments\"\nwhere case\n when nullif('2025-01-01', '')::date is null then true\n else appointment_start_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else appointment_start_datetime <= nullif('2025-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\n and\n case\n when coalesce(nullif('', '')::text) is null then true\n else appointment_status in (nullif('', '')::text)\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else appointment_type_id = nullif('', '')::text\n end\norder by appointment_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient-emergency-encounters-summary": {"database": "app", "schema": "reporting", "name": "patient-emergency-encounters-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\patient-emergency-encounters-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\patient-emergency-encounters-summary.sql", "unique_id": "model.tamanu_source_dbt.patient-emergency-encounters-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "patient-emergency-encounters-summary"], "alias": "patient-emergency-encounters-summary", "checksum": {"name": "sha256", "checksum": "b64149c4356fa28a51a69a80fb0e492614667acb241e6ec0dbc7ff02939c3c44"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.42107, "relation_name": "\"app\".\"reporting\".\"patient-emergency-encounters-summary\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n count(*) as \"{{ translate_label('triageRecordCount') }}\"\r\nfrom {{ ref('ds__encounters_emergency') }}\r\nwhere case\r\n when {{ parameter('patientId') }} is null then true\r\n else patient_id = {{ parameter('patientId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else triage_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else triage_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\ngroup by\r\n display_id,\r\n first_name,\r\n last_name,\r\n date_of_birth,\r\n sex,\r\n village,\r\n facility\r\norder by last_name, first_name, display_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__encounters_emergency", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__encounters_emergency"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\patient-emergency-encounters-summary.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n count(*) as \"Number of triage records\"\nfrom \"app\".\"reporting\".\"ds__encounters_emergency\"\nwhere case\n when nullif('', '')::text is null then true\n else patient_id = nullif('', '')::text\n end\n and\n case\n when nullif('2025-01-01', '')::date is null then true\n else triage_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else triage_datetime <= nullif('2025-01-31', '')::date\n end\ngroup by\n display_id,\n first_name,\n last_name,\n date_of_birth,\n sex,\n village,\n facility\norder by last_name, first_name, display_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.prescription-line-list": {"database": "app", "schema": "reporting", "name": "prescription-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\prescription-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\prescription-line-list.sql", "unique_id": "model.tamanu_source_dbt.prescription-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "prescription-line-list"], "alias": "prescription-line-list", "checksum": {"name": "sha256", "checksum": "25c01094972ed91c1f4ca2fe5df9f819a92bf85dff51b5117ba4bec1c50e90a9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.4260705, "relation_name": "\"app\".\"reporting\".\"prescription-line-list\"", "raw_code": "select\r\n to_char(datetime, '{{ var(\"date_format\") }}') as \"{{ translate_label('prescriptionDate') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n is_selected_for_discharge as \"{{ translate_label('prescriptionSelectedForDischarge') }}\",\r\n medication_code as \"{{ translate_label('prescriptionMedicationCode') }}\",\r\n medication as \"{{ translate_label('prescriptionMedication') }}\",\r\n route as \"{{ translate_label('prescriptionRoute') }}\",\r\n quantity as \"{{ translate_label('prescriptionQuantity') }}\",\r\n repeats as \"{{ translate_label('prescriptionRepeats') }}\",\r\n is_ongoing as \"{{ translate_label('prescriptionIsOngoing') }}\",\r\n is_prn as \"{{ translate_label('prescriptionIsPRN') }}\",\r\n is_variable_dose as \"{{ translate_label('prescriptionIsVariableDose') }}\",\r\n dose_amount as \"{{ translate_label('prescriptionDoseAmount') }}\",\r\n units as \"{{ translate_label('prescriptionUnits') }}\",\r\n frequency as \"{{ translate_label('prescriptionFrequency') }}\"\r\nfrom {{ ref('ds__encounter_prescriptions') }}\r\nwhere\r\n case when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case when {{ parameter('facilityId') }} is null then true\r\n else {{ parameter('facilityId') }} = facility_id\r\n end\r\norder by datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__encounter_prescriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\prescription-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(datetime, 'YYYY-MM-DD') as \"Prescription date\",\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n is_selected_for_discharge as \"Prescription selected for discharge\",\n medication_code as \"Code\",\n medication as \"Medication\",\n route as \"Route\",\n quantity as \"Quantity\",\n repeats as \"Repeats\",\n is_ongoing as \"Is ongoing\",\n is_prn as \"Is PRN\",\n is_variable_dose as \"Is variable dose\",\n dose_amount as \"Dose amount\",\n units as \"Units\",\n frequency as \"Frequency\"\nfrom \"app\".\"reporting\".\"ds__encounter_prescriptions\"\nwhere\n case when nullif('2024-01-01', '')::date is null then true\n else datetime >= nullif('2024-01-01', '')::date\n end\n and case when nullif('2024-01-31', '')::date is null then true\n else datetime <= nullif('2024-01-31', '')::date\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = facility_id\n end\norder by datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.procedures-line-list": {"database": "app", "schema": "reporting", "name": "procedures-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\procedures-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\procedures-line-list.sql", "unique_id": "model.tamanu_source_dbt.procedures-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "procedures-line-list"], "alias": "procedures-line-list", "checksum": {"name": "sha256", "checksum": "a8f217b6746c372235243072888e01118e7dc27bf3f076aa61e1868d1e501319"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.42777, "relation_name": "\"app\".\"reporting\".\"procedures-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n encounter_facility as \"{{ translate_label('facility') }}\",\r\n encounter_department as \"{{ translate_label('department') }}\",\r\n encounter_type as \"{{ translate_label('encounterType') }}\",\r\n to_char(encounter_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(encounter_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n procedure_facility as \"{{ translate_label('procedureFacility') }}\",\r\n procedure_area as \"{{ translate_label('procedureLocationGroup') }}\",\r\n procedure_location as \"{{ translate_label('procedureLocation') }}\",\r\n procedure_type as \"{{ translate_label('procedure') }}\",\r\n to_char(procedure_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('procedureDate') }}\",\r\n to_char(procedure_start_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('procedureStartDateTime') }}\",\r\n to_char(procedure_end_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('procedureEndDateTime') }}\",\r\n procedure_duration as \"{{ translate_label('procedureDuration') }}\",\r\n procedure_clinician as \"{{ translate_label('procedureClinician') }}\",\r\n procedure_anaesthetist as \"{{ translate_label('procedureAnaesthetist') }}\",\r\n procedure_assistant_anaesthetist as \"{{ translate_label('procedureAssistantAnaesthetist') }}\",\r\n is_completed as \"{{ translate_label('procedureIsCompleted') }}\",\r\n time_in as \"{{ translate_label('procedureTimeIn') }}\",\r\n time_out as \"{{ translate_label('procedureTimeOut') }}\"\r\nfrom {{ ref('ds__procedures') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else procedure_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else procedure_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else procedure_facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else encounter_department_id = {{ parameter('departmentId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else procedure_area_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationId') }} is null then true\r\n else procedure_location_id = {{ parameter('locationId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else procedure_clinician_id = {{ parameter('clinicianId') }}\r\n end\r\norder by procedure_start_time", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__procedures", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\procedures-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n nationality as \"Nationality\",\n encounter_facility as \"Facility\",\n encounter_department as \"Department\",\n encounter_type as \"Type\",\n to_char(encounter_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(encounter_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n procedure_facility as \"Procedure facility\",\n procedure_area as \"Procedure area\",\n procedure_location as \"Procedure location\",\n procedure_type as \"Procedure\",\n to_char(procedure_date, 'YYYY-MM-DD') as \"Procedure date\",\n to_char(procedure_start_time, 'HH24:MI') as \"Procedure start (date and time)\",\n to_char(procedure_end_time, 'HH24:MI') as \"Procedure end (date and time)\",\n procedure_duration as \"Procedure duration\",\n procedure_clinician as \"Procedure clinician\",\n procedure_anaesthetist as \"Procedure anaesthetist\",\n procedure_assistant_anaesthetist as \"Procedure assistant anesthetist\",\n is_completed as \"Procedure marked as completed\",\n time_in as \"Procedure time in\",\n time_out as \"Procedure time out\"\nfrom \"app\".\"reporting\".\"ds__procedures\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else procedure_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else procedure_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else encounter_department_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_area_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_location_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_clinician_id = nullif('', '')::text\n end\norder by procedure_start_time", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program-registry-line-list": {"database": "app", "schema": "reporting", "name": "program-registry-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\program-registry-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\program-registry-line-list.sql", "unique_id": "model.tamanu_source_dbt.program-registry-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "program-registry-line-list"], "alias": "program-registry-line-list", "checksum": {"name": "sha256", "checksum": "52921a50021eb54514b007b4dc64b345df4cc59288c8ff6fe3e91711fe9c39d8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.442251, "relation_name": "\"app\".\"reporting\".\"program-registry-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n registering_facility as \"{{ translate_label('registryRegisteringFacility') }}\",\r\n subdivision as \"{{ translate_label('patientSubDivision') }}\",\r\n division as \"{{ translate_label('patientDivision') }}\",\r\n registered_by as \"{{ translate_label('registryRegisteredBy') }}\",\r\n currently_at as \"{{ translate_label('registryCurrentlyAt') }}\",\r\n related_conditions as \"{{ translate_label('registryConditions') }}\",\r\n related_condition_categories as \"{{ translate_label('registryConditionCategories') }}\",\r\n clinical_status as \"{{ translate_label('registryClinicalStatus') }}\",\r\n to_char(registration_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('registryRegisteredDate') }}\"\r\nfrom {{ ref('ds__patient_program_registrations') }}\r\nwhere registration_status = 'active'\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else registration_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else registration_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('registryId') }} is null then true\r\n else program_registry_id = {{ parameter('registryId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('subdivisionId') }} is null then true\r\n else subdivision_id = {{ parameter('subdivisionId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('divisionId') }} is null then true\r\n else division_id = {{ parameter('divisionId') }}\r\n end\r\norder by registration_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patient_program_registrations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\program-registry-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n registering_facility as \"Registering facility\",\n subdivision as \"Sub-division\",\n division as \"Division\",\n registered_by as \"Registered by\",\n currently_at as \"Currently at\",\n related_conditions as \"Related conditions\",\n related_condition_categories as \"Related condition categories\",\n clinical_status as \"Status\",\n to_char(registration_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date of registration\"\nfrom \"app\".\"reporting\".\"ds__patient_program_registrations\"\nwhere registration_status = 'active'\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else registration_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else registration_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else program_registry_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else subdivision_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else division_id = nullif('', '')::text\n end\norder by registration_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program-registry-removed-patients-line-list": {"database": "app", "schema": "reporting", "name": "program-registry-removed-patients-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\program-registry-removed-patients-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\program-registry-removed-patients-line-list.sql", "unique_id": "model.tamanu_source_dbt.program-registry-removed-patients-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "program-registry-removed-patients-line-list"], "alias": "program-registry-removed-patients-line-list", "checksum": {"name": "sha256", "checksum": "382958e536e1de88a622be873ec1ace0ccb6a6b22104d8e441b4ed828094e4ef"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.4502733, "relation_name": "\"app\".\"reporting\".\"program-registry-removed-patients-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n registering_facility as \"{{ translate_label('registryRegisteringFacility') }}\",\r\n registered_by as \"{{ translate_label('registryRegisteredBy') }}\",\r\n currently_at as \"{{ translate_label('registryCurrentlyAt') }}\",\r\n related_conditions as \"{{ translate_label('registryConditions') }}\",\r\n related_condition_categories as \"{{ translate_label('registryConditionCategories') }}\",\r\n clinical_status as \"{{ translate_label('registryClinicalStatus') }}\",\r\n to_char(registration_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('registryRegisteredDate') }}\",\r\n to_char(deactivated_datetime::date, '{{ var(\"date_format\") }}') as \"{{ translate_label('registryDeactivatedDate') }}\",\r\n deactivated_by as \"{{ translate_label('registryDeactivatedBy') }}\"\r\nfrom {{ ref('ds__patient_program_registrations') }}\r\nwhere registration_status != 'active'\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else deactivated_datetime\r\n >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else deactivated_datetime\r\n <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('registryId') }} is null then true\r\n else program_registry_id = {{ parameter('registryId') }}\r\n end\r\norder by deactivated_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patient_program_registrations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\program-registry-removed-patients-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n registering_facility as \"Registering facility\",\n registered_by as \"Registered by\",\n currently_at as \"Currently at\",\n related_conditions as \"Related conditions\",\n related_condition_categories as \"Related condition categories\",\n clinical_status as \"Status\",\n to_char(registration_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date of registration\",\n to_char(deactivated_datetime::date, 'YYYY-MM-DD') as \"Date of deactivation\",\n deactivated_by as \"Deactivated by\"\nfrom \"app\".\"reporting\".\"ds__patient_program_registrations\"\nwhere registration_status != 'active'\n and\n case\n when nullif('2025-01-01', '')::date is null then true\n else deactivated_datetime\n >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else deactivated_datetime\n <= nullif('2025-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else program_registry_id = nullif('', '')::text\n end\norder by deactivated_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.recent-diagnoses-line-list": {"database": "app", "schema": "reporting", "name": "recent-diagnoses-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\recent-diagnoses-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\recent-diagnoses-line-list.sql", "unique_id": "model.tamanu_source_dbt.recent-diagnoses-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "recent-diagnoses-line-list"], "alias": "recent-diagnoses-line-list", "checksum": {"name": "sha256", "checksum": "435d94e50d8519502b673b26e18653a190bef7b147294bc7072067bc9907083e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.4562907, "relation_name": "\"app\".\"reporting\".\"recent-diagnoses-line-list\"", "raw_code": "select\r\n to_char(diagnosis_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('diagnosisDateTime') }}\",\r\n diagnosis as \"{{ translate_label('diagnoses') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n contact_number as \"{{ translate_label('patientPrimaryContactNumber') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n clinician as \"{{ translate_label('encounterClinician') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n certainty as \"{{ translate_label('diagnosisCertainty') }}\",\r\n is_primary as \"{{ translate_label('diagnosisIsPrimary') }}\"\r\nfrom {{ ref('ds__diagnoses') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else diagnosis_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else diagnosis_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case when\r\n coalesce({{ parameter('diagnosisId') }}, {{ parameter('diagnosis2Id') }}, {{ parameter('diagnosis3Id') }}, {{ parameter('diagnosis4Id') }}, {{ parameter('diagnosis5Id') }}) is null\r\n then true\r\n else diagnosis_id in (\r\n {{ parameter('diagnosisId') }},\r\n {{ parameter('diagnosis2Id') }},\r\n {{ parameter('diagnosis3Id') }},\r\n {{ parameter('diagnosis4Id') }},\r\n {{ parameter('diagnosis5Id') }}\r\n )\r\n end\r\norder by diagnosis_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__diagnoses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\recent-diagnoses-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(diagnosis_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date & time\",\n diagnosis as \"Diagnoses\",\n first_name as \"First name\",\n last_name as \"Last name\",\n display_id as \"Patient ID\",\n age as \"Age\",\n sex as \"Sex\",\n contact_number as \"Primary contact number\",\n village as \"Village\",\n clinician as \"Clinician\",\n department as \"Department\",\n certainty as \"Certainty\",\n is_primary as \"Is primary\"\nfrom \"app\".\"reporting\".\"ds__diagnoses\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else diagnosis_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else diagnosis_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case when\n coalesce(nullif('', '')::text, nullif('', '')::text, nullif('', '')::text, nullif('', '')::text, nullif('', '')::text) is null\n then true\n else diagnosis_id in (\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text\n )\n end\norder by diagnosis_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.registered-births-line-list": {"database": "app", "schema": "reporting", "name": "registered-births-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\registered-births-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\registered-births-line-list.sql", "unique_id": "model.tamanu_source_dbt.registered-births-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "registered-births-line-list"], "alias": "registered-births-line-list", "checksum": {"name": "sha256", "checksum": "5b9604be523ab8c8e5a9927007b8252dec6da785002cf3e4af05072e6f27495e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.464056, "relation_name": "\"app\".\"reporting\".\"registered-births-line-list\"", "raw_code": "select\r\n to_char(registration_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('birthRegisteredDateTime') }}\",\r\n registered_by as \"{{ translate_label('birthRegisteredBy') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n ethnicity as \"{{ translate_label('patientEthnicity') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n mother as \"{{ translate_label('patientMother') }}\",\r\n father as \"{{ translate_label('patientFather') }}\",\r\n to_char(birth_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('birthTimeOfBirth') }}\",\r\n gestational_age_estimate as \"{{ translate_label('birthGestationalAgeEstimate') }}\",\r\n registered_birth_place as \"{{ translate_label('patientPlaceOfBirth') }}\",\r\n birth_facility as \"{{ translate_label('birthFacility') }}\",\r\n attendant_at_birth as \"{{ translate_label('birthAttendantType') }}\",\r\n name_of_attendant_at_birth as \"{{ translate_label('birthAttendant') }}\",\r\n birth_delivery_type as \"{{ translate_label('birthDeliveryType') }}\",\r\n birth_type as \"{{ translate_label('birthType') }}\",\r\n birth_weight as \"{{ translate_label('birthWeight') }}\",\r\n birth_length as \"{{ translate_label('birthLength') }}\",\r\n apgar_score_one_minute as \"{{ translate_label('birthApgarScoreOneMinute') }}\",\r\n apgar_score_five_minutes as \"{{ translate_label('birthApgarScoreFiveMinutes') }}\",\r\n apgar_score_ten_minutes as \"{{ translate_label('birthApgarScoreTenMinutes') }}\"\r\nfrom {{ ref(\"ds__births\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else date_of_birth >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else date_of_birth <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else birth_facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by date_of_birth, birth_time", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__births", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__births"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\registered-births-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(registration_date, 'YYYY-MM-DD') as \"Registration date\",\n registered_by as \"Registered by\",\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n ethnicity as \"Ethnicity\",\n nationality as \"Nationality\",\n village as \"Village\",\n mother as \"Mother\",\n father as \"Father\",\n to_char(birth_time, 'HH24:MI') as \"Time of birth\",\n gestational_age_estimate as \"Gestational age (weeks)\",\n registered_birth_place as \"Place of birth\",\n birth_facility as \"Name of health facility (if selected)\",\n attendant_at_birth as \"Attendant at birth\",\n name_of_attendant_at_birth as \"Name of attendant\",\n birth_delivery_type as \"Delivery type\",\n birth_type as \"Single/Plural birth\",\n birth_weight as \"Birth weight (kg)\",\n birth_length as \"Birth length (cm)\",\n apgar_score_one_minute as \"Apgar score at 1 min\",\n apgar_score_five_minutes as \"Apgar score at 5 min\",\n apgar_score_ten_minutes as \"Apgar score at 10 min\"\nfrom \"app\".\"reporting\".\"ds__births\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else date_of_birth >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else date_of_birth <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else birth_facility_id = nullif('', '')::text\n end\norder by date_of_birth, birth_time", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.registered-patients-by-dob-line-list": {"database": "app", "schema": "reporting", "name": "registered-patients-by-dob-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\registered-patients-by-dob-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\registered-patients-by-dob-line-list.sql", "unique_id": "model.tamanu_source_dbt.registered-patients-by-dob-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "registered-patients-by-dob-line-list"], "alias": "registered-patients-by-dob-line-list", "checksum": {"name": "sha256", "checksum": "cf39873c1fc9f6a0a76587011922808df503e6f1e2f522082b6edd364b8b722b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.472078, "relation_name": "\"app\".\"reporting\".\"registered-patients-by-dob-line-list\"", "raw_code": "select\r\n to_char(registration_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientRegistrationDate') }}\",\r\n registered_by as \"{{ translate_label('patientRegisteredBy') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n middle_name as \"{{ translate_label('patientMiddleName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n cultural_name as \"{{ translate_label('patientCulturalName') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n registration_type as \"{{ translate_label('patientRegistrationType') }}\",\r\n birth_certificate as \"{{ translate_label('patientBirthCertificate') }}\",\r\n driving_license as \"{{ translate_label('patientDrivingLicense') }}\",\r\n passport as \"{{ translate_label('patientPassport') }}\",\r\n blood_type as \"{{ translate_label('patientBloodType') }}\",\r\n title as \"{{ translate_label('patientTitle') }}\",\r\n marital_status as \"{{ translate_label('patientMaritalStatus') }}\",\r\n primary_contact_number as \"{{ translate_label('patientPrimaryContactNumber') }}\", -- noqa:disable=LT05\r\n secondary_contact_number as \"{{ translate_label('patientSecondaryContactNumber') }}\", -- noqa:disable=LT05\r\n country_of_birth as \"{{ translate_label('patientCountryOfBirth') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n ethnicity as \"{{ translate_label('patientEthnicity') }}\",\r\n occupation as \"{{ translate_label('patientOccupation') }}\",\r\n religion as \"{{ translate_label('patientReligion') }}\",\r\n patient_billing_type as \"{{ translate_label('patientBillingType') }}\"\r\nfrom {{ ref(\"ds__patients\") }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else date_of_birth >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else date_of_birth <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by date_of_birth, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\registered-patients-by-dob-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(registration_date, 'YYYY-MM-DD') as \"Registration date\",\n registered_by as \"Registered by\",\n first_name as \"First name\",\n middle_name as \"Middle name\",\n last_name as \"Last name\",\n cultural_name as \"Cultural name\",\n display_id as \"Patient ID\",\n sex as \"Sex\",\n village as \"Village\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n registration_type as \"Registration type\",\n birth_certificate as \"Birth certificate\",\n driving_license as \"Driving license\",\n passport as \"Passport\",\n blood_type as \"Blood type\",\n title as \"Title\",\n marital_status as \"Marital status\",\n primary_contact_number as \"Primary contact number\", -- noqa:disable=LT05\n secondary_contact_number as \"Secondary contact number\", -- noqa:disable=LT05\n country_of_birth as \"Country of birth\",\n nationality as \"Nationality\",\n ethnicity as \"Ethnicity\",\n occupation as \"Occupation\",\n religion as \"Religion\",\n patient_billing_type as \"Billing type\"\nfrom \"app\".\"reporting\".\"ds__patients\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else date_of_birth >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else date_of_birth <= nullif('2024-01-31', '')::date\n end\norder by date_of_birth, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.registered-patients-daily-summary": {"database": "app", "schema": "reporting", "name": "registered-patients-daily-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\registered-patients-daily-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\registered-patients-daily-summary.sql", "unique_id": "model.tamanu_source_dbt.registered-patients-daily-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "registered-patients-daily-summary"], "alias": "registered-patients-daily-summary", "checksum": {"name": "sha256", "checksum": "7d3032f5d17623bf33e3fcb5c17d6c71c0fcc95b4bf6c2a92fadbf0674880a1d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.4738264, "relation_name": "\"app\".\"reporting\".\"registered-patients-daily-summary\"", "raw_code": "select\r\n to_char(registration_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientRegistrationDate') }}\",\r\n count(\r\n case when sex = 'Male' then 1 end\r\n ) as \"{{ translate_label('patientMaleCount') }}\",\r\n count(\r\n case when sex = 'Female' then 1 end\r\n ) as \"{{ translate_label('patientFemaleCount') }}\"\r\nfrom {{ ref(\"ds__patients\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else registration_date >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else registration_date <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\ngroup by registration_date", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\registered-patients-daily-summary.sql", "compiled": true, "compiled_code": "select\n to_char(registration_date, 'YYYY-MM-DD') as \"Registration date\",\n count(\n case when sex = 'Male' then 1 end\n ) as \"Total patients (male)\",\n count(\n case when sex = 'Female' then 1 end\n ) as \"Total patients (female)\"\nfrom \"app\".\"reporting\".\"ds__patients\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else registration_date >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else registration_date <= nullif('2024-01-31', '')::date\n end\ngroup by registration_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.registered-patients-line-list": {"database": "app", "schema": "reporting", "name": "registered-patients-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\registered-patients-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\registered-patients-line-list.sql", "unique_id": "model.tamanu_source_dbt.registered-patients-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "registered-patients-line-list"], "alias": "registered-patients-line-list", "checksum": {"name": "sha256", "checksum": "154918e6a44ae56338f8800ce4f1f6f13559b7078a799f0390a3128ae81d1182"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.4861803, "relation_name": "\"app\".\"reporting\".\"registered-patients-line-list\"", "raw_code": "select\r\n to_char(registration_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientRegistrationDate') }}\",\r\n registered_by as \"{{ translate_label('patientRegisteredBy') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n middle_name as \"{{ translate_label('patientMiddleName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n cultural_name as \"{{ translate_label('patientCulturalName') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n birth_certificate as \"{{ translate_label('patientBirthCertificate') }}\",\r\n driving_license as \"{{ translate_label('patientDrivingLicense') }}\",\r\n passport as \"{{ translate_label('patientPassport') }}\",\r\n blood_type as \"{{ translate_label('patientBloodType') }}\",\r\n title as \"{{ translate_label('patientTitle') }}\",\r\n marital_status as \"{{ translate_label('patientMaritalStatus') }}\",\r\n primary_contact_number as \"{{ translate_label('patientPrimaryContactNumber') }}\", -- noqa:disable=LT05\r\n secondary_contact_number as \"{{ translate_label('patientSecondaryContactNumber') }}\", -- noqa:disable=LT05\r\n country_of_birth as \"{{ translate_label('patientCountryOfBirth') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n ethnicity as \"{{ translate_label('patientEthnicity') }}\",\r\n occupation as \"{{ translate_label('patientOccupation') }}\",\r\n religion as \"{{ translate_label('patientReligion') }}\",\r\n patient_billing_type as \"{{ translate_label('patientBillingType') }}\"\r\nfrom {{ ref(\"ds__patients\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else registration_date >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else registration_date <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by registration_date", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\registered-patients-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(registration_date, 'YYYY-MM-DD') as \"Registration date\",\n registered_by as \"Registered by\",\n first_name as \"First name\",\n middle_name as \"Middle name\",\n last_name as \"Last name\",\n cultural_name as \"Cultural name\",\n display_id as \"Patient ID\",\n sex as \"Sex\",\n village as \"Village\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n birth_certificate as \"Birth certificate\",\n driving_license as \"Driving license\",\n passport as \"Passport\",\n blood_type as \"Blood type\",\n title as \"Title\",\n marital_status as \"Marital status\",\n primary_contact_number as \"Primary contact number\", -- noqa:disable=LT05\n secondary_contact_number as \"Secondary contact number\", -- noqa:disable=LT05\n country_of_birth as \"Country of birth\",\n nationality as \"Nationality\",\n ethnicity as \"Ethnicity\",\n occupation as \"Occupation\",\n religion as \"Religion\",\n patient_billing_type as \"Billing type\"\nfrom \"app\".\"reporting\".\"ds__patients\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else registration_date >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else registration_date <= nullif('2024-01-31', '')::date\n end\norder by registration_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.upcoming-vaccinations-line-list": {"database": "app", "schema": "reporting", "name": "upcoming-vaccinations-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\upcoming-vaccinations-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\upcoming-vaccinations-line-list.sql", "unique_id": "model.tamanu_source_dbt.upcoming-vaccinations-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "upcoming-vaccinations-line-list"], "alias": "upcoming-vaccinations-line-list", "checksum": {"name": "sha256", "checksum": "77ab59d5f067cd4bafb635437e135e1e3d47d06bfc4344684cb2fedf32c63515"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.4939444, "relation_name": "\"app\".\"reporting\".\"upcoming-vaccinations-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n to_char(due_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDueDate') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\"\r\nfrom {{ ref(\"ds__patient_vaccinations_upcoming\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else date_of_birth >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else date_of_birth <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('status') }} is null then true\r\n else vaccine_status = {{ parameter('status') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\norder by due_date, last_name, first_name, vaccine_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patient_vaccinations_upcoming", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patient_vaccinations_upcoming"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\upcoming-vaccinations-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n village as \"Village\",\n age as \"Age\",\n sex as \"Sex\",\n to_char(due_date, 'YYYY-MM-DD') as \"Vaccination due date\",\n vaccine_name as \"Vaccine name\",\n vaccine_schedule as \"Schedule\",\n vaccine_status as \"Vaccine status\"\nfrom \"app\".\"reporting\".\"ds__patient_vaccinations_upcoming\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else date_of_birth >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else date_of_birth <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_status = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\norder by due_date, last_name, first_name, vaccine_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.usage-quality-metrics-patient-details": {"database": "app", "schema": "reporting", "name": "usage-quality-metrics-patient-details", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\usage-quality-metrics-patient-details.sql", "original_file_path": "models\\reports\\sql\\standard\\usage-quality-metrics-patient-details.sql", "unique_id": "model.tamanu_source_dbt.usage-quality-metrics-patient-details", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "usage-quality-metrics-patient-details"], "alias": "usage-quality-metrics-patient-details", "checksum": {"name": "sha256", "checksum": "89601d74e18959b0d3a9a8127f4f88ce8a48db0e093d4779ae5aaee8a112db1a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.4999628, "relation_name": "\"app\".\"reporting\".\"usage-quality-metrics-patient-details\"", "raw_code": "select\r\n total_patients as \"{{ translate_label('patientTotal') }}\",\r\n total_patients_with_incomplete_name as \"{{ translate_label('patientTotalWithIncompleteName') }}\",\r\n total_patients_with_missing_dob as \"{{ translate_label('patientTotalWithMissingDateOfBirth') }}\",\r\n total_patients_with_invalid_dob as \"{{ translate_label('patientTotalWithInvalidDateOfBirth') }}\",\r\n total_patients_with_missing_location as \"{{ translate_label('patientTotalWithMissingLocation') }}\",\r\n total_patients_with_missing_contact as \"{{ translate_label('patientTotalWithMissingContact') }}\",\r\n total_patients_merged as \"{{ translate_label('patientTotalMerged') }}\"\r\nfrom {{ ref(\"ds__usage_quality_metrics_patient_details\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__usage_quality_metrics_patient_details", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\usage-quality-metrics-patient-details.sql", "compiled": true, "compiled_code": "select\n total_patients as \"Total patients\",\n total_patients_with_incomplete_name as \"Total patients with incomplete name\",\n total_patients_with_missing_dob as \"Total patients with missing date of birth\",\n total_patients_with_invalid_dob as \"Total patients with invalid date of birth\",\n total_patients_with_missing_location as \"Total patients with missing location\",\n total_patients_with_missing_contact as \"Total patients with missing contact\",\n total_patients_merged as \"Total patients merged\"\nfrom \"app\".\"reporting\".\"ds__usage_quality_metrics_patient_details\"", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations": {"database": "app", "schema": "reporting", "name": "usage-quality-metrics-patient-registrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\usage-quality-metrics-patient-registrations.sql", "original_file_path": "models\\reports\\sql\\standard\\usage-quality-metrics-patient-registrations.sql", "unique_id": "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "usage-quality-metrics-patient-registrations"], "alias": "usage-quality-metrics-patient-registrations", "checksum": {"name": "sha256", "checksum": "e5188b8a82a43eb74feb139fe9a29eecff799d6cd4605f194d2465bbc59fd967"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.5034742, "relation_name": "\"app\".\"reporting\".\"usage-quality-metrics-patient-registrations\"", "raw_code": "select\r\n registration_date as \"{{ translate_label('patientRegistrationDate') }}\",\r\n total_patient_registrations as \"{{ translate_label('patientTotalPatientRegistrations') }}\",\r\n total_birth_registrations as \"{{ translate_label('patientTotalBirthRegistrations') }}\",\r\n total_incorrect_registrations_for_patient_under_6mth as \"{{ translate_label('patientTotalIncorrectRegistrationsForAgedUnder6Months') }}\"\r\nfrom {{ ref(\"ds__usage_quality_metrics_patient_registrations\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else registration_date >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else registration_date <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__usage_quality_metrics_patient_registrations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\usage-quality-metrics-patient-registrations.sql", "compiled": true, "compiled_code": "select\n registration_date as \"Registration date\",\n total_patient_registrations as \"Total patient registrations\",\n total_birth_registrations as \"Total birth registrations\",\n total_incorrect_registrations_for_patient_under_6mth as \"Total incorrect registrations for aged under 6 months\"\nfrom \"app\".\"reporting\".\"ds__usage_quality_metrics_patient_registrations\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else registration_date >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else registration_date <= nullif('2024-01-31', '')::date\n end", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.user-audit-line-list": {"database": "app", "schema": "reporting", "name": "user-audit-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\user-audit-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\user-audit-line-list.sql", "unique_id": "model.tamanu_source_dbt.user-audit-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "user-audit-line-list"], "alias": "user-audit-line-list", "checksum": {"name": "sha256", "checksum": "244ac39ab43145a9160c972340e0de7ab4f98576df81920ed0d14ac8de4d6d45"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.509505, "relation_name": "\"app\".\"reporting\".\"user-audit-line-list\"", "raw_code": "select\r\n user_name as \"{{ translate_label('userName') }}\",\r\n user_role as \"{{ translate_label('userRole') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n patient_category as \"{{ translate_label('patientCategory') }}\",\r\n triage_category as \"{{ translate_label('triageCategory') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(encounter_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(encounter_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n to_char(first_note_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('noteStartDateTime') }}\",\r\n to_char(last_note_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('noteEndDateTime') }}\",\r\n is_discharged as \"{{ translate_label('encounterIsDischarged') }}\",\r\n non_discharge_by_clinicians as \"{{ translate_label('encounterNonDischargeClinician') }}\"\r\nfrom {{ ref('ds__user_audit') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else encounter_start_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else encounter_start_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else department_id = {{ parameter('departmentId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\norder by encounter_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__user_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__user_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\user-audit-line-list.sql", "compiled": true, "compiled_code": "select\n user_name as \"User name\",\n user_role as \"User role\",\n display_id as \"Patient ID\",\n patient_category as \"Patient category\",\n triage_category as \"Triage category\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(encounter_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(encounter_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n to_char(first_note_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Notes start date and time\",\n to_char(last_note_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Notes end date and time\",\n is_discharged as \"Discharges (has the patient been discharged)\",\n non_discharge_by_clinicians as \"Non-discharge by clinicians\"\nfrom \"app\".\"reporting\".\"ds__user_audit\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else encounter_start_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else encounter_start_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else department_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\norder by encounter_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine-audit-line-list": {"database": "app", "schema": "reporting", "name": "vaccine-audit-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\vaccine-audit-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\vaccine-audit-line-list.sql", "unique_id": "model.tamanu_source_dbt.vaccine-audit-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "vaccine-audit-line-list"], "alias": "vaccine-audit-line-list", "checksum": {"name": "sha256", "checksum": "543890829e39869f611088dbd1073f3ecd0a2afeaea4c4ca539ce3bdfe4f0193"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.509505, "relation_name": "\"app\".\"reporting\".\"vaccine-audit-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n to_char(vaccination_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDate') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_brand as \"{{ translate_label('vaccineBrand') }}\",\r\n disease as \"{{ translate_label('vaccineDisease') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n given_by as \"{{ translate_label('vaccinationGivenBy') }}\",\r\n recorded_by as \"{{ translate_label('vaccinationRecordedBy') }}\",\r\n modified_by as \"{{ translate_label('vaccinationModifiedBy') }}\",\r\n to_char(updated_at, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('vaccinationModifiedDate') }}\"\r\nfrom {{ ref(\"ds__vaccinations\") }}\r\nwhere\r\n vaccine_status in ('Recorded in error', 'Historical')\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else vaccination_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else vaccination_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('status') }} is null then true\r\n else vaccine_status = {{ parameter('status') }}\r\n end\r\norder by vaccination_date, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\vaccine-audit-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n to_char(vaccination_date, 'YYYY-MM-DD') as \"Vaccination date\",\n vaccine_name as \"Vaccine name\",\n vaccine_brand as \"If category of Other, Vaccine brand\",\n disease as \"If category of Other, Disease\",\n vaccine_status as \"Vaccine status\",\n vaccine_schedule as \"Schedule\",\n given_by as \"Given by\",\n recorded_by as \"Recorded by\",\n modified_by as \"Record modified by\",\n to_char(updated_at, 'YYYY-MM-DD HH24:MI:SS') as \"Record modification date\"\nfrom \"app\".\"reporting\".\"ds__vaccinations\"\nwhere\n vaccine_status in ('Recorded in error', 'Historical')\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else vaccination_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else vaccination_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_status = nullif('', '')::text\n end\norder by vaccination_date, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine-line-list": {"database": "app", "schema": "reporting", "name": "vaccine-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\vaccine-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\vaccine-line-list.sql", "unique_id": "model.tamanu_source_dbt.vaccine-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "vaccine-line-list"], "alias": "vaccine-line-list", "checksum": {"name": "sha256", "checksum": "381751f5880c4c39ed7abcb8d931cd66c97372c48e6b6b3955f5bd26222adbee"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782422374.5215561, "relation_name": "\"app\".\"reporting\".\"vaccine-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(vaccination_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDate') }}\",\r\n vaccine_category as \"{{ translate_label('vaccineCategory') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_brand as \"{{ translate_label('vaccineBrand') }}\",\r\n disease as \"{{ translate_label('vaccineDisease') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n batch as \"{{ translate_label('vaccinationBatch') }}\",\r\n given_by as \"{{ translate_label('vaccinationGivenBy') }}\",\r\n recorded_by as \"{{ translate_label('vaccinationRecordedBy') }}\",\r\n circumstances as \"{{ translate_label('vaccinationGivenElseWhereCircumstances') }}\",\r\n given_elsewhere_by as \"{{ translate_label('vaccinationGivenElsewhereCountry') }}\",\r\n not_given_clinician as \"{{ translate_label('vaccinationNotGivenClinician') }}\",\r\n not_given_reason as \"{{ translate_label('vaccinationNotGivenReason') }}\"\r\nfrom {{ ref(\"ds__vaccinations\") }}\r\nwhere\r\n vaccine_status in ('Given', 'Not Given')\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else vaccination_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else vaccination_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\norder by vaccination_date, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\vaccine-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(vaccination_date, 'YYYY-MM-DD') as \"Vaccination date\",\n vaccine_category as \"Vaccine category\",\n vaccine_name as \"Vaccine name\",\n vaccine_brand as \"If category of Other, Vaccine brand\",\n disease as \"If category of Other, Disease\",\n vaccine_status as \"Vaccine status\",\n vaccine_schedule as \"Schedule\",\n batch as \"Batch\",\n given_by as \"Given by\",\n recorded_by as \"Recorded by\",\n circumstances as \"If given elsewhere, Circumstances\",\n given_elsewhere_by as \"If given elsewhere, Country\",\n not_given_clinician as \"If not given, Supervising clinician\",\n not_given_reason as \"If not given, Reason not given\"\nfrom \"app\".\"reporting\".\"ds__vaccinations\"\nwhere\n vaccine_status in ('Given', 'Not Given')\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else vaccination_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else vaccination_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\norder by vaccination_date, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.tamanu_source_dbt.logical__ds__admissions": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__admissions", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__admissions.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__admissions.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__admissions", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__admissions"], "alias": "logical__ds__admissions", "checksum": {"name": "sha256", "checksum": "6cbc32741ad544b52471e759e543e9e6124749a6ebd67b9ae6f66c3a12cfe103"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.5850072, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_admissions\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n and e.encounter_type = 'admission'\r\n),\r\ndataset as (\r\n select count(*) as total_admissions\r\n from {{ ref('ds__admissions') }}\r\n)\r\nselect base.total_admissions as base_total_admissions,\r\n dataset.total_admissions as dataset_total_admissions\r\nfrom base\r\njoin dataset on dataset.total_admissions != base.total_admissions", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__admissions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__admissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__admissions.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_admissions\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n and e.encounter_type = 'admission'\n),\ndataset as (\n select count(*) as total_admissions\n from \"app\".\"reporting\".\"ds__admissions\"\n)\nselect base.total_admissions as base_total_admissions,\n dataset.total_admissions as dataset_total_admissions\nfrom base\njoin dataset on dataset.total_admissions != base.total_admissions", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__diagnoses": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__diagnoses", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__diagnoses.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__diagnoses.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__diagnoses", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__diagnoses"], "alias": "logical__ds__diagnoses", "checksum": {"name": "sha256", "checksum": "1381d6a4641a4f7b37a57396787d4c2d1409acd59229ef66cc430655a9d094d2"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.5850072, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_diagnoses\r\n from {{ ref('encounter_diagnoses') }} ed\r\n join {{ ref('encounters') }} e\r\n on e.id = ed.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_diagnoses\r\n from {{ ref('ds__diagnoses') }}\r\n)\r\nselect base.total_diagnoses as base_total_diagnoses,\r\n dataset.total_diagnoses as dataset_total_diagnoses\r\nfrom base\r\njoin dataset on dataset.total_diagnoses != base.total_diagnoses", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__diagnoses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__diagnoses.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = ed.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_diagnoses\n from \"app\".\"reporting\".\"ds__diagnoses\"\n)\nselect base.total_diagnoses as base_total_diagnoses,\n dataset.total_diagnoses as dataset_total_diagnoses\nfrom base\njoin dataset on dataset.total_diagnoses != base.total_diagnoses", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__encounters_emergency": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__encounters_emergency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__encounters_emergency.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__encounters_emergency.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__encounters_emergency", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__encounters_emergency"], "alias": "logical__ds__encounters_emergency", "checksum": {"name": "sha256", "checksum": "7029453522360970b2fdf3f42b90de15515e07ad20e9705fb2b9e8372a661dc1"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.600799, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_encounters\r\n from {{ ref('triages') }} t\r\n),\r\ndataset as (\r\n select count(*) as total_encounters\r\n from {{ ref('ds__encounters_emergency') }}\r\n)\r\nselect base.total_encounters as base_total_encounters,\r\n dataset.total_encounters as dataset_total_encounters\r\nfrom base\r\njoin dataset on dataset.total_encounters != base.total_encounters", "doc_blocks": [], "language": "sql", "refs": [{"name": "triages", "package": null, "version": null}, {"name": "ds__encounters_emergency", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.ds__encounters_emergency"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__encounters_emergency.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"triages\" t\n),\ndataset as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"ds__encounters_emergency\"\n)\nselect base.total_encounters as base_total_encounters,\n dataset.total_encounters as dataset_total_encounters\nfrom base\njoin dataset on dataset.total_encounters != base.total_encounters", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__encounter_diets": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__encounter_diets", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__encounter_diets.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__encounter_diets.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__encounter_diets", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__encounter_diets"], "alias": "logical__ds__encounter_diets", "checksum": {"name": "sha256", "checksum": "ed17631c77c982faf8016e5ad23d72c6a63e27fb44ef6d9821b3b605cb1d6f18"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6018157, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_patients\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and not f.is_sensitive\r\n where e.end_datetime is null\r\n),\r\ndataset as (\r\n select count(*) as total_patients\r\n from {{ ref('ds__encounter_diets') }}\r\n)\r\nselect base.total_patients as base_total_patients,\r\n dataset.total_patients as dataset_total_patients\r\nfrom base\r\njoin dataset on dataset.total_patients != base.total_patients", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__encounter_diets", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__encounter_diets.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_patients\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and not f.is_sensitive\n where e.end_datetime is null\n),\ndataset as (\n select count(*) as total_patients\n from \"app\".\"reporting\".\"ds__encounter_diets\"\n)\nselect base.total_patients as base_total_patients,\n dataset.total_patients as dataset_total_patients\nfrom base\njoin dataset on dataset.total_patients != base.total_patients", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__encounter_prescriptions": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__encounter_prescriptions", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__encounter_prescriptions.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__encounter_prescriptions.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__encounter_prescriptions", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__encounter_prescriptions"], "alias": "logical__ds__encounter_prescriptions", "checksum": {"name": "sha256", "checksum": "a6597408683d2ffa8c3d6559e116433daf61d1fc127f0540f6257c4c2fdebe7f"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6018157, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_prescriptions\r\n from {{ ref('encounter_prescriptions') }} ep\r\n join {{ ref('encounters') }} e\r\n on e.id = ep.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_prescriptions\r\n from {{ ref('ds__encounter_prescriptions') }}\r\n)\r\nselect base.total_prescriptions as base_total_prescriptions,\r\n dataset.total_prescriptions as dataset_total_prescriptions\r\nfrom base\r\njoin dataset on dataset.total_prescriptions != base.total_prescriptions", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__encounter_prescriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__encounter_prescriptions.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_prescriptions\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = ep.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_prescriptions\n from \"app\".\"reporting\".\"ds__encounter_prescriptions\"\n)\nselect base.total_prescriptions as base_total_prescriptions,\n dataset.total_prescriptions as dataset_total_prescriptions\nfrom base\njoin dataset on dataset.total_prescriptions != base.total_prescriptions", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__imaging_requests": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__imaging_requests", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__imaging_requests.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__imaging_requests.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__imaging_requests", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__imaging_requests"], "alias": "logical__ds__imaging_requests", "checksum": {"name": "sha256", "checksum": "633ba58f9aedb9e6b0edb80aaab073beab450a917577d0039df300c1a560e1ea"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6018157, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_requests\r\n from {{ ref('imaging_requests') }} ir\r\n join {{ ref('encounters') }} e\r\n on e.id = ir.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_requests\r\n from {{ ref('ds__imaging_requests') }}\r\n)\r\nselect base.total_requests as base_total_requests,\r\n dataset.total_requests as dataset_total_requests\r\nfrom base\r\njoin dataset on dataset.total_requests != base.total_requests", "doc_blocks": [], "language": "sql", "refs": [{"name": "imaging_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__imaging_requests.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_requests\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = ir.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_requests\n from \"app\".\"reporting\".\"ds__imaging_requests\"\n)\nselect base.total_requests as base_total_requests,\n dataset.total_requests as dataset_total_requests\nfrom base\njoin dataset on dataset.total_requests != base.total_requests", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__location_bookings": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__location_bookings", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__location_bookings.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__location_bookings.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__location_bookings", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__location_bookings"], "alias": "logical__ds__location_bookings", "checksum": {"name": "sha256", "checksum": "0e99e681b6099a1bbc0137f63936ff78d5600ef1d512fcf99818032025087f7f"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6018157, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_bookings\r\n from {{ ref('location_bookings') }} lb\r\n join {{ ref('locations') }} l\r\n on l.id = lb.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_bookings\r\n from {{ ref('ds__location_bookings') }}\r\n)\r\nselect base.total_bookings as base_total_bookings,\r\n dataset.total_bookings as dataset_total_bookings\r\nfrom base\r\njoin dataset on dataset.total_bookings != base.total_bookings", "doc_blocks": [], "language": "sql", "refs": [{"name": "location_bookings", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__location_bookings", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__location_bookings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__location_bookings.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_bookings\n from \"app\".\"reporting\".\"location_bookings\" lb\n join \"app\".\"reporting\".\"locations\" l\n on l.id = lb.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_bookings\n from \"app\".\"reporting\".\"ds__location_bookings\"\n)\nselect base.total_bookings as base_total_bookings,\n dataset.total_bookings as dataset_total_bookings\nfrom base\njoin dataset on dataset.total_bookings != base.total_bookings", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__outpatient_appointments": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__outpatient_appointments", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__outpatient_appointments.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__outpatient_appointments.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__outpatient_appointments", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__outpatient_appointments"], "alias": "logical__ds__outpatient_appointments", "checksum": {"name": "sha256", "checksum": "08ecc89f114270604ad3507df8701de315b3e307d2a0219b1948f8f37dddbc40"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6018157, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_appointments\r\n from {{ ref('outpatient_appointments') }} lb\r\n join {{ ref('location_groups') }} lg\r\n on lg.id = lb.location_group_id\r\n join {{ ref('facilities') }} f\r\n on f.id = lg.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_appointments\r\n from {{ ref('ds__outpatient_appointments') }}\r\n)\r\nselect base.total_appointments as base_total_appointments,\r\n dataset.total_appointments as dataset_total_appointments\r\nfrom base\r\njoin dataset on dataset.total_appointments != base.total_appointments", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__outpatient_appointments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__outpatient_appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__outpatient_appointments.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_appointments\n from \"app\".\"reporting\".\"outpatient_appointments\" lb\n join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = lb.location_group_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = lg.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_appointments\n from \"app\".\"reporting\".\"ds__outpatient_appointments\"\n)\nselect base.total_appointments as base_total_appointments,\n dataset.total_appointments as dataset_total_appointments\nfrom base\njoin dataset on dataset.total_appointments != base.total_appointments", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__procedures": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__procedures", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__procedures.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__procedures.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__procedures", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__procedures"], "alias": "logical__ds__procedures", "checksum": {"name": "sha256", "checksum": "6133c8017cc8d84871beecc16a0d5947e68ece261a422bf6478a49b9ae8e5115"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6018157, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_procedures\r\n from {{ ref('procedures') }} p\r\n join {{ ref('encounters') }} e\r\n on e.id = p.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_procedures\r\n from {{ ref('ds__procedures') }}\r\n)\r\nselect base.total_procedures as base_total_procedures,\r\n dataset.total_procedures as dataset_total_procedures\r\nfrom base\r\njoin dataset on dataset.total_procedures != base.total_procedures", "doc_blocks": [], "language": "sql", "refs": [{"name": "procedures", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__procedures", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__procedures.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_procedures\n from \"app\".\"reporting\".\"procedures\" p\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = p.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_procedures\n from \"app\".\"reporting\".\"ds__procedures\"\n)\nselect base.total_procedures as base_total_procedures,\n dataset.total_procedures as dataset_total_procedures\nfrom base\njoin dataset on dataset.total_procedures != base.total_procedures", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__referrals": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__referrals", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__referrals.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__referrals.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__referrals", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__referrals"], "alias": "logical__ds__referrals", "checksum": {"name": "sha256", "checksum": "07cbc168b774759b131a766cddbe358b938c315f4f9dab3a0fd788764f29591d"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.616459, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_referrals\r\n from {{ ref('referrals') }} r\r\n join {{ ref('encounters') }} e\r\n on e.id = r.initiating_encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_referrals\r\n from {{ ref('ds__referrals') }}\r\n)\r\nselect base.total_referrals as base_total_referrals,\r\n dataset.total_referrals as dataset_total_referrals\r\nfrom base\r\njoin dataset on dataset.total_referrals != base.total_referrals", "doc_blocks": [], "language": "sql", "refs": [{"name": "referrals", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__referrals", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__referrals.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_referrals\n from \"app\".\"reporting\".\"referrals\" r\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = r.initiating_encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_referrals\n from \"app\".\"reporting\".\"ds__referrals\"\n)\nselect base.total_referrals as base_total_referrals,\n dataset.total_referrals as dataset_total_referrals\nfrom base\njoin dataset on dataset.total_referrals != base.total_referrals", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__user_audit": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__user_audit", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__user_audit.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__user_audit.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__user_audit", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__user_audit"], "alias": "logical__ds__user_audit", "checksum": {"name": "sha256", "checksum": "3cab73cd866b58cd073298de9fe9b8865af225121e4c76b32415d0eee9fd3b9b"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.616459, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_encounters\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_encounters\r\n from {{ ref('ds__user_audit') }}\r\n)\r\nselect base.total_encounters as base_total_encounters,\r\n dataset.total_encounters as dataset_total_encounters\r\nfrom base\r\njoin dataset on dataset.total_encounters != base.total_encounters", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__user_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__user_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__user_audit.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"ds__user_audit\"\n)\nselect base.total_encounters as base_total_encounters,\n dataset.total_encounters as dataset_total_encounters\nfrom base\njoin dataset on dataset.total_encounters != base.total_encounters", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__vaccinations": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__vaccinations", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__vaccinations.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__vaccinations.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__vaccinations", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__vaccinations"], "alias": "logical__ds__vaccinations", "checksum": {"name": "sha256", "checksum": "3e4d109462ca7d37c1e3afe0ed4206eaef030bb05e9bbb613058d1268f6bbd74"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.616459, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_vaccinations\r\n from {{ ref('vaccine_administrations') }} va\r\n join {{ ref('encounters') }} e\r\n on e.id = va.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_vaccinations\r\n from {{ ref('ds__vaccinations') }}\r\n)\r\nselect base.total_vaccinations as base_total_vaccinations,\r\n dataset.total_vaccinations as dataset_total_vaccinations\r\nfrom base\r\njoin dataset on dataset.total_vaccinations != base.total_vaccinations", "doc_blocks": [], "language": "sql", "refs": [{"name": "vaccine_administrations", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__vaccinations.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" va\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = va.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_vaccinations\n from \"app\".\"reporting\".\"ds__vaccinations\"\n)\nselect base.total_vaccinations as base_total_vaccinations,\n dataset.total_vaccinations as dataset_total_vaccinations\nfrom base\njoin dataset on dataset.total_vaccinations != base.total_vaccinations", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__encounter_summary_by_end_date": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__encounter_summary_by_end_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__encounter_summary_by_end_date.sql", "original_file_path": "tests\\logical_integrity\\logical__encounter_summary_by_end_date.sql", "unique_id": "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__encounter_summary_by_end_date"], "alias": "logical__encounter_summary_by_end_date", "checksum": {"name": "sha256", "checksum": "aa3c486e972ccccf3163cbf42c9e4ca6f2b0816d6cce556871247935d68cff3f"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.616459, "relation_name": null, "raw_code": "with base as (\r\n select count(distinct e.id) as total_encounters\r\n from {{ ref('encounters') }} e\r\n join {{ ref('encounter_history') }} eh\r\n on eh.encounter_id = e.id\r\n join {{ ref('users') }} actor\r\n on actor.id = eh.updated_by_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n join {{ ref('departments') }} dp\r\n on dp.id = e.department_id\r\n join {{ ref('patients') }} p\r\n on p.id = e.patient_id\r\n where not f.is_sensitive\r\n and e.end_datetime is not null\r\n and e.end_datetime >= '2024-01-01'::date\r\n and e.end_datetime <= '2024-01-31'::date\r\n and e.patient_id != '{{ var(\"test_patient\") }}'\r\n),\r\nreport as (\r\n select count(*) as total_encounters\r\n from {{ ref('encounter-summary-by-end-date') }}\r\n)\r\nselect\r\n base.total_encounters as base_total_encounters,\r\n report.total_encounters as report_total_encounters\r\nfrom base\r\njoin report on report.total_encounters != base.total_encounters", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "encounter-summary-by-end-date", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.encounter-summary-by-end-date"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__encounter_summary_by_end_date.sql", "compiled": true, "compiled_code": "with base as (\n select count(distinct e.id) as total_encounters\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = e.id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n join \"app\".\"reporting\".\"departments\" dp\n on dp.id = e.department_id\n join \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\n where not f.is_sensitive\n and e.end_datetime is not null\n and e.end_datetime >= '2024-01-01'::date\n and e.end_datetime <= '2024-01-31'::date\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n),\nreport as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"encounter-summary-by-end-date\"\n)\nselect\n base.total_encounters as base_total_encounters,\n report.total_encounters as report_total_encounters\nfrom base\njoin report on report.total_encounters != base.total_encounters", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__encounter_summary_by_start_date": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__encounter_summary_by_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__encounter_summary_by_start_date.sql", "original_file_path": "tests\\logical_integrity\\logical__encounter_summary_by_start_date.sql", "unique_id": "test.tamanu_source_dbt.logical__encounter_summary_by_start_date", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__encounter_summary_by_start_date"], "alias": "logical__encounter_summary_by_start_date", "checksum": {"name": "sha256", "checksum": "f3672b8efce772e301002ca59fa84aaab2525464e1b62d992073f75dab414482"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6323621, "relation_name": null, "raw_code": "with base as (\r\n select count(distinct e.id) as total_encounters\r\n from {{ ref('encounters') }} e\r\n join {{ ref('encounter_history') }} eh\r\n on eh.encounter_id = e.id\r\n join {{ ref('users') }} actor\r\n on actor.id = eh.updated_by_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n join {{ ref('departments') }} dp\r\n on dp.id = e.department_id\r\n join {{ ref('patients') }} p\r\n on p.id = e.patient_id\r\n where not f.is_sensitive\r\n and e.start_datetime >= '2024-01-01'::date\r\n and e.start_datetime <= '2024-01-31'::date\r\n and e.patient_id != '{{ var(\"test_patient\") }}'\r\n),\r\nreport as (\r\n select count(*) as total_encounters\r\n from {{ ref('encounter-summary-by-start-date') }}\r\n)\r\nselect\r\n base.total_encounters as base_total_encounters,\r\n report.total_encounters as report_total_encounters\r\nfrom base\r\njoin report on report.total_encounters != base.total_encounters", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "encounter-summary-by-start-date", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.encounter-summary-by-start-date"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__encounter_summary_by_start_date.sql", "compiled": true, "compiled_code": "with base as (\n select count(distinct e.id) as total_encounters\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = e.id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n join \"app\".\"reporting\".\"departments\" dp\n on dp.id = e.department_id\n join \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\n where not f.is_sensitive\n and e.start_datetime >= '2024-01-01'::date\n and e.start_datetime <= '2024-01-31'::date\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n),\nreport as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"encounter-summary-by-start-date\"\n)\nselect\n base.total_encounters as base_total_encounters,\n report.total_encounters as report_total_encounters\nfrom base\njoin report on report.total_encounters != base.total_encounters", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.assert__metric_definitions__disaggregations": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "assert__metric_definitions__disaggregations", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source\\assert__metric_definitions__disaggregations.sql", "original_file_path": "tests\\source\\assert__metric_definitions__disaggregations.sql", "unique_id": "test.tamanu_source_dbt.assert__metric_definitions__disaggregations", "fqn": ["tamanu_source_dbt", "source", "assert__metric_definitions__disaggregations"], "alias": "assert__metric_definitions__disaggregations", "checksum": {"name": "sha256", "checksum": "78791500ff5cee27f9d05c99025684e81ccb2c688f14f1dbfdf4621459be657c"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6323621, "relation_name": null, "raw_code": "select\r\n md.metric_id,\r\n trim(d) as offending_disaggregation\r\nfrom {{ ref('metric_definitions') }} md\r\ncross join lateral unnest(string_to_array(md.disaggregations, ',')) as t(d)\r\nwhere trim(d) not in ('age_group', 'sex', 'facility_id', 'dhis_ncd_category')", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\source\\assert__metric_definitions__disaggregations.sql", "compiled": true, "compiled_code": "select\n md.metric_id,\n trim(d) as offending_disaggregation\nfrom \"app\".\"reporting\".\"metric_definitions\" md\ncross join lateral unnest(string_to_array(md.disaggregations, ',')) as t(d)\nwhere trim(d) not in ('age_group', 'sex', 'facility_id', 'dhis_ncd_category')", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.assert__patients__village_id": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "assert__patients__village_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source\\assert__patients__village_id.sql", "original_file_path": "tests\\source\\assert__patients__village_id.sql", "unique_id": "test.tamanu_source_dbt.assert__patients__village_id", "fqn": ["tamanu_source_dbt", "source", "assert__patients__village_id"], "alias": "assert__patients__village_id", "checksum": {"name": "sha256", "checksum": "94296d5b9ffcdc806f24dca745552981af5777095ed9b40db780b85d3c8c45cc"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6323621, "relation_name": null, "raw_code": "select rd.id\r\nfrom {{ source(\"tamanu\", \"patients\") }} p\r\nleft join {{ source(\"tamanu\", \"reference_data\") }} rd on rd.id = p.village_id\r\nwhere p.village_id is not null\r\n and rd.id is null", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\source\\assert__patients__village_id.sql", "compiled": true, "compiled_code": "select rd.id\nfrom \"app\".\"public\".\"patients\" p\nleft join \"app\".\"public\".\"reference_data\" rd on rd.id = p.village_id\nwhere p.village_id is not null\n and rd.id is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "assert__scheduled_vaccines__weeks_due", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source\\assert__scheduled_vaccines__weeks_due.sql", "original_file_path": "tests\\source\\assert__scheduled_vaccines__weeks_due.sql", "unique_id": "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due", "fqn": ["tamanu_source_dbt", "source", "assert__scheduled_vaccines__weeks_due"], "alias": "assert__scheduled_vaccines__weeks_due", "checksum": {"name": "sha256", "checksum": "0f5d5d8362f4e9402018786e77c42bb2c38c6491b4a2ea2754a7d9ff3317743c"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6323621, "relation_name": null, "raw_code": "select\r\n category,\r\n vaccine_id\r\nfrom {{ source(\"tamanu\", \"scheduled_vaccines\") }}\r\nwhere weeks_from_birth_due notnull\r\n and index != 1\r\n and visibility_status = 'current'\r\ngroup by\r\n category,\r\n vaccine_id\r\n\r\nunion\r\n\r\nselect\r\n category,\r\n vaccine_id\r\nfrom {{ source(\"tamanu\", \"scheduled_vaccines\") }}\r\nwhere weeks_from_last_vaccination_due notnull\r\n and index = 1\r\n and visibility_status = 'current'\r\ngroup by\r\n category,\r\n vaccine_id", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"], ["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\source\\assert__scheduled_vaccines__weeks_due.sql", "compiled": true, "compiled_code": "select\n category,\n vaccine_id\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere weeks_from_birth_due notnull\n and index != 1\n and visibility_status = 'current'\ngroup by\n category,\n vaccine_id\n\nunion\n\nselect\n category,\n vaccine_id\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere weeks_from_last_vaccination_due notnull\n and index = 1\n and visibility_status = 'current'\ngroup by\n category,\n vaccine_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.assert__users__role": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "assert__users__role", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source\\assert__users__role.sql", "original_file_path": "tests\\source\\assert__users__role.sql", "unique_id": "test.tamanu_source_dbt.assert__users__role", "fqn": ["tamanu_source_dbt", "source", "assert__users__role"], "alias": "assert__users__role", "checksum": {"name": "sha256", "checksum": "913180135f0df2269cfc10b274a164b1e4708ad471ab536a7f6ab057c3ffa3f0"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422374.6323621, "relation_name": null, "raw_code": "select u.role\r\nfrom {{ source(\"tamanu\", \"users\") }} u\r\nleft join {{ source(\"tamanu\", \"roles\") }} r on r.id = u.role\r\nwhere r.id is null\r\n and u.role not in ('admin', 'base', 'practitioner', 'system')", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\source\\assert__users__role.sql", "compiled": true, "compiled_code": "select u.role\nfrom \"app\".\"public\".\"users\" u\nleft join \"app\".\"public\".\"roles\" r on r.id = u.role\nwhere r.id is null\n and u.role not in ('admin', 'base', 'practitioner', 'system')", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "seed.tamanu_source_dbt.metric_definitions": {"database": "app", "schema": "reporting", "name": "metric_definitions", "resource_type": "seed", "package_name": "tamanu_source_dbt", "path": "metric_definitions.csv", "original_file_path": "seeds\\metric_definitions.csv", "unique_id": "seed.tamanu_source_dbt.metric_definitions", "fqn": ["tamanu_source_dbt", "metric_definitions"], "alias": "metric_definitions", "checksum": {"name": "sha256", "checksum": "6c392d7de33cabd5d508af21ac36c0163dfa2691321db67e6b88a9d6d991b216"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"owner": "bes-maui", "domain": "clinical", "pii": false, "classification": "internal"}, "group": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"metric_id": "text", "kind": "text", "name": "text", "description": "text", "numerator_description": "text", "denominator_description": "text", "data_source": "text", "definition_source": "text", "definition_source_code": "text", "definition_rationale": "text", "unit": "text", "subject_grain": "text", "disaggregations": "text", "variant_of": "text", "owner": "text", "status": "text", "spec_path": "text"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "Canonical registry of `metric__` indicators and `der__` derived elements\nderived from Tamanu data. Consumed by every deployment that depends on\nthis package \u2014 deployments inherit the catalogue automatically via\n`ref('metric_definitions')` without redeclaring anything.\n\nEach row defines one indicator: identifier, plain-English description,\nnumerator/denominator, source standard, output shape (subject grain,\ndisaggregations, unit), and lifecycle status. Definitions here are the\nsingle source of truth \u2014 implementation overrides (a deployment uses a\ndifferent upstream survey for the same metric) are invisible at this\nlayer; only definition variances (different rules, different numbers) are\nflagged, via `variant_of` on a deployment-specific extension seed at\n`tamanu-dbt-/seeds/metric_definitions_.csv`.\n\nSchema per Maui data architecture D5\n(`.maui/knowledge/architecture/data-architecture/decisions.md`).\nStatus lifecycle: `draft` \u2192 `approved` \u2192 `deprecated`. PR review checks\nthat the corresponding `metric__` model output matches the registered\nshape (disaggregations, subject_grain, unit) before a row promotes from\n`draft` to `approved`.\n", "columns": {"metric_id": {"name": "metric_id", "description": "Globally unique, snake-case identifier. Matches the `metric__` model name suffix or `der__` cohort id. Stable across releases \u2014 never reused.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "kind": {"name": "kind", "description": "Artefact kind \u2014 `metric`, `cohort`, `condition_era`, `drug_era`, `dose_era`, or `episode`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Human-readable label shown in catalogues and dashboards.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Plain-English description of what the artefact measures.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "numerator_description": {"name": "numerator_description", "description": "Numerator in words. Metrics only \u2014 NULL for `der__` rows.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "denominator_description": {"name": "denominator_description", "description": "Denominator in words. Metrics only \u2014 NULL for count metrics and for `der__` rows.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "data_source": {"name": "data_source", "description": "Source system the artefact derives from (`tamanu`, `msupply`, `senaite`, `weather`).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "definition_source": {"name": "definition_source", "description": "Where the definition comes from \u2014 external standard name (e.g. `WHO_SMART_HIV`, `WHO_CORE_100`, `WHO_PEN`, `SDG`, `DHIS2_HDT`, `MANA`, `GLOBAL_FUND`, `OHDSI`, `IYCF`, `MSF`) or `BES` for internal definitions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "definition_source_code": {"name": "definition_source_code", "description": "External standard's own identifier for the indicator (e.g. WHO DAK indicator code, SDG code, DHIS2 data element code). NULL for `BES` definitions and standards without a structured code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "definition_rationale": {"name": "definition_rationale", "description": "Short justification \u2014 for external standards, why this one over others; for `BES`/`MSF`, why an internal definition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "unit": {"name": "unit", "description": "Unit of measure (`count`, `percentage`, `rate_per_1000`). Metrics only \u2014 NULL for non-metric kinds.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "subject_grain": {"name": "subject_grain", "description": "Grain of `subject_id` in the metric output \u2014 `patient`, `encounter`, `facility`, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "disaggregations": {"name": "disaggregations", "description": "Comma-separated list of disaggregation column names the artefact produces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "variant_of": {"name": "variant_of", "description": "Parent `metric_id` if this row is a deployment-specific definition variant; else NULL. Metrics only.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner": {"name": "owner", "description": "Team or individual responsible for the artefact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Lifecycle status \u2014 `draft`, `approved`, or `deprecated`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "spec_path": {"name": "spec_path", "description": "Repo-relative path to the SDD spec for this artefact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://seeds\\metric_definitions.yml", "build_path": null, "unrendered_config": {"meta": {"owner": "bes-maui", "domain": "clinical", "pii": false, "classification": "internal"}, "column_types": {"metric_id": "text", "kind": "text", "name": "text", "description": "text", "numerator_description": "text", "denominator_description": "text", "data_source": "text", "definition_source": "text", "definition_source_code": "text", "definition_rationale": "text", "unit": "text", "subject_grain": "text", "disaggregations": "text", "variant_of": "text", "owner": "text", "status": "text", "spec_path": "text"}}, "created_at": 1782422375.7611165, "relation_name": "\"app\".\"reporting\".\"metric_definitions\"", "raw_code": "", "doc_blocks": [], "root_path": "C:\\Users\\julia\\Documents\\GitHub\\tamanu-source-dbt", "depends_on": {"macros": []}}, "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8.sql", "original_file_path": "models\\bases\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc", "fqn": ["tamanu_source_dbt", "bases", "dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error"], "alias": "dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8"}, "created_at": 1782422374.9003649, "relation_name": null, "raw_code": "{{ dbt_utils.test_not_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_not_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_diagnoses.yml\\dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8.sql", "compiled": true, "compiled_code": "\nwith all_values as (\n\n select distinct\n certainty as value_field\n\n from \"app\".\"reporting\".\"encounter_diagnoses\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n 'disproven','error'\n )\n\n)\n\nselect *\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "certainty", "file_key_name": "models.encounter_diagnoses", "attached_node": "model.tamanu_source_dbt.encounter_diagnoses", "test_metadata": {"name": "not_accepted_values", "kwargs": {"column_name": "certainty", "values": ["disproven", "error"], "model": "{{ get_where_subquery(ref('encounter_diagnoses')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_metric_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_metric_id.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_metric_id"], "alias": "not_null_metric_definitions_metric_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.7611165, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_metric_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect metric_id\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere metric_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "metric_id", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "metric_id", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "unique_metric_definitions_metric_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "unique_metric_definitions_metric_id.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13", "fqn": ["tamanu_source_dbt", "unique_metric_definitions_metric_id"], "alias": "unique_metric_definitions_metric_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.7611165, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\unique_metric_definitions_metric_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n metric_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere metric_id is not null\ngroup by metric_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "metric_id", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "unique", "kwargs": {"column_name": "metric_id", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_kind", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_kind.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_kind"], "alias": "not_null_metric_definitions_kind", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.7611165, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_kind.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect kind\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere kind is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "kind", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "kind", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_df924eba44c45a8608483602f26072d9.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode"], "alias": "accepted_values_metric_definit_df924eba44c45a8608483602f26072d9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_df924eba44c45a8608483602f26072d9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_df924eba44c45a8608483602f26072d9"}, "created_at": 1782422375.777114, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_df924eba44c45a8608483602f26072d9\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_df924eba44c45a8608483602f26072d9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n kind as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by kind\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'metric','cohort','condition_era','drug_era','dose_era','episode'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "kind", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["metric", "cohort", "condition_era", "drug_era", "dose_era", "episode"], "column_name": "kind", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_name.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_name"], "alias": "not_null_metric_definitions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.777114, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_description", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_description.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_description"], "alias": "not_null_metric_definitions_description", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.777114, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_description.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect description\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere description is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "description", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "description", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_data_source", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_data_source.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_data_source"], "alias": "not_null_metric_definitions_data_source", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.777114, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_data_source.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect data_source\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere data_source is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data_source", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "data_source", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather"], "alias": "accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1"}, "created_at": 1782422375.777114, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n data_source as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by data_source\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'tamanu','msupply','senaite','weather'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data_source", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["tamanu", "msupply", "senaite", "weather"], "column_name": "data_source", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_definition_source", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_definition_source.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_definition_source"], "alias": "not_null_metric_definitions_definition_source", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.777114, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_definition_source.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect definition_source\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere definition_source is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "definition_source", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "definition_source", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES"], "alias": "accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f"}, "created_at": 1782422375.777114, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n definition_source as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by definition_source\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'WHO_SMART_HIV','WHO_CORE_100','WHO_PEN','SDG','DHIS2_HDT','MANA','GLOBAL_FUND','OHDSI','IYCF','MSF','BES'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "definition_source", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["WHO_SMART_HIV", "WHO_CORE_100", "WHO_PEN", "SDG", "DHIS2_HDT", "MANA", "GLOBAL_FUND", "OHDSI", "IYCF", "MSF", "BES"], "column_name": "definition_source", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_unit__count__percentage__rate_per_1000", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_unit__count__percentage__rate_per_1000"], "alias": "accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3"}, "created_at": 1782422375.7985914, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n unit as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by unit\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'count','percentage','rate_per_1000'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unit", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["count", "percentage", "rate_per_1000"], "column_name": "unit", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_subject_grain", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_subject_grain.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_subject_grain"], "alias": "not_null_metric_definitions_subject_grain", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8063843, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_subject_grain.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect subject_grain\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere subject_grain is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "subject_grain", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "subject_grain", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a", "fqn": ["tamanu_source_dbt", "relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_"], "alias": "relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332"}, "created_at": 1782422375.8063843, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}, {"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select variant_of as from_field\n from \"app\".\"reporting\".\"metric_definitions\"\n where variant_of is not null\n),\n\nparent as (\n select metric_id as to_field\n from \"app\".\"reporting\".\"metric_definitions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "variant_of", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('metric_definitions')", "field": "metric_id", "column_name": "variant_of", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_owner", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_owner.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_owner"], "alias": "not_null_metric_definitions_owner", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8177168, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_owner.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect owner\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere owner is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "owner", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "owner", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_status.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_status"], "alias": "not_null_metric_definitions_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8197253, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_status__draft__approved__deprecated", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_status__draft__approved__deprecated"], "alias": "accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b"}, "created_at": 1782422375.8217325, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'draft','approved','deprecated'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["draft", "approved", "deprecated"], "column_name": "status", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_spec_path", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_spec_path.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_spec_path"], "alias": "not_null_metric_definitions_spec_path", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8309932, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_spec_path.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect spec_path\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere spec_path is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "spec_path", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "spec_path", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_accesses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_accesses_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_accesses_id"], "alias": "source_unique_logs__tamanu_accesses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8349938, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_unique_logs__tamanu_accesses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"accesses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_id"], "alias": "source_not_null_logs__tamanu_accesses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8359935, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"accesses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_created_at.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_created_at"], "alias": "source_not_null_logs__tamanu_accesses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8379934, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"logs\".\"accesses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_updated_at.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_updated_at"], "alias": "source_not_null_logs__tamanu_accesses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8399916, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"logs\".\"accesses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_user_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_user_id"], "alias": "source_not_null_logs__tamanu_accesses_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8419917, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"logs\".\"accesses\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_record_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_record_id"], "alias": "source_not_null_logs__tamanu_accesses_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8449118, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"logs\".\"accesses\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_record_type.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_record_type"], "alias": "source_not_null_logs__tamanu_accesses_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8459573, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"logs\".\"accesses\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_session_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_session_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_session_id"], "alias": "source_not_null_logs__tamanu_accesses_session_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8469741, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_session_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect session_id\nfrom \"app\".\"logs\".\"accesses\"\nwhere session_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "session_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "session_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_device_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_device_id"], "alias": "source_not_null_logs__tamanu_accesses_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8479717, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"logs\".\"accesses\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_logged_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_logged_at.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_logged_at"], "alias": "source_not_null_logs__tamanu_accesses_logged_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8489766, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_logged_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect logged_at\nfrom \"app\".\"logs\".\"accesses\"\nwhere logged_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "logged_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "logged_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_front_end_context", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_front_end_context.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_front_end_context"], "alias": "source_not_null_logs__tamanu_accesses_front_end_context", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8499756, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_front_end_context.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect front_end_context\nfrom \"app\".\"logs\".\"accesses\"\nwhere front_end_context is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "front_end_context", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "front_end_context", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_back_end_context", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_back_end_context.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_back_end_context"], "alias": "source_not_null_logs__tamanu_accesses_back_end_context", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.850971, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_back_end_context.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect back_end_context\nfrom \"app\".\"logs\".\"accesses\"\nwhere back_end_context is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "back_end_context", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "back_end_context", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_is_mobile", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_is_mobile.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_is_mobile"], "alias": "source_not_null_logs__tamanu_accesses_is_mobile", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8519702, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_is_mobile.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_mobile\nfrom \"app\".\"logs\".\"accesses\"\nwhere is_mobile is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_mobile", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_mobile", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_version", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_version.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_version"], "alias": "source_not_null_logs__tamanu_accesses_version", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8519702, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_version.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect version\nfrom \"app\".\"logs\".\"accesses\"\nwhere version is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "version", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "version", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_updated_at_sync_tick.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_updated_at_sync_tick"], "alias": "source_not_null_logs__tamanu_accesses_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8529694, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"logs\".\"accesses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_changes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_changes_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_changes_id"], "alias": "source_unique_logs__tamanu_changes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8619628, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_unique_logs__tamanu_changes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"changes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_id"], "alias": "source_not_null_logs__tamanu_changes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8619628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"changes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_table_oid", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_table_oid.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_table_oid"], "alias": "source_not_null_logs__tamanu_changes_table_oid", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8619628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_table_oid.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect table_oid\nfrom \"app\".\"logs\".\"changes\"\nwhere table_oid is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "table_oid", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "table_oid", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_table_schema", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_table_schema.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_table_schema"], "alias": "source_not_null_logs__tamanu_changes_table_schema", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8619628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_table_schema.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect table_schema\nfrom \"app\".\"logs\".\"changes\"\nwhere table_schema is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "table_schema", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "table_schema", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_table_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_table_name.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_table_name"], "alias": "source_not_null_logs__tamanu_changes_table_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8619628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_table_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect table_name\nfrom \"app\".\"logs\".\"changes\"\nwhere table_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "table_name", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "table_name", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_logged_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_logged_at.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_logged_at"], "alias": "source_not_null_logs__tamanu_changes_logged_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8619628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_logged_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect logged_at\nfrom \"app\".\"logs\".\"changes\"\nwhere logged_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "logged_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "logged_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_created_at.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_created_at"], "alias": "source_not_null_logs__tamanu_changes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8619628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"logs\".\"changes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_updated_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_updated_by_user_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_updated_by_user_id"], "alias": "source_not_null_logs__tamanu_changes_updated_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8619628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_updated_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_by_user_id\nfrom \"app\".\"logs\".\"changes\"\nwhere updated_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_by_user_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_by_user_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465", "fqn": ["tamanu_source_dbt", "logs", "source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a"}, "created_at": 1782422375.8619628, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select updated_by_user_id as from_field\n from \"app\".\"logs\".\"changes\"\n where updated_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_by_user_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "updated_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_device_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_device_id"], "alias": "source_not_null_logs__tamanu_changes_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"logs\".\"changes\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_version", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_version.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_version"], "alias": "source_not_null_logs__tamanu_changes_version", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_version.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect version\nfrom \"app\".\"logs\".\"changes\"\nwhere version is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "version", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "version", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_record_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_record_id"], "alias": "source_not_null_logs__tamanu_changes_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"logs\".\"changes\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_record_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_record_created_at.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_record_created_at"], "alias": "source_not_null_logs__tamanu_changes_record_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_record_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_created_at\nfrom \"app\".\"logs\".\"changes\"\nwhere record_created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_record_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_record_updated_at.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_record_updated_at"], "alias": "source_not_null_logs__tamanu_changes_record_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_record_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_updated_at\nfrom \"app\".\"logs\".\"changes\"\nwhere record_updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_updated_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_updated_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_record_data", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_record_data.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_record_data"], "alias": "source_not_null_logs__tamanu_changes_record_data", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_record_data.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_data\nfrom \"app\".\"logs\".\"changes\"\nwhere record_data is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_data", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_data", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_updated_at_sync_tick.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_updated_at_sync_tick"], "alias": "source_not_null_logs__tamanu_changes_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"logs\".\"changes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_debug_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_debug_logs_id.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_debug_logs_id"], "alias": "source_unique_logs__tamanu_debug_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_unique_logs__tamanu_debug_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"debug_logs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_debug_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_debug_logs_id.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_debug_logs_id"], "alias": "source_not_null_logs__tamanu_debug_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_not_null_logs__tamanu_debug_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"debug_logs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_debug_logs_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_debug_logs_type.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_debug_logs_type"], "alias": "source_not_null_logs__tamanu_debug_logs_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_not_null_logs__tamanu_debug_logs_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"logs\".\"debug_logs\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0", "fqn": ["tamanu_source_dbt", "logs", "source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate"], "alias": "source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n type as value_field,\n count(*) as n_records\n\n from \"app\".\"logs\".\"debug_logs\"\n group by type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'syncLookupUpdate'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "type", "values": ["syncLookupUpdate"], "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_debug_logs_info", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_debug_logs_info.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_debug_logs_info"], "alias": "source_not_null_logs__tamanu_debug_logs_info", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_not_null_logs__tamanu_debug_logs_info.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect info\nfrom \"app\".\"logs\".\"debug_logs\"\nwhere info is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "info", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "info", "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_dhis2_pushes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_dhis2_pushes_id.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_dhis2_pushes_id"], "alias": "source_unique_logs__tamanu_dhis2_pushes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_unique_logs__tamanu_dhis2_pushes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_id.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_id"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8780098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_created_at.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_created_at"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.893775, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_report_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_report_id.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_report_id"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_report_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.893775, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_report_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect report_id\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere report_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "report_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "report_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_status.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_status"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8956676, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_updated_at.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_updated_at"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8964322, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_fhir_writes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_fhir_writes_id.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_fhir_writes_id"], "alias": "source_unique_logs__tamanu_fhir_writes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8964322, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_unique_logs__tamanu_fhir_writes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_id.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_id"], "alias": "source_not_null_logs__tamanu_fhir_writes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8964322, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_created_at.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_created_at"], "alias": "source_not_null_logs__tamanu_fhir_writes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8964322, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_verb", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_verb.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_verb"], "alias": "source_not_null_logs__tamanu_fhir_writes_verb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8964322, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_verb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect verb\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere verb is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "verb", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "verb", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_url", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_url.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_url"], "alias": "source_not_null_logs__tamanu_fhir_writes_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.8964322, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_url.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect url\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere url is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "url", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "url", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_body", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_body.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_body"], "alias": "source_not_null_logs__tamanu_fhir_writes_body", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.902487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_body.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect body\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere body is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "body", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "body", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_headers", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_headers.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_headers"], "alias": "source_not_null_logs__tamanu_fhir_writes_headers", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.902487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_headers.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect headers\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere headers is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "headers", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "headers", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_migrations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_migrations_id.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_migrations_id"], "alias": "source_unique_logs__tamanu_migrations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.902487, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_unique_logs__tamanu_migrations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"migrations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_id.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_id"], "alias": "source_not_null_logs__tamanu_migrations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.902487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"migrations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_logged_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_logged_at.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_logged_at"], "alias": "source_not_null_logs__tamanu_migrations_logged_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.902487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_logged_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect logged_at\nfrom \"app\".\"logs\".\"migrations\"\nwhere logged_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "logged_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "logged_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_record_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_record_sync_tick.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_record_sync_tick"], "alias": "source_not_null_logs__tamanu_migrations_record_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.902487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_record_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_sync_tick\nfrom \"app\".\"logs\".\"migrations\"\nwhere record_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_sync_tick", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_sync_tick", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_device_id.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_device_id"], "alias": "source_not_null_logs__tamanu_migrations_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.902487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"logs\".\"migrations\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_version", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_version.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_version"], "alias": "source_not_null_logs__tamanu_migrations_version", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.902487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_version.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect version\nfrom \"app\".\"logs\".\"migrations\"\nwhere version is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "version", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "version", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_direction", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_direction.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_direction"], "alias": "source_not_null_logs__tamanu_migrations_direction", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_direction.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect direction\nfrom \"app\".\"logs\".\"migrations\"\nwhere direction is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "direction", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "direction", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_migrations", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_migrations.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_migrations"], "alias": "source_not_null_logs__tamanu_migrations_migrations", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_migrations.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect migrations\nfrom \"app\".\"logs\".\"migrations\"\nwhere migrations is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "migrations", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "migrations", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_updated_at_sync_tick.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_updated_at_sync_tick"], "alias": "source_not_null_logs__tamanu_migrations_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"logs\".\"migrations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_administered_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_administered_vaccines_id.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_administered_vaccines_id"], "alias": "source_unique_tamanu_administered_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_unique_tamanu_administered_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_administered_vaccines_id.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_id"], "alias": "source_not_null_tamanu_administered_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_administered_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_administered_vaccines_created_at.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_created_at"], "alias": "source_not_null_tamanu_administered_vaccines_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_administered_vaccines_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_administered_vaccines_updated_at.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_updated_at"], "alias": "source_not_null_tamanu_administered_vaccines_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_administered_vaccines_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_administered_vaccines_status.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_status"], "alias": "source_not_null_tamanu_administered_vaccines_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_administered_vaccines_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING"], "alias": "source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"administered_vaccines\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'DUE','GIVEN','HISTORICAL','MISSED','NOT_GIVEN','OVERDUE','RECORDED_IN_ERROR','SCHEDULED','UNKNOWN','UPCOMING'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["DUE", "GIVEN", "HISTORICAL", "MISSED", "NOT_GIVEN", "OVERDUE", "RECORDED_IN_ERROR", "SCHEDULED", "UNKNOWN", "UPCOMING"], "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_"], "alias": "source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd"}, "created_at": 1782422375.9094262, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"], ["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines", "source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select scheduled_vaccine_id as from_field\n from \"app\".\"public\".\"administered_vaccines\"\n where scheduled_vaccine_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"scheduled_vaccines\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scheduled_vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "scheduled_vaccine_id", "to": "source('tamanu', 'scheduled_vaccines')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9"}, "created_at": 1782422375.9252164, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"administered_vaccines\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other"], "alias": "source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e"}, "created_at": 1782422375.9252164, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n injection_site as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"administered_vaccines\"\n group by injection_site\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'left_arm','right_arm','left_thigh','right_thigh','oral','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "injection_site", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "injection_site", "values": ["left_arm", "right_arm", "left_thigh", "right_thigh", "oral", "other"], "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_updated_at_sync_tick"], "alias": "source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7"}, "created_at": 1782422375.931215, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_"], "alias": "dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce"}, "created_at": 1782422375.931215, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n not_given_reason_id as id\n\n from \"app\".\"public\".\"administered_vaccines\"\n\n where not_given_reason_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'vaccineNotGivenReason'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "not_given_reason_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "not_given_reason_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'vaccineNotGivenReason'", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_appointments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_appointments_id.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_appointments_id"], "alias": "source_unique_tamanu_appointments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.931215, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_unique_tamanu_appointments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"appointments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_id.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_id"], "alias": "source_not_null_tamanu_appointments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.931215, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"appointments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4"}, "created_at": 1782422375.931215, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"appointments\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ap_75af671c924175fc8823980196455715.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_ap_75af671c924175fc8823980196455715", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ap_75af671c924175fc8823980196455715", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ap_75af671c924175fc8823980196455715"}, "created_at": 1782422375.942213, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ap_75af671c924175fc8823980196455715\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_relationships_tamanu_ap_75af671c924175fc8823980196455715.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"appointments\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233"}, "created_at": 1782422375.942213, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"appointments\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_type_legacy", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_type_legacy.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_type_legacy"], "alias": "source_not_null_tamanu_appointments_type_legacy", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.942213, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_type_legacy.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type_legacy\nfrom \"app\".\"public\".\"appointments\"\nwhere type_legacy is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type_legacy", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type_legacy", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_status.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_status"], "alias": "source_not_null_tamanu_appointments_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.942213, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"appointments\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled"], "alias": "source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256"}, "created_at": 1782422375.942213, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"appointments\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Confirmed','Arrived','Assessed','Seen','No-show','Cancelled'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["Confirmed", "Arrived", "Assessed", "Seen", "No-show", "Cancelled"], "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_"], "alias": "source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867"}, "created_at": 1782422375.942213, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_group_id as from_field\n from \"app\".\"public\".\"appointments\"\n where location_group_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"location_groups\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_group_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_group_id", "to": "source('tamanu', 'location_groups')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_appointments_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9569275, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"appointments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_"], "alias": "dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911"}, "created_at": 1782422375.9569275, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n booking_type_id as id\n\n from \"app\".\"public\".\"appointments\"\n\n where booking_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'bookingType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "booking_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "booking_type_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'bookingType'", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_"], "alias": "dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0"}, "created_at": 1782422375.960252, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n appointment_type_id as id\n\n from \"app\".\"public\".\"appointments\"\n\n where appointment_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'appointmentType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "appointment_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "appointment_type_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'appointmentType'", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_is_high_priority", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_is_high_priority.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_is_high_priority"], "alias": "source_not_null_tamanu_appointments_is_high_priority", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.960252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_is_high_priority.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_high_priority\nfrom \"app\".\"public\".\"appointments\"\nwhere is_high_priority is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_high_priority", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_high_priority", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_appointment_procedure_types_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_appointment_procedure_types_id.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_appointment_procedure_types_id"], "alias": "source_unique_tamanu_appointment_procedure_types_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.960252, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_unique_tamanu_appointment_procedure_types_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_procedure_types_id.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_id"], "alias": "source_not_null_tamanu_appointment_procedure_types_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.960252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appointment_procedure_types_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_appointment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_appointment_id"], "alias": "source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f"}, "created_at": 1782422375.960252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect appointment_id\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere appointment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "appointment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "appointment_id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_procedure_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_procedure_type_id"], "alias": "source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703"}, "created_at": 1782422375.960252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect procedure_type_id\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere procedure_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "procedure_type_id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_procedure_types_created_at.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_created_at"], "alias": "source_not_null_tamanu_appointment_procedure_types_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.960252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appointment_procedure_types_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_procedure_types_updated_at.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_updated_at"], "alias": "source_not_null_tamanu_appointment_procedure_types_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.960252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appointment_procedure_types_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick"], "alias": "source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042"}, "created_at": 1782422375.960252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_appointment_schedules_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_appointment_schedules_id.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_appointment_schedules_id"], "alias": "source_unique_tamanu_appointment_schedules_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_unique_tamanu_appointment_schedules_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_id.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_id"], "alias": "source_not_null_tamanu_appointment_schedules_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_interval", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_interval.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_interval"], "alias": "source_not_null_tamanu_appointment_schedules_interval", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_interval.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect interval\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere interval is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "interval", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "interval", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_frequency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_frequency.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_frequency"], "alias": "source_not_null_tamanu_appointment_schedules_frequency", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_frequency.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect frequency\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere frequency is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "frequency", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "frequency", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_created_at.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_created_at"], "alias": "source_not_null_tamanu_appointment_schedules_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_updated_at.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_updated_at"], "alias": "source_not_null_tamanu_appointment_schedules_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_updated_at_sync_tick"], "alias": "source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_is_fully_generated", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_is_fully_generated.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_is_fully_generated"], "alias": "source_not_null_tamanu_appointment_schedules_is_fully_generated", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_is_fully_generated.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_fully_generated\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere is_fully_generated is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_fully_generated", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_fully_generated", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_assets_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_assets_id.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_assets_id"], "alias": "source_unique_tamanu_assets_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_unique_tamanu_assets_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"assets\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_id.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_id"], "alias": "source_not_null_tamanu_assets_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"assets\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_name.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_name"], "alias": "source_not_null_tamanu_assets_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"assets\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_type.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_type"], "alias": "source_not_null_tamanu_assets_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"assets\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_assets_type__image_png__image_svg", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu_assets_type__image_png__image_svg.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_assets_type__image_png__image_svg"], "alias": "source_accepted_values_tamanu_assets_type__image_png__image_svg", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_accepted_values_tamanu_assets_type__image_png__image_svg.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"assets\"\n group by type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'image/png','image/svg'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "type", "values": ["image/png", "image/svg"], "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_data", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_data.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_data"], "alias": "source_not_null_tamanu_assets_data", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_data.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect data\nfrom \"app\".\"public\".\"assets\"\nwhere data is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "data", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_updated_at_sync_tick"], "alias": "source_not_null_tamanu_assets_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"assets\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_attachments_id.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_attachments_id"], "alias": "source_unique_tamanu_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9888182, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_unique_tamanu_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"attachments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_attachments_id.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_attachments_id"], "alias": "source_not_null_tamanu_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.989725, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_not_null_tamanu_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"attachments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_attachments_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_attachments_type.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_attachments_type"], "alias": "source_not_null_tamanu_attachments_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9902477, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_not_null_tamanu_attachments_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"attachments\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_attachments_data", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_attachments_data.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_attachments_data"], "alias": "source_not_null_tamanu_attachments_data", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9902477, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_not_null_tamanu_attachments_data.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect data\nfrom \"app\".\"public\".\"attachments\"\nwhere data is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "data", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_attachments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_attachments_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_attachments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_attachments_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9902477, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_not_null_tamanu_attachments_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"attachments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_certifiable_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_certifiable_vaccines_id.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_certifiable_vaccines_id"], "alias": "source_unique_tamanu_certifiable_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9902477, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_unique_tamanu_certifiable_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_id.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_id"], "alias": "source_not_null_tamanu_certifiable_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9944546, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_created_at.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_created_at"], "alias": "source_not_null_tamanu_certifiable_vaccines_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.997465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_updated_at.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_updated_at"], "alias": "source_not_null_tamanu_certifiable_vaccines_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9984617, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_certifiable_vaccines_vaccine_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_certifiable_vaccines_vaccine_id.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_certifiable_vaccines_vaccine_id"], "alias": "source_unique_tamanu_certifiable_vaccines_vaccine_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422375.9994612, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_unique_tamanu_certifiable_vaccines_vaccine_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n vaccine_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere vaccine_id is not null\ngroup by vaccine_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "vaccine_id", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_vaccine_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_vaccine_id.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_vaccine_id"], "alias": "source_not_null_tamanu_certifiable_vaccines_vaccine_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0004609, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_vaccine_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect vaccine_id\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere vaccine_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "vaccine_id", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_"], "alias": "dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa"}, "created_at": 1782422376.0004609, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n vaccine_id as id\n\n from \"app\".\"public\".\"certifiable_vaccines\"\n\n where vaccine_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'vaccine'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "vaccine_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'vaccine'", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_"], "alias": "dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824"}, "created_at": 1782422376.0039754, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n manufacturer_id as id\n\n from \"app\".\"public\".\"certifiable_vaccines\"\n\n where manufacturer_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'manufacturer'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "manufacturer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "manufacturer_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'manufacturer'", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_icd11_drug_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_icd11_drug_code"], "alias": "source_not_null_tamanu_certifiable_vaccines_icd11_drug_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0069745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd11_drug_code\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere icd11_drug_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "icd11_drug_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd11_drug_code", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_icd11_disease_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_icd11_disease_code"], "alias": "source_not_null_tamanu_certifiable_vaccines_icd11_disease_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0079746, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd11_disease_code\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere icd11_disease_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "icd11_disease_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd11_disease_code", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_vaccine_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_vaccine_code.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_vaccine_code"], "alias": "source_not_null_tamanu_certifiable_vaccines_vaccine_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.008974, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_vaccine_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect vaccine_code\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere vaccine_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "vaccine_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "vaccine_code", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_maximum_dosage", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_maximum_dosage.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_maximum_dosage"], "alias": "source_not_null_tamanu_certifiable_vaccines_maximum_dosage", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0099742, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_maximum_dosage.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect maximum_dosage\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere maximum_dosage is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "maximum_dosage", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "maximum_dosage", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick"], "alias": "source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9"}, "created_at": 1782422376.0099742, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_certificate_notifications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_certificate_notifications_id.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_certificate_notifications_id"], "alias": "source_unique_tamanu_certificate_notifications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0109746, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_unique_tamanu_certificate_notifications_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certificate_notifications_id.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_id"], "alias": "source_not_null_tamanu_certificate_notifications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0109746, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certificate_notifications_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certificate_notifications_type.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_type"], "alias": "source_not_null_tamanu_certificate_notifications_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0109746, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certificate_notifications_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc"], "alias": "source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8"}, "created_at": 1782422376.0109746, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"certificate_notifications\"\n group by type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'covid_19_clearance','vaccination_certificate','icao.test','icao.vacc'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "type", "values": ["covid_19_clearance", "vaccination_certificate", "icao.test", "icao.vacc"], "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_require_signing", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_require_signing"], "alias": "source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e"}, "created_at": 1782422376.0109746, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect require_signing\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere require_signing is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "require_signing", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "require_signing", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b"}, "created_at": 1782422376.0109746, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"certificate_notifications\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_"], "alias": "source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af"}, "created_at": 1782422376.0109746, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"], ["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests", "source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_id as from_field\n from \"app\".\"public\".\"certificate_notifications\"\n where lab_test_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_tests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_id", "to": "source('tamanu', 'lab_tests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certificate_notifications_status.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_status"], "alias": "source_not_null_tamanu_certificate_notifications_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0109746, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certificate_notifications_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore"], "alias": "source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4"}, "created_at": 1782422376.0109746, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"certificate_notifications\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Queued','Processed','Error','Ignore'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["Queued", "Processed", "Error", "Ignore"], "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_"], "alias": "source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961"}, "created_at": 1782422376.0270953, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_request_id as from_field\n from \"app\".\"public\".\"certificate_notifications\"\n where lab_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_request_id", "to": "source('tamanu', 'lab_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_updated_at_sync_tick"], "alias": "source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4"}, "created_at": 1782422376.0270953, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_contributing_death_causes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_contributing_death_causes_id.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_contributing_death_causes_id"], "alias": "source_unique_tamanu_contributing_death_causes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0270953, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_unique_tamanu_contributing_death_causes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contributing_death_causes_id.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_id"], "alias": "source_not_null_tamanu_contributing_death_causes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0270953, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contributing_death_causes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_time_after_onset", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_time_after_onset"], "alias": "source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617"}, "created_at": 1782422376.0270953, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect time_after_onset\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere time_after_onset is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "time_after_onset", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "time_after_onset", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_patient_death_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_patient_death_data_id"], "alias": "source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b"}, "created_at": 1782422376.0270953, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_death_data_id\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere patient_death_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_death_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_death_data_id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_"], "alias": "source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396"}, "created_at": 1782422376.0270953, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"], ["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_death_data_id as from_field\n from \"app\".\"public\".\"contributing_death_causes\"\n where patient_death_data_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patient_death_data\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_death_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_death_data_id", "to": "source('tamanu', 'patient_death_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_condition_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contributing_death_causes_condition_id.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_condition_id"], "alias": "source_not_null_tamanu_contributing_death_causes_condition_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0270953, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contributing_death_causes_condition_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition_id\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere condition_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition_id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da"}, "created_at": 1782422376.0270953, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n condition_id as id\n\n from \"app\".\"public\".\"contributing_death_causes\"\n\n where condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick"], "alias": "source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_death_revert_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_death_revert_logs_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_death_revert_logs_id"], "alias": "source_unique_tamanu_death_revert_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_unique_tamanu_death_revert_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_id"], "alias": "source_not_null_tamanu_death_revert_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_created_at.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_created_at"], "alias": "source_not_null_tamanu_death_revert_logs_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_updated_at.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_updated_at"], "alias": "source_not_null_tamanu_death_revert_logs_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_revert_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_revert_time.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_revert_time"], "alias": "source_not_null_tamanu_death_revert_logs_revert_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_revert_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect revert_time\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere revert_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "revert_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "revert_time", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_death_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_death_data_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_death_data_id"], "alias": "source_not_null_tamanu_death_revert_logs_death_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_death_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect death_data_id\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere death_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "death_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "death_data_id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_"], "alias": "source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"], ["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select death_data_id as from_field\n from \"app\".\"public\".\"death_revert_logs\"\n where death_data_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patient_death_data\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "death_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "death_data_id", "to": "source('tamanu', 'patient_death_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_patient_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_patient_id"], "alias": "source_not_null_tamanu_death_revert_logs_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"death_revert_logs\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_reverted_by_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_reverted_by_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_reverted_by_id"], "alias": "source_not_null_tamanu_death_revert_logs_reverted_by_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_reverted_by_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reverted_by_id\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere reverted_by_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reverted_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reverted_by_id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0"}, "created_at": 1782422376.0427778, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select reverted_by_id as from_field\n from \"app\".\"public\".\"death_revert_logs\"\n where reverted_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reverted_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "reverted_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_death_revert_logs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_departments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_departments_id.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_departments_id"], "alias": "source_unique_tamanu_departments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_unique_tamanu_departments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"departments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_departments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_departments_id.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_departments_id"], "alias": "source_not_null_tamanu_departments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_not_null_tamanu_departments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"departments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_departments_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_departments_code.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_departments_code"], "alias": "source_not_null_tamanu_departments_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_not_null_tamanu_departments_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"departments\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_departments_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_departments_name.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_departments_name"], "alias": "source_not_null_tamanu_departments_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_not_null_tamanu_departments_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"departments\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"departments\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_departments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_departments_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_departments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_departments_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_not_null_tamanu_departments_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"departments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_devices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_devices_id.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_devices_id"], "alias": "source_unique_tamanu_devices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_unique_tamanu_devices_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"devices\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_id.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_id"], "alias": "source_not_null_tamanu_devices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"devices\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_created_at.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_created_at"], "alias": "source_not_null_tamanu_devices_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"devices\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_updated_at.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_updated_at"], "alias": "source_not_null_tamanu_devices_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"devices\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_last_seen_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_last_seen_at.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_last_seen_at"], "alias": "source_not_null_tamanu_devices_last_seen_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.0586007, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_last_seen_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect last_seen_at\nfrom \"app\".\"public\".\"devices\"\nwhere last_seen_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_seen_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_seen_at", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_registered_by_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_registered_by_id.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_registered_by_id"], "alias": "source_not_null_tamanu_devices_registered_by_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.074243, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_registered_by_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect registered_by_id\nfrom \"app\".\"public\".\"devices\"\nwhere registered_by_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registered_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "registered_by_id", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160"}, "created_at": 1782422376.074243, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select registered_by_id as from_field\n from \"app\".\"public\".\"devices\"\n where registered_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registered_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'users')", "field": "id", "column_name": "registered_by_id", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_scopes", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_scopes.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_scopes"], "alias": "source_not_null_tamanu_devices_scopes", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.074243, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_scopes.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect scopes\nfrom \"app\".\"public\".\"devices\"\nwhere scopes is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scopes", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "scopes", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_discharges_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_discharges_id.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_discharges_id"], "alias": "source_unique_tamanu_discharges_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.074243, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_unique_tamanu_discharges_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"discharges\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_discharges_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_discharges_id.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_discharges_id"], "alias": "source_not_null_tamanu_discharges_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.074243, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_not_null_tamanu_discharges_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"discharges\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_discharges_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_discharges_encounter_id.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_discharges_encounter_id"], "alias": "source_not_null_tamanu_discharges_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.074243, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_not_null_tamanu_discharges_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"discharges\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1"}, "created_at": 1782422376.074243, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"discharges\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975"}, "created_at": 1782422376.074243, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select discharger_id as from_field\n from \"app\".\"public\".\"discharges\"\n where discharger_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "discharger_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "discharger_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_"], "alias": "dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9"}, "created_at": 1782422376.074243, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n disposition_id as id\n\n from \"app\".\"public\".\"discharges\"\n\n where disposition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'dischargeDisposition'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "disposition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "disposition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'dischargeDisposition'", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_discharges_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_discharges_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_discharges_updated_at_sync_tick"], "alias": "source_not_null_tamanu_discharges_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.089911, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_not_null_tamanu_discharges_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"discharges\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd"}, "created_at": 1782422376.089911, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_name as from_field\n from \"app\".\"public\".\"discharges\"\n where facility_name is not null\n),\n\nparent as (\n select name as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_name", "to": "source('tamanu', 'facilities')", "field": "name", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c"}, "created_at": 1782422376.089911, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_address as from_field\n from \"app\".\"public\".\"discharges\"\n where facility_address is not null\n),\n\nparent as (\n select street_address as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_address", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_address", "to": "source('tamanu', 'facilities')", "field": "street_address", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192"}, "created_at": 1782422376.089911, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_town as from_field\n from \"app\".\"public\".\"discharges\"\n where facility_town is not null\n),\n\nparent as (\n select city_town as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_town", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_town", "to": "source('tamanu', 'facilities')", "field": "city_town", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_document_metadata_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_document_metadata_id.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_document_metadata_id"], "alias": "source_unique_tamanu_document_metadata_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.089911, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_unique_tamanu_document_metadata_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"document_metadata\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_id.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_id"], "alias": "source_not_null_tamanu_document_metadata_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.089911, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"document_metadata\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_name.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_name"], "alias": "source_not_null_tamanu_document_metadata_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1027365, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"document_metadata\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_type.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_type"], "alias": "source_not_null_tamanu_document_metadata_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1027365, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"document_metadata\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_document_uploaded_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_document_uploaded_at.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_document_uploaded_at"], "alias": "source_not_null_tamanu_document_metadata_document_uploaded_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1027365, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_document_uploaded_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect document_uploaded_at\nfrom \"app\".\"public\".\"document_metadata\"\nwhere document_uploaded_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "document_uploaded_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "document_uploaded_at", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9"}, "created_at": 1782422376.1057675, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"document_metadata\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a"}, "created_at": 1782422376.1117985, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"document_metadata\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_attachment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_attachment_id.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_attachment_id"], "alias": "source_not_null_tamanu_document_metadata_attachment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1138048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_attachment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect attachment_id\nfrom \"app\".\"public\".\"document_metadata\"\nwhere attachment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attachment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "attachment_id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_"], "alias": "source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d"}, "created_at": 1782422376.1158113, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"], ["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments", "source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select attachment_id as from_field\n from \"app\".\"public\".\"document_metadata\"\n where attachment_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"attachments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attachment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "attachment_id", "to": "source('tamanu', 'attachments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_"], "alias": "source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4"}, "created_at": 1782422376.1178179, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"], ["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select department_id as from_field\n from \"app\".\"public\".\"document_metadata\"\n where department_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"departments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "department_id", "to": "source('tamanu', 'departments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_updated_at_sync_tick"], "alias": "source_not_null_tamanu_document_metadata_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1215725, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"document_metadata\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_source", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_source.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_source"], "alias": "source_not_null_tamanu_document_metadata_source", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1215725, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_source.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source\nfrom \"app\".\"public\".\"document_metadata\"\nwhere source is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "source", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "source", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded"], "alias": "source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383"}, "created_at": 1782422376.1215725, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n source as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"document_metadata\"\n group by source\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'patient_letter','uploaded'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "source", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "source", "values": ["patient_letter", "uploaded"], "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounters_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounters_id.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounters_id"], "alias": "source_unique_tamanu_encounters_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1255853, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_unique_tamanu_encounters_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounters\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_id.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_id"], "alias": "source_not_null_tamanu_encounters_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1275897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounters\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_created_at.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_created_at"], "alias": "source_not_null_tamanu_encounters_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1275897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounters\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_updated_at.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_updated_at"], "alias": "source_not_null_tamanu_encounters_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1275897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounters\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_encounter_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_encounter_type.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_encounter_type"], "alias": "source_not_null_tamanu_encounters_encounter_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.129596, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_encounter_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_type\nfrom \"app\".\"public\".\"encounters\"\nwhere encounter_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_type", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination"], "alias": "source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee"}, "created_at": 1782422376.129596, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n encounter_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"encounters\"\n group by encounter_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'admission','clinic','imaging','emergency','observation','triage','surveyResponse','vaccination'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "encounter_type", "values": ["admission", "clinic", "imaging", "emergency", "observation", "triage", "surveyResponse", "vaccination"], "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_start_date.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_start_date"], "alias": "source_not_null_tamanu_encounters_start_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1336093, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_start_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_date\nfrom \"app\".\"public\".\"encounters\"\nwhere start_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_date", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_13180f1fedec4cce1227952402808020.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_en_13180f1fedec4cce1227952402808020", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_13180f1fedec4cce1227952402808020", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_13180f1fedec4cce1227952402808020"}, "created_at": 1782422376.1356156, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_13180f1fedec4cce1227952402808020\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_13180f1fedec4cce1227952402808020.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"encounters\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87"}, "created_at": 1782422376.137363, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select examiner_id as from_field\n from \"app\".\"public\".\"encounters\"\n where examiner_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "examiner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "examiner_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64"}, "created_at": 1782422376.1413763, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"encounters\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_"], "alias": "source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4"}, "created_at": 1782422376.1433825, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select department_id as from_field\n from \"app\".\"public\".\"encounters\"\n where department_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"departments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "department_id", "to": "source('tamanu', 'departments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_"], "alias": "dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c"}, "created_at": 1782422376.1453888, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n patient_billing_type_id as id\n\n from \"app\".\"public\".\"encounters\"\n\n where patient_billing_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'patientBillingType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_billing_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "patient_billing_type_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'patientBillingType'", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_"], "alias": "dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9"}, "created_at": 1782422376.1494017, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n referral_source_id as id\n\n from \"app\".\"public\".\"encounters\"\n\n where referral_source_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'referralSource'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "referral_source_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "referral_source_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'referralSource'", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64"}, "created_at": 1782422376.1531563, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select planned_location_id as from_field\n from \"app\".\"public\".\"encounters\"\n where planned_location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "planned_location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "planned_location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encounters_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1551628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounters\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_diagnoses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_diagnoses_id.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_diagnoses_id"], "alias": "source_unique_tamanu_encounter_diagnoses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.157169, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_unique_tamanu_encounter_diagnoses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_id.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_id"], "alias": "source_not_null_tamanu_encounter_diagnoses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.157169, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_created_at.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_created_at"], "alias": "source_not_null_tamanu_encounter_diagnoses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1591752, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_updated_at.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_updated_at"], "alias": "source_not_null_tamanu_encounter_diagnoses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1591752, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected"], "alias": "source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e"}, "created_at": 1782422376.1591752, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n certainty as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"encounter_diagnoses\"\n group by certainty\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'confirmed','disproven','emergency','error','suspected'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "certainty", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "certainty", "values": ["confirmed", "disproven", "emergency", "error", "suspected"], "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_date.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_date"], "alias": "source_not_null_tamanu_encounter_diagnoses_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.163187, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712"}, "created_at": 1782422376.163187, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"encounter_diagnoses\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536"}, "created_at": 1782422376.1672, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n diagnosis_id as id\n\n from \"app\".\"public\".\"encounter_diagnoses\"\n\n where diagnosis_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "diagnosis_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "diagnosis_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.168948, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b"}, "created_at": 1782422376.1709538, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"encounter_diagnoses\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_diets_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_diets_id.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_diets_id"], "alias": "source_unique_tamanu_encounter_diets_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1729605, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_unique_tamanu_encounter_diets_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_id.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_id"], "alias": "source_not_null_tamanu_encounter_diets_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1749668, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_encounter_id.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_encounter_id"], "alias": "source_not_null_tamanu_encounter_diets_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1749668, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77"}, "created_at": 1782422376.1749668, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"encounter_diets\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_diet_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_diet_id.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_diet_id"], "alias": "source_not_null_tamanu_encounter_diets_diet_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1789792, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_diet_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect diet_id\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere diet_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "diet_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "diet_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_"], "alias": "dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3"}, "created_at": 1782422376.1789792, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n diet_id as id\n\n from \"app\".\"public\".\"encounter_diets\"\n\n where diet_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diet'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "diet_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "diet_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diet'", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_created_at.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_created_at"], "alias": "source_not_null_tamanu_encounter_diets_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1829925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_updated_at.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_updated_at"], "alias": "source_not_null_tamanu_encounter_diets_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1829925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encounter_diets_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_history_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_history_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_history_id"], "alias": "source_unique_tamanu_encounter_history_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_unique_tamanu_encounter_history_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_history\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_id"], "alias": "source_not_null_tamanu_encounter_history_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_created_at.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_created_at"], "alias": "source_not_null_tamanu_encounter_history_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_history\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_updated_at.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_updated_at"], "alias": "source_not_null_tamanu_encounter_history_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_history\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_date.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_date"], "alias": "source_not_null_tamanu_encounter_history_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"encounter_history\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_encounter_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_encounter_id"], "alias": "source_not_null_tamanu_encounter_history_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_department_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_department_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_department_id"], "alias": "source_not_null_tamanu_encounter_history_department_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_department_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect department_id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere department_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "department_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_"], "alias": "source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095"}, "created_at": 1782422376.1847394, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select department_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where department_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"departments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "department_id", "to": "source('tamanu', 'departments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_location_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_location_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_location_id"], "alias": "source_not_null_tamanu_encounter_history_location_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2003973, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_location_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect location_id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere location_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "location_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c"}, "created_at": 1782422376.2003973, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_examiner_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_examiner_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_examiner_id"], "alias": "source_not_null_tamanu_encounter_history_examiner_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2029061, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_examiner_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect examiner_id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere examiner_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "examiner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "examiner_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99"}, "created_at": 1782422376.2029061, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select examiner_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where examiner_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "examiner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "examiner_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_encounter_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_encounter_type.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_encounter_type"], "alias": "source_not_null_tamanu_encounter_history_encounter_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2029061, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_encounter_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_type\nfrom \"app\".\"public\".\"encounter_history\"\nwhere encounter_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_type", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination"], "alias": "source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7"}, "created_at": 1782422376.2029061, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n encounter_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"encounter_history\"\n group by encounter_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'admission','clinic','imaging','emergency','observation','triage','surveyResponse','vaccination'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "encounter_type", "values": ["admission", "clinic", "imaging", "emergency", "observation", "triage", "surveyResponse", "vaccination"], "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encounter_history_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2029061, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_history\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f"}, "created_at": 1782422376.2029061, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select actor_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where actor_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "actor_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "actor_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_change_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_change_type.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_change_type"], "alias": "source_not_null_tamanu_encounter_history_change_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": "change_type IS NOT NULL", "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "where": "change_type IS NOT NULL"}, "created_at": 1782422376.2029061, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(where=\"change_type IS NOT NULL\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_change_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect change_type\nfrom (select * from \"app\".\"public\".\"encounter_history\" where change_type IS NOT NULL) dbt_subquery\nwhere change_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "change_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "change_type", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_pause_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_pause_prescriptions_id.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_pause_prescriptions_id"], "alias": "source_unique_tamanu_encounter_pause_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_unique_tamanu_encounter_pause_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_pause_prescriptions_id.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_id"], "alias": "source_not_null_tamanu_encounter_pause_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encounter_pause_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id"], "alias": "source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_prescription_id\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere encounter_prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_pause_duration", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_pause_duration"], "alias": "source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pause_duration\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere pause_duration is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pause_duration", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pause_duration", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit"], "alias": "source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pause_time_unit\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere pause_time_unit is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pause_time_unit", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pause_time_unit", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date"], "alias": "source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pause_start_date\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere pause_start_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pause_start_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pause_start_date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date"], "alias": "source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pause_end_date\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere pause_end_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pause_end_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pause_end_date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_pause_prescriptions_created_at.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_created_at"], "alias": "source_not_null_tamanu_encounter_pause_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encounter_pause_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_pause_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_updated_at"], "alias": "source_not_null_tamanu_encounter_pause_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encounter_pause_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_pause_prescription_histories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_pause_prescription_histories_id.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_pause_prescription_histories_id"], "alias": "source_unique_tamanu_encounter_pause_prescription_histories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_unique_tamanu_encounter_pause_prescription_histories_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_id"], "alias": "source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id"], "alias": "source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_prescription_id\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere encounter_prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_action", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_action"], "alias": "source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect action\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere action is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "action", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "action", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_action_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_action_date"], "alias": "source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect action_date\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere action_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "action_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "action_date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_created_at"], "alias": "source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_updated_at"], "alias": "source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb"}, "created_at": 1782422376.216181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_prescriptions_id.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_prescriptions_id"], "alias": "source_unique_tamanu_encounter_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_unique_tamanu_encounter_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_id.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_id"], "alias": "source_not_null_tamanu_encounter_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_encounter_id.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_encounter_id"], "alias": "source_not_null_tamanu_encounter_prescriptions_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_prescription_id.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_prescription_id"], "alias": "source_not_null_tamanu_encounter_prescriptions_prescription_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_prescription_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect prescription_id\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge"], "alias": "source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_selected_for_discharge\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere is_selected_for_discharge is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_selected_for_discharge", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_selected_for_discharge", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_created_at.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_created_at"], "alias": "source_not_null_tamanu_encounter_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_updated_at"], "alias": "source_not_null_tamanu_encounter_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_facilities_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_facilities_id.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_facilities_id"], "alias": "source_unique_tamanu_facilities_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_unique_tamanu_facilities_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"facilities\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_id.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_id"], "alias": "source_not_null_tamanu_facilities_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"facilities\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_code.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_code"], "alias": "source_not_null_tamanu_facilities_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2319708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"facilities\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_name.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_name"], "alias": "source_not_null_tamanu_facilities_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2419457, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"facilities\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_facilities_visibility_status__current__historical", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_facilities_visibility_status__current__historical"], "alias": "source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83"}, "created_at": 1782422376.2419457, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n visibility_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"facilities\"\n group by visibility_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'current','historical'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "visibility_status", "values": ["current", "historical"], "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_"], "alias": "dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d"}, "created_at": 1782422376.2419457, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n catchment_id as id\n\n from \"app\".\"public\".\"facilities\"\n\n where catchment_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'catchment'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "catchment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "catchment_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'catchment'", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_updated_at_sync_tick"], "alias": "source_not_null_tamanu_facilities_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2491527, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"facilities\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_is_sensitive", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_is_sensitive.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_is_sensitive"], "alias": "source_not_null_tamanu_facilities_is_sensitive", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2498963, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_is_sensitive.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_sensitive\nfrom \"app\".\"public\".\"facilities\"\nwhere is_sensitive is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_sensitive", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_sensitive", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_area_external_codes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_area_external_codes_id.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_area_external_codes_id"], "alias": "source_unique_tamanu_imaging_area_external_codes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2509701, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_unique_tamanu_imaging_area_external_codes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_id.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_id"], "alias": "source_not_null_tamanu_imaging_area_external_codes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.251738, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_created_at.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_created_at"], "alias": "source_not_null_tamanu_imaging_area_external_codes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2524087, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_updated_at.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_updated_at"], "alias": "source_not_null_tamanu_imaging_area_external_codes_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2537005, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_visibility_status"], "alias": "source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65"}, "created_at": 1782422376.2543185, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_area_external_codes_area_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_area_external_codes_area_id.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_area_external_codes_area_id"], "alias": "source_unique_tamanu_imaging_area_external_codes_area_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2549682, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_unique_tamanu_imaging_area_external_codes_area_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n area_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere area_id is not null\ngroup by area_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "area_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_area_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_area_id.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_area_id"], "alias": "source_not_null_tamanu_imaging_area_external_codes_area_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2562249, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_area_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect area_id\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere area_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "area_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_"], "alias": "source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a"}, "created_at": 1782422376.2568383, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select area_id as from_field\n from \"app\".\"public\".\"imaging_area_external_codes\"\n where area_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"reference_data\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "area_id", "to": "source('tamanu', 'reference_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_code.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_code"], "alias": "source_not_null_tamanu_imaging_area_external_codes_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2597926, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab"}, "created_at": 1782422376.2608917, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_requests_id.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_requests_id"], "alias": "source_unique_tamanu_imaging_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2620146, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_unique_tamanu_imaging_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_id.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_id"], "alias": "source_not_null_tamanu_imaging_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.263351, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_created_at.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_created_at"], "alias": "source_not_null_tamanu_imaging_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2638962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_updated_at.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_updated_at"], "alias": "source_not_null_tamanu_imaging_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2649782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error"], "alias": "source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017"}, "created_at": 1782422376.2656302, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"imaging_requests\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'pending','in_progress','completed','cancelled','deleted','entered_in_error'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["pending", "in_progress", "completed", "cancelled", "deleted", "entered_in_error"], "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_requested_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_requested_date.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_requested_date"], "alias": "source_not_null_tamanu_imaging_requests_requested_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2692091, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_requested_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect requested_date\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere requested_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "requested_date", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82"}, "created_at": 1782422376.2697487, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a"}, "created_at": 1782422376.2728941, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select requested_by_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where requested_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "requested_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6"}, "created_at": 1782422376.2755432, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select completed_by_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where completed_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "completed_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "completed_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2"}, "created_at": 1782422376.278723, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay"], "alias": "source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f"}, "created_at": 1782422376.2807918, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n imaging_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"imaging_requests\"\n group by imaging_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'angiogram','colonoscopy','ctScan','ecg','echocardiogram','endoscopy','fluroscopy','holterMonitor','mammogram','orthopantomography','mri','stressTest','ultrasound','vascularStudy','xRay'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "imaging_type", "values": ["angiogram", "colonoscopy", "ctScan", "ecg", "echocardiogram", "endoscopy", "fluroscopy", "holterMonitor", "mammogram", "orthopantomography", "mri", "stressTest", "ultrasound", "vascularStudy", "xRay"], "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_"], "alias": "source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1"}, "created_at": 1782422376.2873757, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_group_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where location_group_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"location_groups\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_group_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_group_id", "to": "source('tamanu', 'location_groups')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_requests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2901778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_display_id.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_display_id"], "alias": "source_not_null_tamanu_imaging_requests_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2907202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_id\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere display_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_request_areas_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_request_areas_id.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_request_areas_id"], "alias": "source_unique_tamanu_imaging_request_areas_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.291259, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_unique_tamanu_imaging_request_areas_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_id.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_id"], "alias": "source_not_null_tamanu_imaging_request_areas_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.291259, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_created_at.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_created_at"], "alias": "source_not_null_tamanu_imaging_request_areas_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.291259, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_updated_at.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_updated_at"], "alias": "source_not_null_tamanu_imaging_request_areas_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.294783, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_imaging_request_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_imaging_request_id.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_imaging_request_id"], "alias": "source_not_null_tamanu_imaging_request_areas_imaging_request_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.294783, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_imaging_request_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect imaging_request_id\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere imaging_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "imaging_request_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_"], "alias": "source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6"}, "created_at": 1782422376.294783, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"], ["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select imaging_request_id as from_field\n from \"app\".\"public\".\"imaging_request_areas\"\n where imaging_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"imaging_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "imaging_request_id", "to": "source('tamanu', 'imaging_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_area_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_area_id.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_area_id"], "alias": "source_not_null_tamanu_imaging_request_areas_area_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.2989328, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_area_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect area_id\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere area_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "area_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_"], "alias": "source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55"}, "created_at": 1782422376.2989328, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select area_id as from_field\n from \"app\".\"public\".\"imaging_request_areas\"\n where area_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"reference_data\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "area_id", "to": "source('tamanu', 'reference_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760"}, "created_at": 1782422376.303029, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_results_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_results_id.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_results_id"], "alias": "source_unique_tamanu_imaging_results_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.303029, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_unique_tamanu_imaging_results_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_results\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_id.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_id"], "alias": "source_not_null_tamanu_imaging_results_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.303029, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_results\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_created_at.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_created_at"], "alias": "source_not_null_tamanu_imaging_results_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.303029, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_results\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_updated_at.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_updated_at"], "alias": "source_not_null_tamanu_imaging_results_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.303029, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_results\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_results_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.303029, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_results\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_visibility_status.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_visibility_status"], "alias": "source_not_null_tamanu_imaging_results_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.303029, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"imaging_results\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_imaging_request_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_imaging_request_id.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_imaging_request_id"], "alias": "source_not_null_tamanu_imaging_results_imaging_request_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.303029, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_imaging_request_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect imaging_request_id\nfrom \"app\".\"public\".\"imaging_results\"\nwhere imaging_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "imaging_request_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_"], "alias": "source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde"}, "created_at": 1782422376.303029, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"], ["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select imaging_request_id as from_field\n from \"app\".\"public\".\"imaging_results\"\n where imaging_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"imaging_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "imaging_request_id", "to": "source('tamanu', 'imaging_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5"}, "created_at": 1782422376.3108554, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select completed_by_id as from_field\n from \"app\".\"public\".\"imaging_results\"\n where completed_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "completed_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "completed_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_completed_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_completed_at.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_completed_at"], "alias": "source_not_null_tamanu_imaging_results_completed_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3108554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_completed_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect completed_at\nfrom \"app\".\"public\".\"imaging_results\"\nwhere completed_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "completed_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "completed_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_type_external_codes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_type_external_codes_id.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_type_external_codes_id"], "alias": "source_unique_tamanu_imaging_type_external_codes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3108554, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_unique_tamanu_imaging_type_external_codes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_type_external_codes_id.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_id"], "alias": "source_not_null_tamanu_imaging_type_external_codes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3108554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_type_external_codes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_type_external_codes_created_at.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_created_at"], "alias": "source_not_null_tamanu_imaging_type_external_codes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_type_external_codes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_type_external_codes_updated_at.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_updated_at"], "alias": "source_not_null_tamanu_imaging_type_external_codes_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_type_external_codes_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_visibility_status"], "alias": "source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_imaging_type_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_imaging_type_code"], "alias": "source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect imaging_type_code\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere imaging_type_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_type_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "imaging_type_code", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_type_external_codes_code.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_code"], "alias": "source_not_null_tamanu_imaging_type_external_codes_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_type_external_codes_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoices_id.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoices_id"], "alias": "source_unique_tamanu_invoices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_unique_tamanu_invoices_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoices\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_id.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_id"], "alias": "source_not_null_tamanu_invoices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoices\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_display_id.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_display_id"], "alias": "source_not_null_tamanu_invoices_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_id\nfrom \"app\".\"public\".\"invoices\"\nwhere display_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_date.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_date"], "alias": "source_not_null_tamanu_invoices_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"invoices\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_status.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_status"], "alias": "source_not_null_tamanu_invoices_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"invoices\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised"], "alias": "source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9"}, "created_at": 1782422376.3745346, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"invoices\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'cancelled','in_progress','finalised'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["cancelled", "in_progress", "finalised"], "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_encounter_id.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_encounter_id"], "alias": "source_not_null_tamanu_invoices_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.390432, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"invoices\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea"}, "created_at": 1782422376.393006, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"invoices\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_created_at.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_created_at"], "alias": "source_not_null_tamanu_invoices_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3950133, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoices\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_patient_payment_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_patient_payment_status.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_patient_payment_status"], "alias": "source_not_null_tamanu_invoices_patient_payment_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.3970203, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_patient_payment_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_payment_status\nfrom \"app\".\"public\".\"invoices\"\nwhere patient_payment_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_payment_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_payment_status", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial"], "alias": "source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8"}, "created_at": 1782422376.3970203, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n patient_payment_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"invoices\"\n group by patient_payment_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'unpaid','paid','partial'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_payment_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "patient_payment_status", "values": ["unpaid", "paid", "partial"], "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_insurer_payment_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_insurer_payment_status.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_insurer_payment_status"], "alias": "source_not_null_tamanu_invoices_insurer_payment_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4010293, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_insurer_payment_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect insurer_payment_status\nfrom \"app\".\"public\".\"invoices\"\nwhere insurer_payment_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurer_payment_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "insurer_payment_status", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected"], "alias": "source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d"}, "created_at": 1782422376.4010293, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n insurer_payment_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"invoices\"\n group by insurer_payment_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'unpaid','paid','partial','rejected'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurer_payment_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "insurer_payment_status", "values": ["unpaid", "paid", "partial", "rejected"], "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoices_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4030614, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoices\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoices_invoice_insurance_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoices_invoice_insurance_plans_id.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoices_invoice_insurance_plans_id"], "alias": "source_unique_tamanu_invoices_invoice_insurance_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_unique_tamanu_invoices_invoice_insurance_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_invoice_insurance_plans_id.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_id"], "alias": "source_not_null_tamanu_invoices_invoice_insurance_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoices_invoice_insurance_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_created_at"], "alias": "source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at"], "alias": "source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id"], "alias": "source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_id\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere invoice_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id"], "alias": "source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_insurance_plan_id\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere invoice_insurance_plan_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_insurance_plan_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_insurance_plan_id", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_discounts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_discounts_id.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_discounts_id"], "alias": "source_unique_tamanu_invoice_discounts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_unique_tamanu_invoice_discounts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_id.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_id"], "alias": "source_not_null_tamanu_invoice_discounts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_invoice_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_invoice_id.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_invoice_id"], "alias": "source_not_null_tamanu_invoice_discounts_invoice_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_invoice_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_id\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere invoice_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_"], "alias": "source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"], ["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_id as from_field\n from \"app\".\"public\".\"invoice_discounts\"\n where invoice_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoices\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_id", "to": "source('tamanu', 'invoices')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_percentage", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_percentage.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_percentage"], "alias": "source_not_null_tamanu_invoice_discounts_percentage", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_percentage.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect percentage\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere percentage is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "percentage", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "percentage", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_is_manual", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_is_manual.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_is_manual"], "alias": "source_not_null_tamanu_invoice_discounts_is_manual", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_is_manual.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_manual\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere is_manual is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_manual", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_manual", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_applied_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_applied_by_user_id.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_applied_by_user_id"], "alias": "source_not_null_tamanu_invoice_discounts_applied_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_applied_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect applied_by_user_id\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere applied_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "applied_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "applied_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e"}, "created_at": 1782422376.4061162, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select applied_by_user_id as from_field\n from \"app\".\"public\".\"invoice_discounts\"\n where applied_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "applied_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "applied_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_applied_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_applied_time.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_applied_time"], "alias": "source_not_null_tamanu_invoice_discounts_applied_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_applied_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect applied_time\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere applied_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "applied_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "applied_time", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_created_at.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_created_at"], "alias": "source_not_null_tamanu_invoice_discounts_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_discounts_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_insurance_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_insurance_plans_id.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_insurance_plans_id"], "alias": "source_unique_tamanu_invoice_insurance_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_unique_tamanu_invoice_insurance_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plans_id.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_id"], "alias": "source_not_null_tamanu_invoice_insurance_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_insurance_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plans_created_at.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_created_at"], "alias": "source_not_null_tamanu_invoice_insurance_plans_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_insurance_plans_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plans_updated_at.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_updated_at"], "alias": "source_not_null_tamanu_invoice_insurance_plans_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_insurance_plans_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plans_code.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_code"], "alias": "source_not_null_tamanu_invoice_insurance_plans_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_insurance_plans_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_visibility_status"], "alias": "source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_insurance_plan_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_insurance_plan_items_id.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_insurance_plan_items_id"], "alias": "source_unique_tamanu_invoice_insurance_plan_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_unique_tamanu_invoice_insurance_plan_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plan_items_id.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_id"], "alias": "source_not_null_tamanu_invoice_insurance_plan_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_insurance_plan_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plan_items_created_at.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_created_at"], "alias": "source_not_null_tamanu_invoice_insurance_plan_items_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_insurance_plan_items_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plan_items_updated_at.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_updated_at"], "alias": "source_not_null_tamanu_invoice_insurance_plan_items_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_insurance_plan_items_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448"}, "created_at": 1782422376.4219182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id"], "alias": "source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_insurance_plan_id\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere invoice_insurance_plan_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_insurance_plan_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_insurance_plan_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id"], "alias": "source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_product_id\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere invoice_product_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_product_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_product_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_insurer_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_insurer_payments_id.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_insurer_payments_id"], "alias": "source_unique_tamanu_invoice_insurer_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_unique_tamanu_invoice_insurer_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurer_payments_id.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_id"], "alias": "source_not_null_tamanu_invoice_insurer_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_insurer_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_insurer_payments_invoice_payment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_insurer_payments_invoice_payment_id"], "alias": "source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n invoice_payment_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere invoice_payment_id is not null\ngroup by invoice_payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "invoice_payment_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id"], "alias": "source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_payment_id\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere invoice_payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_payment_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_"], "alias": "source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"], ["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments", "source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_payment_id as from_field\n from \"app\".\"public\".\"invoice_insurer_payments\"\n where invoice_payment_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoice_payments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_payment_id", "to": "source('tamanu', 'invoice_payments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_insurer_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurer_payments_insurer_id.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_insurer_id"], "alias": "source_not_null_tamanu_invoice_insurer_payments_insurer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_insurer_payments_insurer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect insurer_id\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere insurer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "insurer_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_"], "alias": "dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n insurer_id as id\n\n from \"app\".\"public\".\"invoice_insurer_payments\"\n\n where insurer_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'insurer'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "insurer_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'insurer'", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurer_payments_status.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_status"], "alias": "source_not_null_tamanu_invoice_insurer_payments_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_insurer_payments_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected"], "alias": "source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b"}, "created_at": 1782422376.4376707, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"invoice_insurer_payments\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'unpaid','paid','partial','rejected'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["unpaid", "paid", "partial", "rejected"], "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurer_payments_created_at.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_created_at"], "alias": "source_not_null_tamanu_invoice_insurer_payments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_insurer_payments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_items_id.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_items_id"], "alias": "source_unique_tamanu_invoice_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_unique_tamanu_invoice_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_items\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_id.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_id"], "alias": "source_not_null_tamanu_invoice_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_items\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_invoice_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_invoice_id.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_invoice_id"], "alias": "source_not_null_tamanu_invoice_items_invoice_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_invoice_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_id\nfrom \"app\".\"public\".\"invoice_items\"\nwhere invoice_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_"], "alias": "source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"], ["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_id as from_field\n from \"app\".\"public\".\"invoice_items\"\n where invoice_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoices\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_id", "to": "source('tamanu', 'invoices')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_order_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_order_date.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_order_date"], "alias": "source_not_null_tamanu_invoice_items_order_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_order_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_date\nfrom \"app\".\"public\".\"invoice_items\"\nwhere order_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_date", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_"], "alias": "source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"], ["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products", "source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select product_id as from_field\n from \"app\".\"public\".\"invoice_items\"\n where product_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoice_products\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "product_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "product_id", "to": "source('tamanu', 'invoice_products')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_quantity", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_quantity.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_quantity"], "alias": "source_not_null_tamanu_invoice_items_quantity", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_quantity.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect quantity\nfrom \"app\".\"public\".\"invoice_items\"\nwhere quantity is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "quantity", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "quantity", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_ordered_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_ordered_by_user_id.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_ordered_by_user_id"], "alias": "source_not_null_tamanu_invoice_items_ordered_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_ordered_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect ordered_by_user_id\nfrom \"app\".\"public\".\"invoice_items\"\nwhere ordered_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ordered_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ordered_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a"}, "created_at": 1782422376.4533184, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select ordered_by_user_id as from_field\n from \"app\".\"public\".\"invoice_items\"\n where ordered_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ordered_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "ordered_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_created_at.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_created_at"], "alias": "source_not_null_tamanu_invoice_items_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_items\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_items_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_items\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_approved", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_approved.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_approved"], "alias": "source_not_null_tamanu_invoice_items_approved", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_approved.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect approved\nfrom \"app\".\"public\".\"invoice_items\"\nwhere approved is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "approved", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "approved", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_item_discounts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_item_discounts_id.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_item_discounts_id"], "alias": "source_unique_tamanu_invoice_item_discounts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_unique_tamanu_invoice_item_discounts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_id.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_id"], "alias": "source_not_null_tamanu_invoice_item_discounts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_invoice_item_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_invoice_item_id.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_invoice_item_id"], "alias": "source_not_null_tamanu_invoice_item_discounts_invoice_item_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_invoice_item_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_item_id\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere invoice_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_item_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_item_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_"], "alias": "source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"], ["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_item_id as from_field\n from \"app\".\"public\".\"invoice_item_discounts\"\n where invoice_item_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoice_items\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_item_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_item_id", "to": "source('tamanu', 'invoice_items')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_amount", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_amount.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_amount"], "alias": "source_not_null_tamanu_invoice_item_discounts_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_created_at.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_created_at"], "alias": "source_not_null_tamanu_invoice_item_discounts_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_type.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_type"], "alias": "source_not_null_tamanu_invoice_item_discounts_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_item_finalised_insurances_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_item_finalised_insurances_id.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_item_finalised_insurances_id"], "alias": "source_unique_tamanu_invoice_item_finalised_insurances_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_unique_tamanu_invoice_item_finalised_insurances_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_finalised_insurances_id.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_id"], "alias": "source_not_null_tamanu_invoice_item_finalised_insurances_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4689639, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_item_finalised_insurances_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_created_at"], "alias": "source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_updated_at"], "alias": "source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id"], "alias": "source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_item_id\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere invoice_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_item_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_item_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final"], "alias": "source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coverage_value_final\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere coverage_value_final is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "coverage_value_final", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coverage_value_final", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id"], "alias": "source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_insurance_plan_id\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere invoice_insurance_plan_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_insurance_plan_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_insurance_plan_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_patient_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_patient_payments_id.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_patient_payments_id"], "alias": "source_unique_tamanu_invoice_patient_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_unique_tamanu_invoice_patient_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_patient_payments_id.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_id"], "alias": "source_not_null_tamanu_invoice_patient_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_patient_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_patient_payments_invoice_payment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_patient_payments_invoice_payment_id"], "alias": "source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n invoice_payment_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere invoice_payment_id is not null\ngroup by invoice_payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "invoice_payment_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_invoice_payment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_invoice_payment_id"], "alias": "source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_payment_id\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere invoice_payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_payment_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_"], "alias": "source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"], ["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments", "source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_payment_id as from_field\n from \"app\".\"public\".\"invoice_patient_payments\"\n where invoice_payment_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoice_payments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_payment_id", "to": "source('tamanu', 'invoice_payments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_method_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_patient_payments_method_id.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_method_id"], "alias": "source_not_null_tamanu_invoice_patient_payments_method_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_patient_payments_method_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect method_id\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere method_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "method_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "method_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_"], "alias": "dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba"}, "created_at": 1782422376.4847252, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n method_id as id\n\n from \"app\".\"public\".\"invoice_patient_payments\"\n\n where method_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'paymentMethod'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "method_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "method_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'paymentMethod'", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_patient_payments_created_at.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_created_at"], "alias": "source_not_null_tamanu_invoice_patient_payments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.500467, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_patient_payments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_payments_id.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_payments_id"], "alias": "source_unique_tamanu_invoice_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_unique_tamanu_invoice_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_id.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_id"], "alias": "source_not_null_tamanu_invoice_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_invoice_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_invoice_id.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_invoice_id"], "alias": "source_not_null_tamanu_invoice_payments_invoice_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_invoice_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_id\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere invoice_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_"], "alias": "source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"], ["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_id as from_field\n from \"app\".\"public\".\"invoice_payments\"\n where invoice_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoices\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_id", "to": "source('tamanu', 'invoices')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_date.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_date"], "alias": "source_not_null_tamanu_invoice_payments_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_receipt_number", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_receipt_number.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_receipt_number"], "alias": "source_not_null_tamanu_invoice_payments_receipt_number", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_receipt_number.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect receipt_number\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere receipt_number is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "receipt_number", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "receipt_number", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_amount", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_amount.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_amount"], "alias": "source_not_null_tamanu_invoice_payments_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_created_at.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_created_at"], "alias": "source_not_null_tamanu_invoice_payments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187"}, "created_at": 1782422376.5032225, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select updated_by_user_id as from_field\n from \"app\".\"public\".\"invoice_payments\"\n where updated_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "updated_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_payments_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.516376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_price_lists_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_price_lists_id.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_price_lists_id"], "alias": "source_unique_tamanu_invoice_price_lists_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_unique_tamanu_invoice_price_lists_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_id.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_id"], "alias": "source_not_null_tamanu_invoice_price_lists_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_created_at.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_created_at"], "alias": "source_not_null_tamanu_invoice_price_lists_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_updated_at.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_updated_at"], "alias": "source_not_null_tamanu_invoice_price_lists_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_code.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_code"], "alias": "source_not_null_tamanu_invoice_price_lists_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_visibility_status.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_visibility_status"], "alias": "source_not_null_tamanu_invoice_price_lists_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_price_list_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_price_list_items_id.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_price_list_items_id"], "alias": "source_unique_tamanu_invoice_price_list_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_unique_tamanu_invoice_price_list_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_list_items_id.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_id"], "alias": "source_not_null_tamanu_invoice_price_list_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_price_list_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_list_items_created_at.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_created_at"], "alias": "source_not_null_tamanu_invoice_price_list_items_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_price_list_items_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_list_items_updated_at.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_updated_at"], "alias": "source_not_null_tamanu_invoice_price_list_items_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5175161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_price_list_items_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223"}, "created_at": 1782422376.528736, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id"], "alias": "source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d"}, "created_at": 1782422376.529733, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_price_list_id\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere invoice_price_list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_price_list_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_price_list_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_invoice_product_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_invoice_product_id"], "alias": "source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5"}, "created_at": 1782422376.5307326, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_product_id\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere invoice_product_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_product_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_product_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_is_hidden", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_list_items_is_hidden.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_is_hidden"], "alias": "source_not_null_tamanu_invoice_price_list_items_is_hidden", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5317311, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_price_list_items_is_hidden.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_hidden\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere is_hidden is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_hidden", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_hidden", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_products_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_products_id.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_products_id"], "alias": "source_unique_tamanu_invoice_products_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.532733, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_unique_tamanu_invoice_products_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_products\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_id.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_id"], "alias": "source_not_null_tamanu_invoice_products_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5337312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_products\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_name.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_name"], "alias": "source_not_null_tamanu_invoice_products_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5337312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"invoice_products\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_insurable", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_insurable.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_insurable"], "alias": "source_not_null_tamanu_invoice_products_insurable", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5347316, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_insurable.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect insurable\nfrom \"app\".\"public\".\"invoice_products\"\nwhere insurable is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurable", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "insurable", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_created_at.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_created_at"], "alias": "source_not_null_tamanu_invoice_products_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5357313, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_products\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_visibility_status.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_visibility_status"], "alias": "source_not_null_tamanu_invoice_products_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5367312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"invoice_products\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_products_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5377312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_products\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_ips_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_ips_requests_id.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_ips_requests_id"], "alias": "source_unique_tamanu_ips_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5387328, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_unique_tamanu_ips_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"ips_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_id.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_id"], "alias": "source_not_null_tamanu_ips_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5397334, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"ips_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_created_at.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_created_at"], "alias": "source_not_null_tamanu_ips_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5407317, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"ips_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_updated_at.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_updated_at"], "alias": "source_not_null_tamanu_ips_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5417316, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"ips_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_patient_id.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_patient_id"], "alias": "source_not_null_tamanu_ips_requests_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5417316, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"ips_requests\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_created_by", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_created_by.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_created_by"], "alias": "source_not_null_tamanu_ips_requests_created_by", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5427315, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_created_by.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_by\nfrom \"app\".\"public\".\"ips_requests\"\nwhere created_by is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_by", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_by", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select created_by as from_field\n from \"app\".\"public\".\"ips_requests\"\n where created_by is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_by", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "created_by", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_status.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_status"], "alias": "source_not_null_tamanu_ips_requests_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"ips_requests\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_email.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_email"], "alias": "source_not_null_tamanu_ips_requests_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_email.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect email\nfrom \"app\".\"public\".\"ips_requests\"\nwhere email is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_ips_requests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"ips_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_requests_id.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_requests_id"], "alias": "source_unique_tamanu_lab_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_unique_tamanu_lab_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_id.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_id"], "alias": "source_not_null_tamanu_lab_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_created_at.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_created_at"], "alias": "source_not_null_tamanu_lab_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_updated_at.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_updated_at"], "alias": "source_not_null_tamanu_lab_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error"], "alias": "source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"lab_requests\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'reception_pending','results_pending','interim_results','to_be_verified','verified','published','cancelled','invalidated','deleted','sample-not-collected','entered-in-error'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["reception_pending", "results_pending", "interim_results", "to_be_verified", "verified", "published", "cancelled", "invalidated", "deleted", "sample-not-collected", "entered-in-error"], "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922"}, "created_at": 1782422376.5443003, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select requested_by_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where requested_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "requested_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5"}, "created_at": 1782422376.5594425, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_"], "alias": "dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e"}, "created_at": 1782422376.5594425, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_category_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where lab_test_category_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestCategory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"to_condition": "type = 'labTestCategory'", "column_name": "lab_test_category_id", "to": "source('tamanu', 'reference_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_display_id.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_display_id"], "alias": "source_not_null_tamanu_lab_requests_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5594425, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_id\nfrom \"app\".\"public\".\"lab_requests\"\nwhere display_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_"], "alias": "dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32"}, "created_at": 1782422376.5594425, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_priority_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where lab_test_priority_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestPriority'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_priority_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_test_priority_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestPriority'", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_"], "alias": "dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63"}, "created_at": 1782422376.5594425, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_laboratory_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where lab_test_laboratory_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestLaboratory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_laboratory_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_test_laboratory_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestLaboratory'", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_requests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5755486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused"], "alias": "source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297"}, "created_at": 1782422376.5775592, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n reason_for_cancellation as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"lab_requests\"\n group by reason_for_cancellation\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'clinical','duplicate','entered-in-error','other','patient-discharged','patient-refused'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reason_for_cancellation", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "reason_for_cancellation", "values": ["clinical", "duplicate", "entered-in-error", "other", "patient-discharged", "patient-refused"], "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_"], "alias": "source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe"}, "created_at": 1782422376.5815792, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select department_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where department_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"departments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "department_id", "to": "source('tamanu', 'departments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_081684246f6bf00522c0c77579566577.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_"], "alias": "source_relationships_tamanu_la_081684246f6bf00522c0c77579566577", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_081684246f6bf00522c0c77579566577", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_081684246f6bf00522c0c77579566577"}, "created_at": 1782422376.5855927, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_081684246f6bf00522c0c77579566577\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_081684246f6bf00522c0c77579566577.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_panel_request_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where lab_test_panel_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_panel_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_panel_request_id", "to": "source('tamanu', 'lab_test_panel_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_"], "alias": "dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7"}, "created_at": 1782422376.587599, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_sample_site_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where lab_sample_site_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labSampleSite'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_sample_site_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_sample_site_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labSampleSite'", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_"], "alias": "dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748"}, "created_at": 1782422376.5913537, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n specimen_type_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where specimen_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'specimenType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "specimen_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "specimen_type_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'specimenType'", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6"}, "created_at": 1782422376.5953639, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select collected_by_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where collected_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "collected_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "collected_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_request_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_request_attachments_id.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_request_attachments_id"], "alias": "source_unique_tamanu_lab_request_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.5973687, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_unique_tamanu_lab_request_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_id.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_id"], "alias": "source_not_null_tamanu_lab_request_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.599374, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_created_at.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_created_at"], "alias": "source_not_null_tamanu_lab_request_attachments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.599374, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_updated_at.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_updated_at"], "alias": "source_not_null_tamanu_lab_request_attachments_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.601379, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_attachment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_attachment_id.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_attachment_id"], "alias": "source_not_null_tamanu_lab_request_attachments_attachment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.601379, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_attachment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect attachment_id\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere attachment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attachment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "attachment_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_"], "alias": "source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb"}, "created_at": 1782422376.601379, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"], ["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments", "source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select attachment_id as from_field\n from \"app\".\"public\".\"lab_request_attachments\"\n where attachment_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"attachments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attachment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "attachment_id", "to": "source('tamanu', 'attachments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_lab_request_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_lab_request_id.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_lab_request_id"], "alias": "source_not_null_tamanu_lab_request_attachments_lab_request_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6053884, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_lab_request_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lab_request_id\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere lab_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lab_request_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_"], "alias": "source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108"}, "created_at": 1782422376.6053884, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_request_id as from_field\n from \"app\".\"public\".\"lab_request_attachments\"\n where lab_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_request_id", "to": "source('tamanu', 'lab_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_"], "alias": "source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc"}, "created_at": 1782422376.6092443, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"], ["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select replaced_by_id as from_field\n from \"app\".\"public\".\"lab_request_attachments\"\n where replaced_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_request_attachments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "replaced_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "replaced_by_id", "to": "source('tamanu', 'lab_request_attachments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15"}, "created_at": 1782422376.6092443, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_request_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_request_logs_id.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_request_logs_id"], "alias": "source_unique_tamanu_lab_request_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6092443, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_unique_tamanu_lab_request_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_request_logs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_logs_id.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_logs_id"], "alias": "source_not_null_tamanu_lab_request_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6092443, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_not_null_tamanu_lab_request_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_request_logs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_logs_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_logs_status.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_logs_status"], "alias": "source_not_null_tamanu_lab_request_logs_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6092443, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_not_null_tamanu_lab_request_logs_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"lab_request_logs\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_"], "alias": "source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4"}, "created_at": 1782422376.6092443, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_request_id as from_field\n from \"app\".\"public\".\"lab_request_logs\"\n where lab_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_request_id", "to": "source('tamanu', 'lab_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55"}, "created_at": 1782422376.6092443, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select updated_by_id as from_field\n from \"app\".\"public\".\"lab_request_logs\"\n where updated_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "updated_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_logs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_logs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_request_logs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6092443, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_request_logs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_tests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_tests_id.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_tests_id"], "alias": "source_unique_tamanu_lab_tests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_unique_tamanu_lab_tests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_tests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_id.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_id"], "alias": "source_not_null_tamanu_lab_tests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_tests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_created_at.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_created_at"], "alias": "source_not_null_tamanu_lab_tests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_tests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_updated_at.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_updated_at"], "alias": "source_not_null_tamanu_lab_tests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_tests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_date.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_date"], "alias": "source_not_null_tamanu_lab_tests_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"lab_tests\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_result", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_result.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_result"], "alias": "source_not_null_tamanu_lab_tests_result", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_result.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect result\nfrom \"app\".\"public\".\"lab_tests\"\nwhere result is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "result", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "result", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_"], "alias": "source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_request_id as from_field\n from \"app\".\"public\".\"lab_tests\"\n where lab_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_request_id", "to": "source('tamanu', 'lab_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_"], "alias": "source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"], ["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types", "source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_type_id as from_field\n from \"app\".\"public\".\"lab_tests\"\n where lab_test_type_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_types\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_type_id", "to": "source('tamanu', 'lab_test_types')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_"], "alias": "dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n category_id as id\n\n from \"app\".\"public\".\"lab_tests\"\n\n where category_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestCategory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "category_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestCategory'", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_"], "alias": "dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6"}, "created_at": 1782422376.6230674, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_method_id as id\n\n from \"app\".\"public\".\"lab_tests\"\n\n where lab_test_method_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestMethod'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_method_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_test_method_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestMethod'", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_tests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_tests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_test_panels_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_test_panels_id.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_test_panels_id"], "alias": "source_unique_tamanu_lab_test_panels_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_unique_tamanu_lab_test_panels_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_id.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_id"], "alias": "source_not_null_tamanu_lab_test_panels_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_created_at.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_created_at"], "alias": "source_not_null_tamanu_lab_test_panels_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_updated_at.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_updated_at"], "alias": "source_not_null_tamanu_lab_test_panels_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_name.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_name"], "alias": "source_not_null_tamanu_lab_test_panels_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_code.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_code"], "alias": "source_not_null_tamanu_lab_test_panels_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_visibility_status.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_visibility_status"], "alias": "source_not_null_tamanu_lab_test_panels_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_"], "alias": "dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n category_id as id\n\n from \"app\".\"public\".\"lab_test_panels\"\n\n where category_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestCategory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "category_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestCategory'", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_test_panels_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_created_at"], "alias": "source_not_null_tamanu_lab_test_panel_lab_test_types_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at"], "alias": "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id"], "alias": "source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f"}, "created_at": 1782422376.6390924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lab_test_panel_id\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere lab_test_panel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lab_test_panel_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_"], "alias": "source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"], ["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels", "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_panel_id as from_field\n from \"app\".\"public\".\"lab_test_panel_lab_test_types\"\n where lab_test_panel_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_panels\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_panel_id", "to": "source('tamanu', 'lab_test_panels')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id"], "alias": "source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lab_test_type_id\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere lab_test_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lab_test_type_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_"], "alias": "source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"], ["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types", "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_type_id as from_field\n from \"app\".\"public\".\"lab_test_panel_lab_test_types\"\n where lab_test_type_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_types\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_type_id", "to": "source('tamanu', 'lab_test_types')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types__order_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_lab_test_types__order_.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types__order_"], "alias": "source_not_null_tamanu_lab_test_panel_lab_test_types__order_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_test_panel_lab_test_types__order_.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect \"order\"\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere \"order\" is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "\"order\"", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "\"order\"", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_test_panel_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_test_panel_requests_id.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_test_panel_requests_id"], "alias": "source_unique_tamanu_lab_test_panel_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_unique_tamanu_lab_test_panel_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_requests_id.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_id"], "alias": "source_not_null_tamanu_lab_test_panel_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_test_panel_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_requests_created_at.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_created_at"], "alias": "source_not_null_tamanu_lab_test_panel_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_test_panel_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_requests_updated_at.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_updated_at"], "alias": "source_not_null_tamanu_lab_test_panel_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_test_panel_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id"], "alias": "source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lab_test_panel_id\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere lab_test_panel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lab_test_panel_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_"], "alias": "source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc"}, "created_at": 1782422376.654786, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"], ["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_panel_id as from_field\n from \"app\".\"public\".\"lab_test_panel_requests\"\n where lab_test_panel_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_panels\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_panel_id", "to": "source('tamanu', 'lab_test_panels')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_requests_encounter_id.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_encounter_id"], "alias": "source_not_null_tamanu_lab_test_panel_requests_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6708004, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_test_panel_requests_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba"}, "created_at": 1782422376.6728156, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"lab_test_panel_requests\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d"}, "created_at": 1782422376.676835, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_test_types_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_test_types_id.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_test_types_id"], "alias": "source_unique_tamanu_lab_test_types_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.676835, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_unique_tamanu_lab_test_types_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_id.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_id"], "alias": "source_not_null_tamanu_lab_test_types_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6788414, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_created_at.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_created_at"], "alias": "source_not_null_tamanu_lab_test_types_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6788414, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_updated_at.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_updated_at"], "alias": "source_not_null_tamanu_lab_test_types_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6808472, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_code.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_code"], "alias": "source_not_null_tamanu_lab_test_types_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6808472, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_name.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_name"], "alias": "source_not_null_tamanu_lab_test_types_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6808472, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_unit", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_unit.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_unit"], "alias": "source_not_null_tamanu_lab_test_types_unit", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6828525, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_unit.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unit\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere unit is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unit", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unit", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_result_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_result_type.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_result_type"], "alias": "source_not_null_tamanu_lab_test_types_result_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6828525, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_result_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect result_type\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere result_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "result_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "result_type", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select"], "alias": "source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c"}, "created_at": 1782422376.6848586, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n result_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"lab_test_types\"\n group by result_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'FreeText','Number','Select'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "result_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "result_type", "values": ["FreeText", "Number", "Select"], "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_"], "alias": "dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253"}, "created_at": 1782422376.6866064, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_category_id as id\n\n from \"app\".\"public\".\"lab_test_types\"\n\n where lab_test_category_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestCategory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_test_category_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestCategory'", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_test_types_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.69062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_is_sensitive", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_is_sensitive.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_is_sensitive"], "alias": "source_not_null_tamanu_lab_test_types_is_sensitive", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.69062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_is_sensitive.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_sensitive\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere is_sensitive is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_sensitive", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_sensitive", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_local_system_facts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_local_system_facts_id.sql", "original_file_path": "models\\sources\\local_system_facts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_local_system_facts_id"], "alias": "source_unique_tamanu_local_system_facts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6926265, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "local_system_facts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.local_system_facts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\local_system_facts.yml\\source_unique_tamanu_local_system_facts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"local_system_facts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'local_system_facts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_local_system_facts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_local_system_facts_id.sql", "original_file_path": "models\\sources\\local_system_facts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_local_system_facts_id"], "alias": "source_not_null_tamanu_local_system_facts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6926265, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "local_system_facts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.local_system_facts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\local_system_facts.yml\\source_not_null_tamanu_local_system_facts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"local_system_facts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'local_system_facts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_local_system_facts_key", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_local_system_facts_key.sql", "original_file_path": "models\\sources\\local_system_facts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_local_system_facts_key"], "alias": "source_not_null_tamanu_local_system_facts_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.6926265, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "local_system_facts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.local_system_facts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\local_system_facts.yml\\source_not_null_tamanu_local_system_facts_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect key\nfrom \"app\".\"public\".\"local_system_facts\"\nwhere key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "key", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "key", "model": "{{ get_where_subquery(source('tamanu', 'local_system_facts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_locations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_locations_id.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_locations_id"], "alias": "source_unique_tamanu_locations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.694631, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_unique_tamanu_locations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"locations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_locations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locations_id.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_locations_id"], "alias": "source_not_null_tamanu_locations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.694631, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_not_null_tamanu_locations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"locations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_locations_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_locations_code.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_locations_code"], "alias": "source_unique_tamanu_locations_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.696637, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_unique_tamanu_locations_code.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n code as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"locations\"\nwhere code is not null\ngroup by code\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_locations_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locations_code.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_locations_code"], "alias": "source_not_null_tamanu_locations_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.696637, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_not_null_tamanu_locations_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"locations\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_locations_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locations_name.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_locations_name"], "alias": "source_not_null_tamanu_locations_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.698643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_not_null_tamanu_locations_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"locations\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955"}, "created_at": 1782422376.698643, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"locations\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_locations_visibility_status__current__historical", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_locations_visibility_status__current__historical"], "alias": "source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b"}, "created_at": 1782422376.702398, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n visibility_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"locations\"\n group by visibility_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'current','historical'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "visibility_status", "values": ["current", "historical"], "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_"], "alias": "source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69"}, "created_at": 1782422376.703403, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"], ["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups", "source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_group_id as from_field\n from \"app\".\"public\".\"locations\"\n where location_group_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"location_groups\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_group_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_group_id", "to": "source('tamanu', 'location_groups')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_locations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locations_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_locations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_locations_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7074163, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_not_null_tamanu_locations_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"locations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_location_assignments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_location_assignments_id.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_location_assignments_id"], "alias": "source_unique_tamanu_location_assignments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7074163, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_unique_tamanu_location_assignments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"location_assignments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_id.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_id"], "alias": "source_not_null_tamanu_location_assignments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7094223, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"location_assignments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_user_id.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_user_id"], "alias": "source_not_null_tamanu_location_assignments_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7094223, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"location_assignments\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_location_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_location_id.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_location_id"], "alias": "source_not_null_tamanu_location_assignments_location_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7114282, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_location_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect location_id\nfrom \"app\".\"public\".\"location_assignments\"\nwhere location_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "location_id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_date.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_date"], "alias": "source_not_null_tamanu_location_assignments_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7114282, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"location_assignments\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_start_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_start_time.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_start_time"], "alias": "source_not_null_tamanu_location_assignments_start_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7134333, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_start_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_time\nfrom \"app\".\"public\".\"location_assignments\"\nwhere start_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_time", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_end_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_end_time.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_end_time"], "alias": "source_not_null_tamanu_location_assignments_end_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7134333, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_end_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect end_time\nfrom \"app\".\"public\".\"location_assignments\"\nwhere end_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "end_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "end_time", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_created_at.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_created_at"], "alias": "source_not_null_tamanu_location_assignments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7134333, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"location_assignments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_updated_at.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_updated_at"], "alias": "source_not_null_tamanu_location_assignments_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.715439, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"location_assignments\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766"}, "created_at": 1782422376.715439, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"location_assignments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_location_assignment_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_location_assignment_templates_id.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_location_assignment_templates_id"], "alias": "source_unique_tamanu_location_assignment_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7174447, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_unique_tamanu_location_assignment_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_id.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_id"], "alias": "source_not_null_tamanu_location_assignment_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.71845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_user_id.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_user_id"], "alias": "source_not_null_tamanu_location_assignment_templates_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.71845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_location_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_location_id"], "alias": "source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524"}, "created_at": 1782422376.720457, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect location_id\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere location_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "location_id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_date.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_date"], "alias": "source_not_null_tamanu_location_assignment_templates_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.720457, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_start_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_start_time.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_start_time"], "alias": "source_not_null_tamanu_location_assignment_templates_start_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.720457, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_start_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_time\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere start_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_time", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_end_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_end_time.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_end_time"], "alias": "source_not_null_tamanu_location_assignment_templates_end_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.722463, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_end_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect end_time\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere end_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "end_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "end_time", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_repeat_end_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_repeat_end_date"], "alias": "source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51"}, "created_at": 1782422376.722463, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect repeat_end_date\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere repeat_end_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "repeat_end_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "repeat_end_date", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_repeat_frequency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_repeat_frequency"], "alias": "source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f"}, "created_at": 1782422376.7244697, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect repeat_frequency\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere repeat_frequency is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "repeat_frequency", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "repeat_frequency", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_repeat_unit", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_repeat_unit"], "alias": "source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722"}, "created_at": 1782422376.7244697, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect repeat_unit\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere repeat_unit is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "repeat_unit", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "repeat_unit", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_created_at.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_created_at"], "alias": "source_not_null_tamanu_location_assignment_templates_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7244697, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_updated_at.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_updated_at"], "alias": "source_not_null_tamanu_location_assignment_templates_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.726475, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick"], "alias": "source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc"}, "created_at": 1782422376.726475, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_location_groups_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_location_groups_id.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_location_groups_id"], "alias": "source_unique_tamanu_location_groups_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.728481, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_unique_tamanu_location_groups_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"location_groups\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_id.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_id"], "alias": "source_not_null_tamanu_location_groups_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.728481, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"location_groups\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_created_at.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_created_at"], "alias": "source_not_null_tamanu_location_groups_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7304862, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"location_groups\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_updated_at.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_updated_at"], "alias": "source_not_null_tamanu_location_groups_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7304862, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"location_groups\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_location_groups_visibility_status__current__historical", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_location_groups_visibility_status__current__historical"], "alias": "source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980"}, "created_at": 1782422376.7324922, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n visibility_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"location_groups\"\n group by visibility_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'current','historical'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "visibility_status", "values": ["current", "historical"], "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_name.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_name"], "alias": "source_not_null_tamanu_location_groups_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"location_groups\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_code.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_code"], "alias": "source_not_null_tamanu_location_groups_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"location_groups\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_facility_id.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_facility_id"], "alias": "source_not_null_tamanu_location_groups_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"location_groups\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"location_groups\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_updated_at_sync_tick"], "alias": "source_not_null_tamanu_location_groups_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"location_groups\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_is_bookable", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_is_bookable.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_is_bookable"], "alias": "source_not_null_tamanu_location_groups_is_bookable", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_is_bookable.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_bookable\nfrom \"app\".\"public\".\"location_groups\"\nwhere is_bookable is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_bookable", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_bookable", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_medication_administration_records_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_medication_administration_records_id.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_medication_administration_records_id"], "alias": "source_unique_tamanu_medication_administration_records_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_unique_tamanu_medication_administration_records_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_administration_records_id.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_id"], "alias": "source_not_null_tamanu_medication_administration_records_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medication_administration_records_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN"], "alias": "source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"medication_administration_records\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'GIVEN','NOT_GIVEN'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["GIVEN", "NOT_GIVEN"], "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_due_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_administration_records_due_at.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_due_at"], "alias": "source_not_null_tamanu_medication_administration_records_due_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medication_administration_records_due_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect due_at\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere due_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "due_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "due_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_is_auto_generated", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_is_auto_generated"], "alias": "source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f"}, "created_at": 1782422376.7342398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_auto_generated\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere is_auto_generated is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_auto_generated", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_auto_generated", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_created_at"], "alias": "source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_updated_at"], "alias": "source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_updated_at_sync_tick"], "alias": "source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_is_edited", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_is_edited"], "alias": "source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_edited\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere is_edited is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_edited", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_edited", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_medication_administration_record_doses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_medication_administration_record_doses_id.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_medication_administration_record_doses_id"], "alias": "source_unique_tamanu_medication_administration_record_doses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_unique_tamanu_medication_administration_record_doses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_id"], "alias": "source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_dose_amount", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_dose_amount"], "alias": "source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect dose_amount\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere dose_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "dose_amount", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "dose_amount", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_given_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_given_time"], "alias": "source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect given_time\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere given_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "given_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "given_time", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_given_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_given_by_user_id"], "alias": "source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect given_by_user_id\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere given_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "given_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "given_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id"], "alias": "source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_by_user_id\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere recorded_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_mar_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_mar_id"], "alias": "source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect mar_id\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere mar_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "mar_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "mar_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_created_at"], "alias": "source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_updated_at"], "alias": "source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_dose_index", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_dose_index"], "alias": "source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect dose_index\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere dose_index is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "dose_index", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "dose_index", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_medication_dispenses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_medication_dispenses_id.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_medication_dispenses_id"], "alias": "source_unique_tamanu_medication_dispenses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_unique_tamanu_medication_dispenses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_id.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_id"], "alias": "source_not_null_tamanu_medication_dispenses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id"], "alias": "source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88"}, "created_at": 1782422376.7502122, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pharmacy_order_prescription_id\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere pharmacy_order_prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pharmacy_order_prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pharmacy_order_prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_quantity", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_quantity.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_quantity"], "alias": "source_not_null_tamanu_medication_dispenses_quantity", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7660155, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_quantity.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect quantity\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere quantity is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "quantity", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "quantity", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_dispensed_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_dispensed_by_user_id"], "alias": "source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c"}, "created_at": 1782422376.7660155, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect dispensed_by_user_id\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere dispensed_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "dispensed_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "dispensed_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_dispensed_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_dispensed_at.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_dispensed_at"], "alias": "source_not_null_tamanu_medication_dispenses_dispensed_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7660155, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_dispensed_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect dispensed_at\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere dispensed_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "dispensed_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "dispensed_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_created_at.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_created_at"], "alias": "source_not_null_tamanu_medication_dispenses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7687943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_updated_at.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_updated_at"], "alias": "source_not_null_tamanu_medication_dispenses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7687943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794"}, "created_at": 1782422376.7707994, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_notes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_notes_id.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_notes_id"], "alias": "source_unique_tamanu_notes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7707994, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_unique_tamanu_notes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"notes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_id.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_id"], "alias": "source_not_null_tamanu_notes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7728033, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"notes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_created_at.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_created_at"], "alias": "source_not_null_tamanu_notes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7728033, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"notes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_updated_at.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_updated_at"], "alias": "source_not_null_tamanu_notes_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7728033, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"notes\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_record_id.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_record_id"], "alias": "source_not_null_tamanu_notes_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7748077, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"public\".\"notes\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_record_type.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_record_type"], "alias": "source_not_null_tamanu_notes_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7748077, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"public\".\"notes\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage"], "alias": "source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3"}, "created_at": 1782422376.7748077, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n record_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"notes\"\n group by record_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Encounter','ImagingRequest','LabRequest','Patient','PatientCarePlan','Triage'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "record_type", "values": ["Encounter", "ImagingRequest", "LabRequest", "Patient", "PatientCarePlan", "Triage"], "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_date.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_date"], "alias": "source_not_null_tamanu_notes_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7748077, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"notes\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_updated_at_sync_tick"], "alias": "source_not_null_tamanu_notes_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.781776, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"notes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_notes_author_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_notes_author_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3"}, "created_at": 1782422376.781776, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select author_id as from_field\n from \"app\".\"public\".\"notes\"\n where author_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "author_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "author_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa"}, "created_at": 1782422376.781776, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select on_behalf_of_id as from_field\n from \"app\".\"public\".\"notes\"\n where on_behalf_of_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "on_behalf_of_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "on_behalf_of_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_content", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_content.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_content"], "alias": "source_not_null_tamanu_notes_content", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7885573, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_content.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect content\nfrom \"app\".\"public\".\"notes\"\nwhere content is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "content", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "content", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_"], "alias": "source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935"}, "created_at": 1782422376.7885573, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"], ["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select revised_by_id as from_field\n from \"app\".\"public\".\"notes\"\n where revised_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"notes\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "revised_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "revised_by_id", "to": "source('tamanu', 'notes')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_note_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_note_type_id.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_note_type_id"], "alias": "source_not_null_tamanu_notes_note_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7905624, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_note_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect note_type_id\nfrom \"app\".\"public\".\"notes\"\nwhere note_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "note_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "note_type_id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_notes_legacy_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_notes_legacy_id.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_notes_legacy_id"], "alias": "source_unique_tamanu_notes_legacy_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.792566, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_unique_tamanu_notes_legacy_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_id.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_id"], "alias": "source_not_null_tamanu_notes_legacy_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.792566, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_created_at.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_created_at"], "alias": "source_not_null_tamanu_notes_legacy_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7945693, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_updated_at.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_updated_at"], "alias": "source_not_null_tamanu_notes_legacy_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7945693, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_record_id.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_record_id"], "alias": "source_not_null_tamanu_notes_legacy_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.7965736, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_record_type.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_record_type"], "alias": "source_not_null_tamanu_notes_legacy_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.797577, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_date.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_date"], "alias": "source_not_null_tamanu_notes_legacy_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.797577, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_content", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_content.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_content"], "alias": "source_not_null_tamanu_notes_legacy_content", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.797577, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_content.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect content\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere content is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "content", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "content", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_updated_at_sync_tick"], "alias": "source_not_null_tamanu_notes_legacy_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.797577, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_note_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_note_items_id.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_note_items_id"], "alias": "source_unique_tamanu_note_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8005908, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_unique_tamanu_note_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"note_items\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_id.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_id"], "alias": "source_not_null_tamanu_note_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8026001, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"note_items\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_created_at.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_created_at"], "alias": "source_not_null_tamanu_note_items_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8026001, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"note_items\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_updated_at.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_updated_at"], "alias": "source_not_null_tamanu_note_items_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8036032, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"note_items\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_note_page_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_note_page_id.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_note_page_id"], "alias": "source_not_null_tamanu_note_items_note_page_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8036032, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_note_page_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect note_page_id\nfrom \"app\".\"public\".\"note_items\"\nwhere note_page_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "note_page_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "note_page_id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_"], "alias": "source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22"}, "created_at": 1782422376.8036032, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"], ["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages", "source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select note_page_id as from_field\n from \"app\".\"public\".\"note_items\"\n where note_page_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"note_pages\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "note_page_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "note_page_id", "to": "source('tamanu', 'note_pages')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9"}, "created_at": 1782422376.8087776, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select author_id as from_field\n from \"app\".\"public\".\"note_items\"\n where author_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "author_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "author_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3"}, "created_at": 1782422376.8087776, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select on_behalf_of_id as from_field\n from \"app\".\"public\".\"note_items\"\n where on_behalf_of_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "on_behalf_of_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "on_behalf_of_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_content", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_content.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_content"], "alias": "source_not_null_tamanu_note_items_content", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_content.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect content\nfrom \"app\".\"public\".\"note_items\"\nwhere content is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "content", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "content", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_date.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_date"], "alias": "source_not_null_tamanu_note_items_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"note_items\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_updated_at_sync_tick"], "alias": "source_not_null_tamanu_note_items_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"note_items\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_note_pages_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_note_pages_id.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_note_pages_id"], "alias": "source_unique_tamanu_note_pages_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_unique_tamanu_note_pages_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"note_pages\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_id.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_id"], "alias": "source_not_null_tamanu_note_pages_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"note_pages\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_created_at.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_created_at"], "alias": "source_not_null_tamanu_note_pages_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"note_pages\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_updated_at.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_updated_at"], "alias": "source_not_null_tamanu_note_pages_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"note_pages\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_note_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_note_type.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_note_type"], "alias": "source_not_null_tamanu_note_pages_note_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_note_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect note_type\nfrom \"app\".\"public\".\"note_pages\"\nwhere note_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "note_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "note_type", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_record_id.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_record_id"], "alias": "source_not_null_tamanu_note_pages_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"public\".\"note_pages\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_record_type.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_record_type"], "alias": "source_not_null_tamanu_note_pages_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"public\".\"note_pages\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_date.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_date"], "alias": "source_not_null_tamanu_note_pages_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"note_pages\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_updated_at_sync_tick"], "alias": "source_not_null_tamanu_note_pages_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"note_pages\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_notifications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_notifications_id.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_notifications_id"], "alias": "source_unique_tamanu_notifications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_unique_tamanu_notifications_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"notifications\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_id.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_id"], "alias": "source_not_null_tamanu_notifications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"notifications\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_type.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_type"], "alias": "source_not_null_tamanu_notifications_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"notifications\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_status.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_status"], "alias": "source_not_null_tamanu_notifications_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.81327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"notifications\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_user_id.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_user_id"], "alias": "source_not_null_tamanu_notifications_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"notifications\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_created_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_created_time.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_created_time"], "alias": "source_not_null_tamanu_notifications_created_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_created_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_time\nfrom \"app\".\"public\".\"notifications\"\nwhere created_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_time", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_metadata", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_metadata.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_metadata"], "alias": "source_not_null_tamanu_notifications_metadata", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_metadata.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect metadata\nfrom \"app\".\"public\".\"notifications\"\nwhere metadata is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "metadata", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "metadata", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_created_at.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_created_at"], "alias": "source_not_null_tamanu_notifications_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"notifications\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_updated_at.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_updated_at"], "alias": "source_not_null_tamanu_notifications_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"notifications\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_updated_at_sync_tick"], "alias": "source_not_null_tamanu_notifications_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"notifications\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_one_time_logins_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_one_time_logins_id.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_one_time_logins_id"], "alias": "source_unique_tamanu_one_time_logins_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_unique_tamanu_one_time_logins_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_one_time_logins_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_one_time_logins_id.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_one_time_logins_id"], "alias": "source_not_null_tamanu_one_time_logins_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_not_null_tamanu_one_time_logins_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_one_time_logins_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_one_time_logins_user_id.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_one_time_logins_user_id"], "alias": "source_not_null_tamanu_one_time_logins_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_not_null_tamanu_one_time_logins_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"one_time_logins\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_one_time_logins_token", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_one_time_logins_token.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_one_time_logins_token"], "alias": "source_not_null_tamanu_one_time_logins_token", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_not_null_tamanu_one_time_logins_token.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect token\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere token is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "token", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "token", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_one_time_logins_expires_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_one_time_logins_expires_at.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_one_time_logins_expires_at"], "alias": "source_not_null_tamanu_one_time_logins_expires_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_not_null_tamanu_one_time_logins_expires_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect expires_at\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere expires_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "expires_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "expires_at", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patients_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patients_id.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patients_id"], "alias": "source_unique_tamanu_patients_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_unique_tamanu_patients_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patients\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_id.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_id"], "alias": "source_not_null_tamanu_patients_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patients\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_created_at.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_created_at"], "alias": "source_not_null_tamanu_patients_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8290474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patients\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_updated_at.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_updated_at"], "alias": "source_not_null_tamanu_patients_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8447735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patients\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patients_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patients_display_id.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patients_display_id"], "alias": "source_unique_tamanu_patients_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8467853, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_unique_tamanu_patients_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n display_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patients\"\nwhere display_id is not null\ngroup by display_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_display_id.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_display_id"], "alias": "source_not_null_tamanu_patients_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8487916, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_id\nfrom \"app\".\"public\".\"patients\"\nwhere display_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_sex", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_sex.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_sex"], "alias": "source_not_null_tamanu_patients_sex", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8487916, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_sex.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect sex\nfrom \"app\".\"public\".\"patients\"\nwhere sex is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "sex", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "sex", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patients_sex__female__male__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu_patients_sex__female__male__other.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patients_sex__female__male__other"], "alias": "source_accepted_values_tamanu_patients_sex__female__male__other", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8487916, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_accepted_values_tamanu_patients_sex__female__male__other.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n sex as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patients\"\n group by sex\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'female','male','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "sex", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "sex", "values": ["female", "male", "other"], "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patients_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8528032, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patients\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown"], "alias": "source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448"}, "created_at": 1782422376.8528032, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n marital_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_additional_data\"\n group by marital_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Defacto','Married','Single','Widow','Divorced','Separated','Unknown'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "marital_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "marital_status", "values": ["Defacto", "Married", "Single", "Widow", "Divorced", "Separated", "Unknown"], "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_"], "alias": "source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb"}, "created_at": 1782422376.856815, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n blood_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_additional_data\"\n group by blood_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'A+','A-','AB-','AB+','B+','B-','O+','O-'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "blood_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "blood_type", "values": ["A+", "A-", "AB-", "AB+", "B+", "B-", "O+", "O-"], "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_additional_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_additional_data_patient_id.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_additional_data_patient_id"], "alias": "source_unique_tamanu_patient_additional_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8625762, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_unique_tamanu_patient_additional_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_additional_data\"\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_additional_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_additional_data_patient_id.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_additional_data_patient_id"], "alias": "source_not_null_tamanu_patient_additional_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8625762, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_not_null_tamanu_patient_additional_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_additional_data\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_additional_data_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_additional_data_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9"}, "created_at": 1782422376.8625762, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_additional_data\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_allergies_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_allergies_id.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_allergies_id"], "alias": "source_unique_tamanu_patient_allergies_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.864582, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_unique_tamanu_patient_allergies_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_id.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_id"], "alias": "source_not_null_tamanu_patient_allergies_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.864582, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_created_at.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_created_at"], "alias": "source_not_null_tamanu_patient_allergies_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8665884, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_updated_at.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_updated_at"], "alias": "source_not_null_tamanu_patient_allergies_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8665884, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_recorded_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_recorded_date.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_recorded_date"], "alias": "source_not_null_tamanu_patient_allergies_recorded_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8685944, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_recorded_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_date\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere recorded_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_date", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_allergies_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8685944, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_birth_data_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_birth_data_created_at.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_birth_data_created_at"], "alias": "source_not_null_tamanu_patient_birth_data_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.870601, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_not_null_tamanu_patient_birth_data_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_birth_data_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_birth_data_updated_at.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_birth_data_updated_at"], "alias": "source_not_null_tamanu_patient_birth_data_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.870601, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_not_null_tamanu_patient_birth_data_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_birth_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_birth_data_patient_id.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_birth_data_patient_id"], "alias": "source_unique_tamanu_patient_birth_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.872607, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_unique_tamanu_patient_birth_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_birth_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_birth_data_patient_id.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_birth_data_patient_id"], "alias": "source_not_null_tamanu_patient_birth_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.872607, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_not_null_tamanu_patient_birth_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db"}, "created_at": 1782422376.872607, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_birth_data\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other"], "alias": "source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388"}, "created_at": 1782422376.876361, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n birth_delivery_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_birth_data\"\n group by birth_delivery_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'normal_vaginal_delivery','breech','emergency_c_section','elective_c_section','vacuum_extraction','forceps','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "birth_delivery_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "birth_delivery_type", "values": ["normal_vaginal_delivery", "breech", "emergency_c_section", "elective_c_section", "vacuum_extraction", "forceps", "other"], "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other"], "alias": "source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80"}, "created_at": 1782422376.8803747, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n attendant_at_birth as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_birth_data\"\n group by attendant_at_birth\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'doctor','midwife','nurse','traditional_birth_attentdant','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attendant_at_birth", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "attendant_at_birth", "values": ["doctor", "midwife", "nurse", "traditional_birth_attentdant", "other"], "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a"}, "created_at": 1782422376.8843875, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select birth_facility_id as from_field\n from \"app\".\"public\".\"patient_birth_data\"\n where birth_facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "birth_facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "birth_facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other"], "alias": "source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f"}, "created_at": 1782422376.8863943, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n registered_birth_place as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_birth_data\"\n group by registered_birth_place\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'health_facility','home','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registered_birth_place", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "registered_birth_place", "values": ["health_facility", "home", "other"], "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_birth_data_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_birth_data_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_birth_data_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8884008, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_care_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_care_plans_id.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_care_plans_id"], "alias": "source_unique_tamanu_patient_care_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8904068, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_unique_tamanu_patient_care_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_id.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_id"], "alias": "source_not_null_tamanu_patient_care_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8921547, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_created_at.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_created_at"], "alias": "source_not_null_tamanu_patient_care_plans_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8921547, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_updated_at.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_updated_at"], "alias": "source_not_null_tamanu_patient_care_plans_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8921547, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_date.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_date"], "alias": "source_not_null_tamanu_patient_care_plans_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8941588, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_care_plans_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8941588, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_communications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_communications_id.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_communications_id"], "alias": "source_unique_tamanu_patient_communications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8964074, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_unique_tamanu_patient_communications_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_communications\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_id.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_id"], "alias": "source_not_null_tamanu_patient_communications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8976064, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_communications\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_created_at.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_created_at"], "alias": "source_not_null_tamanu_patient_communications_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.8982086, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_communications\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_updated_at.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_updated_at"], "alias": "source_not_null_tamanu_patient_communications_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.899164, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_communications\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_type.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_type"], "alias": "source_not_null_tamanu_patient_communications_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9002316, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"patient_communications\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_channel", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_channel.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_channel"], "alias": "source_not_null_tamanu_patient_communications_channel", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9007602, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_channel.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel\nfrom \"app\".\"public\".\"patient_communications\"\nwhere channel is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_status.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_status"], "alias": "source_not_null_tamanu_patient_communications_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9007602, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"patient_communications\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20"}, "created_at": 1782422376.9027708, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_communications\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2"}, "created_at": 1782422376.9057837, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_communications\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_conditions_id.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_conditions_id"], "alias": "source_unique_tamanu_patient_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9057837, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_unique_tamanu_patient_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_id.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_id"], "alias": "source_not_null_tamanu_patient_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9057837, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_created_at.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_created_at"], "alias": "source_not_null_tamanu_patient_conditions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.908626, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_updated_at.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_updated_at"], "alias": "source_not_null_tamanu_patient_conditions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.908626, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_recorded_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_recorded_date.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_recorded_date"], "alias": "source_not_null_tamanu_patient_conditions_recorded_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9106321, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_recorded_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_date\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere recorded_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_date", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_conditions_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9106321, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_contacts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_contacts_id.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_contacts_id"], "alias": "source_unique_tamanu_patient_contacts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9126384, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_unique_tamanu_patient_contacts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_id.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_id"], "alias": "source_not_null_tamanu_patient_contacts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9126384, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_created_at.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_created_at"], "alias": "source_not_null_tamanu_patient_contacts_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9126384, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_updated_at.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_updated_at"], "alias": "source_not_null_tamanu_patient_contacts_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9146447, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_name.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_name"], "alias": "source_not_null_tamanu_patient_contacts_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9146447, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_method", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_method.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_method"], "alias": "source_not_null_tamanu_patient_contacts_method", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9166503, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_method.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect method\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere method is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "method", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "method", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram"], "alias": "source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516"}, "created_at": 1782422376.9166503, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n method as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_contacts\"\n group by method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Email','Sms','WhatsApp','Telegram'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "method", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "method", "values": ["Email", "Sms", "WhatsApp", "Telegram"], "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_patient_id.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_patient_id"], "alias": "source_not_null_tamanu_patient_contacts_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9206634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735"}, "created_at": 1782422376.9206634, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_contacts\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_relationship_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_relationship_id.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_relationship_id"], "alias": "source_not_null_tamanu_patient_contacts_relationship_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9236753, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_relationship_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect relationship_id\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere relationship_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "relationship_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "relationship_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_"], "alias": "dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6"}, "created_at": 1782422376.9236753, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n relationship_id as id\n\n from \"app\".\"public\".\"patient_contacts\"\n\n where relationship_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'contactRelationship'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "relationship_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "relationship_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'contactRelationship'", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_contacts_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9276881, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_death_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_death_data_id.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_death_data_id"], "alias": "source_unique_tamanu_patient_death_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.929695, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_unique_tamanu_patient_death_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_id.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_id"], "alias": "source_not_null_tamanu_patient_death_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.929695, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_patient_id.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_patient_id"], "alias": "source_not_null_tamanu_patient_death_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.929695, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c"}, "created_at": 1782422376.931701, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_death_data\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_clinician_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_clinician_id.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_clinician_id"], "alias": "source_not_null_tamanu_patient_death_data_clinician_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9337075, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_clinician_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect clinician_id\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere clinician_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "clinician_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79"}, "created_at": 1782422376.935714, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"patient_death_data\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f"}, "created_at": 1782422376.93772, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"patient_death_data\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d"}, "created_at": 1782422376.9414737, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n last_surgery_reason_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where last_surgery_reason_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_surgery_reason_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "last_surgery_reason_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c"}, "created_at": 1782422376.9434798, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n primary_cause_condition_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where primary_cause_condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "primary_cause_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "primary_cause_condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa"}, "created_at": 1782422376.9454863, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n antecedent_cause1_condition_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where antecedent_cause1_condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "antecedent_cause1_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "antecedent_cause1_condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6"}, "created_at": 1782422376.9494994, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n antecedent_cause2_condition_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where antecedent_cause2_condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "antecedent_cause2_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "antecedent_cause2_condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_death_data_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.951506, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_is_final", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_is_final.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_is_final"], "alias": "source_not_null_tamanu_patient_death_data_is_final", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.953512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_is_final.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_final\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere is_final is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_final", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_final", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338"}, "created_at": 1782422376.953512, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n antecedent_cause3_condition_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where antecedent_cause3_condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "antecedent_cause3_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "antecedent_cause3_condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_facilities_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_facilities_facility_id.sql", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_facilities_facility_id"], "alias": "source_not_null_tamanu_patient_facilities_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9572637, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_facilities.yml\\source_not_null_tamanu_patient_facilities_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"patient_facilities\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449.sql", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449"}, "created_at": 1782422376.95927, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_facilities.yml\\source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"patient_facilities\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_facilities_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_facilities_patient_id.sql", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_facilities_patient_id"], "alias": "source_not_null_tamanu_patient_facilities_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.961276, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_facilities.yml\\source_not_null_tamanu_patient_facilities_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_facilities\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e.sql", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e"}, "created_at": 1782422376.961276, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_facilities.yml\\source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_facilities\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_family_histories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_family_histories_id.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_family_histories_id"], "alias": "source_unique_tamanu_patient_family_histories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9652889, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_unique_tamanu_patient_family_histories_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_family_histories_id.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_id"], "alias": "source_not_null_tamanu_patient_family_histories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9652889, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_family_histories_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_family_histories_created_at.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_created_at"], "alias": "source_not_null_tamanu_patient_family_histories_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.967295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_family_histories_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_family_histories_updated_at.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_updated_at"], "alias": "source_not_null_tamanu_patient_family_histories_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.967295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_family_histories_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_recorded_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_family_histories_recorded_date.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_recorded_date"], "alias": "source_not_null_tamanu_patient_family_histories_recorded_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9693012, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_family_histories_recorded_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_date\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere recorded_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_date", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_b004150615fa7d97829881147916498e.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_b004150615fa7d97829881147916498e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_b004150615fa7d97829881147916498e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_b004150615fa7d97829881147916498e"}, "created_at": 1782422376.971063, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_b004150615fa7d97829881147916498e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_relationships_tamanu_pa_b004150615fa7d97829881147916498e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_family_histories\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18"}, "created_at": 1782422376.971063, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select practitioner_id as from_field\n from \"app\".\"public\".\"patient_family_histories\"\n where practitioner_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "practitioner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "practitioner_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9"}, "created_at": 1782422376.971063, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n diagnosis_id as id\n\n from \"app\".\"public\".\"patient_family_histories\"\n\n where diagnosis_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "diagnosis_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "diagnosis_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc"}, "created_at": 1782422376.971063, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_field_definitions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_field_definitions_id.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_field_definitions_id"], "alias": "source_unique_tamanu_patient_field_definitions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.971063, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_unique_tamanu_patient_field_definitions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_id.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_id"], "alias": "source_not_null_tamanu_patient_field_definitions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.971063, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_created_at.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_created_at"], "alias": "source_not_null_tamanu_patient_field_definitions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.971063, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_updated_at.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_updated_at"], "alias": "source_not_null_tamanu_patient_field_definitions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.971063, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_name.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_name"], "alias": "source_not_null_tamanu_patient_field_definitions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.971063, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_field_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_field_type.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_field_type"], "alias": "source_not_null_tamanu_patient_field_definitions_field_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9870105, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_field_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect field_type\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere field_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "field_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "field_type", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select"], "alias": "source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8"}, "created_at": 1782422376.9870105, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n field_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_field_definitions\"\n group by field_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'string','number','select'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "field_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "field_type", "values": ["string", "number", "select"], "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_visibility_status"], "alias": "source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_category_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_category_id.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_category_id"], "alias": "source_not_null_tamanu_patient_field_definitions_category_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_category_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect category_id\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere category_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "category_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_"], "alias": "source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"], ["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories", "source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select category_id as from_field\n from \"app\".\"public\".\"patient_field_definitions\"\n where category_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patient_field_definition_categories\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "category_id", "to": "source('tamanu', 'patient_field_definition_categories')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_field_definition_categories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_field_definition_categories_id.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_field_definition_categories_id"], "alias": "source_unique_tamanu_patient_field_definition_categories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_unique_tamanu_patient_field_definition_categories_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definition_categories_id.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_id"], "alias": "source_not_null_tamanu_patient_field_definition_categories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_field_definition_categories_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_created_at"], "alias": "source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_updated_at"], "alias": "source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definition_categories_name.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_name"], "alias": "source_not_null_tamanu_patient_field_definition_categories_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_field_definition_categories_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_created_at.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_created_at"], "alias": "source_not_null_tamanu_patient_field_values_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422376.9890199, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_updated_at.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_updated_at"], "alias": "source_not_null_tamanu_patient_field_values_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0031207, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_value", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_value.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_value"], "alias": "source_not_null_tamanu_patient_field_values_value", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_value.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect value\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere value is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "value", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "value", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_definition_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_definition_id.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_definition_id"], "alias": "source_not_null_tamanu_patient_field_values_definition_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_definition_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect definition_id\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere definition_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "definition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "definition_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_"], "alias": "source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"], ["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions", "source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select definition_id as from_field\n from \"app\".\"public\".\"patient_field_values\"\n where definition_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patient_field_definitions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "definition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "definition_id", "to": "source('tamanu', 'patient_field_definitions')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_patient_id.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_patient_id"], "alias": "source_not_null_tamanu_patient_field_values_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_field_values\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_issues_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_issues_id.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_issues_id"], "alias": "source_unique_tamanu_patient_issues_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_unique_tamanu_patient_issues_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_issues\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_id.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_id"], "alias": "source_not_null_tamanu_patient_issues_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_issues\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_created_at.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_created_at"], "alias": "source_not_null_tamanu_patient_issues_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_issues\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_updated_at.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_updated_at"], "alias": "source_not_null_tamanu_patient_issues_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_issues\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_recorded_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_recorded_date.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_recorded_date"], "alias": "source_not_null_tamanu_patient_issues_recorded_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_recorded_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_date\nfrom \"app\".\"public\".\"patient_issues\"\nwhere recorded_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_date", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_type.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_type"], "alias": "source_not_null_tamanu_patient_issues_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"patient_issues\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc"}, "created_at": 1782422377.0041287, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_issues\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_issues_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_issues\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_ongoing_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_ongoing_prescriptions_id.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_ongoing_prescriptions_id"], "alias": "source_unique_tamanu_patient_ongoing_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_unique_tamanu_patient_ongoing_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_ongoing_prescriptions_id.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_id"], "alias": "source_not_null_tamanu_patient_ongoing_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_ongoing_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_patient_id"], "alias": "source_not_null_tamanu_patient_ongoing_prescriptions_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id"], "alias": "source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect prescription_id\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_ongoing_prescriptions_created_at.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_created_at"], "alias": "source_not_null_tamanu_patient_ongoing_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_ongoing_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at"], "alias": "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_program_registrations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_program_registrations_id.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_program_registrations_id"], "alias": "source_unique_tamanu_patient_program_registrations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_unique_tamanu_patient_program_registrations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_id.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_id"], "alias": "source_not_null_tamanu_patient_program_registrations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_created_at.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_created_at"], "alias": "source_not_null_tamanu_patient_program_registrations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_updated_at.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_updated_at"], "alias": "source_not_null_tamanu_patient_program_registrations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_date.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_date"], "alias": "source_not_null_tamanu_patient_program_registrations_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_registration_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_registration_status"], "alias": "source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect registration_status\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere registration_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registration_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "registration_status", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_patient_id.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_patient_id"], "alias": "source_not_null_tamanu_patient_program_registrations_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.01887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c"}, "created_at": 1782422377.0346222, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_program_registry_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_program_registry_id"], "alias": "source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098"}, "created_at": 1782422377.0346222, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_id\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere program_registry_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_"], "alias": "source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea"}, "created_at": 1782422377.0346222, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_registry_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where program_registry_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registries\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_registry_id", "to": "source('tamanu', 'program_registries')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_"], "alias": "source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0"}, "created_at": 1782422377.0346222, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinical_status_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where clinical_status_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registry_clinical_statuses\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinical_status_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinical_status_id", "to": "source('tamanu', 'program_registry_clinical_statuses')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_clinician_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_clinician_id"], "alias": "source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682"}, "created_at": 1782422377.0346222, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect clinician_id\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere clinician_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "clinician_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_24112443541f682d55878e61af957461.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_24112443541f682d55878e61af957461", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_24112443541f682d55878e61af957461", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_24112443541f682d55878e61af957461"}, "created_at": 1782422377.0346222, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_24112443541f682d55878e61af957461\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_24112443541f682d55878e61af957461.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419"}, "created_at": 1782422377.0346222, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select registering_facility_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where registering_facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registering_facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "registering_facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26"}, "created_at": 1782422377.0503635, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_"], "alias": "dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c"}, "created_at": 1782422377.0517497, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n village_id as id\n\n from \"app\".\"public\".\"patient_program_registrations\"\n\n where village_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'village'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "village_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "village_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'village'", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb"}, "created_at": 1782422377.0517497, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_program_registration_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_program_registration_conditions_id.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_program_registration_conditions_id"], "alias": "source_unique_tamanu_patient_program_registration_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0517497, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_unique_tamanu_patient_program_registration_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_id"], "alias": "source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8"}, "created_at": 1782422377.0517497, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_created_at"], "alias": "source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1"}, "created_at": 1782422377.0517497, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_updated_at"], "alias": "source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013"}, "created_at": 1782422377.0611815, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_date"], "alias": "source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e"}, "created_at": 1782422377.06321, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_"], "alias": "source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b"}, "created_at": 1782422377.0641956, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"], ["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_registry_condition_id as from_field\n from \"app\".\"public\".\"patient_program_registration_conditions\"\n where program_registry_condition_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registry_conditions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_registry_condition_id", "to": "source('tamanu', 'program_registry_conditions')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847"}, "created_at": 1782422377.0672014, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"patient_program_registration_conditions\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6"}, "created_at": 1782422377.0692048, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select deletion_clinician_id as from_field\n from \"app\".\"public\".\"patient_program_registration_conditions\"\n where deletion_clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "deletion_clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "deletion_clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a"}, "created_at": 1782422377.0721889, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id"], "alias": "source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79"}, "created_at": 1782422377.0731888, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_condition_category_id\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere program_registry_condition_category_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_condition_category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_condition_category_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_secondary_ids_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_secondary_ids_id.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_secondary_ids_id"], "alias": "source_unique_tamanu_patient_secondary_ids_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0741887, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_unique_tamanu_patient_secondary_ids_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_id.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_id"], "alias": "source_not_null_tamanu_patient_secondary_ids_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0751913, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_value", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_value.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_value"], "alias": "source_not_null_tamanu_patient_secondary_ids_value", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0761883, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_value.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect value\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere value is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "value", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "value", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_visibility_status.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_visibility_status"], "alias": "source_not_null_tamanu_patient_secondary_ids_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0771885, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_type_id.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_type_id"], "alias": "source_not_null_tamanu_patient_secondary_ids_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type_id\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_patient_id.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_patient_id"], "alias": "source_not_null_tamanu_patient_secondary_ids_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_vrs_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_vrs_data_id.sql", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_vrs_data_id"], "alias": "source_unique_tamanu_patient_vrs_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_vrs_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_vrs_data.yml\\source_unique_tamanu_patient_vrs_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_vrs_data\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_vrs_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_vrs_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_vrs_data_id.sql", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_vrs_data_id"], "alias": "source_not_null_tamanu_patient_vrs_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_vrs_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_vrs_data.yml\\source_not_null_tamanu_patient_vrs_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_vrs_data\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_vrs_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a.sql", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_vrs_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_vrs_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_vrs_data.yml\\source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_vrs_data\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_vrs_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.sql", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote"], "alias": "source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_vrs_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_vrs_data.yml\\source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_deleted_by_remote\nfrom \"app\".\"public\".\"patient_vrs_data\"\nwhere is_deleted_by_remote is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_deleted_by_remote", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_deleted_by_remote", "model": "{{ get_where_subquery(source('tamanu', 'patient_vrs_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_permissions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_permissions_id.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_permissions_id"], "alias": "source_unique_tamanu_permissions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_unique_tamanu_permissions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"permissions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_id.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_id"], "alias": "source_not_null_tamanu_permissions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"permissions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_role_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_role_id.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_role_id"], "alias": "source_not_null_tamanu_permissions_role_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_role_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect role_id\nfrom \"app\".\"public\".\"permissions\"\nwhere role_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "role_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "role_id", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_"], "alias": "source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963"}, "created_at": 1782422377.0777209, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"], ["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles", "source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select role_id as from_field\n from \"app\".\"public\".\"permissions\"\n where role_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"roles\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "role_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "role_id", "to": "source('tamanu', 'roles')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_noun", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_noun.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_noun"], "alias": "source_not_null_tamanu_permissions_noun", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_noun.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect noun\nfrom \"app\".\"public\".\"permissions\"\nwhere noun is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "noun", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "noun", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_verb", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_verb.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_verb"], "alias": "source_not_null_tamanu_permissions_verb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_verb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect verb\nfrom \"app\".\"public\".\"permissions\"\nwhere verb is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "verb", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "verb", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_permissions_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"permissions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_pharmacy_orders_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_pharmacy_orders_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_pharmacy_orders_id"], "alias": "source_unique_tamanu_pharmacy_orders_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_unique_tamanu_pharmacy_orders_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_id"], "alias": "source_not_null_tamanu_pharmacy_orders_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_ordering_clinician_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_ordering_clinician_id"], "alias": "source_not_null_tamanu_pharmacy_orders_ordering_clinician_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect ordering_clinician_id\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere ordering_clinician_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ordering_clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ordering_clinician_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_encounter_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_encounter_id"], "alias": "source_not_null_tamanu_pharmacy_orders_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_created_at.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_created_at"], "alias": "source_not_null_tamanu_pharmacy_orders_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_updated_at.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_updated_at"], "alias": "source_not_null_tamanu_pharmacy_orders_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick"], "alias": "source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_is_discharge_prescription", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_is_discharge_prescription"], "alias": "source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_discharge_prescription\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere is_discharge_prescription is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_discharge_prescription", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_discharge_prescription", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_date.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_date"], "alias": "source_not_null_tamanu_pharmacy_orders_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.0931997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_facility_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_facility_id"], "alias": "source_not_null_tamanu_pharmacy_orders_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1041765, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_pharmacy_order_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_pharmacy_order_prescriptions_id.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_pharmacy_order_prescriptions_id"], "alias": "source_unique_tamanu_pharmacy_order_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1041765, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_unique_tamanu_pharmacy_order_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_order_prescriptions_id.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_id"], "alias": "source_not_null_tamanu_pharmacy_order_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1041765, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmacy_order_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id"], "alias": "source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff"}, "created_at": 1782422377.1041765, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pharmacy_order_id\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere pharmacy_order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pharmacy_order_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pharmacy_order_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id"], "alias": "source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38"}, "created_at": 1782422377.1041765, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect prescription_id\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_quantity", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_order_prescriptions_quantity.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_quantity"], "alias": "source_not_null_tamanu_pharmacy_order_prescriptions_quantity", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1041765, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmacy_order_prescriptions_quantity.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect quantity\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere quantity is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "quantity", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "quantity", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_order_prescriptions_created_at.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_created_at"], "alias": "source_not_null_tamanu_pharmacy_order_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmacy_order_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at"], "alias": "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_is_completed", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_is_completed"], "alias": "source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_completed\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere is_completed is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_completed", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_completed", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_portal_one_time_tokens_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_portal_one_time_tokens_id.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_portal_one_time_tokens_id"], "alias": "source_unique_tamanu_portal_one_time_tokens_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_unique_tamanu_portal_one_time_tokens_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_id.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_id"], "alias": "source_not_null_tamanu_portal_one_time_tokens_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_created_at.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_created_at"], "alias": "source_not_null_tamanu_portal_one_time_tokens_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_updated_at.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_updated_at"], "alias": "source_not_null_tamanu_portal_one_time_tokens_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_portal_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_portal_user_id.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_portal_user_id"], "alias": "source_not_null_tamanu_portal_one_time_tokens_portal_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_portal_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect portal_user_id\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere portal_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "portal_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "portal_user_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_type.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_type"], "alias": "source_not_null_tamanu_portal_one_time_tokens_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_token", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_token.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_token"], "alias": "source_not_null_tamanu_portal_one_time_tokens_token", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_token.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect token\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere token is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "token", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "token", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_expires_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_expires_at.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_expires_at"], "alias": "source_not_null_tamanu_portal_one_time_tokens_expires_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_expires_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect expires_at\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere expires_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "expires_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "expires_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_portal_survey_assignments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_portal_survey_assignments_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_portal_survey_assignments_id"], "alias": "source_unique_tamanu_portal_survey_assignments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_unique_tamanu_portal_survey_assignments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_created_at.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_created_at"], "alias": "source_not_null_tamanu_portal_survey_assignments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_updated_at.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_updated_at"], "alias": "source_not_null_tamanu_portal_survey_assignments_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_patient_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_patient_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1089678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_survey_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_survey_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_survey_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_survey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_survey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect survey_id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere survey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "survey_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_status.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_status"], "alias": "source_not_null_tamanu_portal_survey_assignments_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_assigned_by_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_assigned_by_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_assigned_by_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_assigned_by_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_assigned_by_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect assigned_by_id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere assigned_by_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "assigned_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "assigned_by_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_assigned_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_assigned_at.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_assigned_at"], "alias": "source_not_null_tamanu_portal_survey_assignments_assigned_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_assigned_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect assigned_at\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere assigned_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "assigned_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "assigned_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_facility_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_facility_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_portal_users_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_portal_users_id.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_portal_users_id"], "alias": "source_unique_tamanu_portal_users_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_unique_tamanu_portal_users_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"portal_users\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_id.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_id"], "alias": "source_not_null_tamanu_portal_users_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"portal_users\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_created_at.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_created_at"], "alias": "source_not_null_tamanu_portal_users_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"portal_users\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_updated_at.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_updated_at"], "alias": "source_not_null_tamanu_portal_users_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"portal_users\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_patient_id.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_patient_id"], "alias": "source_not_null_tamanu_portal_users_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"portal_users\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_portal_users_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_portal_users_email.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_portal_users_email"], "alias": "source_unique_tamanu_portal_users_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_unique_tamanu_portal_users_email.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n email as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"portal_users\"\nwhere email is not null\ngroup by email\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_email.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_email"], "alias": "source_not_null_tamanu_portal_users_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_email.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect email\nfrom \"app\".\"public\".\"portal_users\"\nwhere email is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_status.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_status"], "alias": "source_not_null_tamanu_portal_users_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"portal_users\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_updated_at_sync_tick"], "alias": "source_not_null_tamanu_portal_users_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"portal_users\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_prescriptions_id.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_prescriptions_id"], "alias": "source_unique_tamanu_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_unique_tamanu_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_id.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_id"], "alias": "source_not_null_tamanu_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_created_at.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_created_at"], "alias": "source_not_null_tamanu_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.124928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_updated_at"], "alias": "source_not_null_tamanu_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_date.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_date"], "alias": "source_not_null_tamanu_prescriptions_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"prescriptions\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_units", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_units.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_units"], "alias": "source_not_null_tamanu_prescriptions_units", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_units.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect units\nfrom \"app\".\"public\".\"prescriptions\"\nwhere units is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "units", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "units", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_frequency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_frequency.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_frequency"], "alias": "source_not_null_tamanu_prescriptions_frequency", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_frequency.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect frequency\nfrom \"app\".\"public\".\"prescriptions\"\nwhere frequency is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "frequency", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "frequency", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_start_date.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_start_date"], "alias": "source_not_null_tamanu_prescriptions_start_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_start_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_date\nfrom \"app\".\"public\".\"prescriptions\"\nwhere start_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_date", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_prescriptions_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_procedures_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_procedures_id.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_procedures_id"], "alias": "source_unique_tamanu_procedures_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_unique_tamanu_procedures_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"procedures\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_id.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_id"], "alias": "source_not_null_tamanu_procedures_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"procedures\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_created_at.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_created_at"], "alias": "source_not_null_tamanu_procedures_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"procedures\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_updated_at.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_updated_at"], "alias": "source_not_null_tamanu_procedures_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"procedures\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_date.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_date"], "alias": "source_not_null_tamanu_procedures_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"procedures\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"procedures\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'encounters')", "field": "id", "column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd"}, "created_at": 1782422377.140912, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"procedures\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'locations')", "field": "id", "column_name": "location_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_"], "alias": "dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc"}, "created_at": 1782422377.1568992, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n procedure_type_id as id\n\n from \"app\".\"public\".\"procedures\"\n\n where procedure_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'procedureType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'procedureType'", "column_name": "procedure_type_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_"], "alias": "dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1"}, "created_at": 1782422377.1609156, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n anaesthetic_id as id\n\n from \"app\".\"public\".\"procedures\"\n\n where anaesthetic_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'drug'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "anaesthetic_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'drug'", "column_name": "anaesthetic_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c"}, "created_at": 1782422377.1609156, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select physician_id as from_field\n from \"app\".\"public\".\"procedures\"\n where physician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "physician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'users')", "field": "id", "column_name": "physician_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad"}, "created_at": 1782422377.1609156, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select anaesthetist_id as from_field\n from \"app\".\"public\".\"procedures\"\n where anaesthetist_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "anaesthetist_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'users')", "field": "id", "column_name": "anaesthetist_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_updated_at_sync_tick"], "alias": "source_not_null_tamanu_procedures_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"procedures\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_procedure_assistant_clinicians_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_procedure_assistant_clinicians_id.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_procedure_assistant_clinicians_id"], "alias": "source_unique_tamanu_procedure_assistant_clinicians_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_unique_tamanu_procedure_assistant_clinicians_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_assistant_clinicians_id.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_id"], "alias": "source_not_null_tamanu_procedure_assistant_clinicians_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedure_assistant_clinicians_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_procedure_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_procedure_id"], "alias": "source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect procedure_id\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere procedure_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "procedure_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_assistant_clinicians_user_id.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_user_id"], "alias": "source_not_null_tamanu_procedure_assistant_clinicians_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedure_assistant_clinicians_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_created_at"], "alias": "source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_updated_at"], "alias": "source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick"], "alias": "source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_procedure_survey_responses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_procedure_survey_responses_id.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_procedure_survey_responses_id"], "alias": "source_unique_tamanu_procedure_survey_responses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_unique_tamanu_procedure_survey_responses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_survey_responses_id.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_id"], "alias": "source_not_null_tamanu_procedure_survey_responses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1725512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedure_survey_responses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_procedure_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_survey_responses_procedure_id.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_procedure_id"], "alias": "source_not_null_tamanu_procedure_survey_responses_procedure_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.183487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedure_survey_responses_procedure_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect procedure_id\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere procedure_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "procedure_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_survey_response_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_survey_response_id"], "alias": "source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222"}, "created_at": 1782422377.183487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect survey_response_id\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere survey_response_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_response_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "survey_response_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_survey_responses_created_at.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_created_at"], "alias": "source_not_null_tamanu_procedure_survey_responses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1853106, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedure_survey_responses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_survey_responses_updated_at.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_updated_at"], "alias": "source_not_null_tamanu_procedure_survey_responses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1853106, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedure_survey_responses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc"}, "created_at": 1782422377.1853106, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_procedure_type_surveys_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_procedure_type_surveys_id.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_procedure_type_surveys_id"], "alias": "source_unique_tamanu_procedure_type_surveys_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1883228, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_unique_tamanu_procedure_type_surveys_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_id.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_id"], "alias": "source_not_null_tamanu_procedure_type_surveys_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1883228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_procedure_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_procedure_type_id.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_procedure_type_id"], "alias": "source_not_null_tamanu_procedure_type_surveys_procedure_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1883228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_procedure_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect procedure_type_id\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere procedure_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "procedure_type_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_survey_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_survey_id.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_survey_id"], "alias": "source_not_null_tamanu_procedure_type_surveys_survey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1883228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_survey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect survey_id\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere survey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "survey_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_created_at.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_created_at"], "alias": "source_not_null_tamanu_procedure_type_surveys_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1883228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_updated_at.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_updated_at"], "alias": "source_not_null_tamanu_procedure_type_surveys_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1883228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick"], "alias": "source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e"}, "created_at": 1782422377.1938078, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_programs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_programs_id.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_programs_id"], "alias": "source_unique_tamanu_programs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1938078, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_unique_tamanu_programs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"programs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_programs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_programs_id.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_programs_id"], "alias": "source_not_null_tamanu_programs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1958148, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_not_null_tamanu_programs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"programs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_programs_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_programs_created_at.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_programs_created_at"], "alias": "source_not_null_tamanu_programs_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1958148, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_not_null_tamanu_programs_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"programs\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_programs_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_programs_updated_at.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_programs_updated_at"], "alias": "source_not_null_tamanu_programs_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1978214, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_not_null_tamanu_programs_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"programs\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_programs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_programs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_programs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_programs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.1986492, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_not_null_tamanu_programs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"programs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_data_elements_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_data_elements_id.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_data_elements_id"], "alias": "source_unique_tamanu_program_data_elements_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.199678, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_unique_tamanu_program_data_elements_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_data_elements_id.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_id"], "alias": "source_not_null_tamanu_program_data_elements_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.200724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_data_elements_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_data_elements_created_at.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_created_at"], "alias": "source_not_null_tamanu_program_data_elements_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2017782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_data_elements_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_data_elements_updated_at.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_updated_at"], "alias": "source_not_null_tamanu_program_data_elements_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2023015, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_data_elements_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_data_elements_type.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_type"], "alias": "source_not_null_tamanu_program_data_elements_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2033627, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_data_elements_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824"}, "created_at": 1782422377.204557, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registries_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registries_id.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registries_id"], "alias": "source_unique_tamanu_program_registries_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2056046, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_unique_tamanu_program_registries_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registries\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_id.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_id"], "alias": "source_not_null_tamanu_program_registries_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2066343, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_registries\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_created_at.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_created_at"], "alias": "source_not_null_tamanu_program_registries_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2076776, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_registries\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_updated_at.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_updated_at"], "alias": "source_not_null_tamanu_program_registries_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2087307, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_registries\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registries_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registries_code.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registries_code"], "alias": "source_unique_tamanu_program_registries_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2092571, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_unique_tamanu_program_registries_code.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n code as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registries\"\nwhere code is not null\ngroup by code\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_code.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_code"], "alias": "source_not_null_tamanu_program_registries_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.210312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"program_registries\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_name.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_name"], "alias": "source_not_null_tamanu_program_registries_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2108378, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"program_registries\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_currently_at_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_currently_at_type.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_currently_at_type"], "alias": "source_not_null_tamanu_program_registries_currently_at_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2118902, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_currently_at_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect currently_at_type\nfrom \"app\".\"public\".\"program_registries\"\nwhere currently_at_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "currently_at_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "currently_at_type", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_program_registries_currently_at_type__village__facility", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_program_registries_currently_at_type__village__facility"], "alias": "source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321"}, "created_at": 1782422377.2129314, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n currently_at_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"program_registries\"\n group by currently_at_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'village','facility'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "currently_at_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "currently_at_type", "values": ["village", "facility"], "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_program_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_program_id.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_program_id"], "alias": "source_not_null_tamanu_program_registries_program_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.215588, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_program_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_id\nfrom \"app\".\"public\".\"program_registries\"\nwhere program_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_id", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_registries_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2166476, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_registries\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_clinical_statuses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_clinical_statuses_id.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_clinical_statuses_id"], "alias": "source_unique_tamanu_program_registry_clinical_statuses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2182398, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_unique_tamanu_program_registry_clinical_statuses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_clinical_statuses_id.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_id"], "alias": "source_not_null_tamanu_program_registry_clinical_statuses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2182398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_registry_clinical_statuses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_created_at"], "alias": "source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a"}, "created_at": 1782422377.2199888, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_updated_at"], "alias": "source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74"}, "created_at": 1782422377.2199888, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_clinical_statuses_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_clinical_statuses_code.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_clinical_statuses_code"], "alias": "source_unique_tamanu_program_registry_clinical_statuses_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2199888, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_unique_tamanu_program_registry_clinical_statuses_code.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n code as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere code is not null\ngroup by code\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_clinical_statuses_code.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_code"], "alias": "source_not_null_tamanu_program_registry_clinical_statuses_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2219958, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_registry_clinical_statuses_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_clinical_statuses_name.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_name"], "alias": "source_not_null_tamanu_program_registry_clinical_statuses_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2219958, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_registry_clinical_statuses_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id"], "alias": "source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5"}, "created_at": 1782422377.2243774, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_id\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere program_registry_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_"], "alias": "source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181"}, "created_at": 1782422377.2248816, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"], ["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_registry_id as from_field\n from \"app\".\"public\".\"program_registry_clinical_statuses\"\n where program_registry_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registries\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_registry_id", "to": "source('tamanu', 'program_registries')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c"}, "created_at": 1782422377.2285924, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_conditions_id.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_conditions_id"], "alias": "source_unique_tamanu_program_registry_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.229685, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_unique_tamanu_program_registry_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_id.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_id"], "alias": "source_not_null_tamanu_program_registry_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2312567, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_created_at.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_created_at"], "alias": "source_not_null_tamanu_program_registry_conditions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2317955, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_updated_at.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_updated_at"], "alias": "source_not_null_tamanu_program_registry_conditions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2328453, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_conditions_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_conditions_code.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_conditions_code"], "alias": "source_unique_tamanu_program_registry_conditions_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.23337, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_unique_tamanu_program_registry_conditions_code.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n code as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere code is not null\ngroup by code\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_code.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_code"], "alias": "source_not_null_tamanu_program_registry_conditions_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2344227, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_name.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_name"], "alias": "source_not_null_tamanu_program_registry_conditions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.235478, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_program_registry_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_program_registry_id"], "alias": "source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5"}, "created_at": 1782422377.2374794, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_id\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere program_registry_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_"], "alias": "source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e"}, "created_at": 1782422377.2385225, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"], ["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_registry_id as from_field\n from \"app\".\"public\".\"program_registry_conditions\"\n where program_registry_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registries\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_registry_id", "to": "source('tamanu', 'program_registries')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b"}, "created_at": 1782422377.2426617, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_condition_categories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_condition_categories_id.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_condition_categories_id"], "alias": "source_unique_tamanu_program_registry_condition_categories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2442229, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_unique_tamanu_program_registry_condition_categories_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_condition_categories_id.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_id"], "alias": "source_not_null_tamanu_program_registry_condition_categories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2447479, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_registry_condition_categories_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_created_at"], "alias": "source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341"}, "created_at": 1782422377.2463534, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_updated_at"], "alias": "source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7"}, "created_at": 1782422377.2469044, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_code"], "alias": "source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f"}, "created_at": 1782422377.2469044, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_name"], "alias": "source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c"}, "created_at": 1782422377.2469044, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_program_registry_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_program_registry_id"], "alias": "source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c"}, "created_at": 1782422377.2469044, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_id\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere program_registry_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528"}, "created_at": 1782422377.2469044, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_data_id.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_data_id"], "alias": "source_unique_tamanu_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_unique_tamanu_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_data\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_id.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_id"], "alias": "source_not_null_tamanu_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"reference_data\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_created_at.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_created_at"], "alias": "source_not_null_tamanu_reference_data_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_data\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_updated_at.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_updated_at"], "alias": "source_not_null_tamanu_reference_data_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_data\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_code.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_code"], "alias": "source_not_null_tamanu_reference_data_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"reference_data\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_type.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_type"], "alias": "source_not_null_tamanu_reference_data_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"reference_data\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_name.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_name"], "alias": "source_not_null_tamanu_reference_data_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"reference_data\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_updated_at_sync_tick"], "alias": "source_not_null_tamanu_reference_data_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_data\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_system_required", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_system_required.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_system_required"], "alias": "source_not_null_tamanu_reference_data_system_required", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_system_required.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect system_required\nfrom \"app\".\"public\".\"reference_data\"\nwhere system_required is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "system_required", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "system_required", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_data_relations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_data_relations_id.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_data_relations_id"], "alias": "source_unique_tamanu_reference_data_relations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_unique_tamanu_reference_data_relations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_relations_id.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_id"], "alias": "source_not_null_tamanu_reference_data_relations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_reference_data_relations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_relations_created_at.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_created_at"], "alias": "source_not_null_tamanu_reference_data_relations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_reference_data_relations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_relations_updated_at.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_updated_at"], "alias": "source_not_null_tamanu_reference_data_relations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_reference_data_relations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_relations_type.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_type"], "alias": "source_not_null_tamanu_reference_data_relations_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_reference_data_relations_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_drugs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_drugs_id.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_drugs_id"], "alias": "source_unique_tamanu_reference_drugs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_unique_tamanu_reference_drugs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_id.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_id"], "alias": "source_not_null_tamanu_reference_drugs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2514396, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_drugs_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_drugs_reference_data_id.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_drugs_reference_data_id"], "alias": "source_unique_tamanu_reference_drugs_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_unique_tamanu_reference_drugs_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n reference_data_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere reference_data_id is not null\ngroup by reference_data_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_reference_data_id.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_reference_data_id"], "alias": "source_not_null_tamanu_reference_drugs_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reference_data_id\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere reference_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_is_sensitive", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_is_sensitive.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_is_sensitive"], "alias": "source_not_null_tamanu_reference_drugs_is_sensitive", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_is_sensitive.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_sensitive\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere is_sensitive is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_sensitive", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_sensitive", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_created_at.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_created_at"], "alias": "source_not_null_tamanu_reference_drugs_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_updated_at.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_updated_at"], "alias": "source_not_null_tamanu_reference_drugs_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_reference_drugs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_reference_drug_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_reference_drug_id"], "alias": "source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reference_drug_id\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere reference_drug_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_drug_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reference_drug_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drug_facilities_facility_id.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_facility_id"], "alias": "source_not_null_tamanu_reference_drug_facilities_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_reference_drug_facilities_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drug_facilities_created_at.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_created_at"], "alias": "source_not_null_tamanu_reference_drug_facilities_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_reference_drug_facilities_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drug_facilities_updated_at.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_updated_at"], "alias": "source_not_null_tamanu_reference_drug_facilities_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_reference_drug_facilities_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick"], "alias": "source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_stock_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drug_facilities_stock_status.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_stock_status"], "alias": "source_not_null_tamanu_reference_drug_facilities_stock_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_reference_drug_facilities_stock_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect stock_status\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere stock_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stock_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stock_status", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_medication_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_medication_templates_id.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_medication_templates_id"], "alias": "source_unique_tamanu_reference_medication_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_unique_tamanu_reference_medication_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_id.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_id"], "alias": "source_not_null_tamanu_reference_medication_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_reference_data_id"], "alias": "source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reference_data_id\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere reference_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_medication_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_medication_id"], "alias": "source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect medication_id\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere medication_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "medication_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "medication_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_is_variable_dose", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_is_variable_dose"], "alias": "source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_variable_dose\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere is_variable_dose is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_variable_dose", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_variable_dose", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_is_prn", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_is_prn.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_is_prn"], "alias": "source_not_null_tamanu_reference_medication_templates_is_prn", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2674875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_is_prn.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_prn\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere is_prn is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_prn", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_prn", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_units", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_units.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_units"], "alias": "source_not_null_tamanu_reference_medication_templates_units", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_units.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect units\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere units is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "units", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "units", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_frequency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_frequency.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_frequency"], "alias": "source_not_null_tamanu_reference_medication_templates_frequency", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_frequency.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect frequency\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere frequency is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "frequency", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "frequency", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_route", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_route.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_route"], "alias": "source_not_null_tamanu_reference_medication_templates_route", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_route.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect route\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere route is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "route", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "route", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_created_at"], "alias": "source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_updated_at"], "alias": "source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick"], "alias": "source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_is_ongoing", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_is_ongoing"], "alias": "source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_ongoing\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere is_ongoing is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_ongoing", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_ongoing", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_referrals_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_referrals_id.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_referrals_id"], "alias": "source_unique_tamanu_referrals_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_unique_tamanu_referrals_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"referrals\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_id.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_id"], "alias": "source_not_null_tamanu_referrals_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"referrals\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_created_at.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_created_at"], "alias": "source_not_null_tamanu_referrals_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"referrals\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_updated_at.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_updated_at"], "alias": "source_not_null_tamanu_referrals_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"referrals\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7"}, "created_at": 1782422377.2834995, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select initiating_encounter_id as from_field\n from \"app\".\"public\".\"referrals\"\n where initiating_encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "initiating_encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "initiating_encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a"}, "created_at": 1782422377.2952836, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select completing_encounter_id as from_field\n from \"app\".\"public\".\"referrals\"\n where completing_encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "completing_encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "completing_encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_"], "alias": "source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd"}, "created_at": 1782422377.299986, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"], ["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses", "source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select survey_response_id as from_field\n from \"app\".\"public\".\"referrals\"\n where survey_response_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"survey_responses\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_response_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "survey_response_id", "to": "source('tamanu', 'survey_responses')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_status.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_status"], "alias": "source_not_null_tamanu_referrals_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3020515, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"referrals\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_referrals_status__pending__cancelled__completed", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_referrals_status__pending__cancelled__completed"], "alias": "source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4"}, "created_at": 1782422377.3040586, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"referrals\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'pending','cancelled','completed'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["pending", "cancelled", "completed"], "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_updated_at_sync_tick"], "alias": "source_not_null_tamanu_referrals_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3065734, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"referrals\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_refresh_tokens_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_refresh_tokens_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_refresh_tokens_id"], "alias": "source_unique_tamanu_refresh_tokens_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3065734, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_unique_tamanu_refresh_tokens_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_id"], "alias": "source_not_null_tamanu_refresh_tokens_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3065734, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_refresh_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_refresh_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_refresh_id"], "alias": "source_not_null_tamanu_refresh_tokens_refresh_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3065734, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_refresh_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect refresh_id\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere refresh_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "refresh_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "refresh_id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_device_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_device_id"], "alias": "source_not_null_tamanu_refresh_tokens_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3065734, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_user_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_user_id"], "alias": "source_not_null_tamanu_refresh_tokens_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3065734, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7"}, "created_at": 1782422377.3065734, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"refresh_tokens\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_expires_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_expires_at.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_expires_at"], "alias": "source_not_null_tamanu_refresh_tokens_expires_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_expires_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect expires_at\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere expires_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "expires_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "expires_at", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_report_definitions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_report_definitions_id.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_report_definitions_id"], "alias": "source_unique_tamanu_report_definitions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_unique_tamanu_report_definitions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"report_definitions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definitions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definitions_id.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definitions_id"], "alias": "source_not_null_tamanu_report_definitions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_not_null_tamanu_report_definitions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"report_definitions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_report_definitions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_report_definitions_name.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_report_definitions_name"], "alias": "source_unique_tamanu_report_definitions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_unique_tamanu_report_definitions_name.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n name as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"report_definitions\"\nwhere name is not null\ngroup by name\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definitions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definitions_name.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definitions_name"], "alias": "source_not_null_tamanu_report_definitions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_not_null_tamanu_report_definitions_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"report_definitions\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definitions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definitions_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definitions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_report_definitions_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_not_null_tamanu_report_definitions_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"report_definitions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definitions_db_schema", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definitions_db_schema.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definitions_db_schema"], "alias": "source_not_null_tamanu_report_definitions_db_schema", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_not_null_tamanu_report_definitions_db_schema.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect db_schema\nfrom \"app\".\"public\".\"report_definitions\"\nwhere db_schema is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "db_schema", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "db_schema", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_report_definition_versions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_report_definition_versions_id.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_report_definition_versions_id"], "alias": "source_unique_tamanu_report_definition_versions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_unique_tamanu_report_definition_versions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definition_versions_id.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_id"], "alias": "source_not_null_tamanu_report_definition_versions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report_definition_versions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_version_number", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_version_number"], "alias": "source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect version_number\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere version_number is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "version_number", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "version_number", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definition_versions_status.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_status"], "alias": "source_not_null_tamanu_report_definition_versions_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report_definition_versions_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_report_definition_versions_status__draft__published", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_report_definition_versions_status__draft__published"], "alias": "source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"report_definition_versions\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'draft','published'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["draft", "published"], "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_"], "alias": "source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96"}, "created_at": 1782422377.3151298, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"], ["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions", "source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select report_definition_id as from_field\n from \"app\".\"public\".\"report_definition_versions\"\n where report_definition_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"report_definitions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "report_definition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "report_definition_id", "to": "source('tamanu', 'report_definitions')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definition_versions_user_id.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_user_id"], "alias": "source_not_null_tamanu_report_definition_versions_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.330786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report_definition_versions_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f"}, "created_at": 1782422377.330786, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"report_definition_versions\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8"}, "created_at": 1782422377.330786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_report_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_report_requests_id.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_report_requests_id"], "alias": "source_unique_tamanu_report_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.330786, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_unique_tamanu_report_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"report_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_id.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_id"], "alias": "source_not_null_tamanu_report_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.330786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"report_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_created_at.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_created_at"], "alias": "source_not_null_tamanu_report_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.330786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"report_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_updated_at.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_updated_at"], "alias": "source_not_null_tamanu_report_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.330786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"report_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_recipients", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_recipients.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_recipients"], "alias": "source_not_null_tamanu_report_requests_recipients", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.330786, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_recipients.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recipients\nfrom \"app\".\"public\".\"report_requests\"\nwhere recipients is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recipients", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recipients", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_status.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_status"], "alias": "source_not_null_tamanu_report_requests_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3405106, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"report_requests\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error"], "alias": "source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8"}, "created_at": 1782422377.3405106, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"report_requests\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Received','Processing','Processed','Error'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["Received", "Processing", "Processed", "Error"], "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_requested_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_requested_by_user_id.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_requested_by_user_id"], "alias": "source_not_null_tamanu_report_requests_requested_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3447351, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_requested_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect requested_by_user_id\nfrom \"app\".\"public\".\"report_requests\"\nwhere requested_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "requested_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95"}, "created_at": 1782422377.3457403, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select requested_by_user_id as from_field\n from \"app\".\"public\".\"report_requests\"\n where requested_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "requested_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6"}, "created_at": 1782422377.3487525, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"report_requests\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_export_format", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_export_format.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_export_format"], "alias": "source_not_null_tamanu_report_requests_export_format", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3507583, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_export_format.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect export_format\nfrom \"app\".\"public\".\"report_requests\"\nwhere export_format is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "export_format", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "export_format", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_report_requests_export_format__xlsx__csv", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_report_requests_export_format__xlsx__csv"], "alias": "source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d"}, "created_at": 1782422377.3507583, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n export_format as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"report_requests\"\n group by export_format\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'xlsx','csv'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "export_format", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "export_format", "values": ["xlsx", "csv"], "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_"], "alias": "source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553"}, "created_at": 1782422377.3507583, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"], ["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions", "source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select report_definition_version_id as from_field\n from \"app\".\"public\".\"report_requests\"\n where report_definition_version_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"report_definition_versions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "report_definition_version_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "report_definition_version_id", "to": "source('tamanu', 'report_definition_versions')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_report_requests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3507583, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"report_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_roles_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_roles_id.sql", "original_file_path": "models\\sources\\roles.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_roles_id"], "alias": "source_unique_tamanu_roles_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3507583, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\roles.yml\\source_unique_tamanu_roles_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"roles\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'roles')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_roles_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_roles_id.sql", "original_file_path": "models\\sources\\roles.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_roles_id"], "alias": "source_not_null_tamanu_roles_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3507583, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\roles.yml\\source_not_null_tamanu_roles_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"roles\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'roles')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_roles_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_roles_name.sql", "original_file_path": "models\\sources\\roles.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_roles_name"], "alias": "source_not_null_tamanu_roles_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3623884, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\roles.yml\\source_not_null_tamanu_roles_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"roles\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'roles')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_roles_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_roles_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\roles.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_roles_updated_at_sync_tick"], "alias": "source_not_null_tamanu_roles_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3623884, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\roles.yml\\source_not_null_tamanu_roles_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"roles\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'roles')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_scheduled_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_scheduled_vaccines_id.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_scheduled_vaccines_id"], "alias": "source_unique_tamanu_scheduled_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3623884, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_unique_tamanu_scheduled_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_id.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_id"], "alias": "source_not_null_tamanu_scheduled_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3623884, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_created_at.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_created_at"], "alias": "source_not_null_tamanu_scheduled_vaccines_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3623884, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_updated_at.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_updated_at"], "alias": "source_not_null_tamanu_scheduled_vaccines_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3623884, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine"], "alias": "source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7"}, "created_at": 1782422377.3623884, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n category as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"scheduled_vaccines\"\n group by category\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Campaign','Catchup','Other','Routine'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "category", "values": ["Campaign", "Catchup", "Other", "Routine"], "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick"], "alias": "source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3716621, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_hide_from_certificate", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_hide_from_certificate"], "alias": "source_not_null_tamanu_scheduled_vaccines_hide_from_certificate", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3716621, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect hide_from_certificate\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere hide_from_certificate is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "hide_from_certificate", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "hide_from_certificate", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_sort_index", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_sort_index.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_sort_index"], "alias": "source_not_null_tamanu_scheduled_vaccines_sort_index", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3736675, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_sort_index.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect sort_index\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere sort_index is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "sort_index", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "sort_index", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_SequelizeMeta_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_SequelizeMeta_name.sql", "original_file_path": "models\\sources\\SequelizeMeta.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_SequelizeMeta_name"], "alias": "source_unique_tamanu_SequelizeMeta_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3736675, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "SequelizeMeta"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.SequelizeMeta"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\SequelizeMeta.yml\\source_unique_tamanu_SequelizeMeta_name.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n name as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"SequelizeMeta\"\nwhere name is not null\ngroup by name\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'SequelizeMeta')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_SequelizeMeta_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_SequelizeMeta_name.sql", "original_file_path": "models\\sources\\SequelizeMeta.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_SequelizeMeta_name"], "alias": "source_not_null_tamanu_SequelizeMeta_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3756723, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "SequelizeMeta"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.SequelizeMeta"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\SequelizeMeta.yml\\source_not_null_tamanu_SequelizeMeta_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"SequelizeMeta\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'SequelizeMeta')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_settings_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_settings_id.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_settings_id"], "alias": "source_unique_tamanu_settings_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3756723, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_unique_tamanu_settings_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"settings\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_id.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_id"], "alias": "source_not_null_tamanu_settings_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3776753, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"settings\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_created_at.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_created_at"], "alias": "source_not_null_tamanu_settings_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3776753, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"settings\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_updated_at.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_updated_at"], "alias": "source_not_null_tamanu_settings_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3796804, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"settings\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_key", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_key.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_key"], "alias": "source_not_null_tamanu_settings_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3796804, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect key\nfrom \"app\".\"public\".\"settings\"\nwhere key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "key", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "key", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b"}, "created_at": 1782422377.3796804, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"settings\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_updated_at_sync_tick"], "alias": "source_not_null_tamanu_settings_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3796804, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"settings\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_scope", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_scope.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_scope"], "alias": "source_not_null_tamanu_settings_scope", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3796804, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_scope.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect scope\nfrom \"app\".\"public\".\"settings\"\nwhere scope is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scope", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "scope", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_settings_scope__global__central__facility", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_settings_scope__global__central__facility"], "alias": "source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84"}, "created_at": 1782422377.3796804, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n scope as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"settings\"\n group by scope\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'global','central','facility'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scope", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "scope", "values": ["global", "central", "facility"], "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_signers_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_signers_id.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_signers_id"], "alias": "source_unique_tamanu_signers_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.38954, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_unique_tamanu_signers_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"signers\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_id.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_id"], "alias": "source_not_null_tamanu_signers_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3900623, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"signers\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_created_at.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_created_at"], "alias": "source_not_null_tamanu_signers_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3900623, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"signers\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_updated_at.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_updated_at"], "alias": "source_not_null_tamanu_signers_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3900623, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"signers\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_country_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_country_code.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_country_code"], "alias": "source_not_null_tamanu_signers_country_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_country_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect country_code\nfrom \"app\".\"public\".\"signers\"\nwhere country_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "country_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "country_code", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_public_key", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_public_key.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_public_key"], "alias": "source_not_null_tamanu_signers_public_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_public_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect public_key\nfrom \"app\".\"public\".\"signers\"\nwhere public_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "public_key", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "public_key", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_request", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_request.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_request"], "alias": "source_not_null_tamanu_signers_request", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_request.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect request\nfrom \"app\".\"public\".\"signers\"\nwhere request is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "request", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "request", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_signatures_issued", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_signatures_issued.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_signatures_issued"], "alias": "source_not_null_tamanu_signers_signatures_issued", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_signatures_issued.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect signatures_issued\nfrom \"app\".\"public\".\"signers\"\nwhere signatures_issued is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "signatures_issued", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "signatures_issued", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_socket_io_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_socket_io_attachments_id.sql", "original_file_path": "models\\sources\\socket_io_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_socket_io_attachments_id"], "alias": "source_unique_tamanu_socket_io_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "socket_io_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\socket_io_attachments.yml\\source_unique_tamanu_socket_io_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"socket_io_attachments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'socket_io_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_socket_io_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_socket_io_attachments_id.sql", "original_file_path": "models\\sources\\socket_io_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_socket_io_attachments_id"], "alias": "source_not_null_tamanu_socket_io_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "socket_io_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\socket_io_attachments.yml\\source_not_null_tamanu_socket_io_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"socket_io_attachments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'socket_io_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9.sql", "original_file_path": "models\\sources\\socket_io_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "socket_io_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\socket_io_attachments.yml\\source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"socket_io_attachments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'socket_io_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_surveys_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_surveys_id.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_surveys_id"], "alias": "source_unique_tamanu_surveys_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_unique_tamanu_surveys_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"surveys\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_id.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_id"], "alias": "source_not_null_tamanu_surveys_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"surveys\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_created_at.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_created_at"], "alias": "source_not_null_tamanu_surveys_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"surveys\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_updated_at.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_updated_at"], "alias": "source_not_null_tamanu_surveys_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.3933153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"surveys\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_"], "alias": "source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6"}, "created_at": 1782422377.4045432, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"], ["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs", "source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_id as from_field\n from \"app\".\"public\".\"surveys\"\n where program_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"programs\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_id", "to": "source('tamanu', 'programs')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals"], "alias": "source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234"}, "created_at": 1782422377.4045432, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n survey_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"surveys\"\n group by survey_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'programs','referral','obsolete','vitals'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "survey_type", "values": ["programs", "referral", "obsolete", "vitals"], "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_is_sensitive", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_is_sensitive.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_is_sensitive"], "alias": "source_not_null_tamanu_surveys_is_sensitive", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4099329, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_is_sensitive.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_sensitive\nfrom \"app\".\"public\".\"surveys\"\nwhere is_sensitive is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_sensitive", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_sensitive", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_updated_at_sync_tick"], "alias": "source_not_null_tamanu_surveys_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4099329, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"surveys\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_notifiable", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_notifiable.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_notifiable"], "alias": "source_not_null_tamanu_surveys_notifiable", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4119475, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_notifiable.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect notifiable\nfrom \"app\".\"public\".\"surveys\"\nwhere notifiable is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "notifiable", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "notifiable", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_notify_email_addresses", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_notify_email_addresses.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_notify_email_addresses"], "alias": "source_not_null_tamanu_surveys_notify_email_addresses", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4119475, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_notify_email_addresses.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect notify_email_addresses\nfrom \"app\".\"public\".\"surveys\"\nwhere notify_email_addresses is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "notify_email_addresses", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "notify_email_addresses", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_visibility_status.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_visibility_status"], "alias": "source_not_null_tamanu_surveys_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4139538, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"surveys\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_survey_responses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_survey_responses_id.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_survey_responses_id"], "alias": "source_unique_tamanu_survey_responses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4139538, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_unique_tamanu_survey_responses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"survey_responses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_responses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_responses_id.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_responses_id"], "alias": "source_not_null_tamanu_survey_responses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4159603, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_not_null_tamanu_survey_responses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"survey_responses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_responses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_responses_created_at.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_responses_created_at"], "alias": "source_not_null_tamanu_survey_responses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4164648, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_not_null_tamanu_survey_responses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"survey_responses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_responses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_responses_updated_at.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_responses_updated_at"], "alias": "source_not_null_tamanu_survey_responses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4164648, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_not_null_tamanu_survey_responses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"survey_responses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_"], "alias": "source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e"}, "created_at": 1782422377.418471, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"], ["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys", "source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select survey_id as from_field\n from \"app\".\"public\".\"survey_responses\"\n where survey_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"surveys\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "survey_id", "to": "source('tamanu', 'surveys')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34"}, "created_at": 1782422377.4204779, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"survey_responses\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74"}, "created_at": 1782422377.4224844, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"survey_responses\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_responses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_responses_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_responses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_survey_responses_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4251337, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_not_null_tamanu_survey_responses_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"survey_responses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_survey_response_answers_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_survey_response_answers_id.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_survey_response_answers_id"], "alias": "source_unique_tamanu_survey_response_answers_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4251337, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_unique_tamanu_survey_response_answers_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_response_answers_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_response_answers_id.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_response_answers_id"], "alias": "source_not_null_tamanu_survey_response_answers_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4251337, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_not_null_tamanu_survey_response_answers_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_response_answers_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_response_answers_created_at.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_response_answers_created_at"], "alias": "source_not_null_tamanu_survey_response_answers_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4251337, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_not_null_tamanu_survey_response_answers_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_response_answers_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_response_answers_updated_at.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_response_answers_updated_at"], "alias": "source_not_null_tamanu_survey_response_answers_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4251337, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_not_null_tamanu_survey_response_answers_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_"], "alias": "source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618"}, "created_at": 1782422377.4251337, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"], ["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses", "source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select response_id as from_field\n from \"app\".\"public\".\"survey_response_answers\"\n where response_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"survey_responses\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "response_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "response_id", "to": "source('tamanu', 'survey_responses')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_"], "alias": "source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898"}, "created_at": 1782422377.4339013, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"], ["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements", "source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select data_element_id as from_field\n from \"app\".\"public\".\"survey_response_answers\"\n where data_element_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_data_elements\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data_element_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "data_element_id", "to": "source('tamanu', 'program_data_elements')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_response_answers_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_response_answers_updated_at_sync_tick"], "alias": "source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404"}, "created_at": 1782422377.4339013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_survey_screen_components_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_survey_screen_components_id.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_survey_screen_components_id"], "alias": "source_unique_tamanu_survey_screen_components_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4339013, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_unique_tamanu_survey_screen_components_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_screen_components_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_screen_components_id.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_screen_components_id"], "alias": "source_not_null_tamanu_survey_screen_components_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4339013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_not_null_tamanu_survey_screen_components_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_screen_components_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_screen_components_created_at.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_screen_components_created_at"], "alias": "source_not_null_tamanu_survey_screen_components_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4339013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_not_null_tamanu_survey_screen_components_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_screen_components_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_screen_components_updated_at.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_screen_components_updated_at"], "alias": "source_not_null_tamanu_survey_screen_components_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_not_null_tamanu_survey_screen_components_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_screen_components_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_screen_components_updated_at_sync_tick"], "alias": "source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.sql", "original_file_path": "models\\sources\\sync_device_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick"], "alias": "source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_device_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_device_ticks.yml\\source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n persisted_at_sync_tick as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_device_ticks\"\nwhere persisted_at_sync_tick is not null\ngroup by persisted_at_sync_tick\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "persisted_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "persisted_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_device_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.sql", "original_file_path": "models\\sources\\sync_device_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick"], "alias": "source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_device_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_device_ticks.yml\\source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect persisted_at_sync_tick\nfrom \"app\".\"public\".\"sync_device_ticks\"\nwhere persisted_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "persisted_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "persisted_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_device_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_device_ticks_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_device_ticks_device_id.sql", "original_file_path": "models\\sources\\sync_device_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_device_ticks_device_id"], "alias": "source_not_null_tamanu_sync_device_ticks_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_device_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_device_ticks.yml\\source_not_null_tamanu_sync_device_ticks_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"public\".\"sync_device_ticks\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('tamanu', 'sync_device_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_lookup_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_lookup_id.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_lookup_id"], "alias": "source_unique_tamanu_sync_lookup_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_unique_tamanu_sync_lookup_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_id.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_id"], "alias": "source_not_null_tamanu_sync_lookup_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_record_id.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_record_id"], "alias": "source_not_null_tamanu_sync_lookup_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_record_type.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_record_type"], "alias": "source_not_null_tamanu_sync_lookup_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_data", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_data.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_data"], "alias": "source_not_null_tamanu_sync_lookup_data", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_data.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect data\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere data is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "data", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_updated_at_sync_tick"], "alias": "source_not_null_tamanu_sync_lookup_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"sync_lookup\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a"}, "created_at": 1782422377.440914, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"sync_lookup\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"sync_lookup\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_is_lab_request", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_is_lab_request.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_is_lab_request"], "alias": "source_not_null_tamanu_sync_lookup_is_lab_request", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_is_lab_request.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_lab_request\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere is_lab_request is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_lab_request", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_lab_request", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_is_deleted", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_is_deleted.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_is_deleted"], "alias": "source_not_null_tamanu_sync_lookup_is_deleted", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_is_deleted.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_deleted\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere is_deleted is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_deleted", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_deleted", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_ticks_source_start_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_ticks_source_start_tick.sql", "original_file_path": "models\\sources\\sync_lookup_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_ticks_source_start_tick"], "alias": "source_not_null_tamanu_sync_lookup_ticks_source_start_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup_ticks.yml\\source_not_null_tamanu_sync_lookup_ticks_source_start_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_start_tick\nfrom \"app\".\"public\".\"sync_lookup_ticks\"\nwhere source_start_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "source_start_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_start_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_lookup_ticks_lookup_end_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.sql", "original_file_path": "models\\sources\\sync_lookup_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_lookup_ticks_lookup_end_tick"], "alias": "source_unique_tamanu_sync_lookup_ticks_lookup_end_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup_ticks.yml\\source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n lookup_end_tick as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_lookup_ticks\"\nwhere lookup_end_tick is not null\ngroup by lookup_end_tick\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lookup_end_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "lookup_end_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.sql", "original_file_path": "models\\sources\\sync_lookup_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick"], "alias": "source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup_ticks.yml\\source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lookup_end_tick\nfrom \"app\".\"public\".\"sync_lookup_ticks\"\nwhere lookup_end_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lookup_end_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lookup_end_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_queued_devices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_queued_devices_id.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_queued_devices_id"], "alias": "source_unique_tamanu_sync_queued_devices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_unique_tamanu_sync_queued_devices_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_id.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_id"], "alias": "source_not_null_tamanu_sync_queued_devices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_last_seen_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_last_seen_time.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_last_seen_time"], "alias": "source_not_null_tamanu_sync_queued_devices_last_seen_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_last_seen_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect last_seen_time\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere last_seen_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_seen_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_seen_time", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_last_synced_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_last_synced_tick.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_last_synced_tick"], "alias": "source_not_null_tamanu_sync_queued_devices_last_synced_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_last_synced_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect last_synced_tick\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere last_synced_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_synced_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_synced_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_urgent", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_urgent.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_urgent"], "alias": "source_not_null_tamanu_sync_queued_devices_urgent", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_urgent.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect urgent\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere urgent is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "urgent", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "urgent", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_created_at.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_created_at"], "alias": "source_not_null_tamanu_sync_queued_devices_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_updated_at.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_updated_at"], "alias": "source_not_null_tamanu_sync_queued_devices_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_facility_ids", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_facility_ids.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_facility_ids"], "alias": "source_not_null_tamanu_sync_queued_devices_facility_ids", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4567597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_facility_ids.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_ids\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere facility_ids is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_ids", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_ids", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_sessions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_sessions_id.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_sessions_id"], "alias": "source_unique_tamanu_sync_sessions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_unique_tamanu_sync_sessions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_id.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_id"], "alias": "source_not_null_tamanu_sync_sessions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_created_at.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_created_at"], "alias": "source_not_null_tamanu_sync_sessions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_updated_at.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_updated_at"], "alias": "source_not_null_tamanu_sync_sessions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_start_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_start_time.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_start_time"], "alias": "source_not_null_tamanu_sync_sessions_start_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_start_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_time\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere start_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_time", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_last_connection_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_last_connection_time.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_last_connection_time"], "alias": "source_not_null_tamanu_sync_sessions_last_connection_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_last_connection_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect last_connection_time\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere last_connection_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_connection_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_connection_time", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_parameters", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_parameters.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_parameters"], "alias": "source_not_null_tamanu_sync_sessions_parameters", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_parameters.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect parameters\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere parameters is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "parameters", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "parameters", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_tasks_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_tasks_id.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_tasks_id"], "alias": "source_unique_tamanu_tasks_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_unique_tamanu_tasks_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"tasks\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_id.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_id"], "alias": "source_not_null_tamanu_tasks_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"tasks\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_encounter_id.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_encounter_id"], "alias": "source_not_null_tamanu_tasks_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"tasks\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_name.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_name"], "alias": "source_not_null_tamanu_tasks_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"tasks\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_due_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_due_time.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_due_time"], "alias": "source_not_null_tamanu_tasks_due_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_due_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect due_time\nfrom \"app\".\"public\".\"tasks\"\nwhere due_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "due_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "due_time", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_requested_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_requested_by_user_id.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_requested_by_user_id"], "alias": "source_not_null_tamanu_tasks_requested_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_requested_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect requested_by_user_id\nfrom \"app\".\"public\".\"tasks\"\nwhere requested_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "requested_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_request_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_request_time.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_request_time"], "alias": "source_not_null_tamanu_tasks_request_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_request_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect request_time\nfrom \"app\".\"public\".\"tasks\"\nwhere request_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "request_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "request_time", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_status.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_status"], "alias": "source_not_null_tamanu_tasks_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"tasks\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_created_at.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_created_at"], "alias": "source_not_null_tamanu_tasks_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"tasks\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_updated_at.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_updated_at"], "alias": "source_not_null_tamanu_tasks_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"tasks\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_updated_at_sync_tick"], "alias": "source_not_null_tamanu_tasks_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.472646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"tasks\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_task_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_task_type.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_task_type"], "alias": "source_not_null_tamanu_tasks_task_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_task_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_type\nfrom \"app\".\"public\".\"tasks\"\nwhere task_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_type", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_task_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_task_designations_id.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_task_designations_id"], "alias": "source_unique_tamanu_task_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_unique_tamanu_task_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"task_designations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_id.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_id"], "alias": "source_not_null_tamanu_task_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"task_designations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_task_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_task_id.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_task_id"], "alias": "source_not_null_tamanu_task_designations_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_task_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"app\".\"public\".\"task_designations\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_designation_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_designation_id.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_designation_id"], "alias": "source_not_null_tamanu_task_designations_designation_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_designation_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect designation_id\nfrom \"app\".\"public\".\"task_designations\"\nwhere designation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "designation_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "designation_id", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_created_at.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_created_at"], "alias": "source_not_null_tamanu_task_designations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"task_designations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_updated_at.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_updated_at"], "alias": "source_not_null_tamanu_task_designations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"task_designations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_task_designations_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"task_designations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_task_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_task_templates_id.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_task_templates_id"], "alias": "source_unique_tamanu_task_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_unique_tamanu_task_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"task_templates\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_id.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_id"], "alias": "source_not_null_tamanu_task_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"task_templates\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_task_templates_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_task_templates_reference_data_id.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_task_templates_reference_data_id"], "alias": "source_unique_tamanu_task_templates_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_unique_tamanu_task_templates_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n reference_data_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"task_templates\"\nwhere reference_data_id is not null\ngroup by reference_data_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_reference_data_id.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_reference_data_id"], "alias": "source_not_null_tamanu_task_templates_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reference_data_id\nfrom \"app\".\"public\".\"task_templates\"\nwhere reference_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_created_at.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_created_at"], "alias": "source_not_null_tamanu_task_templates_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"task_templates\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_updated_at.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_updated_at"], "alias": "source_not_null_tamanu_task_templates_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"task_templates\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_updated_at_sync_tick"], "alias": "source_not_null_tamanu_task_templates_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"task_templates\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_task_template_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_task_template_designations_id.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_task_template_designations_id"], "alias": "source_unique_tamanu_task_template_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_unique_tamanu_task_template_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_template_designations_id.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_id"], "alias": "source_not_null_tamanu_task_template_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.4886782, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_template_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_task_template_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_task_template_id"], "alias": "source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a"}, "created_at": 1782422377.5043905, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_template_id\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere task_template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_template_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_template_id", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_designation_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_designation_id"], "alias": "source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f"}, "created_at": 1782422377.5050206, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect designation_id\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere designation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "designation_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "designation_id", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_template_designations_created_at.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_created_at"], "alias": "source_not_null_tamanu_task_template_designations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5063694, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_template_designations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_template_designations_updated_at.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_updated_at"], "alias": "source_not_null_tamanu_task_template_designations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5071, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_template_designations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5"}, "created_at": 1782422377.5078273, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_templates_id.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_templates_id"], "alias": "source_unique_tamanu_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5089211, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_unique_tamanu_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"templates\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_templates_id.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_templates_id"], "alias": "source_not_null_tamanu_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.510107, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_not_null_tamanu_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"templates\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_templates_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_templates_name.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_templates_name"], "alias": "source_not_null_tamanu_templates_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.51066, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_not_null_tamanu_templates_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"templates\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3"}, "created_at": 1782422377.5113106, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select created_by_id as from_field\n from \"app\".\"public\".\"templates\"\n where created_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "created_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_templates_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_templates_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_templates_updated_at_sync_tick"], "alias": "source_not_null_tamanu_templates_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5144906, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_not_null_tamanu_templates_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"templates\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_templates_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_templates_type.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_templates_type"], "alias": "source_not_null_tamanu_templates_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.51581, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_not_null_tamanu_templates_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"templates\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_string_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_string_id.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_string_id"], "alias": "source_not_null_tamanu_translated_strings_string_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5163596, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_string_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect string_id\nfrom \"app\".\"public\".\"translated_strings\"\nwhere string_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "string_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "string_id", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_language", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_language.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_language"], "alias": "source_not_null_tamanu_translated_strings_language", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5163596, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_language.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect language\nfrom \"app\".\"public\".\"translated_strings\"\nwhere language is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "language", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "language", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_created_at.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_created_at"], "alias": "source_not_null_tamanu_translated_strings_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5163596, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"translated_strings\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_updated_at.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_updated_at"], "alias": "source_not_null_tamanu_translated_strings_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5163596, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"translated_strings\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_updated_at_sync_tick"], "alias": "source_not_null_tamanu_translated_strings_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5203707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"translated_strings\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_triages_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_triages_id.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_triages_id"], "alias": "source_unique_tamanu_triages_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5203707, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_unique_tamanu_triages_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"triages\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_triages_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_triages_id.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_triages_id"], "alias": "source_not_null_tamanu_triages_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5203707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_not_null_tamanu_triages_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"triages\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_triages_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_triages_created_at.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_triages_created_at"], "alias": "source_not_null_tamanu_triages_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5203707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_not_null_tamanu_triages_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"triages\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_triages_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_triages_updated_at.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_triages_updated_at"], "alias": "source_not_null_tamanu_triages_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5203707, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_not_null_tamanu_triages_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"triages\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2"}, "created_at": 1782422377.5203707, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"triages\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c"}, "created_at": 1782422377.5278869, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select practitioner_id as from_field\n from \"app\".\"public\".\"triages\"\n where practitioner_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "practitioner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "practitioner_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_"], "alias": "dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e"}, "created_at": 1782422377.530454, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n chief_complaint_id as id\n\n from \"app\".\"public\".\"triages\"\n\n where chief_complaint_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'triageReason'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "chief_complaint_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "chief_complaint_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'triageReason'", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_"], "alias": "dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9"}, "created_at": 1782422377.534165, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n secondary_complaint_id as id\n\n from \"app\".\"public\".\"triages\"\n\n where secondary_complaint_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'triageReason'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "secondary_complaint_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "secondary_complaint_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'triageReason'", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_"], "alias": "dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea"}, "created_at": 1782422377.5368135, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n arrival_mode_id as id\n\n from \"app\".\"public\".\"triages\"\n\n where arrival_mode_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'arrivalMode'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "arrival_mode_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "arrival_mode_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'arrivalMode'", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_triages_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_triages_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_triages_updated_at_sync_tick"], "alias": "source_not_null_tamanu_triages_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.537889, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_not_null_tamanu_triages_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"triages\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2.sql", "original_file_path": "models\\sources\\upcoming_vaccinations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2"}, "created_at": 1782422377.537889, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "upcoming_vaccinations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\upcoming_vaccinations.yml\\source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"upcoming_vaccinations\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'upcoming_vaccinations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2.sql", "original_file_path": "models\\sources\\upcoming_vaccinations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_"], "alias": "source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2"}, "created_at": 1782422377.537889, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"], ["tamanu", "upcoming_vaccinations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines", "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\upcoming_vaccinations.yml\\source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select scheduled_vaccine_id as from_field\n from \"app\".\"public\".\"upcoming_vaccinations\"\n where scheduled_vaccine_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"scheduled_vaccines\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scheduled_vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "scheduled_vaccine_id", "to": "source('tamanu', 'scheduled_vaccines')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'upcoming_vaccinations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_users_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_users_id.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_users_id"], "alias": "source_unique_tamanu_users_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.537889, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_unique_tamanu_users_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"users\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_id.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_id"], "alias": "source_not_null_tamanu_users_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.537889, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"users\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_created_at.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_created_at"], "alias": "source_not_null_tamanu_users_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.537889, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"users\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_updated_at.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_updated_at"], "alias": "source_not_null_tamanu_users_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.537889, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"users\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_users_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_users_email.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_users_email"], "alias": "source_unique_tamanu_users_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.537889, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_unique_tamanu_users_email.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n email as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"users\"\nwhere email is not null\ngroup by email\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_email.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_email"], "alias": "source_not_null_tamanu_users_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.551857, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_email.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect email\nfrom \"app\".\"public\".\"users\"\nwhere email is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_display_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_display_name.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_display_name"], "alias": "source_not_null_tamanu_users_display_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.551857, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_display_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_name\nfrom \"app\".\"public\".\"users\"\nwhere display_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_name", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_role", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_role.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_role"], "alias": "source_not_null_tamanu_users_role", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.551857, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_role.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect role\nfrom \"app\".\"public\".\"users\"\nwhere role is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "role", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "role", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_updated_at_sync_tick"], "alias": "source_not_null_tamanu_users_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.551857, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"users\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_visibility_status.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_visibility_status"], "alias": "source_not_null_tamanu_users_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.551857, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"users\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_device_registration_quota", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_device_registration_quota.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_device_registration_quota"], "alias": "source_not_null_tamanu_users_device_registration_quota", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.551857, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_device_registration_quota.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_registration_quota\nfrom \"app\".\"public\".\"users\"\nwhere device_registration_quota is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_registration_quota", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_registration_quota", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0"], "alias": "dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979"}, "created_at": 1782422377.551857, "relation_name": null, "raw_code": "{{ dbt_utils.test_accepted_range(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_accepted_range", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979.sql", "compiled": true, "compiled_code": "\n\nwith meet_condition as(\n select *\n from \"app\".\"public\".\"users\"\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not device_registration_quota >= 0\n)\n\nselect *\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_registration_quota", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_range", "kwargs": {"column_name": "device_registration_quota", "min_value": 0, "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_designations_id.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_designations_id"], "alias": "source_unique_tamanu_user_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.551857, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_unique_tamanu_user_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_designations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_id.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_id"], "alias": "source_not_null_tamanu_user_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.551857, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_designations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_user_id.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_user_id"], "alias": "source_not_null_tamanu_user_designations_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5638895, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_designations\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_designation_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_designation_id.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_designation_id"], "alias": "source_not_null_tamanu_user_designations_designation_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5638895, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_designation_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect designation_id\nfrom \"app\".\"public\".\"user_designations\"\nwhere designation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "designation_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "designation_id", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_created_at.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_created_at"], "alias": "source_not_null_tamanu_user_designations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5638895, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_designations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_updated_at.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_updated_at"], "alias": "source_not_null_tamanu_user_designations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5658984, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_designations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_designations_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5658984, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_designations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_facilities_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_facilities_id.sql", "original_file_path": "models\\sources\\user_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_facilities_id"], "alias": "source_unique_tamanu_user_facilities_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.567645, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_facilities.yml\\source_unique_tamanu_user_facilities_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_facilities\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_facilities_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_facilities_id.sql", "original_file_path": "models\\sources\\user_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_facilities_id"], "alias": "source_not_null_tamanu_user_facilities_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.56965, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_facilities.yml\\source_not_null_tamanu_user_facilities_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_facilities\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_facilities_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_facilities_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_facilities_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_facilities_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.56965, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_facilities.yml\\source_not_null_tamanu_user_facilities_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_facilities\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_leaves_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_leaves_id.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_leaves_id"], "alias": "source_unique_tamanu_user_leaves_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5716546, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_unique_tamanu_user_leaves_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_leaves\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_id.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_id"], "alias": "source_not_null_tamanu_user_leaves_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5716546, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_leaves\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_start_date.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_start_date"], "alias": "source_not_null_tamanu_user_leaves_start_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5736578, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_start_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_date\nfrom \"app\".\"public\".\"user_leaves\"\nwhere start_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_date", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_end_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_end_date.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_end_date"], "alias": "source_not_null_tamanu_user_leaves_end_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5736578, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_end_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect end_date\nfrom \"app\".\"public\".\"user_leaves\"\nwhere end_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "end_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "end_date", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_user_id.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_user_id"], "alias": "source_not_null_tamanu_user_leaves_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5736578, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_leaves\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_created_at.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_created_at"], "alias": "source_not_null_tamanu_user_leaves_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5759723, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_leaves\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_updated_at.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_updated_at"], "alias": "source_not_null_tamanu_user_leaves_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5759723, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_leaves\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_leaves_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5779817, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_leaves\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_localisation_caches_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_localisation_caches_id.sql", "original_file_path": "models\\sources\\user_localisation_caches.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_localisation_caches_id"], "alias": "source_unique_tamanu_user_localisation_caches_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5779817, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_localisation_caches"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_localisation_caches.yml\\source_unique_tamanu_user_localisation_caches_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_localisation_caches\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_localisation_caches')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_localisation_caches_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_localisation_caches_id.sql", "original_file_path": "models\\sources\\user_localisation_caches.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_localisation_caches_id"], "alias": "source_not_null_tamanu_user_localisation_caches_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5779817, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_localisation_caches"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_localisation_caches.yml\\source_not_null_tamanu_user_localisation_caches_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_localisation_caches\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_localisation_caches')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_localisation_caches_localisation", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_localisation_caches_localisation.sql", "original_file_path": "models\\sources\\user_localisation_caches.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_localisation_caches_localisation"], "alias": "source_not_null_tamanu_user_localisation_caches_localisation", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5779817, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_localisation_caches"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_localisation_caches.yml\\source_not_null_tamanu_user_localisation_caches_localisation.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect localisation\nfrom \"app\".\"public\".\"user_localisation_caches\"\nwhere localisation is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "localisation", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "localisation", "model": "{{ get_where_subquery(source('tamanu', 'user_localisation_caches')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_login_attempts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_login_attempts_id.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_login_attempts_id"], "alias": "source_unique_tamanu_user_login_attempts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5779817, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_unique_tamanu_user_login_attempts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_id.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_id"], "alias": "source_not_null_tamanu_user_login_attempts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.584595, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_created_at.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_created_at"], "alias": "source_not_null_tamanu_user_login_attempts_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5860891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_updated_at.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_updated_at"], "alias": "source_not_null_tamanu_user_login_attempts_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5874856, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_outcome", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_outcome.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_outcome"], "alias": "source_not_null_tamanu_user_login_attempts_outcome", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5879903, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_outcome.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect outcome\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere outcome is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "outcome", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "outcome", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_"], "alias": "source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293"}, "created_at": 1782422377.5893493, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"], ["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices", "source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select device_id as from_field\n from \"app\".\"public\".\"user_login_attempts\"\n where device_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"devices\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "device_id", "to": "source('tamanu', 'devices')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_user_id.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_user_id"], "alias": "source_not_null_tamanu_user_login_attempts_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5925255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce"}, "created_at": 1782422377.5931747, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"user_login_attempts\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_login_attempts_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5972373, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_preferences_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_preferences_id.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_preferences_id"], "alias": "source_unique_tamanu_user_preferences_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5979586, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_unique_tamanu_user_preferences_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_preferences\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_id.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_id"], "alias": "source_not_null_tamanu_user_preferences_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5989792, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_preferences\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_created_at.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_created_at"], "alias": "source_not_null_tamanu_user_preferences_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.5999672, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_preferences\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_updated_at.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_updated_at"], "alias": "source_not_null_tamanu_user_preferences_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.6009681, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_preferences\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_user_id.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_user_id"], "alias": "source_not_null_tamanu_user_preferences_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.6009681, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_preferences\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_preferences_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.6019683, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_preferences\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_key", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_key.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_key"], "alias": "source_not_null_tamanu_user_preferences_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.6029668, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect key\nfrom \"app\".\"public\".\"user_preferences\"\nwhere key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "key", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "key", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_value", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_value.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_value"], "alias": "source_not_null_tamanu_user_preferences_value", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.6029668, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_value.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect value\nfrom \"app\".\"public\".\"user_preferences\"\nwhere value is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "value", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "value", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_recently_viewed_patients_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_recently_viewed_patients_id.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_recently_viewed_patients_id"], "alias": "source_unique_tamanu_user_recently_viewed_patients_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.604473, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_unique_tamanu_user_recently_viewed_patients_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_id.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_id"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.6054811, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_created_at.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_created_at"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.6064816, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_updated_at.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_updated_at"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.6074777, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_user_id.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_user_id"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.608481, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_patient_id.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_patient_id"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.6094801, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_vitals_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_vitals_id.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_vitals_id"], "alias": "source_unique_tamanu_vitals_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_unique_tamanu_vitals_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"vitals\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_id.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_id"], "alias": "source_not_null_tamanu_vitals_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"vitals\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_created_at.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_created_at"], "alias": "source_not_null_tamanu_vitals_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"vitals\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_updated_at.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_updated_at"], "alias": "source_not_null_tamanu_vitals_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"vitals\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_date_recorded", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_date_recorded.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_date_recorded"], "alias": "source_not_null_tamanu_vitals_date_recorded", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_date_recorded.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_recorded\nfrom \"app\".\"public\".\"vitals\"\nwhere date_recorded is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_recorded", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_recorded", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_updated_at_sync_tick"], "alias": "source_not_null_tamanu_vitals_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"vitals\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_vital_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_vital_logs_id.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_vital_logs_id"], "alias": "source_unique_tamanu_vital_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_unique_tamanu_vital_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"vital_logs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_id.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_id"], "alias": "source_not_null_tamanu_vital_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"vital_logs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_created_at.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_created_at"], "alias": "source_not_null_tamanu_vital_logs_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"vital_logs\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_updated_at.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_updated_at"], "alias": "source_not_null_tamanu_vital_logs_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"vital_logs\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_date.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_date"], "alias": "source_not_null_tamanu_vital_logs_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"vital_logs\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error"], "alias": "source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n reason_for_change as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"vital_logs\"\n group by reason_for_change\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'incorrect-patient','incorrect-value','other','recorded-in-error'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reason_for_change", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "reason_for_change", "values": ["incorrect-patient", "incorrect-value", "other", "recorded-in-error"], "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179"}, "created_at": 1782422377.610978, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select recorded_by_id as from_field\n from \"app\".\"public\".\"vital_logs\"\n where recorded_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "recorded_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_answer_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_answer_id.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_answer_id"], "alias": "source_not_null_tamanu_vital_logs_answer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.626168, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_answer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect answer_id\nfrom \"app\".\"public\".\"vital_logs\"\nwhere answer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "answer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "answer_id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_"], "alias": "source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f"}, "created_at": 1782422377.626168, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"], ["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers", "source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select answer_id as from_field\n from \"app\".\"public\".\"vital_logs\"\n where answer_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"survey_response_answers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "answer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "answer_id", "to": "source('tamanu', 'survey_response_answers')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_vital_logs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782422377.626168, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"vital_logs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}}, "sources": {"source.tamanu_source_dbt.logs__tamanu.accesses": {"database": "app", "schema": "logs", "name": "accesses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\accesses.yml", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.accesses", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "accesses"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "accesses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Audit logs for users accessing records", "columns": {"id": {"name": "id", "description": "UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__deleted_at"]}, "user_id": {"name": "user_id", "description": "The user that accessed the records", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__user_id"]}, "record_id": {"name": "record_id", "description": "The ID of the accessed record", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__record_id"]}, "record_type": {"name": "record_type", "description": "The type of record accessed", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__record_type"]}, "facility_id": {"name": "facility_id", "description": "The facility that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__facility_id"]}, "session_id": {"name": "session_id", "description": "The user session that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__session_id"]}, "device_id": {"name": "device_id", "description": "The id for the device that the user was accessing the record on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__device_id"]}, "logged_at": {"name": "logged_at", "description": "The time string of when the record was accessed", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__logged_at"]}, "front_end_context": {"name": "front_end_context", "description": "A JSON object containing front end information about the record access", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__front_end_context"]}, "back_end_context": {"name": "back_end_context", "description": "A JSON object containing back end information about the record access", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__back_end_context"]}, "is_mobile": {"name": "is_mobile", "description": "Whether or not the user accessed the record from mobile", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__is_mobile"]}, "version": {"name": "version", "description": "The version of tamanu the record was created on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__version"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in accesses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_accesses_changed", "set_accesses_updated_at", "set_accesses_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_accesses_changed", "set_accesses_updated_at", "set_accesses_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_accesses_changed", "set_accesses_updated_at", "set_accesses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"accesses\"", "created_at": 1782422375.8619628, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__accesses"]}, "source.tamanu_source_dbt.logs__tamanu.changes": {"database": "app", "schema": "logs", "name": "changes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\changes.yml", "original_file_path": "models\\logs\\changes.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.changes", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "changes"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "changes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Contains a full log of all changes made to the core database records.\r\n\r\nThe changes are logged via triggers on source tables. The full row data is\r\nlogged in this table on every change to every row for every table that's covered.\r\nThese triggers are applied by Tamanu rather than being hardcoded in migrations.\r\n\r\nSome tables are excluded from logging. These are listed in the `NON_LOGGED_TABLES`\r\nconstant in the database package, and include the sync subsystem and other\r\ninternal system tables.\r\n\r\nNote that changes before this table was put in service will of course not have\r\nbeen logged.", "columns": {"id": {"name": "id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "table_oid": {"name": "table_oid", "description": "The Postgres OID of the table this change is from.\r\n\r\nPostgres OIDs are much more precise than `schema.name`, and are not susceptible\r\nto search path conflicts, so should be preferred for querying within the same\r\ndatabase. However, they are not easily relatable from outside the database, so\r\nthe schema and name fields are also recorded for those uses, plus human readers.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__table_oid"]}, "table_schema": {"name": "table_schema", "description": "The schema (~database namespace) of the table this change is from.\r\n\r\nThis will typically be `public`; as of writing tables from other schemas are not\r\nautomatically logged.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__table_schema"]}, "table_name": {"name": "table_name", "description": "The name of the table this change is from.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__table_name"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "created_at": {"name": "created_at", "description": "Then sequelize metadata for the records created time", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__created_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "device_id": {"name": "device_id", "description": "The `device_id` of the user behind the change", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__device_id"]}, "version": {"name": "version", "description": "The Tamanu version at time of change", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__version"]}, "record_id": {"name": "record_id", "description": "The value of the `id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_id"]}, "record_created_at": {"name": "record_created_at", "description": "The `created_at` metadata from record the changelog was recorded against", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_created_at"]}, "record_updated_at": {"name": "record_updated_at", "description": "The `updated_at` metadata from record the changelog was recorded against", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_updated_at"]}, "record_deleted_at": {"name": "record_deleted_at", "description": "The `deleted_at` metadata from record the changelog was recorded against", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_deleted_at"]}, "record_data": {"name": "record_data", "description": "The full row data of the change.\r\n\r\nNote that as this is `JSONB`, some type information may be lost. However, row\r\ndata in a Tamanu system is transported using JSON via the sync system anyway, so\r\nit is expected that all data trivially round-trips via JSON.", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_data"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in changes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick"]}, "reason": {"name": "reason", "description": "A string representing the reason for the change.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__reason"]}, "migration_context": {"name": "migration_context", "description": "Stores a JSON string (as type TEXT) with migration context information\r\nif the changelog was created from a migration.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__migration_context"]}}, "meta": {"triggers": ["notify_changes_changed", "set_changes_updated_at", "set_changes_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_changes_changed", "set_changes_updated_at", "set_changes_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_changes_changed", "set_changes_updated_at", "set_changes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"changes\"", "created_at": 1782422375.8780098, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__changes"]}, "source.tamanu_source_dbt.logs__tamanu.debug_logs": {"database": "app", "schema": "logs", "name": "debug_logs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\debug_logs.yml", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.debug_logs", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "debug_logs"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "debug_logs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Debugging logs stored in the database for easy reporting.\r\n\r\nTamanu has an associated tool called [Tamanu Alerts] which runs queries on the Tamanu database to\r\ndetermine alert conditions, especially for the Sync mechanisms. However, sometimes the information\r\nnecessary to determine an alert condition lives in logs, not in database tables. In those cases,\r\nthis table is used.\r\n\r\n[Tamanu Alerts]: https://docs.rs/bestool/latest/bestool/__help/tamanu/alerts/struct.AlertsArgs.html", "columns": {"id": {"name": "id", "description": "UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__debug_logs__id"]}, "type": {"name": "type", "description": "Stable classifier for the log message.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__debug_logs__type"]}, "info": {"name": "info", "description": "Arbitrary JSON log message.\r\n\r\nNot that unlike typical JSON-based log messages (only top-level string key to scalar value), this\r\ncan be nested arbitrarily deep, as it can include objects directly from the application.", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__debug_logs__info"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"debug_logs\"", "created_at": 1782422375.8780098, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__debug_logs"]}, "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes": {"database": "app", "schema": "logs", "name": "dhis2_pushes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\dhis2_pushes.yml", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "dhis2_pushes"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "dhis2_pushes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Audit logs for DHIS2 integration pushes.\r\n\r\nThis table tracks the results of automated pushes of report data to DHIS2 instances.\r\nThe DHIS2IntegrationProcessor scheduled task processes configured reports and pushes\r\ntheir data to external DHIS2 systems. Each push attempt is logged here with details\r\nabout the success/failure status, import counts, and any conflicts encountered.\r\n\r\nThe table stores metadata about data synchronization operations including how many\r\nrecords were imported, updated, ignored, or deleted during each push operation.", "columns": {"id": {"name": "id", "description": "UUID primary key for the push log entry.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when the push log entry was created.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__created_at"]}, "report_id": {"name": "report_id", "description": "The ID of the report that was pushed to DHIS2.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__report_id"]}, "status": {"name": "status", "description": "The status of the push operation: \"success\", \"failure\", or \"warning\".", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__status"]}, "imported": {"name": "imported", "description": "Number of records that were successfully imported to DHIS2.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__imported"]}, "updated": {"name": "updated", "description": "Number of records that were updated in DHIS2.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__updated"]}, "deleted": {"name": "deleted", "description": "Number of records that were deleted from DHIS2.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__deleted"]}, "ignored": {"name": "ignored", "description": "Number of records that were ignored during the push operation.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__ignored"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the push log entry was last updated.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when the push log entry was deleted (soft delete).", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__deleted_at"]}, "conflicts": {"name": "conflicts", "description": "JSON array of conflict details encountered during the push operation.", "meta": {"masking": "text"}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__conflicts"]}, "message": {"name": "message", "description": "Human-readable message describing the result of the push operation.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__message"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"dhis2_pushes\"", "created_at": 1782422375.8964322, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__dhis2_pushes"]}, "source.tamanu_source_dbt.logs__tamanu.fhir_writes": {"database": "app", "schema": "logs", "name": "fhir_writes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\fhir_writes.yml", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.fhir_writes", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "fhir_writes"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "fhir_writes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Full-request logs of writes (creates and modifies) coming over the FHIR API.\r\n\r\nFHIR is an extensive standard and we current support a small subset of it. There's an even tinier\r\nsubset of that which supports writes instead of just reads and searches. To avoid missing or losing\r\ndata which we could support accepting as writes in the future, and for development purposes, this\r\ntable logs the full request bodies for FHIR endpoints. This is not just the endpoints that we\r\ncurrently support, but all incoming write requests.", "columns": {"id": {"name": "id", "description": "UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__id"]}, "created_at": {"name": "created_at", "description": "When Tamanu received the request.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__created_at"]}, "verb": {"name": "verb", "description": "HTTP verb (GET, POST, etc)", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__verb"]}, "url": {"name": "url", "description": "HTTP URL", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__url"]}, "body": {"name": "body", "description": "Full request body", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__body"]}, "headers": {"name": "headers", "description": "Selected request headers.\r\n\r\nSome headers are stripped for sensitivity.", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__headers"]}, "user_id": {"name": "user_id", "description": "The authenticated user for the API request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__user_id"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"fhir_writes\"", "created_at": 1782422375.902487, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__fhir_writes"]}, "source.tamanu_source_dbt.logs__tamanu.migrations": {"database": "app", "schema": "logs", "name": "migrations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\migrations.yml", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.migrations", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "migrations"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "migrations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This table keeps track of when migrations are run.\r\n\r\nThe SequelizeMeta table in the public schema is internal migration state, and\r\nonly records which migrations are currently applied. This table instead logs\r\nwhenever migrations are performed, up and down, with additional timing info.", "columns": {"id": {"name": "id", "description": "A randomly generated UUID.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__id"]}, "logged_at": {"name": "logged_at", "description": "The local server time when the migration run happened.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__logged_at"]}, "record_sync_tick": {"name": "record_sync_tick", "description": "TODO", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__record_sync_tick"]}, "device_id": {"name": "device_id", "description": "TODO", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__device_id"]}, "version": {"name": "version", "description": "TODO", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__version"]}, "direction": {"name": "direction", "description": "What kind of migration operation this was (typically `up`).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__direction"]}, "migrations": {"name": "migrations", "description": "The list of migrations applied during this operation.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__migrations"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in migrations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_migrations_changed", "set_migrations_updated_at", "set_migrations_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_migrations_changed", "set_migrations_updated_at", "set_migrations_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_migrations_changed", "set_migrations_updated_at", "set_migrations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"migrations\"", "created_at": 1782422375.9094262, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__migrations"]}, "source.tamanu_source_dbt.tamanu.administered_vaccines": {"database": "app", "schema": "public", "name": "administered_vaccines", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\administered_vaccines.yml", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "source.tamanu_source_dbt.tamanu.administered_vaccines", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "administered_vaccines"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "administered_vaccines", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of vaccines administered to patients.\r\n\r\nVaccinations are recorded via the Vaccinations modal; they are selected\r\nfrom a list of Scheduled Vaccines and linked to a Patient via an Encounter.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in administered_vaccines.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in administered_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in administered_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in administered_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "status": {"name": "status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "reason": {"name": "reason", "description": "Reason for vaccine administrations `NOT_GIVEN` status. This is a free text field", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__reason"]}, "date": {"name": "date", "description": "Local date for the record in administered_vaccines.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) this vaccine was given in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__encounter_id"]}, "injection_site": {"name": "injection_site", "description": "Injection site of the vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__injection_site"]}, "consent": {"name": "consent", "description": "Consent of the vaccine administrations recorded", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent"]}, "recorder_id": {"name": "recorder_id", "description": "Reference to the [User](#!/source/source.tamanu.tamanu.users) who recorded this vaccination.\r\nThis may differ from the User or person who administered the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__recorder_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "given_by": {"name": "given_by", "description": "Free text field for the name of the health practitioner who administered the\r\nvaccine. This is defaulted to the `display_name` of the logged-in User, but can\r\nbe changed. It is not a requirement that the administerer is a Tamanu User.", "meta": {"masking": "name"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_by"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in administered_vaccines.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in administered_vaccines.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "not_given_reason_id": {"name": "not_given_reason_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}, "given_elsewhere": {"name": "given_elsewhere", "description": "Checks if the vaccine was given elsewhere", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "circumstance_ids": {"name": "circumstance_ids", "description": "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineCircumstance`).", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__circumstance_ids"]}, "consent_given_by": {"name": "consent_given_by", "description": "Free text field recording who gave consent for the vaccination.\r\nThis is usually the patient themselves, but may differ for children or dependent\r\npersons or other cases.", "meta": {"masking": "name"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent_given_by"]}}, "meta": {"triggers": ["notify_administered_vaccines_changed", "record_administered_vaccines_changelog", "set_administered_vaccines_updated_at", "set_administered_vaccines_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_administered_vaccines_changed", "record_administered_vaccines_changelog", "set_administered_vaccines_updated_at", "set_administered_vaccines_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_administered_vaccines_changed", "record_administered_vaccines_changelog", "set_administered_vaccines_updated_at", "set_administered_vaccines_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"administered_vaccines\"", "created_at": 1782422375.931215, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__administered_vaccines"]}, "source.tamanu_source_dbt.tamanu.appointments": {"database": "app", "schema": "public", "name": "appointments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\appointments.yml", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.appointments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "appointments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "appointments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of appointments.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in appointments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in appointments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in appointments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "start_time": {"name": "start_time", "description": "When the appointment starts.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "end_time": {"name": "end_time", "description": "When the appointment ends.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "location_id": {"name": "location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_id"]}, "type_legacy": {"name": "type_legacy", "description": "The legacy type of appointment.\r\n\r\nOne of:\r\n- `Standard`\r\n- `Emergency`\r\n- `Specialist`\r\n- `Other`", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__type_legacy"]}, "status": {"name": "status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "start_time_legacy": {"name": "start_time_legacy", "description": "[Deprecated] Start time.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time_legacy"]}, "end_time_legacy": {"name": "end_time_legacy", "description": "[Deprecated] End time.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time_legacy"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in appointments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "booking_type_id": {"name": "booking_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__appointment_type_id"]}, "is_high_priority": {"name": "is_high_priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) linked to this appointment", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__encounter_id"]}, "schedule_id": {"name": "schedule_id", "description": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__schedule_id"]}, "additional_clinician_id": {"name": "additional_clinician_id", "description": "Reference to an additional [clinician](#!/source/source.tamanu.tamanu.users)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__additional_clinician_id"]}, "link_encounter_id": {"name": "link_encounter_id", "description": "Reference to the related [encounter](#!/source/source.tamanu.tamanu.encounters) of the appointment", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__link_encounter_id"]}}, "meta": {"triggers": ["notify_appointments_changed", "record_appointments_changelog", "set_appointments_updated_at", "set_appointments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_appointments_changed", "record_appointments_changelog", "set_appointments_updated_at", "set_appointments_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_appointments_changed", "record_appointments_changelog", "set_appointments_updated_at", "set_appointments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"appointments\"", "created_at": 1782422375.960252, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__appointments"]}, "source.tamanu_source_dbt.tamanu.appointment_procedure_types": {"database": "app", "schema": "public", "name": "appointment_procedure_types", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\appointment_procedure_types.yml", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "source.tamanu_source_dbt.tamanu.appointment_procedure_types", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "appointment_procedure_types"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "appointment_procedure_types", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Junction table linking appointments to procedure types, allowing multiple procedure types to be associated with a single appointment.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointment_procedure_types.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "appointment_id": {"name": "appointment_id", "description": "Reference to the [appointment](#!/source/source.tamanu.tamanu.appointments) this procedure type is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_procedure_types__appointment_id"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`) associated with this appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_procedure_types__procedure_type_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in appointment_procedure_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in appointment_procedure_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in appointment_procedure_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in appointment_procedure_types.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_appointment_procedure_types_changed", "record_appointment_procedure_types_changelog", "set_appointment_procedure_types_updated_at", "set_appointment_procedure_types_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_appointment_procedure_types_changed", "record_appointment_procedure_types_changelog", "set_appointment_procedure_types_updated_at", "set_appointment_procedure_types_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_appointment_procedure_types_changed", "record_appointment_procedure_types_changelog", "set_appointment_procedure_types_updated_at", "set_appointment_procedure_types_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"appointment_procedure_types\"", "created_at": 1782422375.9727, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__appointment_procedure_types"]}, "source.tamanu_source_dbt.tamanu.appointment_schedules": {"database": "app", "schema": "public", "name": "appointment_schedules", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\appointment_schedules.yml", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "source.tamanu_source_dbt.tamanu.appointment_schedules", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "appointment_schedules"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "appointment_schedules", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Defines recurrence rules for appointments.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointment_schedules.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "until_date": {"name": "until_date", "description": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__until_date"]}, "interval": {"name": "interval", "description": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\"", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__interval"]}, "frequency": {"name": "frequency", "description": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__frequency"]}, "days_of_week": {"name": "days_of_week", "description": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__days_of_week"]}, "nth_weekday": {"name": "nth_weekday", "description": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__nth_weekday"]}, "occurrence_count": {"name": "occurrence_count", "description": "When this value is set, the recurrence ends after generating the specified number of occurrences\r\nAt least one of `occurrence_count` or `until_date` must be set.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__occurrence_count"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in appointment_schedules.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in appointment_schedules.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in appointment_schedules.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in appointment_schedules.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_fully_generated": {"name": "is_fully_generated", "description": "Whether or not all repeating appointments have been created for a schedule", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__is_fully_generated"]}, "generated_until_date": {"name": "generated_until_date", "description": "The date of the most recent appointment in a schedule, this is set after generation of the repeated appointment and then updated if it is necessary to generate further appointments.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__generated_until_date"]}, "cancelled_at_date": {"name": "cancelled_at_date", "description": "The date from which appointments in a schedule have been cancelled, this is set when cancelling 'this and all future appointments'.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__cancelled_at_date"]}}, "meta": {"triggers": ["notify_appointment_schedules_changed", "record_appointment_schedules_changelog", "set_appointment_schedules_updated_at", "set_appointment_schedules_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_appointment_schedules_changed", "record_appointment_schedules_changelog", "set_appointment_schedules_updated_at", "set_appointment_schedules_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_appointment_schedules_changed", "record_appointment_schedules_changelog", "set_appointment_schedules_updated_at", "set_appointment_schedules_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"appointment_schedules\"", "created_at": 1782422375.9727, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__appointment_schedules"]}, "source.tamanu_source_dbt.tamanu.assets": {"database": "app", "schema": "public", "name": "assets", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\assets.yml", "original_file_path": "models\\sources\\assets.yml", "unique_id": "source.tamanu_source_dbt.tamanu.assets", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "assets"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "assets", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of assets used in the tamanu app ui and patient letters.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in assets.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in assets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in assets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in assets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of the asset set by the user on upload.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.assets__name"]}, "type": {"name": "type", "description": "This is the type of asset stored.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.assets__type"]}, "data": {"name": "data", "description": "Contains a binary version of image data uploaded by user.", "meta": {}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.assets__data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facilities](#!/source/source.tamanu.tamanu.facilities) this asset is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.assets__facility_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in assets.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_assets_changed", "record_assets_changelog", "set_assets_updated_at", "set_assets_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_assets_changed", "record_assets_changelog", "set_assets_updated_at", "set_assets_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_assets_changed", "record_assets_changelog", "set_assets_updated_at", "set_assets_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"assets\"", "created_at": 1782422375.9727, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__assets"]}, "source.tamanu_source_dbt.tamanu.attachments": {"database": "app", "schema": "public", "name": "attachments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\attachments.yml", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.attachments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "attachments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "attachments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Uploaded files.\r\n\r\nThese can be documents, photo IDs, patient letters...\r\n\r\nMost direct uploads will have a corresponding [`document_metadata`](#!/source/source.tamanu.tamanu.document_metadata),\r\nbut there's other ways to upload files, such as [for lab requests](#!/source/source.tamanu.tamanu.lab_request_attachments).\r\n\r\nUploaded files are not currently synced to facility servers. Instead, servers request the contents\r\nof documents just-in-time. This does require facility servers to be \"online\" but significantly\r\nreduces sync pressure.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in attachments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "type": {"name": "type", "description": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.attachments__type"]}, "size": {"name": "size", "description": "The file size in bytes.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.attachments__size"]}, "data": {"name": "data", "description": "The file data.", "meta": {"masking": "zero"}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {"masking": "zero"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.attachments__data"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in attachments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_attachments_changed", "record_attachments_changelog", "set_attachments_updated_at", "set_attachments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_attachments_changed", "record_attachments_changelog", "set_attachments_updated_at", "set_attachments_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_attachments_changed", "record_attachments_changelog", "set_attachments_updated_at", "set_attachments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"attachments\"", "created_at": 1782422375.9902477, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__attachments"]}, "source.tamanu_source_dbt.tamanu.certifiable_vaccines": {"database": "app", "schema": "public", "name": "certifiable_vaccines", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\certifiable_vaccines.yml", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "source.tamanu_source_dbt.tamanu.certifiable_vaccines", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "certifiable_vaccines"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "certifiable_vaccines", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of scheduled vaccines which can be certified via EUDCC or ICAO VDC.\r\n\r\nIntroduced during the COVID-19 pandemic, these are standards which can be\r\nused to produce a QR code containing vaccine information and a digital signature\r\nwhich certifies that the vaccines were administered by a competent authority.\r\n\r\nThis table both contains additional information about scheduled vaccines which is\r\nrequired for those to be certified, and signals that the vaccines listed may be\r\nincluded in certification QR codes.\r\n\r\nSee also the [`signers`](#!/source/source.tamanu.tamanu.signers) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in certifiable_vaccines.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in certifiable_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in certifiable_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in certifiable_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "vaccine_id": {"name": "vaccine_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=vaccine`)\r\nfor the vaccine drug.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__vaccine_id"]}, "manufacturer_id": {"name": "manufacturer_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=manufacturer`)\r\nfor the organisation that manufactured the drug.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__manufacturer_id"]}, "icd11_drug_code": {"name": "icd11_drug_code", "description": "Free-text for the ICD11 code for the drug.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__icd11_drug_code"]}, "icd11_disease_code": {"name": "icd11_disease_code", "description": "Free-text for the ICD11 code for the disease targeted by the drug.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__icd11_disease_code"]}, "vaccine_code": {"name": "vaccine_code", "description": "SNOMED CT or ATC code for the vaccine type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__vaccine_code"]}, "target_code": {"name": "target_code", "description": "SNOMED CT or ATC code for targeted disease.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__target_code"]}, "eu_product_code": {"name": "eu_product_code", "description": "EU authorisation code for the vaccine product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__eu_product_code"]}, "maximum_dosage": {"name": "maximum_dosage", "description": "Maximum number of doses. Defaults to 1.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__maximum_dosage"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in certifiable_vaccines.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_certifiable_vaccines_changed", "record_certifiable_vaccines_changelog", "set_certifiable_vaccines_updated_at", "set_certifiable_vaccines_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_certifiable_vaccines_changed", "record_certifiable_vaccines_changelog", "set_certifiable_vaccines_updated_at", "set_certifiable_vaccines_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_certifiable_vaccines_changed", "record_certifiable_vaccines_changelog", "set_certifiable_vaccines_updated_at", "set_certifiable_vaccines_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"certifiable_vaccines\"", "created_at": 1782422376.0109746, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__certifiable_vaccines"]}, "source.tamanu_source_dbt.tamanu.certificate_notifications": {"database": "app", "schema": "public", "name": "certificate_notifications", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\certificate_notifications.yml", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "source.tamanu_source_dbt.tamanu.certificate_notifications", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "certificate_notifications"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "certificate_notifications", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Various medical certificates being sent to patients.\r\n\r\nThese rows are processed by the `CertificateNotificationProcessor` scheduled task, and generate a\r\n[`patient_communications`](#!/source/source.tamanu.tamanu.patient_communications) row.\r\n\r\nThe actual certificate itself is stored separately on the filesystem while it's generated.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in certificate_notifications.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in certificate_notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in certificate_notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in certificate_notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "type": {"name": "type", "description": "Type of certificate being generated.\r\n\r\nThis dictates both from which resource the certificate is generated, and also the template being\r\nused for generating the certificate itself.\r\n\r\nOne of:\r\n- `covid_19_clearance`\r\n- `vaccination_certificate`\r\n- `icao.test`\r\n- `icao.vacc`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__type"]}, "require_signing": {"name": "require_signing", "description": "If the certificates requires cryptographic signing.\r\n\r\nSee [`certifiable_vaccines`](#!/source/source.tamanu.tamanu.certifiable_vaccines).\r\n\r\nOnly applicable to `icao.test` and `icao.vacc` types.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__require_signing"]}, "patient_id": {"name": "patient_id", "description": "Reference to a [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__patient_id"]}, "forward_address": {"name": "forward_address", "description": "An email address to send the generated certificate to.", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__forward_address"]}, "lab_test_id": {"name": "lab_test_id", "description": "The [lab test](#!/source/source.tamanu.tamanu.lab_tests) this certificate is for, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__lab_test_id"]}, "status": {"name": "status", "description": "Processing status.\r\n\r\nOne of:\r\n- `Queued`\r\n- `Processed`\r\n- `Error`\r\n- `Ignore`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__status"]}, "error": {"name": "error", "description": "If the certificate generation fails, this is the error.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__error"]}, "created_by": {"name": "created_by", "description": "The name of the user who initiated the creation of this certificate.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__created_by"]}, "lab_request_id": {"name": "lab_request_id", "description": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this certificate is for, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__lab_request_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in certificate_notifications.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "printed_date": {"name": "printed_date", "description": "When this certificate was printed, if applicable.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__printed_date"]}, "facility_name": {"name": "facility_name", "description": "The name of the facility where the creation of this certificate was initiated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__facility_name"]}, "language": {"name": "language", "description": "Used to translate the certificate.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__language"]}}, "meta": {"triggers": ["notify_certificate_notifications_changed", "record_certificate_notifications_changelog", "set_certificate_notifications_updated_at", "set_certificate_notifications_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_certificate_notifications_changed", "record_certificate_notifications_changelog", "set_certificate_notifications_updated_at", "set_certificate_notifications_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_certificate_notifications_changed", "record_certificate_notifications_changelog", "set_certificate_notifications_updated_at", "set_certificate_notifications_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"certificate_notifications\"", "created_at": 1782422376.0270953, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__certificate_notifications"]}, "source.tamanu_source_dbt.tamanu.contributing_death_causes": {"database": "app", "schema": "public", "name": "contributing_death_causes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\contributing_death_causes.yml", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "source.tamanu_source_dbt.tamanu.contributing_death_causes", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "contributing_death_causes"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "contributing_death_causes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Contributing causes recorded with the patient's death data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in contributing_death_causes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "time_after_onset": {"name": "time_after_onset", "description": "Time between onset of recorded cause and death in minutes.", "meta": {"masking": {"kind": "integer", "range": "0-50000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-50000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__time_after_onset"]}, "patient_death_data_id": {"name": "patient_death_data_id", "description": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id"]}, "condition_id": {"name": "condition_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in contributing_death_causes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in contributing_death_causes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in contributing_death_causes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in contributing_death_causes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_contributing_death_causes_changed", "record_contributing_death_causes_changelog", "set_contributing_death_causes_updated_at", "set_contributing_death_causes_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_contributing_death_causes_changed", "record_contributing_death_causes_changelog", "set_contributing_death_causes_updated_at", "set_contributing_death_causes_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_contributing_death_causes_changed", "record_contributing_death_causes_changelog", "set_contributing_death_causes_updated_at", "set_contributing_death_causes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"contributing_death_causes\"", "created_at": 1782422376.0427778, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__contributing_death_causes"]}, "source.tamanu_source_dbt.tamanu.death_revert_logs": {"database": "app", "schema": "public", "name": "death_revert_logs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\death_revert_logs.yml", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.death_revert_logs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "death_revert_logs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "death_revert_logs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Patient deaths can be reverted if they were recorded in error, this tracks those reverts.\r\n\r\nSee [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in death_revert_logs.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in death_revert_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in death_revert_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in death_revert_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "revert_time": {"name": "revert_time", "description": "When the reversion happened.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.death_revert_logs__revert_time"]}, "death_data_id": {"name": "death_data_id", "description": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record this is reverting.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.death_revert_logs__death_data_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.death_revert_logs__patient_id"]}, "reverted_by_id": {"name": "reverted_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who reverted this death record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.death_revert_logs__reverted_by_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in death_revert_logs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_death_revert_logs_changed", "record_death_revert_logs_changelog", "set_death_revert_logs_updated_at", "set_death_revert_logs_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_death_revert_logs_changed", "record_death_revert_logs_changelog", "set_death_revert_logs_updated_at", "set_death_revert_logs_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_death_revert_logs_changed", "record_death_revert_logs_changelog", "set_death_revert_logs_updated_at", "set_death_revert_logs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"death_revert_logs\"", "created_at": 1782422376.0586007, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__death_revert_logs"]}, "source.tamanu_source_dbt.tamanu.departments": {"database": "app", "schema": "public", "name": "departments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\departments.yml", "original_file_path": "models\\sources\\departments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.departments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "departments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "departments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Basic department info with a reference to parent facility.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in departments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in departments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in departments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in departments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code for department.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__code"]}, "name": {"name": "name", "description": "Full readable name for department.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__name"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this department is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in departments.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in departments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_departments_changed", "record_departments_changelog", "set_departments_updated_at", "set_departments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_departments_changed", "record_departments_changelog", "set_departments_updated_at", "set_departments_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_departments_changed", "record_departments_changelog", "set_departments_updated_at", "set_departments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"departments\"", "created_at": 1782422376.0586007, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__departments"]}, "source.tamanu_source_dbt.tamanu.devices": {"database": "app", "schema": "public", "name": "devices", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\devices.yml", "original_file_path": "models\\sources\\devices.yml", "unique_id": "source.tamanu_source_dbt.tamanu.devices", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "devices"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "devices", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Devices that are authorised to login.\r\n\r\nDevices not in the table can only connect if the user they're\r\n**first** logging in as has enough quota (`device_registration_quota`\r\non the [`users`](#!/source/source.tamanu.tamanu.users) table.)\r\n\r\nThis check is not performed when `features.deviceRegistrationQuota` is disabled.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in devices.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "last_seen_at": {"name": "last_seen_at", "description": "When this device last logged in.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.devices__last_seen_at"]}, "registered_by_id": {"name": "registered_by_id", "description": "Which user registered this device.\r\n\r\nThis is used for quota calculations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.devices__registered_by_id"]}, "name": {"name": "name", "description": "Optional descriptive name, to make it easier to map device IDs to real devices\r\nin debugging and troubleshooting situations.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.devices__name"]}, "scopes": {"name": "scopes", "description": "Scopes the device is authorised to access.\r\n\r\nScopes allow access to parts of the API that are closed to other devices\r\notherwise. Some scopes are restricted by quota. Devices aren't allowed to\r\nrequest more scopes than they currently have, but may login without\r\nspecifying the full scopes they have.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.devices__scopes"]}}, "meta": {"triggers": ["record_devices_changelog"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["record_devices_changelog"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["record_devices_changelog"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"devices\"", "created_at": 1782422376.074243, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__devices"]}, "source.tamanu_source_dbt.tamanu.discharges": {"database": "app", "schema": "public", "name": "discharges", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\discharges.yml", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "source.tamanu_source_dbt.tamanu.discharges", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "discharges"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "discharges", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information about a discharge.\r\n\r\nA discharge is the end of the lifecycle for an encounter.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in discharges.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in discharges.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in discharges.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in discharges.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form notes about the discharge.\r\n\r\nMay include treatment plan and follow-ups, written by the discharging clinician.\r\n\r\nSince v2.0, also see the [`notes`](#!/source/source.tamanu.tamanu.notes) table for encounter and discharge notes.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__note"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this discharge is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__encounter_id"]}, "discharger_id": {"name": "discharger_id", "description": "The [discharging clinician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__discharger_id"]}, "disposition_id": {"name": "disposition_id", "description": "The discharge disposition or classification of the discharge ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__disposition_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in discharges.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "facility_name": {"name": "facility_name", "description": "Name of the discharging facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__facility_name"]}, "facility_address": {"name": "facility_address", "description": "Address of the discharging facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__facility_address"]}, "facility_town": {"name": "facility_town", "description": "Town of the discharging facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__facility_town"]}}, "meta": {"triggers": ["notify_discharges_changed", "record_discharges_changelog", "set_discharges_updated_at", "set_discharges_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_discharges_changed", "record_discharges_changelog", "set_discharges_updated_at", "set_discharges_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_discharges_changed", "record_discharges_changelog", "set_discharges_updated_at", "set_discharges_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"discharges\"", "created_at": 1782422376.089911, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__discharges"]}, "source.tamanu_source_dbt.tamanu.document_metadata": {"database": "app", "schema": "public", "name": "document_metadata", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\document_metadata.yml", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "source.tamanu_source_dbt.tamanu.document_metadata", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "document_metadata"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "document_metadata", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information about an uploaded document or file, typically attached to an encounter or directly to a patient.\r\n\r\nThe actual file data is stored in [`attachments`](#!/source/source.tamanu.tamanu.attachments).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in document_metadata.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Free-form name of the document.\r\n\r\nOften this is the filename.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__name"]}, "type": {"name": "type", "description": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__type"]}, "document_created_at": {"name": "document_created_at", "description": "When the document was created.\r\n\r\nHistorically (before v2.0) this was the \"created at\" timestamp of the file itself, as reported by\r\nthe OS. However that information is no longer available to Tamanu in most contexts, so this is now\r\nusually set to the upload time.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_created_at"]}, "document_uploaded_at": {"name": "document_uploaded_at", "description": "When the document was uploaded.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_uploaded_at"]}, "document_owner": {"name": "document_owner", "description": "Name of the person who owns the document.\r\n\r\nTypically this is the uploader's name.", "meta": {"masking": "name"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_owner"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) the document was uploaded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__patient_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) the document was uploaded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__encounter_id"]}, "attachment_id": {"name": "attachment_id", "description": "The [file data](#!/source/source.tamanu.tamanu.attachments).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__attachment_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in document_metadata.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in document_metadata.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in document_metadata.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the document was uploaded from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__department_id"]}, "note": {"name": "note", "description": "Free-form description of the document.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__note"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in document_metadata.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "document_created_at_legacy": {"name": "document_created_at_legacy", "description": "[Deprecated] When the document was created.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_created_at_legacy"]}, "document_uploaded_at_legacy": {"name": "document_uploaded_at_legacy", "description": "[Deprecated] When the document was uploaded.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_uploaded_at_legacy"]}, "source": {"name": "source", "description": "Where the document came from.\r\n\r\nOne of:\r\n- `patient_letter`\r\n- `uploaded`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__source"]}}, "meta": {"triggers": ["notify_document_metadata_changed", "record_document_metadata_changelog", "set_document_metadata_updated_at", "set_document_metadata_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_document_metadata_changed", "record_document_metadata_changelog", "set_document_metadata_updated_at", "set_document_metadata_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_document_metadata_changed", "record_document_metadata_changelog", "set_document_metadata_updated_at", "set_document_metadata_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"document_metadata\"", "created_at": 1782422376.1255853, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__document_metadata"]}, "source.tamanu_source_dbt.tamanu.encounters": {"database": "app", "schema": "public", "name": "encounters", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounters.yml", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounters", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounters"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounters", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Tracks the basic information of the patient encounters within Tamanu from start to finish", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounters.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounters.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounters.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounters.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "start_date": {"name": "start_date", "description": "The beginning of the encounter", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "end_date": {"name": "end_date", "description": "The date encounter was discharged/ended", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "reason_for_encounter": {"name": "reason_for_encounter", "description": "Free-form information about the encounter.\r\n\r\nCan include info like type of survey submitted, emergency diagnosis, etc.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__reason_for_encounter"]}, "device_id": {"name": "device_id", "description": "Unique identifier for the device that created the encounter.\r\n\r\nDevice IDs are proper to each device and not globally recorded in e.g. a `devices` table.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__device_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "examiner_id": {"name": "examiner_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__department_id"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "The billing type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_billing_type_id"]}, "start_date_legacy": {"name": "start_date_legacy", "description": "[Deprecated] Start date.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date_legacy"]}, "end_date_legacy": {"name": "end_date_legacy", "description": "[Deprecated] End date.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date_legacy"]}, "referral_source_id": {"name": "referral_source_id", "description": "The referral source ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__referral_source_id"]}, "planned_location_id": {"name": "planned_location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) that the encounter will transfer to at the\r\n`planned_location_start_time`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__planned_location_id"]}, "planned_location_start_time": {"name": "planned_location_start_time", "description": "The time that the encounter will transfer to the planned location.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__planned_location_start_time"]}, "discharge_draft": {"name": "discharge_draft", "description": "Draft data of the encounter", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__discharge_draft"]}, "estimated_end_date": {"name": "estimated_end_date", "description": "The estimated discharge date of the encounter", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__estimated_end_date"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounters.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounters_changed", "record_encounters_changelog", "set_encounters_updated_at", "set_encounters_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounters_changed", "record_encounters_changelog", "set_encounters_updated_at", "set_encounters_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_encounters_changed", "record_encounters_changelog", "set_encounters_updated_at", "set_encounters_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounters\"", "created_at": 1782422376.157169, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounters"]}, "source.tamanu_source_dbt.tamanu.encounter_diagnoses": {"database": "app", "schema": "public", "name": "encounter_diagnoses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_diagnoses.yml", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_diagnoses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_diagnoses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_diagnoses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records diagnoses made during an encounter", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diagnoses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_diagnoses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_diagnoses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_diagnoses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "certainty": {"name": "certainty", "description": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__certainty"]}, "is_primary": {"name": "is_primary", "description": "A boolean indicating if this is a primary diagnosis", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__is_primary"]}, "date": {"name": "date", "description": "Local date for the record in encounter_diagnoses.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__encounter_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in encounter_diagnoses.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_diagnoses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that diagnosis.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__clinician_id"]}}, "meta": {"triggers": ["notify_encounter_diagnoses_changed", "record_encounter_diagnoses_changelog", "set_encounter_diagnoses_updated_at", "set_encounter_diagnoses_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_diagnoses_changed", "record_encounter_diagnoses_changelog", "set_encounter_diagnoses_updated_at", "set_encounter_diagnoses_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_encounter_diagnoses_changed", "record_encounter_diagnoses_changelog", "set_encounter_diagnoses_updated_at", "set_encounter_diagnoses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_diagnoses\"", "created_at": 1782422376.1729605, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_diagnoses"]}, "source.tamanu_source_dbt.tamanu.encounter_diets": {"database": "app", "schema": "public", "name": "encounter_diets", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_diets.yml", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_diets", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_diets"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_diets", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A diet associated with an encounter.\r\n\r\nA patient can be placed on a diet for various medical purposes.\r\nDiets are specified in reference data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diets.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diet is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diets__encounter_id"]}, "diet_id": {"name": "diet_id", "description": "The diet ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diet`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diets__diet_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_diets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_diets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_diets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_diets.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounter_diets_changed", "record_encounter_diets_changelog", "set_encounter_diets_updated_at", "set_encounter_diets_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_diets_changed", "record_encounter_diets_changelog", "set_encounter_diets_updated_at", "set_encounter_diets_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_encounter_diets_changed", "record_encounter_diets_changelog", "set_encounter_diets_updated_at", "set_encounter_diets_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_diets\"", "created_at": 1782422376.1847394, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_diets"]}, "source.tamanu_source_dbt.tamanu.encounter_history": {"database": "app", "schema": "public", "name": "encounter_history", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_history.yml", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_history", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_history"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records changes to an encounter's basic details.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_history.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_history.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_history.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_history.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in encounter_history.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the original [encounter](#!/source/source.tamanu.tamanu.encounters) this history is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__encounter_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the encounter was in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__department_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the encounter was in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__location_id"]}, "examiner_id": {"name": "examiner_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users) for the encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__examiner_id"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__encounter_type"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_history.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "actor_id": {"name": "actor_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) made the change.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__actor_id"]}, "change_type": {"name": "change_type", "description": "The field which was changed.\r\n\r\nOne of:\r\n- `encounter_type`\r\n- `location`\r\n- `department`\r\n- `examiner`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__change_type"]}}, "meta": {"triggers": ["notify_encounter_history_changed", "record_encounter_history_changelog", "set_encounter_history_updated_at", "set_encounter_history_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_history_changed", "record_encounter_history_changelog", "set_encounter_history_updated_at", "set_encounter_history_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_encounter_history_changed", "record_encounter_history_changelog", "set_encounter_history_updated_at", "set_encounter_history_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_history\"", "created_at": 1782422376.2029061, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_history"]}, "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions": {"database": "app", "schema": "public", "name": "encounter_pause_prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_pause_prescriptions.yml", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_pause_prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_pause_prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records details about the prescription being paused, the duration and timing of the pause, and the clinician responsible for initiating the pause.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_pause_prescriptions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_prescription_id": {"name": "encounter_prescription_id", "description": "References the unique identifier of the prescription being paused. This links to the `encounter_prescriptions` table to provide context about the specific prescription.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__encounter_prescription_id"]}, "pause_duration": {"name": "pause_duration", "description": "Describes the length of time for which the prescription is paused. This value works in conjunction with the `pause_time_unit` field to specify the duration (e.g., 5 days, 2 weeks).", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_duration"]}, "pause_time_unit": {"name": "pause_time_unit", "description": "Specifies the unit of time for the pause duration. Common values include days, weeks and it works in conjunction with the `pause_duration` field to define the total pause period.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_time_unit"]}, "pause_start_date": {"name": "pause_start_date", "description": "Indicates the date when the prescription pause begins. This field is used to track the start of the pause period.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_start_date"]}, "pause_end_date": {"name": "pause_end_date", "description": "Indicates the date when the prescription pause ends. This field is used to track the end of the pause period.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_end_date"]}, "notes": {"name": "notes", "description": "Provides additional information or context about the prescription pause.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__notes"]}, "pausing_clinician_id": {"name": "pausing_clinician_id", "description": "References the unique identifier of the clinician responsible for initiating the pause.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pausing_clinician_id"]}, "created_by": {"name": "created_by", "description": "References the unique identifier of the user who created the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__created_by"]}, "updated_by": {"name": "updated_by", "description": "The identifier of the user logged on when the record was created, updated or deleted in encounter_pause_prescriptions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_by"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_pause_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_pause_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_pause_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_pause_prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounter_pause_prescriptions_changed", "record_encounter_pause_prescriptions_changelog", "set_encounter_pause_prescriptions_updated_at", "set_encounter_pause_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_pause_prescriptions_changed", "record_encounter_pause_prescriptions_changelog", "set_encounter_pause_prescriptions_updated_at", "set_encounter_pause_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_encounter_pause_prescriptions_changed", "record_encounter_pause_prescriptions_changelog", "set_encounter_pause_prescriptions_updated_at", "set_encounter_pause_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_pause_prescriptions\"", "created_at": 1782422376.216181, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_pause_prescriptions"]}, "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories": {"database": "app", "schema": "public", "name": "encounter_pause_prescription_histories", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_pause_prescription_histories.yml", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_pause_prescription_histories"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_pause_prescription_histories", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This table tracks the history of paused prescriptions for encounters, including details about the action, user, and duration.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_pause_prescription_histories.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_prescription_id": {"name": "encounter_prescription_id", "description": "The ID of the prescription associated with the encounter.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__encounter_prescription_id"]}, "action": {"name": "action", "description": "The type of action performed, such as \"pause\" or \"resume.\"", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__action"]}, "action_date": {"name": "action_date", "description": "The date and time when the action was performed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_date"]}, "action_user_id": {"name": "action_user_id", "description": "The ID of the user who performed the action.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_user_id"]}, "notes": {"name": "notes", "description": "Additional notes or comments of the paused prescription.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__notes"]}, "pause_duration": {"name": "pause_duration", "description": "The duration for which the prescription was paused.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_duration"]}, "pause_time_unit": {"name": "pause_time_unit", "description": "The unit of time for the pause duration, such as \"days\" or \"hours.\"", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_time_unit"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_pause_prescription_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_pause_prescription_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_pause_prescription_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_pause_prescription_histories.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounter_pause_prescription_histories_changed", "record_encounter_pause_prescription_histories_changelog", "set_encounter_pause_prescription_histories_updated_at", "set_encounter_pause_prescription_histories_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_pause_prescription_histories_changed", "record_encounter_pause_prescription_histories_changelog", "set_encounter_pause_prescription_histories_updated_at", "set_encounter_pause_prescription_histories_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_encounter_pause_prescription_histories_changed", "record_encounter_pause_prescription_histories_changelog", "set_encounter_pause_prescription_histories_updated_at", "set_encounter_pause_prescription_histories_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_pause_prescription_histories\"", "created_at": 1782422376.2319708, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_pause_prescription_histories"]}, "source.tamanu_source_dbt.tamanu.encounter_prescriptions": {"database": "app", "schema": "public", "name": "encounter_prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_prescriptions.yml", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of encounter to prescription", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__encounter_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__prescription_id"]}, "is_selected_for_discharge": {"name": "is_selected_for_discharge", "description": "Whether the prescription is for when the patient is discharged.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounter_prescriptions_changed", "record_encounter_prescriptions_changelog", "set_encounter_prescriptions_updated_at", "set_encounter_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_prescriptions_changed", "record_encounter_prescriptions_changelog", "set_encounter_prescriptions_updated_at", "set_encounter_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_encounter_prescriptions_changed", "record_encounter_prescriptions_changelog", "set_encounter_prescriptions_updated_at", "set_encounter_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_prescriptions\"", "created_at": 1782422376.2319708, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_prescriptions"]}, "source.tamanu_source_dbt.tamanu.facilities": {"database": "app", "schema": "public", "name": "facilities", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\facilities.yml", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "source.tamanu_source_dbt.tamanu.facilities", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "facilities"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "facilities", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of facilities.\r\n\r\nFacilities may be either or both of:\r\n\r\n- Any healthcare facility, like hospitals, clinics, mobile vaccination vans, laboratories, etc\r\n- A Tamanu Facility deployment.\r\n\r\nWhen syncing, patient and related records are scoped to a facility, according to the\r\n[`patient_facilities`](#!/source/source.tamanu.tamanu.patient_facilities) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in facilities.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code (identifier) for the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__code"]}, "name": {"name": "name", "description": "Full readable name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}, "division": {"name": "division", "description": "Administrative division this facility lives in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__division"]}, "type": {"name": "type", "description": "Type of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__type"]}, "email": {"name": "email", "description": "Administrative email address of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__email"]}, "contact_number": {"name": "contact_number", "description": "Administrative contact number of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__contact_number"]}, "city_town": {"name": "city_town", "description": "City or town of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__city_town"]}, "street_address": {"name": "street_address", "description": "Street address of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__street_address"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in facilities.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "catchment_id": {"name": "catchment_id", "description": "Catchment area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__catchment_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in facilities.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_sensitive": {"name": "is_sensitive", "description": "If set to `true`, encounters created on this facility will only be viewable when logged into this facility", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__is_sensitive"]}}, "meta": {"triggers": ["notify_facilities_changed", "record_facilities_changelog", "set_facilities_updated_at", "set_facilities_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_facilities_changed", "record_facilities_changelog", "set_facilities_updated_at", "set_facilities_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_facilities_changed", "record_facilities_changelog", "set_facilities_updated_at", "set_facilities_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"facilities\"", "created_at": 1782422376.2502258, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__facilities"]}, "source.tamanu_source_dbt.tamanu.imaging_area_external_codes": {"database": "app", "schema": "public", "name": "imaging_area_external_codes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_area_external_codes.yml", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_area_external_codes", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_area_external_codes"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_area_external_codes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "External codes for imaging areas (such as for [PACS](https://en.wikipedia.org/wiki/Picture_archiving_and_communication_system)).\r\n\r\nImaging areas are stored in [Reference Data](#!/source/source.tamanu.tamanu.reference_data), this\r\ntable adds additional (external) codes.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_area_external_codes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_area_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_area_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_area_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_area_external_codes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "area_id": {"name": "area_id", "description": "Reference to the imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__area_id"]}, "code": {"name": "code", "description": "External code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__code"]}, "description": {"name": "description", "description": "Human-friendly description for the area/code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__description"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_area_external_codes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_imaging_area_external_codes_changed", "record_imaging_area_external_codes_changelog", "set_imaging_area_external_codes_updated_at", "set_imaging_area_external_codes_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_imaging_area_external_codes_changed", "record_imaging_area_external_codes_changelog", "set_imaging_area_external_codes_updated_at", "set_imaging_area_external_codes_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_imaging_area_external_codes_changed", "record_imaging_area_external_codes_changelog", "set_imaging_area_external_codes_updated_at", "set_imaging_area_external_codes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_area_external_codes\"", "created_at": 1782422376.2614827, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_area_external_codes"]}, "source.tamanu_source_dbt.tamanu.imaging_requests": {"database": "app", "schema": "public", "name": "imaging_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_requests.yml", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Imaging requests are the entrypoint of imaging workflows in Tamanu.\r\n\r\nEach row is a request for radiology to perform one or more imagings on a patient.\r\n\r\nImagings can have one or more [request areas](#!/source/source.tamanu.tamanu.imaging_request_areas)\r\nattached, and when completed will have [results](#!/source/source.tamanu.tamanu.imaging_results).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_requests.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "requested_date": {"name": "requested_date", "description": "When the imaging was requested.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this imaging request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__encounter_id"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "legacy_results": {"name": "legacy_results", "description": "[Deprecated] Description of the results.\r\n\r\nSince v1.24 this has moved to the [imaging results](#!/source/source.tamanu.tamanu.imaging_results) table.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__legacy_results"]}, "completed_by_id": {"name": "completed_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__completed_by_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) for this imaging request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__location_id"]}, "imaging_type": {"name": "imaging_type", "description": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__imaging_type"]}, "requested_date_legacy": {"name": "requested_date_legacy", "description": "[Deprecated] Timestamp when the imaging was requested.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date_legacy"]}, "priority": {"name": "priority", "description": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__priority"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [location group](#!/source/source.tamanu.tamanu.location_groups) for this imaging request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__location_group_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113).", "meta": {"masking": "text"}, "data_type": "character varying(1024)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__display_id"]}}, "meta": {"triggers": ["notify_imaging_requests_changed", "record_imaging_requests_changelog", "set_imaging_requests_updated_at", "set_imaging_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_imaging_requests_changed", "record_imaging_requests_changelog", "set_imaging_requests_updated_at", "set_imaging_requests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_imaging_requests_changed", "record_imaging_requests_changelog", "set_imaging_requests_updated_at", "set_imaging_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_requests\"", "created_at": 1782422376.291259, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_requests"]}, "source.tamanu_source_dbt.tamanu.imaging_request_areas": {"database": "app", "schema": "public", "name": "imaging_request_areas", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_request_areas.yml", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_request_areas", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_request_areas"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_request_areas", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Areas to be imaged as part of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_request_areas.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_request_areas.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_request_areas.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_request_areas.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "imaging_request_id": {"name": "imaging_request_id", "description": "The [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_request_areas__imaging_request_id"]}, "area_id": {"name": "area_id", "description": "The imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_request_areas__area_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_request_areas.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_imaging_request_areas_changed", "record_imaging_request_areas_changelog", "set_imaging_request_areas_updated_at", "set_imaging_request_areas_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_imaging_request_areas_changed", "record_imaging_request_areas_changelog", "set_imaging_request_areas_updated_at", "set_imaging_request_areas_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_imaging_request_areas_changed", "record_imaging_request_areas_changelog", "set_imaging_request_areas_updated_at", "set_imaging_request_areas_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_request_areas\"", "created_at": 1782422376.303029, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_request_areas"]}, "source.tamanu_source_dbt.tamanu.imaging_results": {"database": "app", "schema": "public", "name": "imaging_results", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_results.yml", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_results", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_results"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_results", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Result of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).\r\n\r\nIn practice, there is usually one or two results per request:\r\n- one containing a reference to a PACS image, when imaging integrations are enabled;\r\n- one containing notes from a doctor who analysed the image.\r\n\r\nHowever there is no limit; for example there may be multiple notes from multiple doctors.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_results.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_results.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_results.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_results.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_results.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_results.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "imaging_request_id": {"name": "imaging_request_id", "description": "Reference to the [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__imaging_request_id"]}, "completed_by_id": {"name": "completed_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_by_id"]}, "description": {"name": "description", "description": "Free-form description / notes about this imaging.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__description"]}, "external_code": {"name": "external_code", "description": "External code for this result, used with PACS integration (generally via FHIR).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__external_code"]}, "completed_at": {"name": "completed_at", "description": "When this result was completed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_at"]}, "result_image_url": {"name": "result_image_url", "description": "Link to external imaging result viewer.", "meta": {"masking": "url"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "url"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__result_image_url"]}}, "meta": {"triggers": ["notify_imaging_results_changed", "record_imaging_results_changelog", "set_imaging_results_updated_at", "set_imaging_results_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_imaging_results_changed", "record_imaging_results_changelog", "set_imaging_results_updated_at", "set_imaging_results_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_imaging_results_changed", "record_imaging_results_changelog", "set_imaging_results_updated_at", "set_imaging_results_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_results\"", "created_at": 1782422376.3108554, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_results"]}, "source.tamanu_source_dbt.tamanu.imaging_type_external_codes": {"database": "app", "schema": "public", "name": "imaging_type_external_codes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_type_external_codes.yml", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_type_external_codes", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_type_external_codes"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_type_external_codes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Mapping table for imaging types to external codes.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_type_external_codes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_type_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_type_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_type_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_type_external_codes.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "imaging_type_code": {"name": "imaging_type_code", "description": "Tamanu's imaging type code.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_type_external_codes__imaging_type_code"]}, "code": {"name": "code", "description": "External code.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_type_external_codes__code"]}, "description": {"name": "description", "description": "Description of code.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_type_external_codes__description"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_type_external_codes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["fhir_refresh", "notify_imaging_type_external_codes_changed", "record_imaging_type_external_codes_changelog", "set_imaging_type_external_codes_updated_at", "set_imaging_type_external_codes_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["fhir_refresh", "notify_imaging_type_external_codes_changed", "record_imaging_type_external_codes_changelog", "set_imaging_type_external_codes_updated_at", "set_imaging_type_external_codes_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["fhir_refresh", "notify_imaging_type_external_codes_changed", "record_imaging_type_external_codes_changelog", "set_imaging_type_external_codes_updated_at", "set_imaging_type_external_codes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_type_external_codes\"", "created_at": 1782422376.3745346, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_type_external_codes"]}, "source.tamanu_source_dbt.tamanu.invoices": {"database": "app", "schema": "public", "name": "invoices", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoices.yml", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoices", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoices"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoices", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Invoices related to encounters.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoices.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__display_id"]}, "date": {"name": "date", "description": "Local date for the record in invoices.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "status": {"name": "status", "description": "Status of the invoice.\r\n\r\nOne of:\r\n- `cancelled`\r\n- `in_progress`\r\n- `finalised`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__status"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this invoice is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__encounter_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_payment_status": {"name": "patient_payment_status", "description": "Payment status (patient portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__patient_payment_status"]}, "insurer_payment_status": {"name": "insurer_payment_status", "description": "Payment status (insurer portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__insurer_payment_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoices.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoices_changed", "record_invoices_changelog", "set_invoices_updated_at", "set_invoices_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoices_changed", "record_invoices_changelog", "set_invoices_updated_at", "set_invoices_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoices_changed", "record_invoices_changelog", "set_invoices_updated_at", "set_invoices_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoices\"", "created_at": 1782422376.4061162, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoices"]}, "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans": {"database": "app", "schema": "public", "name": "invoices_invoice_insurance_plans", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoices_invoice_insurance_plans.yml", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoices_invoice_insurance_plans"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoices_invoice_insurance_plans", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Junction table linking invoices to insurance contracts. This many-to-many relationship allows an invoice to be associated with multiple insurance contracts.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoices_invoice_insurance_plans.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoices_invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoices_invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoices_invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoices_invoice_insurance_plans.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "invoice_id": {"name": "invoice_id", "description": "Reference to the [invoice](#!/source/source.tamanu.tamanu.invoices) that this insurance contract applies to.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_id"]}, "invoice_insurance_plan_id": {"name": "invoice_insurance_plan_id", "description": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans) being applied to the invoice.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_insurance_plan_id"]}}, "meta": {"triggers": ["notify_invoices_invoice_insurance_plans_changed", "record_invoices_invoice_insurance_plans_changelog", "set_invoices_invoice_insurance_plans_updated_at", "set_invoices_invoice_insurance_plans_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoices_invoice_insurance_plans_changed", "record_invoices_invoice_insurance_plans_changelog", "set_invoices_invoice_insurance_plans_updated_at", "set_invoices_invoice_insurance_plans_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoices_invoice_insurance_plans_changed", "record_invoices_invoice_insurance_plans_changelog", "set_invoices_invoice_insurance_plans_updated_at", "set_invoices_invoice_insurance_plans_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoices_invoice_insurance_plans\"", "created_at": 1782422376.4061162, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoices_invoice_insurance_plans"]}, "source.tamanu_source_dbt.tamanu.invoice_discounts": {"database": "app", "schema": "public", "name": "invoice_discounts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_discounts.yml", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_discounts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_discounts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_discounts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Invoice discount that is applied to the patient's portion of the discountable costs.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_discounts.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_id": {"name": "invoice_id", "description": "The [invoice](#!/source/source.tamanu.tamanu.invoices).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__invoice_id"]}, "percentage": {"name": "percentage", "description": "Percentage discount to apply to the invoice", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__percentage"]}, "reason": {"name": "reason", "description": "Reason the discount is given", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__reason"]}, "is_manual": {"name": "is_manual", "description": "Indicates if the discount was manually added or based on an assessment", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__is_manual"]}, "applied_by_user_id": {"name": "applied_by_user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) who applied this discount.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__applied_by_user_id"]}, "applied_time": {"name": "applied_time", "description": "When this discount was applied.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__applied_time"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_discounts.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoice_discounts_changed", "record_invoice_discounts_changelog", "set_invoice_discounts_updated_at", "set_invoice_discounts_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_discounts_changed", "record_invoice_discounts_changelog", "set_invoice_discounts_updated_at", "set_invoice_discounts_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_discounts_changed", "record_invoice_discounts_changelog", "set_invoice_discounts_updated_at", "set_invoice_discounts_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_discounts\"", "created_at": 1782422376.4219182, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_discounts"]}, "source.tamanu_source_dbt.tamanu.invoice_insurance_plans": {"database": "app", "schema": "public", "name": "invoice_insurance_plans", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_insurance_plans.yml", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurance_plans", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_insurance_plans"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_insurance_plans", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table for insurance contracts used for invoicing.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurance_plans.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_insurance_plans.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "code": {"name": "code", "description": "Unique identifier code for the insurance contract.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__code"]}, "name": {"name": "name", "description": "Human-readable name of the insurance contract.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__name"]}, "default_coverage": {"name": "default_coverage", "description": "The default coverage (in percentage) of the insurance contract.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__default_coverage"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_insurance_plans.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_invoice_insurance_plans_changed", "record_invoice_insurance_plans_changelog", "set_invoice_insurance_plans_updated_at", "set_invoice_insurance_plans_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_insurance_plans_changed", "record_invoice_insurance_plans_changelog", "set_invoice_insurance_plans_updated_at", "set_invoice_insurance_plans_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_insurance_plans_changed", "record_invoice_insurance_plans_changelog", "set_invoice_insurance_plans_updated_at", "set_invoice_insurance_plans_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_insurance_plans\"", "created_at": 1782422376.4219182, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurance_plans"]}, "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items": {"database": "app", "schema": "public", "name": "invoice_insurance_plan_items", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_insurance_plan_items.yml", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_insurance_plan_items"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_insurance_plan_items", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table for insurance contract items used for invoicing.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurance_plan_items.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_insurance_plan_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_insurance_plan_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_insurance_plan_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_insurance_plan_items.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "invoice_insurance_plan_id": {"name": "invoice_insurance_plan_id", "description": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans).", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_insurance_plan_id"]}, "invoice_product_id": {"name": "invoice_product_id", "description": "Reference to the [invoice product](#!/source/source.tamanu.tamanu.invoice_products).", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_product_id"]}, "coverage_value": {"name": "coverage_value", "description": "The amount of coverage (in percentage) of the insurance contract item.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__coverage_value"]}}, "meta": {"triggers": ["notify_invoice_insurance_plan_items_changed", "record_invoice_insurance_plan_items_changelog", "set_invoice_insurance_plan_items_updated_at", "set_invoice_insurance_plan_items_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_insurance_plan_items_changed", "record_invoice_insurance_plan_items_changelog", "set_invoice_insurance_plan_items_updated_at", "set_invoice_insurance_plan_items_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_insurance_plan_items_changed", "record_invoice_insurance_plan_items_changelog", "set_invoice_insurance_plan_items_updated_at", "set_invoice_insurance_plan_items_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_insurance_plan_items\"", "created_at": 1782422376.4376707, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurance_plan_items"]}, "source.tamanu_source_dbt.tamanu.invoice_insurer_payments": {"database": "app", "schema": "public", "name": "invoice_insurer_payments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_insurer_payments.yml", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurer_payments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_insurer_payments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_insurer_payments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Extra metadata about a payment when it was done by a patient.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurer_payments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_payment_id": {"name": "invoice_payment_id", "description": "The [payment](#!/source/source.tamanu.tamanu.invoice_payments).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurer_payments__invoice_payment_id"]}, "insurer_id": {"name": "insurer_id", "description": "The insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurer_payments__insurer_id"]}, "status": {"name": "status", "description": "The status of this payment.\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurer_payments__status"]}, "reason": {"name": "reason", "description": "The reason for the payment. Generally this is used for rejections.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurer_payments__reason"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_insurer_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_insurer_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_insurer_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_insurer_payments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoice_insurer_payments_changed", "record_invoice_insurer_payments_changelog", "set_invoice_insurer_payments_updated_at", "set_invoice_insurer_payments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_insurer_payments_changed", "record_invoice_insurer_payments_changelog", "set_invoice_insurer_payments_updated_at", "set_invoice_insurer_payments_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_insurer_payments_changed", "record_invoice_insurer_payments_changelog", "set_invoice_insurer_payments_updated_at", "set_invoice_insurer_payments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_insurer_payments\"", "created_at": 1782422376.4533184, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurer_payments"]}, "source.tamanu_source_dbt.tamanu.invoice_items": {"database": "app", "schema": "public", "name": "invoice_items", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_items.yml", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_items", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_items"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_items", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Items (products) on invoices.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_items.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_id": {"name": "invoice_id", "description": "The [invoice](#!/source/source.tamanu.tamanu.invoices).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__invoice_id"]}, "order_date": {"name": "order_date", "description": "When the item was ordered.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__order_date"]}, "product_id": {"name": "product_id", "description": "The [product](#!/source/source.tamanu.tamanu.invoice_products).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_id"]}, "quantity": {"name": "quantity", "description": "Quantity ordered.", "meta": {"masking": {"kind": "integer", "range": "0-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__quantity"]}, "product_name_final": {"name": "product_name_final", "description": "The final product name used on the invoice. Saved from the product name field when the invoice is finalised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_name_final"]}, "manual_entry_price": {"name": "manual_entry_price", "description": "Manually entered price override for this item, if specified. When set, this takes precedence over the product's standard price.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__manual_entry_price"]}, "ordered_by_user_id": {"name": "ordered_by_user_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) ordered the item.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__ordered_by_user_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "product_code_final": {"name": "product_code_final", "description": "The final product code used on the invoice. Saved from the product code field when the invoice is finalised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_code_final"]}, "note": {"name": "note", "description": "Free-form note for this item.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__note"]}, "source_record_type": {"name": "source_record_type", "description": "The underlying model that the source record belongs to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__source_record_type"]}, "source_record_id": {"name": "source_record_id", "description": "Foreign key relation for record type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__source_record_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_items.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "approved": {"name": "approved", "description": "A boolean field that enables clinicians to track the approval status of individual invoice line items", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__approved"]}, "price_final": {"name": "price_final", "description": "The final price per unit for this item on the invoice. This is determined by the manual_entry_price if provided, otherwise from the product's price when the invoice is finalised.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__price_final"]}}, "meta": {"triggers": ["notify_invoice_items_changed", "record_invoice_items_changelog", "set_invoice_items_updated_at", "set_invoice_items_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_items_changed", "record_invoice_items_changelog", "set_invoice_items_updated_at", "set_invoice_items_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_items_changed", "record_invoice_items_changelog", "set_invoice_items_updated_at", "set_invoice_items_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_items\"", "created_at": 1782422376.4689639, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_items"]}, "source.tamanu_source_dbt.tamanu.invoice_item_discounts": {"database": "app", "schema": "public", "name": "invoice_item_discounts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_item_discounts.yml", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_item_discounts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_item_discounts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_item_discounts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Discounts applied to invoice items.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_item_discounts.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_item_id": {"name": "invoice_item_id", "description": "The [invoice item](#!/source/source.tamanu.tamanu.invoice_items).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_discounts__invoice_item_id"]}, "amount": {"name": "amount", "description": "Discount amount of invoice items (can be percentage or a whole number)", "meta": {"masking": "money"}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {"masking": "money"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_discounts__amount"]}, "reason": {"name": "reason", "description": "Free-form reason for the discount.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_discounts__reason"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_item_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_item_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_item_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_item_discounts.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "type": {"name": "type", "description": "Discount type of invoice items", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_discounts__type"]}}, "meta": {"triggers": ["notify_invoice_item_discounts_changed", "record_invoice_item_discounts_changelog", "set_invoice_item_discounts_updated_at", "set_invoice_item_discounts_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_item_discounts_changed", "record_invoice_item_discounts_changelog", "set_invoice_item_discounts_updated_at", "set_invoice_item_discounts_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_item_discounts_changed", "record_invoice_item_discounts_changelog", "set_invoice_item_discounts_updated_at", "set_invoice_item_discounts_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_item_discounts\"", "created_at": 1782422376.4689639, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_item_discounts"]}, "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances": {"database": "app", "schema": "public", "name": "invoice_item_finalised_insurances", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_item_finalised_insurances.yml", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_item_finalised_insurances"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_item_finalised_insurances", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Finalised insurance coverage values for invoice items.\r\n\r\nThis table stores the insurance coverage amounts that were locked in when an invoice item is finalised, \r\npreserving the coverage percentage at that point in time even if the insurance plan's coverage changes later.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_item_finalised_insurances.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_item_finalised_insurances.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_item_finalised_insurances.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_item_finalised_insurances.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_item_finalised_insurances.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "invoice_item_id": {"name": "invoice_item_id", "description": "The [invoice item](#!/source/source.tamanu.tamanu.invoice_items) this insurance coverage applies to.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_item_id"]}, "coverage_value_final": {"name": "coverage_value_final", "description": "The finalised coverage percentage for this invoice item.\r\n\r\nThis value is copied from the insurance plan's coverage at the time the invoice item is finalised,\r\npreserving it for the record even if the insurance plan's coverage percentage changes later.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_finalised_insurances__coverage_value_final"]}, "invoice_insurance_plan_id": {"name": "invoice_insurance_plan_id", "description": "The [insurance plan](#!/source/source.tamanu.tamanu.invoice_insurance_plans) providing the coverage.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_insurance_plan_id"]}}, "meta": {"triggers": ["notify_invoice_item_finalised_insurances_changed", "record_invoice_item_finalised_insurances_changelog", "set_invoice_item_finalised_insurances_updated_at", "set_invoice_item_finalised_insurances_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_item_finalised_insurances_changed", "record_invoice_item_finalised_insurances_changelog", "set_invoice_item_finalised_insurances_updated_at", "set_invoice_item_finalised_insurances_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_item_finalised_insurances_changed", "record_invoice_item_finalised_insurances_changelog", "set_invoice_item_finalised_insurances_updated_at", "set_invoice_item_finalised_insurances_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_item_finalised_insurances\"", "created_at": 1782422376.4847252, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_item_finalised_insurances"]}, "source.tamanu_source_dbt.tamanu.invoice_patient_payments": {"database": "app", "schema": "public", "name": "invoice_patient_payments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_patient_payments.yml", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_patient_payments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_patient_payments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_patient_payments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Extra metadata about a payment when it was done by a patient.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_patient_payments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_payment_id": {"name": "invoice_payment_id", "description": "The [payment](#!/source/source.tamanu.tamanu.invoice_payments).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_patient_payments__invoice_payment_id"]}, "method_id": {"name": "method_id", "description": "The method used to pay ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_patient_payments__method_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_patient_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_patient_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_patient_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "cheque_number": {"name": "cheque_number", "description": "The cheque number for cheque payments.", "meta": {"masking": {"kind": "integer", "range": "10000000-99999999"}}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "10000000-99999999"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_patient_payments__cheque_number"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_patient_payments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoice_patient_payments_changed", "record_invoice_patient_payments_changelog", "set_invoice_patient_payments_updated_at", "set_invoice_patient_payments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_patient_payments_changed", "record_invoice_patient_payments_changelog", "set_invoice_patient_payments_updated_at", "set_invoice_patient_payments_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_patient_payments_changed", "record_invoice_patient_payments_changelog", "set_invoice_patient_payments_updated_at", "set_invoice_patient_payments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_patient_payments\"", "created_at": 1782422376.5032225, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_patient_payments"]}, "source.tamanu_source_dbt.tamanu.invoice_payments": {"database": "app", "schema": "public", "name": "invoice_payments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_payments.yml", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_payments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_payments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_payments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Individual payment against an invoice.\r\n\r\nInvoices can be paid in installments, by different parties, etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_payments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_id": {"name": "invoice_id", "description": "The [invoice](#!/source/source.tamanu.tamanu.invoices).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_payments__invoice_id"]}, "date": {"name": "date", "description": "Local date for the record in invoice_payments.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "receipt_number": {"name": "receipt_number", "description": "Receipt number. Usually auto-generated.", "meta": {"masking": {"kind": "integer", "range": "10000000-99999999"}}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "10000000-99999999"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_payments__receipt_number"]}, "amount": {"name": "amount", "description": "Amount paid.", "meta": {"masking": "money"}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {"masking": "money"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_payments__amount"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this invoice payment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_payments__updated_by_user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_payments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoice_payments_changed", "record_invoice_payments_changelog", "set_invoice_payments_updated_at", "set_invoice_payments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_payments_changed", "record_invoice_payments_changelog", "set_invoice_payments_updated_at", "set_invoice_payments_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_payments_changed", "record_invoice_payments_changelog", "set_invoice_payments_updated_at", "set_invoice_payments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_payments\"", "created_at": 1782422376.5175161, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_payments"]}, "source.tamanu_source_dbt.tamanu.invoice_price_lists": {"database": "app", "schema": "public", "name": "invoice_price_lists", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_price_lists.yml", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_price_lists", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_price_lists"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_price_lists", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Contains price list definitions used for invoice line item pricing. Each price list represents a set of pricing rules that can be applied to different types of invoices, patients, or services.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_price_lists.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_price_lists.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_price_lists.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_price_lists.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_price_lists.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "code": {"name": "code", "description": "Unique identifier code for the price list. Used for referencing the price list in business logic and integrations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__code"]}, "name": {"name": "name", "description": "Human-readable name of the price list, displayed in user interfaces and reports.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__name"]}, "rules": {"name": "rules", "description": "JSON configuration containing the pricing rules and logic for this price list. Defines how prices are calculated or retrieved for invoice line items.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__rules"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_price_lists.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_invoice_price_lists_changed", "record_invoice_price_lists_changelog", "set_invoice_price_lists_updated_at", "set_invoice_price_lists_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_price_lists_changed", "record_invoice_price_lists_changelog", "set_invoice_price_lists_updated_at", "set_invoice_price_lists_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_price_lists_changed", "record_invoice_price_lists_changelog", "set_invoice_price_lists_updated_at", "set_invoice_price_lists_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_price_lists\"", "created_at": 1782422376.5175161, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_price_lists"]}, "source.tamanu_source_dbt.tamanu.invoice_price_list_items": {"database": "app", "schema": "public", "name": "invoice_price_list_items", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_price_list_items.yml", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_price_list_items", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_price_list_items"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_price_list_items", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Contains individual pricing entries for specific products within a price list. Each record defines the price or pricing configuration for a particular product in the context of a specific price list.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_price_list_items.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_price_list_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_price_list_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_price_list_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_price_list_items.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "invoice_price_list_id": {"name": "invoice_price_list_id", "description": "Foreign key reference to the invoice_price_lists table. Links this pricing item to its parent price list.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__invoice_price_list_id"]}, "invoice_product_id": {"name": "invoice_product_id", "description": "Foreign key reference to the invoice products/services that can be priced. Identifies which product or service this pricing item applies to.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__invoice_product_id"]}, "price": {"name": "price", "description": "The price amount for this product in the context of this price list. Stored as a numeric value representing the cost in the system's base currency.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__price"]}, "is_hidden": {"name": "is_hidden", "description": "Determines whether the related invoice product should be hidden from searches on the frontend and also whether it should be automatically added to the invoice.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__is_hidden"]}}, "meta": {"triggers": ["notify_invoice_price_list_items_changed", "record_invoice_price_list_items_changelog", "set_invoice_price_list_items_updated_at", "set_invoice_price_list_items_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_price_list_items_changed", "record_invoice_price_list_items_changelog", "set_invoice_price_list_items_updated_at", "set_invoice_price_list_items_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_price_list_items_changed", "record_invoice_price_list_items_changelog", "set_invoice_price_list_items_updated_at", "set_invoice_price_list_items_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_price_list_items\"", "created_at": 1782422376.5317311, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_price_list_items"]}, "source.tamanu_source_dbt.tamanu.invoice_products": {"database": "app", "schema": "public", "name": "invoice_products", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_products.yml", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_products", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_products"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_products", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Products which can be invoiced.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Name of the product.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__name"]}, "insurable": {"name": "insurable", "description": "Whether or not discounts can be applied to a product", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__insurable"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_products.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_products.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_products.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_products.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "category": {"name": "category", "description": "The category of the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__category"]}, "source_record_type": {"name": "source_record_type", "description": "The underlying database model of the source record for the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__source_record_type"]}, "source_record_id": {"name": "source_record_id", "description": "The id of the source record for the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__source_record_id"]}}, "meta": {"triggers": ["notify_invoice_products_changed", "record_invoice_products_changelog", "set_invoice_products_updated_at", "set_invoice_products_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_products_changed", "record_invoice_products_changelog", "set_invoice_products_updated_at", "set_invoice_products_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_invoice_products_changed", "record_invoice_products_changelog", "set_invoice_products_updated_at", "set_invoice_products_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_products\"", "created_at": 1782422376.5387328, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_products"]}, "source.tamanu_source_dbt.tamanu.ips_requests": {"database": "app", "schema": "public", "name": "ips_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\ips_requests.yml", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.ips_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "ips_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "ips_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Queue of requests to generate [International Patient Summaries](https://international-patient-summary.net/) (IPS).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in ips_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in ips_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in ips_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in ips_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__patient_id"]}, "created_by": {"name": "created_by", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who created this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__created_by"]}, "status": {"name": "status", "description": "Processing status.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__status"]}, "email": {"name": "email", "description": "Email to send the generated IPS to.", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__email"]}, "error": {"name": "error", "description": "If processing fails, the error.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__error"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in ips_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_ips_requests_changed", "record_ips_requests_changelog", "set_ips_requests_updated_at", "set_ips_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_ips_requests_changed", "record_ips_requests_changelog", "set_ips_requests_updated_at", "set_ips_requests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_ips_requests_changed", "record_ips_requests_changelog", "set_ips_requests_updated_at", "set_ips_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"ips_requests\"", "created_at": 1782422376.5443003, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__ips_requests"]}, "source.tamanu_source_dbt.tamanu.lab_requests": {"database": "app", "schema": "public", "name": "lab_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_requests.yml", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Lab requests are the entrypoint of laboratory workflows in Tamanu.\r\n\r\nEach row is a request for a laboratory to perform a group of tests on a sample taken from a patient.\r\n\r\nIt will be updated over the course of the workflow to various statuses, starting with\r\n`reception_pending` (lab has not received the request yet), up to `published` (lab has completed the\r\ntests and has attached verified results).\r\n\r\nSee also: `lab_request_attachments`, `lab_request_logs`, `lab_results`, `lab_tests`,\r\n`lab_test_panels`, and related tables to those.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "sample_time": {"name": "sample_time", "description": "When the sample was collected.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time"]}, "requested_date": {"name": "requested_date", "description": "When the request was submitted.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "urgent": {"name": "urgent", "description": "Deprecated.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__urgent"]}, "specimen_attached": {"name": "specimen_attached", "description": "Whether a specimen is attached.\r\n\r\nThis implies `specimen_type_id`.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_attached"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "senaite_id": {"name": "senaite_id", "description": "When the [SENAITE](https://www.senaite.com/) integration is enabled, this is filled to the SENAITE\r\nID for the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__senaite_id"]}, "sample_id": {"name": "sample_id", "description": "When the [SENAITE](https://www.senaite.com/) integration is enabled, this is filled to the SENAITE\r\nID for the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_id"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) the request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__encounter_id"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ncategory of this request's test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_category_id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "lab_test_priority_id": {"name": "lab_test_priority_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_priority_id"]}, "lab_test_laboratory_id": {"name": "lab_test_laboratory_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id"]}, "sample_time_legacy": {"name": "sample_time_legacy", "description": "[Deprecated] When the sample was collected.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time_legacy"]}, "requested_date_legacy": {"name": "requested_date_legacy", "description": "[Deprecated] When the request was submitted.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__reason_for_cancellation"]}, "published_date": {"name": "published_date", "description": "When this lab request's results were published.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__published_date"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) the request comes from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__department_id"]}, "lab_test_panel_request_id": {"name": "lab_test_panel_request_id", "description": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id"]}, "lab_sample_site_id": {"name": "lab_sample_site_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing where\r\non the patient the sample was taken.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_sample_site_id"]}, "specimen_type_id": {"name": "specimen_type_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_type_id"]}, "collected_by_id": {"name": "collected_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__collected_by_id"]}, "results_interpretation": {"name": "results_interpretation", "description": "Free-text interpretation and clinical commentary on the laboratory test results.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__results_interpretation"]}}, "meta": {"triggers": ["notify_lab_requests_changed", "record_lab_requests_changelog", "set_lab_requests_updated_at", "set_lab_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_requests_changed", "record_lab_requests_changelog", "set_lab_requests_updated_at", "set_lab_requests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_requests_changed", "record_lab_requests_changelog", "set_lab_requests_updated_at", "set_lab_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_requests\"", "created_at": 1782422376.5973687, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_requests"]}, "source.tamanu_source_dbt.tamanu.lab_request_attachments": {"database": "app", "schema": "public", "name": "lab_request_attachments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_request_attachments.yml", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_request_attachments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_request_attachments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_request_attachments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Attachments (uploaded documents) to a lab request.\r\n\r\nThis could be forms for authorisation or consent, notes, instructions, etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_request_attachments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_request_attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_request_attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_request_attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "attachment_id": {"name": "attachment_id", "description": "The [attachment](#!/source/source.tamanu.tamanu.attachments) (obtained by uploading the file).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_attachments__attachment_id"]}, "lab_request_id": {"name": "lab_request_id", "description": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_attachments__lab_request_id"]}, "title": {"name": "title", "description": "Short name of the attachment.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_attachments__title"]}, "replaced_by_id": {"name": "replaced_by_id", "description": "Another lab request attachment which replaces this one.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_attachments__replaced_by_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_request_attachments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_request_attachments_changed", "record_lab_request_attachments_changelog", "set_lab_request_attachments_updated_at", "set_lab_request_attachments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_request_attachments_changed", "record_lab_request_attachments_changelog", "set_lab_request_attachments_updated_at", "set_lab_request_attachments_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_request_attachments_changed", "record_lab_request_attachments_changelog", "set_lab_request_attachments_updated_at", "set_lab_request_attachments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_request_attachments\"", "created_at": 1782422376.6092443, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_request_attachments"]}, "source.tamanu_source_dbt.tamanu.lab_request_logs": {"database": "app", "schema": "public", "name": "lab_request_logs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_request_logs.yml", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_request_logs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_request_logs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_request_logs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This is a log of who changed the status of a lab request when.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_request_logs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_request_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_request_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_request_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "status": {"name": "status", "description": "The status the lab request was updated to.", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__status"]}, "lab_request_id": {"name": "lab_request_id", "description": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__lab_request_id"]}, "updated_by_id": {"name": "updated_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this lab request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__updated_by_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_request_logs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_request_logs_changed", "record_lab_request_logs_changelog", "set_lab_request_logs_updated_at", "set_lab_request_logs_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_request_logs_changed", "record_lab_request_logs_changelog", "set_lab_request_logs_updated_at", "set_lab_request_logs_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_request_logs_changed", "record_lab_request_logs_changelog", "set_lab_request_logs_updated_at", "set_lab_request_logs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_request_logs\"", "created_at": 1782422376.6230674, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_request_logs"]}, "source.tamanu_source_dbt.tamanu.lab_tests": {"database": "app", "schema": "public", "name": "lab_tests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_tests.yml", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_tests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_tests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_tests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A single test as part of a [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_tests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_tests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_tests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_tests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in lab_tests.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "result": {"name": "result", "description": "The result of the test.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__result"]}, "lab_request_id": {"name": "lab_request_id", "description": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this test is part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_request_id"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_type_id"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__category_id"]}, "lab_test_method_id": {"name": "lab_test_method_id", "description": "Reference to the method ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_method_id"]}, "laboratory_officer": {"name": "laboratory_officer", "description": "Name of the lab officer performing the test.", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__laboratory_officer"]}, "completed_date": {"name": "completed_date", "description": "Datetime at which the test was completed.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}, "verification": {"name": "verification", "description": "Free-form field for a verification indication.\r\n\r\nMay be a verifying or supervising officer's name, a department, lab notes...", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__verification"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in lab_tests.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "completed_date_legacy": {"name": "completed_date_legacy", "description": "[Deprecated] Timestamp at which the test was completed.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_tests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_tests_changed", "record_lab_tests_changelog", "set_lab_tests_updated_at", "set_lab_tests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_tests_changed", "record_lab_tests_changelog", "set_lab_tests_updated_at", "set_lab_tests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_tests_changed", "record_lab_tests_changelog", "set_lab_tests_updated_at", "set_lab_tests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_tests\"", "created_at": 1782422376.6390924, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_tests"]}, "source.tamanu_source_dbt.tamanu.lab_test_panels": {"database": "app", "schema": "public", "name": "lab_test_panels", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_test_panels.yml", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panels", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_test_panels"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_test_panels", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A panel is a collection of lab test types, usually standardised.\r\n\r\nFor example the BMP (basic metabolic panel) is a panel of 8 blood tests. Instead of ordering all 8\r\ntests individually, a clinician can order the panel all at once. This may also used to more\r\nefficiently use samples.\r\n\r\nThis table defines the available test panels, and\r\n[`lab_test_panel_lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_panel_lab_test_types)\r\ncontains the actual test types that are part of each panel. See\r\n[`lab_test_panel_requests`](#!/source/source.tamanu.tamanu.lab_test_panel_requests) for requesting\r\npanels specifically, and [`lab_test_requests`](#!/source/source.tamanu.tamanu.lab_test_requests) for\r\nrequesting lab tests in general.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panels.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_test_panels.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_test_panels.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_test_panels.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "code": {"name": "code", "description": "Internal Tamanu code of the panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__code"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_panels.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "external_code": {"name": "external_code", "description": "External code, such as for interfacing with LIMS.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__external_code"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__category_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_test_panels.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_test_panels_changed", "record_lab_test_panels_changelog", "set_lab_test_panels_updated_at", "set_lab_test_panels_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_test_panels_changed", "record_lab_test_panels_changelog", "set_lab_test_panels_updated_at", "set_lab_test_panels_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_lab_test_panels_changed", "record_lab_test_panels_changelog", "set_lab_test_panels_updated_at", "set_lab_test_panels_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_test_panels\"", "created_at": 1782422376.6390924, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panels"]}, "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types": {"database": "app", "schema": "public", "name": "lab_test_panel_lab_test_types", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_test_panel_lab_test_types.yml", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_test_panel_lab_test_types"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_test_panel_lab_test_types", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "The lab tests contained in a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about lab test\r\npanels, and [`lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_types) for the test types.", "columns": {"created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_panel_id"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [test type](#!/source/source.tamanu.tamanu.lab_test_types).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_type_id"]}, "order": {"name": "order", "description": "The position of this test within the panel, used to control the display\r\nand processing order of lab tests in a lab test panel. Lower values are\r\nshown and processed before higher values.", "meta": {}, "data_type": "integer", "constraints": [], "quote": true, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__order"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_test_panel_lab_test_types_changed", "record_lab_test_panel_lab_test_types_changelog", "set_lab_test_panel_lab_test_types_updated_at", "set_lab_test_panel_lab_test_types_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_test_panel_lab_test_types_changed", "record_lab_test_panel_lab_test_types_changelog", "set_lab_test_panel_lab_test_types_updated_at", "set_lab_test_panel_lab_test_types_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_lab_test_panel_lab_test_types_changed", "record_lab_test_panel_lab_test_types_changelog", "set_lab_test_panel_lab_test_types_updated_at", "set_lab_test_panel_lab_test_types_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_test_panel_lab_test_types\"", "created_at": 1782422376.654786, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panel_lab_test_types"]}, "source.tamanu_source_dbt.tamanu.lab_test_panel_requests": {"database": "app", "schema": "public", "name": "lab_test_panel_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_test_panel_requests.yml", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panel_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_test_panel_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_test_panel_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A request for a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about those.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panel_requests.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_test_panel_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_test_panel_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_test_panel_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_requests__lab_test_panel_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this lab test panel request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_requests__encounter_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_test_panel_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_test_panel_requests_changed", "record_lab_test_panel_requests_changelog", "set_lab_test_panel_requests_updated_at", "set_lab_test_panel_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_test_panel_requests_changed", "record_lab_test_panel_requests_changelog", "set_lab_test_panel_requests_updated_at", "set_lab_test_panel_requests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_test_panel_requests_changed", "record_lab_test_panel_requests_changelog", "set_lab_test_panel_requests_updated_at", "set_lab_test_panel_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_test_panel_requests\"", "created_at": 1782422376.676835, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panel_requests"]}, "source.tamanu_source_dbt.tamanu.lab_test_types": {"database": "app", "schema": "public", "name": "lab_test_types", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_test_types.yml", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_types", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_test_types"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_test_types", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A kind of test that's possible to request.\r\n\r\nThis includes information about the test itself, and also parameters around result formatting, like\r\ndata type, expected ranges, etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_types.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Internal Tamanu code of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__code"]}, "name": {"name": "name", "description": "Human-friendly name of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__name"]}, "unit": {"name": "unit", "description": "Unit the test result is measured in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__unit"]}, "male_min": {"name": "male_min", "description": "Minimum typical range for males.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__male_min"]}, "male_max": {"name": "male_max", "description": "Maximum typical range for males.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__male_max"]}, "female_min": {"name": "female_min", "description": "Minimum typical range for females.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__female_min"]}, "female_max": {"name": "female_max", "description": "Maximum typical range for females.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__female_max"]}, "range_text": {"name": "range_text", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__range_text"]}, "result_type": {"name": "result_type", "description": "Input type of result.\r\n\r\nOne of:\r\n- `FreeText`\r\n- `Number`\r\n- `Select`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__result_type"]}, "options": {"name": "options", "description": "Comma-separated list of options. Unused.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__options"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__lab_test_category_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_types.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_test_types.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "external_code": {"name": "external_code", "description": "External code for the test (such as for LIMS).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__external_code"]}, "is_sensitive": {"name": "is_sensitive", "description": "Used to indicate if the lab test type is sensitive and should be hidden accordingly.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__is_sensitive"]}}, "meta": {"triggers": ["notify_lab_test_types_changed", "record_lab_test_types_changelog", "set_lab_test_types_updated_at", "set_lab_test_types_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_test_types_changed", "record_lab_test_types_changelog", "set_lab_test_types_updated_at", "set_lab_test_types_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_lab_test_types_changed", "record_lab_test_types_changelog", "set_lab_test_types_updated_at", "set_lab_test_types_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_test_types\"", "created_at": 1782422376.69062, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_types"]}, "source.tamanu_source_dbt.tamanu.local_system_facts": {"database": "app", "schema": "public", "name": "local_system_facts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\local_system_facts.yml", "original_file_path": "models\\sources\\local_system_facts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.local_system_facts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "local_system_facts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "local_system_facts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A set of values that are proper to this installation of Tamanu.\r\n\r\nThese are never synchronised.\r\nUsage is entirely internal to Tamanu and should never be used externally.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in local_system_facts.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in local_system_facts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in local_system_facts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in local_system_facts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "key": {"name": "key", "description": "Key of the fact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.local_system_facts__key"]}, "value": {"name": "value", "description": "Value of the fact.\r\n\r\nThis is `text`, but may be interpreted as other things, e.g. JSON objects or numbers.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.local_system_facts__value"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"local_system_facts\"", "created_at": 1782422376.694631, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__local_system_facts"]}, "source.tamanu_source_dbt.tamanu.locations": {"database": "app", "schema": "public", "name": "locations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\locations.yml", "original_file_path": "models\\sources\\locations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.locations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "locations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "locations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information on the hospital locations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in locations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in locations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in locations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in locations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code for location", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__code"]}, "name": {"name": "name", "description": "Full readable name for location", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__name"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in locations.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "max_occupancy": {"name": "max_occupancy", "description": "The maximum number of patients that can be in this location", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__max_occupancy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in locations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_locations_changed", "record_locations_changelog", "set_locations_updated_at", "set_locations_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_locations_changed", "record_locations_changelog", "set_locations_updated_at", "set_locations_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_locations_changed", "record_locations_changelog", "set_locations_updated_at", "set_locations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"locations\"", "created_at": 1782422376.7074163, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__locations"]}, "source.tamanu_source_dbt.tamanu.location_assignments": {"database": "app", "schema": "public", "name": "location_assignments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\location_assignments.yml", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.location_assignments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "location_assignments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "location_assignments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Individual location assignment records representing specific time periods when healthcare staff are scheduled to work at particular locations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in location_assignments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) assigned to this location.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__user_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) where the user is assigned.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__location_id"]}, "date": {"name": "date", "description": "Local date for the record in location_assignments.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "start_time": {"name": "start_time", "description": "Start time of the assignment period.", "meta": {}, "data_type": "time without time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__start_time"]}, "end_time": {"name": "end_time", "description": "End time of the assignment period.", "meta": {}, "data_type": "time without time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__end_time"]}, "template_id": {"name": "template_id", "description": "Reference to the [location assignment template](#!/source/source.tamanu.tamanu.location_assignment_templates) that generated this assignment.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__template_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in location_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in location_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in location_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in location_assignments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_location_assignments_changed", "record_location_assignments_changelog", "set_location_assignments_updated_at", "set_location_assignments_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_location_assignments_changed", "record_location_assignments_changelog", "set_location_assignments_updated_at", "set_location_assignments_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_location_assignments_changed", "record_location_assignments_changelog", "set_location_assignments_updated_at", "set_location_assignments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"location_assignments\"", "created_at": 1782422376.715439, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__location_assignments"]}, "source.tamanu_source_dbt.tamanu.location_assignment_templates": {"database": "app", "schema": "public", "name": "location_assignment_templates", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\location_assignment_templates.yml", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "source.tamanu_source_dbt.tamanu.location_assignment_templates", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "location_assignment_templates"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "location_assignment_templates", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Templates for recurring location assignments that define when healthcare staff are scheduled to work at specific locations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in location_assignment_templates.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) assigned to this location.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__user_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) where the user is assigned.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__location_id"]}, "date": {"name": "date", "description": "Local date for the record in location_assignment_templates.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "start_time": {"name": "start_time", "description": "Start time of the daily assignment period.", "meta": {}, "data_type": "time without time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__start_time"]}, "end_time": {"name": "end_time", "description": "End time of the daily assignment period.", "meta": {}, "data_type": "time without time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__end_time"]}, "repeat_end_date": {"name": "repeat_end_date", "description": "Date when the repeating assignments should stop being generated.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__repeat_end_date"]}, "repeat_frequency": {"name": "repeat_frequency", "description": "Number of frequency units between each assignment (e.g., every 2 weeks).", "meta": {}, "data_type": "smallint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__repeat_frequency"]}, "repeat_unit": {"name": "repeat_unit", "description": "Frequency unit for repeating assignments.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__repeat_unit"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in location_assignment_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in location_assignment_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in location_assignment_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in location_assignment_templates.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_location_assignment_templates_changed", "record_location_assignment_templates_changelog", "set_location_assignment_templates_updated_at", "set_location_assignment_templates_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_location_assignment_templates_changed", "record_location_assignment_templates_changelog", "set_location_assignment_templates_updated_at", "set_location_assignment_templates_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_location_assignment_templates_changed", "record_location_assignment_templates_changelog", "set_location_assignment_templates_updated_at", "set_location_assignment_templates_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"location_assignment_templates\"", "created_at": 1782422376.728481, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__location_assignment_templates"]}, "source.tamanu_source_dbt.tamanu.location_groups": {"database": "app", "schema": "public", "name": "location_groups", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\location_groups.yml", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "source.tamanu_source_dbt.tamanu.location_groups", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "location_groups"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "location_groups", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A group of locations managed as a single unit (e.g. a ward in hospital)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in location_groups.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in location_groups.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in location_groups.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in location_groups.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in location_groups.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "name": {"name": "name", "description": "Full readable name for location group", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "code": {"name": "code", "description": "Code for location group", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__code"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location group is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__facility_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in location_groups.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_bookable": {"name": "is_bookable", "description": "Controls whether and where this location group appears in the booking calendar: \r\n- `all`: shown on both views \r\n- `weekly`: shown only on weekly view\r\n- `daily`: shown only on daily view\r\n- `no`: hidden from calendar (default)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__is_bookable"]}}, "meta": {"triggers": ["notify_location_groups_changed", "record_location_groups_changelog", "set_location_groups_updated_at", "set_location_groups_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_location_groups_changed", "record_location_groups_changelog", "set_location_groups_updated_at", "set_location_groups_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_location_groups_changed", "record_location_groups_changelog", "set_location_groups_updated_at", "set_location_groups_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"location_groups\"", "created_at": 1782422376.7342398, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__location_groups"]}, "source.tamanu_source_dbt.tamanu.medication_administration_records": {"database": "app", "schema": "public", "name": "medication_administration_records", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\medication_administration_records.yml", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "source.tamanu_source_dbt.tamanu.medication_administration_records", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "medication_administration_records"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "medication_administration_records", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records of medication administrations to patients, tracking when medications prescribed in the system were given, not given, or otherwise administered.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_administration_records.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "status": {"name": "status", "description": "Status of the medication administration.\r\n\r\nOne of:\r\n- `GIVEN` - The medication was administered to the patient\r\n- `NOT_GIVEN` - The medication was not administered to the patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__status"]}, "due_at": {"name": "due_at", "description": "The scheduled date and time when the medication administration was planned to occur, based on the prescription's frequency and start date.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__due_at"]}, "recorded_at": {"name": "recorded_at", "description": "The timestamp indicating when the administration status (e.g., `GIVEN` or `NOT_GIVEN`) was actually recorded in the system. May be null if the status has not yet been recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__recorded_at"]}, "recorded_by_user_id": {"name": "recorded_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) who recorded that the medication was given or not given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__recorded_by_user_id"]}, "prescription_id": {"name": "prescription_id", "description": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions) that this administration record is associated with. Links this administration event to the specific medication order it fulfills.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__prescription_id"]}, "is_auto_generated": {"name": "is_auto_generated", "description": "Indicates whether this administration record was automatically generated by the system based on the prescription's frequency and schedule. This is typically true for scheduled medications and false for one-time or as-needed medications.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__is_auto_generated"]}, "changing_status_reason": {"name": "changing_status_reason", "description": "Optional free text field that allows healthcare professionals to document the reason for changing the status of a medication administration record. This is particularly useful when changing a previously recorded status to a different one.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__changing_status_reason"]}, "reason_not_given_id": {"name": "reason_not_given_id", "description": "Reference to the reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why the medication was not administered to the patient. Only applicable when status is `NOT_GIVEN`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__reason_not_given_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in medication_administration_records.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in medication_administration_records.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in medication_administration_records.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in medication_administration_records.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_error": {"name": "is_error", "description": "Indicates whether this medication administration record is marked as error.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__is_error"]}, "error_notes": {"name": "error_notes", "description": "Detailed description of any errors or discrepancies associated with this medication administration record.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__error_notes"]}, "changing_not_given_info_reason": {"name": "changing_not_given_info_reason", "description": "Optional free text field that allows healthcare professionals to document the reason for modifying information about why a medication was not given. This is used when updating or changing the details of a previously recorded 'not given' status, providing an audit trail of why the information was changed.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__changing_not_given_info_reason"]}, "is_edited": {"name": "is_edited", "description": "Indicates whether this medication administration record has been manually edited after its initial creation or recording.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__is_edited"]}}, "meta": {"triggers": ["notify_medication_administration_records_changed", "record_medication_administration_records_changelog", "set_medication_administration_records_updated_at", "set_medication_administration_records_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_medication_administration_records_changed", "record_medication_administration_records_changelog", "set_medication_administration_records_updated_at", "set_medication_administration_records_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_medication_administration_records_changed", "record_medication_administration_records_changelog", "set_medication_administration_records_updated_at", "set_medication_administration_records_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"medication_administration_records\"", "created_at": 1782422376.7502122, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__medication_administration_records"]}, "source.tamanu_source_dbt.tamanu.medication_administration_record_doses": {"database": "app", "schema": "public", "name": "medication_administration_record_doses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\medication_administration_record_doses.yml", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.medication_administration_record_doses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "medication_administration_record_doses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "medication_administration_record_doses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Stores details about individual doses given as part of a medication administration record. A single administration event may involve multiple distinct doses (e.g., taking two tablets).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_administration_record_doses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "dose_amount": {"name": "dose_amount", "description": "The amount or quantity of the medication administered in this specific dose entry.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__dose_amount"]}, "given_time": {"name": "given_time", "description": "The precise date and time when this specific dose was administered to the patient. This may differ slightly from the overall `administered_at` time in the parent record if multiple doses were given sequentially.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__given_time"]}, "given_by_user_id": {"name": "given_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) who physically administered this dose to the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__given_by_user_id"]}, "recorded_by_user_id": {"name": "recorded_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) who recorded the details of this specific dose administration in the system. This may or may not be the same user who physically administered the dose (`given_by_user_id`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__recorded_by_user_id"]}, "mar_id": {"name": "mar_id", "description": "Reference to the MAR [medication administration record](#!/model/model.public.medication_administration_records) to which this dose belongs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__mar_id"]}, "is_removed": {"name": "is_removed", "description": "Indicates whether this dose record has been removed or voided.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__is_removed"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in medication_administration_record_doses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in medication_administration_record_doses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in medication_administration_record_doses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in medication_administration_record_doses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reason_for_removal": {"name": "reason_for_removal", "description": "A text field explaining why this dose record was removed or voided.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_removal"]}, "dose_index": {"name": "dose_index", "description": "A sequential number indicating the order of this dose within a multi-dose administration. Helps track the sequence when multiple doses are given in a single administration event.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__dose_index"]}, "reason_for_change": {"name": "reason_for_change", "description": "A text field documenting the reason for any modifications made to this dose record after it was initially recorded. This helps maintain an audit trail of changes and ensures proper documentation of why dose details were updated.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_change"]}}, "meta": {"triggers": ["notify_medication_administration_record_doses_changed", "record_medication_administration_record_doses_changelog", "set_medication_administration_record_doses_updated_at", "set_medication_administration_record_doses_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_medication_administration_record_doses_changed", "record_medication_administration_record_doses_changelog", "set_medication_administration_record_doses_updated_at", "set_medication_administration_record_doses_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_medication_administration_record_doses_changed", "record_medication_administration_record_doses_changelog", "set_medication_administration_record_doses_updated_at", "set_medication_administration_record_doses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"medication_administration_record_doses\"", "created_at": 1782422376.7502122, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__medication_administration_record_doses"]}, "source.tamanu_source_dbt.tamanu.medication_dispenses": {"database": "app", "schema": "public", "name": "medication_dispenses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\medication_dispenses.yml", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.medication_dispenses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "medication_dispenses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "medication_dispenses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records of medication dispensing events, tracking when medications from pharmacy orders are physically dispensed to patients. Each record represents a single dispensing event for a specific prescription within a pharmacy order.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_dispenses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "pharmacy_order_prescription_id": {"name": "pharmacy_order_prescription_id", "description": "Reference to the [pharmacy_order_prescription](#!/source/source.tamanu.tamanu.pharmacy_order_prescriptions) that this dispense record fulfills. Links this dispensing event to the specific medication order being filled.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__pharmacy_order_prescription_id"]}, "quantity": {"name": "quantity", "description": "The quantity of medication units dispensed to the patient in each dispensing.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__quantity"]}, "instructions": {"name": "instructions", "description": "Additional instructions provided to the patient when dispensing the medication, such as dosage guidance, timing, storage requirements, or special considerations for administration.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__instructions"]}, "dispensed_by_user_id": {"name": "dispensed_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) (typically a pharmacist or pharmacy staff member) who dispensed the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_by_user_id"]}, "dispensed_at": {"name": "dispensed_at", "description": "The timestamp indicating when the medication was physically dispensed to the patient.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in medication_dispenses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in medication_dispenses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in medication_dispenses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in medication_dispenses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_medication_dispenses_changed", "record_medication_dispenses_changelog", "set_medication_dispenses_updated_at", "set_medication_dispenses_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_medication_dispenses_changed", "record_medication_dispenses_changelog", "set_medication_dispenses_updated_at", "set_medication_dispenses_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_medication_dispenses_changed", "record_medication_dispenses_changelog", "set_medication_dispenses_updated_at", "set_medication_dispenses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"medication_dispenses\"", "created_at": 1782422376.7707994, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__medication_dispenses"]}, "source.tamanu_source_dbt.tamanu.notes": {"database": "app", "schema": "public", "name": "notes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\notes.yml", "original_file_path": "models\\sources\\notes.yml", "unique_id": "source.tamanu_source_dbt.tamanu.notes", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "notes"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "notes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Notes recorded by clinicians or system generated.\r\n\r\nAlso see the deprecated [`note_items`](#!/source/source.tamanu.tamanu.note_items),\r\n[`note_pages`](#!/source/source.tamanu.tamanu.note_pages), and the even older\r\n[`notes_legacy`](#!/source/source.tamanu.tamanu.notes_legacy).\r\n\r\nThis is the current version (3) of the notes system.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in notes.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in notes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in notes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in notes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "record_id": {"name": "record_id", "description": "Polymorphic relationship to the record to which the note is attached (id).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__record_id"]}, "record_type": {"name": "record_type", "description": "Polymorphic relationship to the record to which the note is attached (type).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__record_type"]}, "date": {"name": "date", "description": "Local date for the record in notes.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in notes.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in notes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in notes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "author_id": {"name": "author_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__author_id"]}, "on_behalf_of_id": {"name": "on_behalf_of_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note, if it wasn't the user who published it.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__on_behalf_of_id"]}, "content": {"name": "content", "description": "The content of the note recorded.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__content"]}, "revised_by_id": {"name": "revised_by_id", "description": "Reference to the [note](#!/source/source.tamanu.tamanu.notes) that is being revised.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__revised_by_id"]}, "note_type_id": {"name": "note_type_id", "description": "Reference to the note type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = noteType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__note_type_id"]}}, "meta": {"triggers": ["notify_notes_changed", "record_notes_changelog", "set_notes_updated_at", "set_notes_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_notes_changed", "record_notes_changelog", "set_notes_updated_at", "set_notes_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_notes_changed", "record_notes_changelog", "set_notes_updated_at", "set_notes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"notes\"", "created_at": 1782422376.792566, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__notes"]}, "source.tamanu_source_dbt.tamanu.notes_legacy": {"database": "app", "schema": "public", "name": "notes_legacy", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\notes_legacy.yml", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "source.tamanu_source_dbt.tamanu.notes_legacy", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "notes_legacy"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "notes_legacy", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Legacy notes", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in notes_legacy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in notes_legacy.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in notes_legacy.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in notes_legacy.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "record_id": {"name": "record_id", "description": "Legacy notes record_id", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__record_id"]}, "record_type": {"name": "record_type", "description": "Legacy notes record_type", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__record_type"]}, "date": {"name": "date", "description": "Local date for the record in notes_legacy.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "note_type": {"name": "note_type", "description": "Legacy notes note_type", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__note_type"]}, "content": {"name": "content", "description": "Legacy notes content", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__content"]}, "author_id": {"name": "author_id", "description": "Legacy notes author_id", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__author_id"]}, "on_behalf_of_id": {"name": "on_behalf_of_id", "description": "Legacy notes on_behalf_of_id", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__on_behalf_of_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in notes_legacy.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_notes_legacy_changed", "record_notes_legacy_changelog", "set_notes_legacy_updated_at", "set_notes_legacy_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_notes_legacy_changed", "record_notes_legacy_changelog", "set_notes_legacy_updated_at", "set_notes_legacy_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_notes_legacy_changed", "record_notes_legacy_changelog", "set_notes_legacy_updated_at", "set_notes_legacy_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"notes_legacy\"", "created_at": 1782422376.8005908, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__notes_legacy"]}, "source.tamanu_source_dbt.tamanu.note_items": {"database": "app", "schema": "public", "name": "note_items", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\note_items.yml", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "source.tamanu_source_dbt.tamanu.note_items", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "note_items"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "note_items", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Version 2 of note management.\r\n\r\nIn this version, notes were split between note pages and actual note (item) content.\r\n\r\nDeprecated.\r\n\r\nSee also [`note_pages`](#!/source/source.tamanu.tamanu.note_pages).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in note_items.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in note_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in note_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in note_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note_page_id": {"name": "note_page_id", "description": "The [note page](#!/source/source.tamanu.tamanu.note_pages) this item belongs to.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__note_page_id"]}, "revised_by_id": {"name": "revised_by_id", "description": "Reference to the [note_item](#!/source/source.tamanu.tamanu.note_items) that is revised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__revised_by_id"]}, "author_id": {"name": "author_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note item.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__author_id"]}, "on_behalf_of_id": {"name": "on_behalf_of_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note item, if different from `author_id`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__on_behalf_of_id"]}, "content": {"name": "content", "description": "Text content of the note.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__content"]}, "date": {"name": "date", "description": "Local date for the record in note_items.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in note_items.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in note_items.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_note_items_changed", "record_note_items_changelog", "set_note_items_updated_at", "set_note_items_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical", "deprecated"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_note_items_changed", "record_note_items_changelog", "set_note_items_updated_at", "set_note_items_updated_at_sync_tick"]}, "tags": ["clinical", "deprecated"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical", "deprecated"], "meta": {"triggers": ["notify_note_items_changed", "record_note_items_changelog", "set_note_items_updated_at", "set_note_items_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"note_items\"", "created_at": 1782422376.81327, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__note_items"]}, "source.tamanu_source_dbt.tamanu.note_pages": {"database": "app", "schema": "public", "name": "note_pages", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\note_pages.yml", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "source.tamanu_source_dbt.tamanu.note_pages", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "note_pages"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "note_pages", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Version 2 of note management.\r\n\r\nIn this version, notes were split between note pages and actual note (item) content.\r\n\r\nDeprecated.\r\n\r\nSee also [`note_items`](#!/source/source.tamanu.tamanu.note_items).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in note_pages.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in note_pages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in note_pages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in note_pages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note_type": {"name": "note_type", "description": "Type of the note page.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_pages__note_type"]}, "record_id": {"name": "record_id", "description": "Polymorphic relationship to the record to which the note is attached (id).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_pages__record_id"]}, "record_type": {"name": "record_type", "description": "Polymorphic relationship to the record to which the note is attached (type).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_pages__record_type"]}, "date": {"name": "date", "description": "Local date for the record in note_pages.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in note_pages.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in note_pages.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in note_pages.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_note_pages_changed", "record_note_pages_changelog", "set_note_pages_updated_at", "set_note_pages_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical", "deprecated"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_note_pages_changed", "record_note_pages_changelog", "set_note_pages_updated_at", "set_note_pages_updated_at_sync_tick"]}, "tags": ["clinical", "deprecated"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical", "deprecated"], "meta": {"triggers": ["notify_note_pages_changed", "record_note_pages_changelog", "set_note_pages_updated_at", "set_note_pages_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"note_pages\"", "created_at": 1782422376.81327, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__note_pages"]}, "source.tamanu_source_dbt.tamanu.notifications": {"database": "app", "schema": "public", "name": "notifications", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\notifications.yml", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "source.tamanu_source_dbt.tamanu.notifications", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "notifications"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "notifications", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Notifications for the clinician dashboard", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in notifications.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "type": {"name": "type", "description": "Type of the notification\r\n\r\nOne of:\r\n- `imaging_request`\r\n- `lab_request`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__type"]}, "status": {"name": "status", "description": "Status of the notification\r\n\r\nOne of:\r\n- `unread`\r\n- `read`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__status"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) that get the notification.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__user_id"]}, "patient_id": {"name": "patient_id", "description": "Related patient of the notification", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__patient_id"]}, "created_time": {"name": "created_time", "description": "When the notification was created", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__created_time"]}, "metadata": {"name": "metadata", "description": "Metadata of the notification", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__metadata"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in notifications.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_notifications_changed", "record_notifications_changelog", "set_notifications_updated_at", "set_notifications_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_notifications_changed", "record_notifications_changelog", "set_notifications_updated_at", "set_notifications_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_notifications_changed", "record_notifications_changelog", "set_notifications_updated_at", "set_notifications_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"notifications\"", "created_at": 1782422376.8290474, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__notifications"]}, "source.tamanu_source_dbt.tamanu.one_time_logins": {"database": "app", "schema": "public", "name": "one_time_logins", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\one_time_logins.yml", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "source.tamanu_source_dbt.tamanu.one_time_logins", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "one_time_logins"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "one_time_logins", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "One time logins are used for password resets.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in one_time_logins.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) for whom this one time login is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.one_time_logins__user_id"]}, "token": {"name": "token", "description": "A random value to use as the login code.\r\n\r\nThis is sent to the user in an email and then entered in a form to reset their password.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.one_time_logins__token"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in one_time_logins.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in one_time_logins.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in one_time_logins.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "expires_at": {"name": "expires_at", "description": "Beyond this time, the one time login can no longer be used.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.one_time_logins__expires_at"]}, "used_at": {"name": "used_at", "description": "When this token was used.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.one_time_logins__used_at"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"one_time_logins\"", "created_at": 1782422376.8290474, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__one_time_logins"]}, "source.tamanu_source_dbt.tamanu.patients": {"database": "app", "schema": "public", "name": "patients", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patients.yml", "original_file_path": "models\\sources\\patients.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patients", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patients"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patients", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "email": {"name": "email", "description": "Email address of patient", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__email"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "user-defined", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "additional_details": {"name": "additional_details", "description": "[Deprecated] Additional details of the patient", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__additional_details"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "merged_into_id": {"name": "merged_into_id", "description": "Tamanu identifier for the patient the patient record was merged into", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__merged_into_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "date_of_death_legacy": {"name": "date_of_death_legacy", "description": "[Deprecated] Timestamp of death of patient", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death_legacy"]}, "date_of_birth_legacy": {"name": "date_of_birth_legacy", "description": "[Deprecated] Timestamp of birth of patient", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patients.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patients_changed", "record_patients_changelog", "set_patients_updated_at", "set_patients_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patients_changed", "record_patients_changelog", "set_patients_updated_at", "set_patients_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"triggers": ["notify_patients_changed", "record_patients_changelog", "set_patients_updated_at", "set_patients_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patients\"", "created_at": 1782422376.8528032, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patients"]}, "source.tamanu_source_dbt.tamanu.patient_additional_data": {"database": "app", "schema": "public", "name": "patient_additional_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_additional_data.yml", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_additional_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_additional_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_additional_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Core or adjunct patient data that doesn't fit elsewhere, but is only downloaded to a facility once a\r\npatient is marked for sync.\r\n\r\nThis is often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`, `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and specify custom/non-standard data to be stored against patients.", "columns": {"created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_additional_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_additional_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_additional_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "place_of_birth": {"name": "place_of_birth", "description": "Free-form place of birth (typically a place name or country).", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__place_of_birth"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {"masking": "phone"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "phone"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {"masking": "phone"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "phone"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "marital_status": {"name": "marital_status", "description": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__marital_status"]}, "city_town": {"name": "city_town", "description": "Patient current address city or town.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__city_town"]}, "street_village": {"name": "street_village", "description": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__street_village"]}, "educational_level": {"name": "educational_level", "description": "Highest educational attainment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__educational_level"]}, "social_media": {"name": "social_media", "description": "Free-form social media contact.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__social_media"]}, "blood_type": {"name": "blood_type", "description": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__blood_type"]}, "title": {"name": "title", "description": "Patient name: title.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__title"]}, "ethnicity_id": {"name": "ethnicity_id", "description": "Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__ethnicity_id"]}, "nationality_id": {"name": "nationality_id", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "country_id": {"name": "country_id", "description": "Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_id"]}, "division_id": {"name": "division_id", "description": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__division_id"]}, "subdivision_id": {"name": "subdivision_id", "description": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__subdivision_id"]}, "medical_area_id": {"name": "medical_area_id", "description": "Reference to patient administrative medical area of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__medical_area_id"]}, "nursing_zone_id": {"name": "nursing_zone_id", "description": "Reference to patient administrative nursing zone of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id"]}, "settlement_id": {"name": "settlement_id", "description": "Reference to patient residence settlement ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__settlement_id"]}, "occupation_id": {"name": "occupation_id", "description": "Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__occupation_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_additional_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_id"]}, "birth_certificate": {"name": "birth_certificate", "description": "Birth certificate identifier.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__birth_certificate"]}, "driving_license": {"name": "driving_license", "description": "Driving licence identifier.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__driving_license"]}, "passport": {"name": "passport", "description": "Passport number.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__passport"]}, "religion_id": {"name": "religion_id", "description": "Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__religion_id"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "country_of_birth_id": {"name": "country_of_birth_id", "description": "Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who registered the patient in Tamanu.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__registered_by_id"]}, "emergency_contact_name": {"name": "emergency_contact_name", "description": "Name of emergency contact.", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name"]}, "emergency_contact_number": {"name": "emergency_contact_number", "description": "Phone number of emergency contact.", "meta": {"masking": "phone"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "phone"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number"]}, "mother_id": {"name": "mother_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father_id": {"name": "father_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_additional_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "updated_at_by_field": {"name": "updated_at_by_field", "description": "JSON object recording the updated datetime for individual columns.\r\n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields are edited separately in\r\ndifferent facilities. The default sync strategy is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict, but this can lead to discarding important data in the case of PADs. This field\r\nis used to implement per-field \"last edit wins\" instead.", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_additional_data.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "health_center_id": {"name": "health_center_id", "description": "Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__health_center_id"]}, "secondary_village_id": {"name": "secondary_village_id", "description": "Reference to patient administrative village of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\nSee also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_village_id"]}, "insurer_id": {"name": "insurer_id", "description": "Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_id"]}, "insurer_policy_number": {"name": "insurer_policy_number", "description": "Policy number of patient insurance.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number"]}}, "meta": {"triggers": ["notify_patient_additional_data_changed", "record_patient_additional_data_changelog", "set_patient_additional_data_updated_at", "set_patient_additional_data_updated_at_by_field", "set_patient_additional_data_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_additional_data_changed", "record_patient_additional_data_changelog", "set_patient_additional_data_updated_at", "set_patient_additional_data_updated_at_by_field", "set_patient_additional_data_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"triggers": ["notify_patient_additional_data_changed", "record_patient_additional_data_changelog", "set_patient_additional_data_updated_at", "set_patient_additional_data_updated_at_by_field", "set_patient_additional_data_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_additional_data\"", "created_at": 1782422376.864582, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_additional_data"]}, "source.tamanu_source_dbt.tamanu.patient_allergies": {"database": "app", "schema": "public", "name": "patient_allergies", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_allergies.yml", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_allergies", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_allergies"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_allergies", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of allergies known of the patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Allergies\".\r\n\r\nSee also: `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`, `public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_allergies.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_allergies.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_allergies.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_allergies.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form description of this allergy.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__note"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this allergy was recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__recorded_date"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__patient_id"]}, "practitioner_id": {"name": "practitioner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this allergy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__practitioner_id"]}, "allergy_id": {"name": "allergy_id", "description": "Reference to an allergy ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__allergy_id"]}, "recorded_date_legacy": {"name": "recorded_date_legacy", "description": "[Deprecated] Timestamp at which this allergy was recorded.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__recorded_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_allergies.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reaction_id": {"name": "reaction_id", "description": "Reference to an allergic reaction ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__reaction_id"]}}, "meta": {"triggers": ["notify_patient_allergies_changed", "record_patient_allergies_changelog", "set_patient_allergies_updated_at", "set_patient_allergies_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_allergies_changed", "record_patient_allergies_changelog", "set_patient_allergies_updated_at", "set_patient_allergies_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_allergies_changed", "record_patient_allergies_changelog", "set_patient_allergies_updated_at", "set_patient_allergies_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_allergies\"", "created_at": 1782422376.8685944, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_allergies"]}, "source.tamanu_source_dbt.tamanu.patient_birth_data": {"database": "app", "schema": "public", "name": "patient_birth_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_birth_data.yml", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_birth_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_birth_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_birth_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information about the birth of the patient, if their birth was recorded into Tamanu.\r\n\r\nThis is specifically data about the newborn, and only the birth-relevant data.\r\nOther patient data is found in the normal tables i.e. `patients`, `patient_additional_data`, etc.", "columns": {"created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_birth_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_birth_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_birth_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_birth_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__patient_id"]}, "birth_weight": {"name": "birth_weight", "description": "Weight in kg at birth.", "meta": {"masking": {"kind": "float", "range": "2-10"}}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "2-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_weight"]}, "birth_length": {"name": "birth_length", "description": "Length in cm at birth.", "meta": {"masking": {"kind": "float", "range": "10-100"}}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "10-100"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_length"]}, "birth_delivery_type": {"name": "birth_delivery_type", "description": "Type of delivery.\r\n\r\nOne of:\r\n- `normal_vaginal_delivery`\r\n- `breech`\r\n- `emergency_c_section`\r\n- `elective_c_section`\r\n- `vacuum_extraction`\r\n- `forceps`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type"]}, "gestational_age_estimate": {"name": "gestational_age_estimate", "description": "Gestational age estimate (weeks).", "meta": {"masking": {"kind": "float", "range": "30-40"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "30-40"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate"]}, "apgar_score_one_minute": {"name": "apgar_score_one_minute", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) one minute after birth.", "meta": {"masking": {"kind": "integer", "range": "0-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute"]}, "apgar_score_five_minutes": {"name": "apgar_score_five_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) five minutes after birth.", "meta": {"masking": {"kind": "integer", "range": "0-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes"]}, "apgar_score_ten_minutes": {"name": "apgar_score_ten_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) ten minutes after birth.", "meta": {"masking": {"kind": "integer", "range": "0-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes"]}, "time_of_birth": {"name": "time_of_birth", "description": "Datetime of birth.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__time_of_birth"]}, "birth_type": {"name": "birth_type", "description": "`single` or `plural` birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_type"]}, "attendant_at_birth": {"name": "attendant_at_birth", "description": "The type of the attendant at birth.\r\n\r\nOne of:\r\n- `doctor`\r\n- `midwife`\r\n- `nurse`\r\n- `traditional_birth_attentdant`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth"]}, "name_of_attendant_at_birth": {"name": "name_of_attendant_at_birth", "description": "Name of attendant at birth.", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth"]}, "birth_facility_id": {"name": "birth_facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) the birth was recorded at.\r\n\r\nThis is only required when `registered_birth_place` is `health_facility`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_facility_id"]}, "registered_birth_place": {"name": "registered_birth_place", "description": "Type of the actual birth place.\r\n\r\nOne of:\r\n- `health_facility`\r\n- `home`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__registered_birth_place"]}, "time_of_birth_legacy": {"name": "time_of_birth_legacy", "description": "[Deprecated] Time of birth.", "meta": {"masking": "datetime"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__time_of_birth_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_birth_data.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_birth_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}}, "meta": {"triggers": ["notify_patient_birth_data_changed", "record_patient_birth_data_changelog", "set_patient_birth_data_updated_at", "set_patient_birth_data_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_birth_data_changed", "record_patient_birth_data_changelog", "set_patient_birth_data_updated_at", "set_patient_birth_data_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_birth_data_changed", "record_patient_birth_data_changelog", "set_patient_birth_data_updated_at", "set_patient_birth_data_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_birth_data\"", "created_at": 1782422376.8904068, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_birth_data"]}, "source.tamanu_source_dbt.tamanu.patient_care_plans": {"database": "app", "schema": "public", "name": "patient_care_plans", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_care_plans.yml", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_care_plans", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_care_plans"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_care_plans", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of current care plans the patient is on.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Care plans\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_conditions`, `public.patient_family_histories`,\r\n`public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_care_plans.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_care_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_care_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_care_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in patient_care_plans.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__patient_id"]}, "examiner_id": {"name": "examiner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) who prescribed this care plan.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__examiner_id"]}, "care_plan_id": {"name": "care_plan_id", "description": "Reference to the care plan ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__care_plan_id"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in patient_care_plans.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_care_plans.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_care_plans_changed", "record_patient_care_plans_changelog", "set_patient_care_plans_updated_at", "set_patient_care_plans_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_care_plans_changed", "record_patient_care_plans_changelog", "set_patient_care_plans_updated_at", "set_patient_care_plans_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_care_plans_changed", "record_patient_care_plans_changelog", "set_patient_care_plans_updated_at", "set_patient_care_plans_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_care_plans\"", "created_at": 1782422376.8956645, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_care_plans"]}, "source.tamanu_source_dbt.tamanu.patient_communications": {"database": "app", "schema": "public", "name": "patient_communications", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_communications.yml", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_communications", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_communications"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_communications", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Messages being sent to a patient, via a variety of channels.\r\n\r\nThis is a multiplexed queue to send emails, SMS, IM messages, etc specifically to patients.\r\n\r\nProcessed by the `PatientEmailCommunicationProcessor` scheduled task.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_communications.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_communications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_communications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_communications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "type": {"name": "type", "description": "The type of communication.\r\n\r\nThis affects the template or action being taken.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__type"]}, "channel": {"name": "channel", "description": "The channel to send the message with.\r\n\r\nOne of:\r\n- Email\r\n- Sms\r\n- WhatsApp\r\n- Telegram", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__channel"]}, "subject": {"name": "subject", "description": "Subject line (short summary of the message).\r\n\r\nThis is the subject line of an email, or equivalent for other channels.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__subject"]}, "content": {"name": "content", "description": "Content of the message.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__content"]}, "status": {"name": "status", "description": "Processing status of the communication.\r\n\r\nOne of:\r\n- `Queued`\r\n- `Processed`\r\n- `Sent`\r\n- `Error`\r\n- `Delivered`\r\n- `Bad Format`", "meta": {}, "data_type": "user-defined", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__status"]}, "error": {"name": "error", "description": "If the communication sending fails, this is the error.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__error"]}, "retry_count": {"name": "retry_count", "description": "How many times the sending has been retried.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__retry_count"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients) that communication is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__patient_id"]}, "destination": {"name": "destination", "description": "Destination address to send this message to.\r\n\r\nIf this is not provided here, it will be derived from the patient, such as using the\r\n[`patient_contacts`](#!/source/source.tamanu.tamanu.patient_contacts) table.", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__destination"]}, "attachment": {"name": "attachment", "description": "The attachment as a string.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__attachment"]}, "hash": {"name": "hash", "description": "Hash of original data that went into creating the row, for purposes of deduplication.\r\n\r\nThe hashing is done with the `hashtext` postgres function.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__hash"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_communications.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_communications_changed", "record_patient_communications_changelog", "set_patient_communications_updated_at", "set_patient_communications_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_communications_changed", "record_patient_communications_changelog", "set_patient_communications_updated_at", "set_patient_communications_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_communications_changed", "record_patient_communications_changelog", "set_patient_communications_updated_at", "set_patient_communications_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_communications\"", "created_at": 1782422376.9057837, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_communications"]}, "source.tamanu_source_dbt.tamanu.patient_conditions": {"database": "app", "schema": "public", "name": "patient_conditions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_conditions.yml", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_conditions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_conditions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_conditions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of ongoing conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Ongoing conditions\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`,\r\n`public.patient_family_histories`, `public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form description of this condition.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__note"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__recorded_date"]}, "resolved": {"name": "resolved", "description": "Whether the condition has resolved.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolved"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__patient_id"]}, "examiner_id": {"name": "examiner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording this\r\ncondition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__examiner_id"]}, "condition_id": {"name": "condition_id", "description": "Reference to a diagnosis describing this issue ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__condition_id"]}, "recorded_date_legacy": {"name": "recorded_date_legacy", "description": "[Deprecated] Timestamp at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__recorded_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_conditions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "resolution_date": {"name": "resolution_date", "description": "Datetime at which this issue was resolved.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_date"]}, "resolution_practitioner_id": {"name": "resolution_practitioner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording the\r\nresolution of this condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_practitioner_id"]}, "resolution_note": {"name": "resolution_note", "description": "Free-form description or notes about the resolution of this condition.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_note"]}}, "meta": {"triggers": ["notify_patient_conditions_changed", "record_patient_conditions_changelog", "set_patient_conditions_updated_at", "set_patient_conditions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_conditions_changed", "record_patient_conditions_changelog", "set_patient_conditions_updated_at", "set_patient_conditions_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_conditions_changed", "record_patient_conditions_changelog", "set_patient_conditions_updated_at", "set_patient_conditions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_conditions\"", "created_at": 1782422376.9106321, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_conditions"]}, "source.tamanu_source_dbt.tamanu.patient_contacts": {"database": "app", "schema": "public", "name": "patient_contacts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_contacts.yml", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_contacts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_contacts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_contacts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Describes how a patient may be contacted, via email, SMS, or IM apps.\r\n\r\nAt present, this is used for:\r\n- display in the application (all methods)\r\n- emailing the patient (`method=Email`)\r\n- sending Telegram reminders for appointments (`method=Telegram`)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_contacts.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_contacts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_contacts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_contacts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Free-form name of the contact method.\r\n\r\nThis could be the name of the patient, or a relationship if the contact method is via another person\r\n(e.g. `Spouse`, `Parent`, `Caregiver`), or a logical keyword if multiple contacts of the same method\r\nare provided (e.g. `Main`, `Primary`, `Work`, `Home`), etc.", "meta": {"masking": "name"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__name"]}, "method": {"name": "method", "description": "What application the contact uses:\r\n- `Email`\r\n- `Sms`\r\n- `WhatsApp`\r\n- `Telegram`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__method"]}, "connection_details": {"name": "connection_details", "description": "JSON structure containing the details of the contact.\r\n\r\nIts schema varies based on the `method`.", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__connection_details"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__patient_id"]}, "relationship_id": {"name": "relationship_id", "description": "If the contact method is via another person.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__relationship_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_contacts.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientContact", "triggers": ["notify_patient_contacts_changed", "record_patient_contacts_changelog", "set_patient_contacts_updated_at", "set_patient_contacts_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientContact", "triggers": ["notify_patient_contacts_changed", "record_patient_contacts_changelog", "set_patient_contacts_updated_at", "set_patient_contacts_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"js_class": "PatientContact", "triggers": ["notify_patient_contacts_changed", "record_patient_contacts_changelog", "set_patient_contacts_updated_at", "set_patient_contacts_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_contacts\"", "created_at": 1782422376.9276881, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_contacts"]}, "source.tamanu_source_dbt.tamanu.patient_death_data": {"database": "app", "schema": "public", "name": "patient_death_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_death_data.yml", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_death_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_death_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_death_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information about a patient's death.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_death_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients) who died.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who is recording this death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__clinician_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where this death is being recorded.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__facility_id"]}, "manner": {"name": "manner", "description": "A descriptive text specifying the manner of death.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner"]}, "recent_surgery": {"name": "recent_surgery", "description": "Whether the deceased patient had a recent surgery, if any.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__recent_surgery"]}, "last_surgery_date": {"name": "last_surgery_date", "description": "Datetime of the most recent surgery the patient received, if any.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_date"]}, "last_surgery_reason_id": {"name": "last_surgery_reason_id", "description": "Reference to a `diagnosis` ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) for the\r\nreason of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id"]}, "external_cause_date": {"name": "external_cause_date", "description": "Datetime of external cause of death, if applicable.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_date"]}, "external_cause_location": {"name": "external_cause_location", "description": "Physical location of external cause of death, if applicable.", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_location"]}, "external_cause_notes": {"name": "external_cause_notes", "description": "Free-form description of the location of external cause of death, if applicable.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_notes"]}, "was_pregnant": {"name": "was_pregnant", "description": "Whether the deceased was pregnant.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__was_pregnant"]}, "pregnancy_contributed": {"name": "pregnancy_contributed", "description": "Whether the pregnancy contributed to the death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed"]}, "fetal_or_infant": {"name": "fetal_or_infant", "description": "Whether the deceased was themselves a foetus or infant.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__fetal_or_infant"]}, "stillborn": {"name": "stillborn", "description": "Whether the deceased was themselves stillborn.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__stillborn"]}, "birth_weight": {"name": "birth_weight", "description": "If the deceased was a foetus, stillborn, or infant, their birth weight.", "meta": {"masking": {"kind": "integer", "range": "1-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "1-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__birth_weight"]}, "within_day_of_birth": {"name": "within_day_of_birth", "description": "If the deceased was a foetus, stillborn, or infant, whether their passing was on the day of their birth.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__within_day_of_birth"]}, "hours_survived_since_birth": {"name": "hours_survived_since_birth", "description": "If the deceased was an infant, how many days since the birth passed before their death.", "meta": {"masking": {"kind": "integer", "range": "1-50"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "1-50"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth"]}, "carrier_age": {"name": "carrier_age", "description": "If the deceased was a foetus, stillborn, or infant, the age of the carrier.", "meta": {"masking": {"kind": "integer", "range": "20-50"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "20-50"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_age"]}, "carrier_pregnancy_weeks": {"name": "carrier_pregnancy_weeks", "description": "If the deceased was a foetus, stillborn, or infant, how many weeks pregnant their carrier was.", "meta": {"masking": {"kind": "integer", "range": "0-40"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_death_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_death_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_death_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "outside_health_facility": {"name": "outside_health_facility", "description": "Whether the death occurred outside of the facility.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__outside_health_facility"]}, "primary_cause_time_after_onset": {"name": "primary_cause_time_after_onset", "description": "The time in minutes after onset of the primary cause of death, if known.", "meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset"]}, "primary_cause_condition_id": {"name": "primary_cause_condition_id", "description": "Reference to the primary cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if known.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id"]}, "antecedent_cause1_time_after_onset": {"name": "antecedent_cause1_time_after_onset", "description": "The time in minutes after onset of an antecedent (1) cause of death, if applicable.", "meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_time_after_onset"]}, "antecedent_cause1_condition_id": {"name": "antecedent_cause1_condition_id", "description": "Reference to an antecedent (1) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id"]}, "antecedent_cause2_time_after_onset": {"name": "antecedent_cause2_time_after_onset", "description": "The time in minutes after onset of an antecedent (2) cause of death, if applicable.", "meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_time_after_onset"]}, "antecedent_cause2_condition_id": {"name": "antecedent_cause2_condition_id", "description": "Reference to an antecedent (2) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id"]}, "external_cause_date_legacy": {"name": "external_cause_date_legacy", "description": "[Deprecated] Timestamp of external cause of death, if applicable.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_date_legacy"]}, "last_surgery_date_legacy": {"name": "last_surgery_date_legacy", "description": "[Deprecated] Timestamp of the most recent surgery the patient received, if any.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_death_data.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_final": {"name": "is_final", "description": "Whether this date record is final.\r\n\r\nIn Tamanu, this is set by a supervisor after review, and cannot be reversed; it causes all fields to\r\nbecome read-only. The only way to undo this record is through a `death_revert_logs`.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__is_final"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patient_death_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "antecedent_cause3_time_after_onset": {"name": "antecedent_cause3_time_after_onset", "description": "The time in minutes after onset of an antecedent (3) cause of death, if applicable.", "meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_time_after_onset"]}, "autopsy_requested": {"name": "autopsy_requested", "description": "Whether an autopsy was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__autopsy_requested"]}, "autopsy_findings_used": {"name": "autopsy_findings_used", "description": "If an autopsy was requested, whether the findings were used in the death certification.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__autopsy_findings_used"]}, "manner_of_death_description": {"name": "manner_of_death_description", "description": "If an external cause occurred, a text description on how and if applicable, notes of poisoning agent.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner_of_death_description"]}, "pregnancy_moment": {"name": "pregnancy_moment", "description": "The status of the pregnancy of the deceased, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_moment"]}, "multiple_pregnancy": {"name": "multiple_pregnancy", "description": "Whether the deceased infant happened in a multiple pregnancy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__multiple_pregnancy"]}, "mother_condition_description": {"name": "mother_condition_description", "description": "A text description stating the conditions of mother that affected the fetus/newborn, if the death was perinatal.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__mother_condition_description"]}, "antecedent_cause3_condition_id": {"name": "antecedent_cause3_condition_id", "description": "Reference to an antecedent (3) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_condition_id"]}}, "meta": {"js_class": "PatientDeathData", "triggers": ["notify_patient_death_data_changed", "record_patient_death_data_changelog", "set_patient_death_data_updated_at", "set_patient_death_data_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientDeathData", "triggers": ["notify_patient_death_data_changed", "record_patient_death_data_changelog", "set_patient_death_data_updated_at", "set_patient_death_data_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"js_class": "PatientDeathData", "triggers": ["notify_patient_death_data_changed", "record_patient_death_data_changelog", "set_patient_death_data_updated_at", "set_patient_death_data_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_death_data\"", "created_at": 1782422376.9572637, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_death_data"]}, "source.tamanu_source_dbt.tamanu.patient_facilities": {"database": "app", "schema": "public", "name": "patient_facilities", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_facilities.yml", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_facilities", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_facilities"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_facilities", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Tracks which patients are of interest to which facilities.\r\n\r\nThis is used to refine sync data: only patient data related to these patients is synced to a\r\nfacility (plus general data, and some exceptions apply like vaccine data under some conditions).\r\n\r\nIn Tamanu, this can be set manually on the facility server (via the \"mark for sync\" button), or\r\ncentrally (via some labs / vaccine programs, or via bulk-imports).\r\n\r\n_(\"Joe Patient attends X Clinic\" is clinical info; even though an entry in patient facilities\r\ndoesn't necessarily imply this, it often does.)_", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_facilities.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_facilities__facility_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_facilities__patient_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_facilities.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientFacility", "triggers": ["notify_patient_facilities_changed", "record_patient_facilities_changelog", "set_patient_facilities_updated_at", "set_patient_facilities_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientFacility", "triggers": ["notify_patient_facilities_changed", "record_patient_facilities_changelog", "set_patient_facilities_updated_at", "set_patient_facilities_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"js_class": "PatientFacility", "triggers": ["notify_patient_facilities_changed", "record_patient_facilities_changelog", "set_patient_facilities_updated_at", "set_patient_facilities_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_facilities\"", "created_at": 1782422376.9652889, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_facilities"]}, "source.tamanu_source_dbt.tamanu.patient_family_histories": {"database": "app", "schema": "public", "name": "patient_family_histories", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_family_histories.yml", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_family_histories", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_family_histories"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_family_histories", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of family history conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Family history\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_family_histories.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_family_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_family_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_family_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form description of this issue.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__note"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__recorded_date"]}, "relationship": {"name": "relationship", "description": "Free-form description of the family relationship.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__relationship"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__patient_id"]}, "practitioner_id": {"name": "practitioner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this history.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__practitioner_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "Reference to a diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))\r\ndescribing this issue.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__diagnosis_id"]}, "recorded_date_legacy": {"name": "recorded_date_legacy", "description": "[Deprecated] Timestamp at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__recorded_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_family_histories.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientFamilyHistory", "triggers": ["notify_patient_family_histories_changed", "record_patient_family_histories_changelog", "set_patient_family_histories_updated_at", "set_patient_family_histories_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientFamilyHistory", "triggers": ["notify_patient_family_histories_changed", "record_patient_family_histories_changelog", "set_patient_family_histories_updated_at", "set_patient_family_histories_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"js_class": "PatientFamilyHistory", "triggers": ["notify_patient_family_histories_changed", "record_patient_family_histories_changelog", "set_patient_family_histories_updated_at", "set_patient_family_histories_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_family_histories\"", "created_at": 1782422376.971063, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_family_histories"]}, "source.tamanu_source_dbt.tamanu.patient_field_definitions": {"database": "app", "schema": "public", "name": "patient_field_definitions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_field_definitions.yml", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_definitions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_field_definitions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_field_definitions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Custom inputs to be included in the Tamanu patient details screens.\r\n\r\nThese are grouped using [categories](#!/source/source.tamanu.tamanu.patient_field_definition_categories).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_field_definitions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_field_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_field_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_field_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of the input.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definitions__name"]}, "field_type": {"name": "field_type", "description": "Input field type.\r\n\r\nOne of:\r\n- `string`\r\n- `number`\r\n- `select`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definitions__field_type"]}, "options": {"name": "options", "description": "When `type = 'select'`, the list of options for this select.\r\n\r\nPostgreSQL array of strings.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definitions__options"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patient_field_definitions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "category_id": {"name": "category_id", "description": "The [category](#!/source/source.tamanu.tamanu.patient_field_definition_categories) this field is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definitions__category_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_field_definitions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_field_definitions_changed", "record_patient_field_definitions_changelog", "set_patient_field_definitions_updated_at", "set_patient_field_definitions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_field_definitions_changed", "record_patient_field_definitions_changelog", "set_patient_field_definitions_updated_at", "set_patient_field_definitions_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_patient_field_definitions_changed", "record_patient_field_definitions_changelog", "set_patient_field_definitions_updated_at", "set_patient_field_definitions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_field_definitions\"", "created_at": 1782422376.9890199, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_field_definitions"]}, "source.tamanu_source_dbt.tamanu.patient_field_definition_categories": {"database": "app", "schema": "public", "name": "patient_field_definition_categories", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_field_definition_categories.yml", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_definition_categories", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_field_definition_categories"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_field_definition_categories", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Groupings for [patient field definitions](#!/source/source.tamanu.tamanu.patient_field_definitions).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_field_definition_categories.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_field_definition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_field_definition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_field_definition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definition_categories__name"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_field_definition_categories.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_field_definition_categories_changed", "record_patient_field_definition_categories_changelog", "set_patient_field_definition_categories_updated_at", "set_patient_field_definition_categories_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_field_definition_categories_changed", "record_patient_field_definition_categories_changelog", "set_patient_field_definition_categories_updated_at", "set_patient_field_definition_categories_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_patient_field_definition_categories_changed", "record_patient_field_definition_categories_changelog", "set_patient_field_definition_categories_updated_at", "set_patient_field_definition_categories_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_field_definition_categories\"", "created_at": 1782422376.9890199, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_field_definition_categories"]}, "source.tamanu_source_dbt.tamanu.patient_field_values": {"database": "app", "schema": "public", "name": "patient_field_values", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_field_values.yml", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_values", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_field_values"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_field_values", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Values recorded in custom patient fields.\r\n\r\nThe `id` column is generated to enforce one value row per field definition per patient.", "columns": {"created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_field_values.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_field_values.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_field_values.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "value": {"name": "value", "description": "Value.", "meta": {"masking": "string"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__value"]}, "definition_id": {"name": "definition_id", "description": "The [field definition](#!/source/source.tamanu.tamanu.patient_field_definitions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__definition_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__patient_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_field_values.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_field_values.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}}, "meta": {"triggers": ["notify_patient_field_values_changed", "record_patient_field_values_changelog", "set_patient_field_values_updated_at", "set_patient_field_values_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_field_values_changed", "record_patient_field_values_changelog", "set_patient_field_values_updated_at", "set_patient_field_values_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"triggers": ["notify_patient_field_values_changed", "record_patient_field_values_changelog", "set_patient_field_values_updated_at", "set_patient_field_values_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_field_values\"", "created_at": 1782422377.0041287, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_field_values"]}, "source.tamanu_source_dbt.tamanu.patient_issues": {"database": "app", "schema": "public", "name": "patient_issues", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_issues.yml", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_issues", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_issues"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_issues", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of \"other issues\" known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Other patient issues\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_issues.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_issues.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_issues.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_issues.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form description of this issue.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__note"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__recorded_date"]}, "type": {"name": "type", "description": "If set to `Warning`, an alert will pop up when visiting the patient.", "meta": {}, "data_type": "user-defined", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__type"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__patient_id"]}, "recorded_date_legacy": {"name": "recorded_date_legacy", "description": "[Deprecated] Timestamp at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__recorded_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_issues.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientIssue", "triggers": ["notify_patient_issues_changed", "record_patient_issues_changelog", "set_patient_issues_updated_at", "set_patient_issues_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientIssue", "triggers": ["notify_patient_issues_changed", "record_patient_issues_changelog", "set_patient_issues_updated_at", "set_patient_issues_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"js_class": "PatientIssue", "triggers": ["notify_patient_issues_changed", "record_patient_issues_changelog", "set_patient_issues_updated_at", "set_patient_issues_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_issues\"", "created_at": 1782422377.01887, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_issues"]}, "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions": {"database": "app", "schema": "public", "name": "patient_ongoing_prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_ongoing_prescriptions.yml", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_ongoing_prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_ongoing_prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of patient to prescription", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_ongoing_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_ongoing_prescriptions__patient_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_ongoing_prescriptions__prescription_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_ongoing_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_ongoing_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_ongoing_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_ongoing_prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_ongoing_prescriptions_changed", "record_patient_ongoing_prescriptions_changelog", "set_patient_ongoing_prescriptions_updated_at", "set_patient_ongoing_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_ongoing_prescriptions_changed", "record_patient_ongoing_prescriptions_changelog", "set_patient_ongoing_prescriptions_updated_at", "set_patient_ongoing_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_patient_ongoing_prescriptions_changed", "record_patient_ongoing_prescriptions_changelog", "set_patient_ongoing_prescriptions_updated_at", "set_patient_ongoing_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_ongoing_prescriptions\"", "created_at": 1782422377.01887, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_ongoing_prescriptions"]}, "source.tamanu_source_dbt.tamanu.patient_program_registrations": {"database": "app", "schema": "public", "name": "patient_program_registrations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_program_registrations.yml", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_program_registrations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_program_registrations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_program_registrations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table with information about the program registrations of a patient. This is helpful\r\nto enroll a specific patient within a program that will be followed for an extended\r\nperiod of time.\r\n\r\n**This table is append-only.**\r\nA new record is created every time there is a change to the status of a registration. \r\n\r\nAt the moment, this implies that when merging two patients, both with a registration to the same\r\nregistry, the merged patient ends up with two registrations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registrations.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_program_registrations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_program_registrations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_program_registrations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in patient_program_registrations.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "registration_status": {"name": "registration_status", "description": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registration_status"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [Patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__patient_id"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__program_registry_id"]}, "clinical_status_id": {"name": "clinical_status_id", "description": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinician_id"]}, "registering_facility_id": {"name": "registering_facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) this program\r\nregistration is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__facility_id"]}, "village_id": {"name": "village_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=village`) this program registration is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__village_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_program_registrations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "deactivated_clinician_id": {"name": "deactivated_clinician_id", "description": "The clinician that removed the patient from the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id"]}, "deactivated_date": {"name": "deactivated_date", "description": "The date that the patient from the program registry.", "meta": {"masking": "date"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_date"]}}, "meta": {"triggers": ["notify_patient_program_registrations_changed", "record_patient_program_registrations_changelog", "set_patient_program_registrations_updated_at", "set_patient_program_registrations_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_program_registrations_changed", "record_patient_program_registrations_changelog", "set_patient_program_registrations_updated_at", "set_patient_program_registrations_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_program_registrations_changed", "record_patient_program_registrations_changelog", "set_patient_program_registrations_updated_at", "set_patient_program_registrations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_program_registrations\"", "created_at": 1782422377.0517497, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registrations"]}, "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions": {"database": "app", "schema": "public", "name": "patient_program_registration_conditions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_program_registration_conditions.yml", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_program_registration_conditions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_program_registration_conditions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of conditions related to patients in a program registration.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registration_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in patient_program_registration_conditions.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "deletion_date": {"name": "deletion_date", "description": "Date field which is a timestamp of record being deleted in patient_program_registration_conditions.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deletion_date"]}, "program_registry_condition_id": {"name": "program_registry_condition_id", "description": "Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id"]}, "deletion_clinician_id": {"name": "deletion_clinician_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) that removed the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_program_registration_conditions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reason_for_change": {"name": "reason_for_change", "description": "Optional field for recording the reason for changing the condition.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change"]}, "patient_program_registration_id": {"name": "patient_program_registration_id", "description": "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\nof the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id"]}, "program_registry_condition_category_id": {"name": "program_registry_condition_category_id", "description": "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\nof the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id"]}}, "meta": {"triggers": ["notify_patient_program_registration_conditions_changed", "record_patient_program_registration_conditions_changelog", "set_patient_program_registration_conditions_updated_at", "set_patient_program_registration_conditions_updated_at_sync_tic"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_program_registration_conditions_changed", "record_patient_program_registration_conditions_changelog", "set_patient_program_registration_conditions_updated_at", "set_patient_program_registration_conditions_updated_at_sync_tic"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_program_registration_conditions_changed", "record_patient_program_registration_conditions_changelog", "set_patient_program_registration_conditions_updated_at", "set_patient_program_registration_conditions_updated_at_sync_tic"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_program_registration_conditions\"", "created_at": 1782422377.0741887, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registration_conditions"]}, "source.tamanu_source_dbt.tamanu.patient_secondary_ids": {"database": "app", "schema": "public", "name": "patient_secondary_ids", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_secondary_ids.yml", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_secondary_ids", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_secondary_ids"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_secondary_ids", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Alternative IDs to be checked for when searching for patient by ID.\r\n\r\nFor example, driver licence or passport numbers, or other national or local health numbers, if there\r\nare disparate systems or the country is in a transitional period.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_secondary_ids.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_secondary_ids.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_secondary_ids.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_secondary_ids.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "value": {"name": "value", "description": "Value of the identifier.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_secondary_ids__value"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patient_secondary_ids.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "type_id": {"name": "type_id", "description": "Reference to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\nwith `type=secondaryIdType`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_secondary_ids__type_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere may be zero or more `patient_secondary_ids` per patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_secondary_ids__patient_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_secondary_ids.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientSecondaryId", "triggers": ["notify_patient_secondary_ids_changed", "record_patient_secondary_ids_changelog", "set_patient_secondary_ids_updated_at", "set_patient_secondary_ids_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientSecondaryId", "triggers": ["notify_patient_secondary_ids_changed", "record_patient_secondary_ids_changelog", "set_patient_secondary_ids_updated_at", "set_patient_secondary_ids_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"js_class": "PatientSecondaryId", "triggers": ["notify_patient_secondary_ids_changed", "record_patient_secondary_ids_changelog", "set_patient_secondary_ids_updated_at", "set_patient_secondary_ids_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_secondary_ids\"", "created_at": 1782422377.0777209, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_secondary_ids"]}, "source.tamanu_source_dbt.tamanu.patient_vrs_data": {"database": "app", "schema": "public", "name": "patient_vrs_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_vrs_data.yml", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_vrs_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_vrs_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_vrs_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Data for Fiji's VRS integration only.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_vrs_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_vrs_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_vrs_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_vrs_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "id_type": {"name": "id_type", "description": "TBC", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__id_type"]}, "identifier": {"name": "identifier", "description": "TBC", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__identifier"]}, "unmatched_village_name": {"name": "unmatched_village_name", "description": "if we don't have a matching village, persist the unmatched name here", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__unmatched_village_name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__patient_id"]}, "is_deleted_by_remote": {"name": "is_deleted_by_remote", "description": "TBC", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__is_deleted_by_remote"]}}, "meta": {"js_class": "PatientVRSData", "triggers": []}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientVRSData", "triggers": []}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"js_class": "PatientVRSData", "triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_vrs_data\"", "created_at": 1782422377.0777209, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_vrs_data"]}, "source.tamanu_source_dbt.tamanu.permissions": {"database": "app", "schema": "public", "name": "permissions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\permissions.yml", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.permissions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "permissions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "permissions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "These are associations of permissions to roles.\r\n\r\nPermissions are modeled on the concept of a sentence like\r\n\r\n```\r\nROLE can VERB the NOUN\r\nROLE can VERB the NOUN which is specifically the OBJECT ID\r\n```\r\n\r\nSee also the [`roles`](#!/source/source.tamanu.tamanu.roles) and\r\n[`users`](#!/source/source.tamanu.tamanu.users) tables.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in permissions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in permissions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in permissions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in permissions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "role_id": {"name": "role_id", "description": "The [`role`](#!/source/source.tamanu.tamanu.roles) authorised for this permission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.permissions__role_id"]}, "noun": {"name": "noun", "description": "The subject of the action/permission, usually the model or resource being affected.\r\n\r\nNouns are defined in `PascalCase` and are singular.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.permissions__noun"]}, "verb": {"name": "verb", "description": "The action verb for this permission.\r\n\r\nSome common verbs include: `create`, `read`, `write`, `list`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.permissions__verb"]}, "object_id": {"name": "object_id", "description": "An optional object ID to specialise the permission.\r\n\r\nIf this is not set the permission is generally for the entire class of objects, if it _is_ set then\r\nthe permission is _only_ for the specific object.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.permissions__object_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in permissions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_permissions_changed", "record_permissions_changelog", "set_permissions_updated_at", "set_permissions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_permissions_changed", "record_permissions_changelog", "set_permissions_updated_at", "set_permissions_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_permissions_changed", "record_permissions_changelog", "set_permissions_updated_at", "set_permissions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"permissions\"", "created_at": 1782422377.0931997, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__permissions"]}, "source.tamanu_source_dbt.tamanu.pharmacy_orders": {"database": "app", "schema": "public", "name": "pharmacy_orders", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\pharmacy_orders.yml", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "source.tamanu_source_dbt.tamanu.pharmacy_orders", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "pharmacy_orders"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "pharmacy_orders", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "An order for prescriptions placed by Tamanu to a Pharmacy", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in pharmacy_orders.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "ordering_clinician_id": {"name": "ordering_clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who placed the order.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__ordering_clinician_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) for the order.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__encounter_id"]}, "comments": {"name": "comments", "description": "Comments provided by the clinician when placing the order.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__comments"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in pharmacy_orders.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in pharmacy_orders.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in pharmacy_orders.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in pharmacy_orders.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_discharge_prescription": {"name": "is_discharge_prescription", "description": "If the patient is being discharged with this prescription.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__is_discharge_prescription"]}, "date": {"name": "date", "description": "Local date for the record in pharmacy_orders.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where the pharmacy order was placed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__facility_id"]}}, "meta": {"triggers": ["notify_pharmacy_orders_changed", "record_pharmacy_orders_changelog", "set_pharmacy_orders_updated_at", "set_pharmacy_orders_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_pharmacy_orders_changed", "record_pharmacy_orders_changelog", "set_pharmacy_orders_updated_at", "set_pharmacy_orders_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_pharmacy_orders_changed", "record_pharmacy_orders_changelog", "set_pharmacy_orders_updated_at", "set_pharmacy_orders_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"pharmacy_orders\"", "created_at": 1782422377.1041765, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__pharmacy_orders"]}, "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions": {"database": "app", "schema": "public", "name": "pharmacy_order_prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\pharmacy_order_prescriptions.yml", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "pharmacy_order_prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "pharmacy_order_prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Individual prescriptions that are included in a [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in pharmacy_order_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "pharmacy_order_id": {"name": "pharmacy_order_id", "description": "Reference to the [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__pharmacy_order_id"]}, "prescription_id": {"name": "prescription_id", "description": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__prescription_id"]}, "ongoing_prescription_id": {"name": "ongoing_prescription_id", "description": "When this pharmacy order prescription was created from an ongoing prescription (send to pharmacy flow), references the ongoing [prescription](#!/source/source.tamanu.tamanu.prescriptions). Null for encounter-based pharmacy orders.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__ongoing_prescription_id"]}, "display_id": {"name": "display_id", "description": "Human-readable request number for this prescription order. A new request number is generated each time a prescription is sent to pharmacy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__display_id"]}, "quantity": {"name": "quantity", "description": "Quantity of medication ordered.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__quantity"]}, "repeats": {"name": "repeats", "description": "Number of repeats for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__repeats"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in pharmacy_order_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in pharmacy_order_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in pharmacy_order_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "is_completed": {"name": "is_completed", "description": "Indicates whether this prescription has been fully completed. Set to `true` when all repeats have been dispensed for a discharge prescription (outpatient medication). Used to filter completed prescriptions from active medication request lists.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__is_completed"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in pharmacy_order_prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_pharmacy_order_prescriptions_changed", "record_pharmacy_order_prescriptions_changelog", "set_pharmacy_order_prescriptions_updated_at", "set_pharmacy_order_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_pharmacy_order_prescriptions_changed", "record_pharmacy_order_prescriptions_changelog", "set_pharmacy_order_prescriptions_updated_at", "set_pharmacy_order_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_pharmacy_order_prescriptions_changed", "record_pharmacy_order_prescriptions_changelog", "set_pharmacy_order_prescriptions_updated_at", "set_pharmacy_order_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"pharmacy_order_prescriptions\"", "created_at": 1782422377.1089678, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__pharmacy_order_prescriptions"]}, "source.tamanu_source_dbt.tamanu.portal_one_time_tokens": {"database": "app", "schema": "public", "name": "portal_one_time_tokens", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\portal_one_time_tokens.yml", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "source.tamanu_source_dbt.tamanu.portal_one_time_tokens", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "portal_one_time_tokens"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "portal_one_time_tokens", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A table that stores one-time tokens for portal users. These tokens are used for secure operations such as login, password reset, and other temporary authentication requirements. Each token is associated with a specific portal user and has an expiration date.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in portal_one_time_tokens.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in portal_one_time_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in portal_one_time_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in portal_one_time_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "portal_user_id": {"name": "portal_user_id", "description": "Foreign key that references the id of the portal user to whom this token belongs. When the user is deleted, all associated tokens are automatically deleted (CASCADE).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_one_time_tokens__portal_user_id"]}, "type": {"name": "type", "description": "Specifies the purpose of the token\r\nOne of:\r\n- `login` (default)\r\n- `password-reset`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_one_time_tokens__type"]}, "token": {"name": "token", "description": "The unique, secure token string that is used for verification. This token should be generated with strong cryptographic methods to ensure security.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_one_time_tokens__token"]}, "expires_at": {"name": "expires_at", "description": "The timestamp at which this token expires and becomes invalid. Tokens should have a limited lifespan appropriate to their purpose, typically ranging from a few minutes to 24 hours depending on the token type.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_one_time_tokens__expires_at"]}}, "meta": {"triggers": ["record_portal_one_time_tokens_changelog"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["record_portal_one_time_tokens_changelog"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["record_portal_one_time_tokens_changelog"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"portal_one_time_tokens\"", "created_at": 1782422377.1089678, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__portal_one_time_tokens"]}, "source.tamanu_source_dbt.tamanu.portal_survey_assignments": {"database": "app", "schema": "public", "name": "portal_survey_assignments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\portal_survey_assignments.yml", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.portal_survey_assignments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "portal_survey_assignments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "portal_survey_assignments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Assignments of surveys to patients for completion through the patient portal.\r\n\r\nThis table tracks which surveys have been assigned to which patients for self-completion through\r\nthe patient portal application. Patients can log into the portal to view their assigned surveys\r\nand complete them independently. Surveys can be assigned to patients for various purposes such as\r\nhealth assessments, follow-up questionnaires, or program evaluations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in portal_survey_assignments.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in portal_survey_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in portal_survey_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in portal_survey_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) who has been assigned the survey.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__patient_id"]}, "survey_id": {"name": "survey_id", "description": "Reference to the [survey](#!/source/source.tamanu.tamanu.surveys) that has been assigned to the patient.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__survey_id"]}, "status": {"name": "status", "description": "The current status of the survey assignment in the patient portal.\r\n\r\nOne of:\r\n- `assigned` - Survey has been assigned but the patient has not yet started it in the portal\r\n- `in_progress` - Patient has started the survey in the portal but not completed it\r\n- `completed` - Survey has been fully completed by the patient through the portal\r\n- `expired` - Survey assignment has expired and can no longer be completed in the portal", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__status"]}, "assigned_by_id": {"name": "assigned_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who assigned the survey to the patient.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__assigned_by_id"]}, "survey_response_id": {"name": "survey_response_id", "description": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) containing the patient's answers from the portal.\r\n\r\nThis field is only populated when the survey has been completed through the patient portal and a response has been recorded.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__survey_response_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in portal_survey_assignments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "assigned_at": {"name": "assigned_at", "description": "Timestamp when the survey was assigned to the patient for completion through the patient portal.\r\n\r\nThis field is provided a value by the Tamanu web frontend when a survey assignment is created.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__assigned_at"]}, "facility_id": {"name": "facility_id", "description": "The facility that the survey was assigned from", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__facility_id"]}}, "meta": {"triggers": ["notify_portal_survey_assignments_changed", "record_portal_survey_assignments_changelog", "set_portal_survey_assignments_updated_at", "set_portal_survey_assignments_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_portal_survey_assignments_changed", "record_portal_survey_assignments_changelog", "set_portal_survey_assignments_updated_at", "set_portal_survey_assignments_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_portal_survey_assignments_changed", "record_portal_survey_assignments_changelog", "set_portal_survey_assignments_updated_at", "set_portal_survey_assignments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"portal_survey_assignments\"", "created_at": 1782422377.124928, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__portal_survey_assignments"]}, "source.tamanu_source_dbt.tamanu.portal_users": {"database": "app", "schema": "public", "name": "portal_users", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\portal_users.yml", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "source.tamanu_source_dbt.tamanu.portal_users", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "portal_users"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "portal_users", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This table manages user accounts for patients who can access the patient portal. It establishes the relationship between patients and their portal login credentials, tracking their registration status and access permissions. Each record represents a patient's portal account with authentication and role information.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in portal_users.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in portal_users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in portal_users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in portal_users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_id": {"name": "patient_id", "description": "Foreign key reference to the patients table. Links the portal user account to a specific patient record in the system. This field is required and establishes the one-to-one relationship between a patient and their portal access.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_users__patient_id"]}, "email": {"name": "email", "description": "Unique email address used for patient portal authentication and communication. This serves as the primary identifier for login purposes and must be unique across all patient portal accounts. The field is optional to allow for patients who may not have email addresses, or who have not yet completed the\r\nregistration flow.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_users__email"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in portal_users.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "status": {"name": "status", "description": "Current registration status of the patient portal account. Possible values are 'pending' (default, when account is first created) and 'registered' (when patient has completed the registration process). This field tracks the progression of patient portal onboarding and account activation.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_users__status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in portal_users.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_portal_users_changed", "record_portal_users_changelog", "set_portal_users_updated_at", "set_portal_users_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_portal_users_changed", "record_portal_users_changelog", "set_portal_users_updated_at", "set_portal_users_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_portal_users_changed", "record_portal_users_changelog", "set_portal_users_updated_at", "set_portal_users_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"portal_users\"", "created_at": 1782422377.124928, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__portal_users"]}, "source.tamanu_source_dbt.tamanu.prescriptions": {"database": "app", "schema": "public", "name": "prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\prescriptions.yml", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records prescriptions for medications.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in prescriptions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in prescriptions.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "notes": {"name": "notes", "description": "Free-form note about the prescription.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__notes"]}, "end_date": {"name": "end_date", "description": "When the prescription ends.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__end_date"]}, "indication": {"name": "indication", "description": "The [indication of use](https://en.wikipedia.org/wiki/Indication_(medicine)) for the medicine.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__indication"]}, "route": {"name": "route", "description": "Administration route for the medication.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__route"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "prescriber_id": {"name": "prescriber_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) prescribed the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__prescriber_id"]}, "quantity": {"name": "quantity", "description": "Quantity of medicine to dispense.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__quantity"]}, "discontinued": {"name": "discontinued", "description": "Whether the prescription was discontinued.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinued"]}, "discontinuing_clinician_id": {"name": "discontinuing_clinician_id", "description": "If the prescription was discontinued, who did it.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinuing_clinician_id"]}, "discontinuing_reason": {"name": "discontinuing_reason", "description": "If the prescription was discontinued, why that happened.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinuing_reason"]}, "repeats": {"name": "repeats", "description": "How many times this prescription can be repeatedly dispensed without a new prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__repeats"]}, "discontinued_date": {"name": "discontinued_date", "description": "If the prescription was discontinued, when that happened.", "meta": {"masking": "date"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinued_date"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in prescriptions.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "end_date_legacy": {"name": "end_date_legacy", "description": "[Deprecated] When the prescription ends.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__end_date_legacy"]}, "is_ongoing": {"name": "is_ongoing", "description": "A flag to determine whether or not the current prescription is ongoing", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_ongoing"]}, "is_prn": {"name": "is_prn", "description": "A flag to determine whether or not the current prescription is prn", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_prn"]}, "is_variable_dose": {"name": "is_variable_dose", "description": "A flag to determine whether or not the current prescription is variable does", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_variable_dose"]}, "dose_amount": {"name": "dose_amount", "description": "Numeric field to record dose amount", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__dose_amount"]}, "units": {"name": "units", "description": "The units of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__units"]}, "frequency": {"name": "frequency", "description": "The frequency of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__frequency"]}, "start_date": {"name": "start_date", "description": "The start date of the prescription", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__start_date"]}, "duration_value": {"name": "duration_value", "description": "The duration value of the prescription", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__duration_value"]}, "duration_unit": {"name": "duration_unit", "description": "The duration unit of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__duration_unit"]}, "is_phone_order": {"name": "is_phone_order", "description": "A flag to determine whether or not the current prescription is phone order", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_phone_order"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "ideal_times": {"name": "ideal_times", "description": "Ideal times which are specified by prescriber", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__ideal_times"]}, "pharmacy_notes": {"name": "pharmacy_notes", "description": "Free-form pharmacy note of the prescription.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__pharmacy_notes"]}, "display_pharmacy_notes_in_mar": {"name": "display_pharmacy_notes_in_mar", "description": "A flag to determine whether to display 'Pharmacy notes' on the medication administration record", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__display_pharmacy_notes_in_mar"]}}, "meta": {"triggers": ["notify_prescriptions_changed", "record_prescriptions_changelog", "set_prescriptions_updated_at", "set_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_prescriptions_changed", "record_prescriptions_changelog", "set_prescriptions_updated_at", "set_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_prescriptions_changed", "record_prescriptions_changelog", "set_prescriptions_updated_at", "set_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"prescriptions\"", "created_at": 1782422377.140912, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__prescriptions"]}, "source.tamanu_source_dbt.tamanu.procedures": {"database": "app", "schema": "public", "name": "procedures", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\procedures.yml", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "source.tamanu_source_dbt.tamanu.procedures", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "procedures"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "procedures", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Record of each procedure in progress or completed.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedures.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in procedures.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in procedures.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in procedures.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "completed": {"name": "completed", "description": "Whether the procedure has completed.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed"]}, "date": {"name": "date", "description": "Local date for the record in procedures.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "end_time": {"name": "end_time", "description": "When the procedure ended, if it's completed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time"]}, "note": {"name": "note", "description": "Free-form description of the procedure.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__note"]}, "completed_note": {"name": "completed_note", "description": "Free-form notes at completion of the procedure.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed_note"]}, "encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters) this procedure is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__encounter_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the procedure happens in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__location_id"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__procedure_type_id"]}, "anaesthetic_id": {"name": "anaesthetic_id", "description": "Reference to the anaesthetic ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetic_id"]}, "physician_id": {"name": "physician_id", "description": "Reference to the [physician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__physician_id"]}, "anaesthetist_id": {"name": "anaesthetist_id", "description": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetist_id"]}, "start_time": {"name": "start_time", "description": "When the procedure started.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in procedures.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "start_time_legacy": {"name": "start_time_legacy", "description": "[Deprecated] When the procedure started.", "meta": {"masking": "datetime"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time_legacy"]}, "end_time_legacy": {"name": "end_time_legacy", "description": "[Deprecated] When the procedure ended.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in procedures.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) where the procedure is performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__department_id"]}, "assistant_anaesthetist_id": {"name": "assistant_anaesthetist_id", "description": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id"]}, "time_in": {"name": "time_in", "description": "The time when the patient entered the procedure room or when the procedure setup began.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_in"]}, "time_out": {"name": "time_out", "description": "The time when the patient left the procedure room or when the procedure cleanup was completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_out"]}}, "meta": {"triggers": ["notify_procedures_changed", "record_procedures_changelog", "set_procedures_updated_at", "set_procedures_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_procedures_changed", "record_procedures_changelog", "set_procedures_updated_at", "set_procedures_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_procedures_changed", "record_procedures_changelog", "set_procedures_updated_at", "set_procedures_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"procedures\"", "created_at": 1782422377.1725512, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__procedures"]}, "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians": {"database": "app", "schema": "public", "name": "procedure_assistant_clinicians", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\procedure_assistant_clinicians.yml", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "procedure_assistant_clinicians"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "procedure_assistant_clinicians", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Junction table that links procedures to their assistant clinicians. Records which users served as assistant clinicians for specific procedures.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedure_assistant_clinicians.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "procedure_id": {"name": "procedure_id", "description": "Reference to the [procedure](#!/source/source.tamanu.tamanu.procedures) this assistant clinician is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_assistant_clinicians__procedure_id"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who served as an assistant clinician for the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_assistant_clinicians__user_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in procedure_assistant_clinicians.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in procedure_assistant_clinicians.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in procedure_assistant_clinicians.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in procedure_assistant_clinicians.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_procedure_assistant_clinicians_changed", "record_procedure_assistant_clinicians_changelog", "set_procedure_assistant_clinicians_updated_at", "set_procedure_assistant_clinicians_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_procedure_assistant_clinicians_changed", "record_procedure_assistant_clinicians_changelog", "set_procedure_assistant_clinicians_updated_at", "set_procedure_assistant_clinicians_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_procedure_assistant_clinicians_changed", "record_procedure_assistant_clinicians_changelog", "set_procedure_assistant_clinicians_updated_at", "set_procedure_assistant_clinicians_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"procedure_assistant_clinicians\"", "created_at": 1782422377.1725512, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__procedure_assistant_clinicians"]}, "source.tamanu_source_dbt.tamanu.procedure_survey_responses": {"database": "app", "schema": "public", "name": "procedure_survey_responses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\procedure_survey_responses.yml", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.procedure_survey_responses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "procedure_survey_responses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "procedure_survey_responses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Junction table linking procedures to their associated survey responses.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedure_survey_responses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "procedure_id": {"name": "procedure_id", "description": "Reference to the [procedure](#!/source/source.tamanu.tamanu.procedures) this survey response is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_survey_responses__procedure_id"]}, "survey_response_id": {"name": "survey_response_id", "description": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) linked to the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_survey_responses__survey_response_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in procedure_survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in procedure_survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in procedure_survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in procedure_survey_responses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_procedure_survey_responses_changed", "record_procedure_survey_responses_changelog", "set_procedure_survey_responses_updated_at", "set_procedure_survey_responses_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_procedure_survey_responses_changed", "record_procedure_survey_responses_changelog", "set_procedure_survey_responses_updated_at", "set_procedure_survey_responses_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_procedure_survey_responses_changed", "record_procedure_survey_responses_changelog", "set_procedure_survey_responses_updated_at", "set_procedure_survey_responses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"procedure_survey_responses\"", "created_at": 1782422377.187317, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__procedure_survey_responses"]}, "source.tamanu_source_dbt.tamanu.procedure_type_surveys": {"database": "app", "schema": "public", "name": "procedure_type_surveys", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\procedure_type_surveys.yml", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "source.tamanu_source_dbt.tamanu.procedure_type_surveys", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "procedure_type_surveys"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "procedure_type_surveys", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association between procedure types and surveys\r\n\r\nThis link is used to populate an embedded survey in the procedure modal", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedure_type_surveys.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=procedureType`)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_type_surveys__procedure_type_id"]}, "survey_id": {"name": "survey_id", "description": "Reference to a [survey](#!/source/source.tamanu.tamanu.surveys).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_type_surveys__survey_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in procedure_type_surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in procedure_type_surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in procedure_type_surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in procedure_type_surveys.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_procedure_type_surveys_changed", "record_procedure_type_surveys_changelog", "set_procedure_type_surveys_updated_at", "set_procedure_type_surveys_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_procedure_type_surveys_changed", "record_procedure_type_surveys_changelog", "set_procedure_type_surveys_updated_at", "set_procedure_type_surveys_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_procedure_type_surveys_changed", "record_procedure_type_surveys_changelog", "set_procedure_type_surveys_updated_at", "set_procedure_type_surveys_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"procedure_type_surveys\"", "created_at": 1782422377.1938078, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__procedure_type_surveys"]}, "source.tamanu_source_dbt.tamanu.programs": {"database": "app", "schema": "public", "name": "programs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\programs.yml", "original_file_path": "models\\sources\\programs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.programs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "programs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "programs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Groups of [surveys](#!/source/source.tamanu.tamanu.surveys) or [program registries](#!/source/source.tamanu.tamanu.program_registries).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in programs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in programs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in programs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in programs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Machine-friendly code.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.programs__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.programs__name"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in programs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_programs_changed", "record_programs_changelog", "set_programs_updated_at", "set_programs_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_programs_changed", "record_programs_changelog", "set_programs_updated_at", "set_programs_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_programs_changed", "record_programs_changelog", "set_programs_updated_at", "set_programs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"programs\"", "created_at": 1782422377.199154, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__programs"]}, "source.tamanu_source_dbt.tamanu.program_data_elements": {"database": "app", "schema": "public", "name": "program_data_elements", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_data_elements.yml", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_data_elements", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_data_elements"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_data_elements", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Describes how a survey question gets stored.\r\n\r\nSee [survey screen components](#!/source/source.tamanu.tamanu.survey_screen_components), which\r\ndescribes how the question is displayed.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_data_elements.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_data_elements.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_data_elements.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_data_elements.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Machine-friendly short name for the question.\r\n\r\nThis is also used to refer to questions within criteria and such.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__code"]}, "name": {"name": "name", "description": "Human-friendly name", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__name"]}, "indicator": {"name": "indicator", "description": "Another name for the data element.\r\n\r\nIt's named `indicator` from mimicry of Tupaia.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__indicator"]}, "default_text": {"name": "default_text", "description": "Default value.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__default_text"]}, "default_options": {"name": "default_options", "description": "Default options if this is a dropdown.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__default_options"]}, "type": {"name": "type", "description": "Type of the field.\r\n\r\nTypes are here: ", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__type"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_data_elements.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visualisation_config": {"name": "visualisation_config", "description": "JSON visualisation configuration.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__visualisation_config"]}}, "meta": {"triggers": ["notify_program_data_elements_changed", "record_program_data_elements_changelog", "set_program_data_elements_updated_at", "set_program_data_elements_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_data_elements_changed", "record_program_data_elements_changelog", "set_program_data_elements_updated_at", "set_program_data_elements_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_program_data_elements_changed", "record_program_data_elements_changelog", "set_program_data_elements_updated_at", "set_program_data_elements_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_data_elements\"", "created_at": 1782422377.2050788, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_data_elements"]}, "source.tamanu_source_dbt.tamanu.program_registries": {"database": "app", "schema": "public", "name": "program_registries", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_registries.yml", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_registries", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_registries"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_registries", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of program registries.\r\n\r\nThis provides functionality to track a patient population defined by a particular disease or\r\ncondition, and follow this population over time.\r\n\r\nThis table defines the different registries available to track users with.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registries.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_registries.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_registries.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_registries.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Machine-friendly identifier.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__name"]}, "currently_at_type": {"name": "currently_at_type", "description": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__currently_at_type"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registries.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_id": {"name": "program_id", "description": "Reference to a [program](#!/source/source.tamanu.tamanu.programs).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__program_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_registries.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_program_registries_changed", "record_program_registries_changelog", "set_program_registries_updated_at", "set_program_registries_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_registries_changed", "record_program_registries_changelog", "set_program_registries_updated_at", "set_program_registries_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_program_registries_changed", "record_program_registries_changelog", "set_program_registries_updated_at", "set_program_registries_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_registries\"", "created_at": 1782422377.2177067, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registries"]}, "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses": {"database": "app", "schema": "public", "name": "program_registry_clinical_statuses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_registry_clinical_statuses.yml", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_registry_clinical_statuses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_registry_clinical_statuses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of clinical statuses used in program registries.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_clinical_statuses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_registry_clinical_statuses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_registry_clinical_statuses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_registry_clinical_statuses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code (identifier) for the clinical status.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__code"]}, "name": {"name": "name", "description": "The name of the clinical status.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__name"]}, "color": {"name": "color", "description": "A color for the clinical status.\r\n\r\nOne of:\r\n- `purple`\r\n- `pink`\r\n- `orange`\r\n- `yellow`\r\n- `blue`\r\n- `green`\r\n- `grey`\r\n- `red`\r\n- `brown`\r\n- `teal`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__color"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_clinical_statuses.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe status is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__program_registry_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_registry_clinical_statuses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_program_registry_clinical_statuses_changed", "record_program_registry_clinical_statuses_changelog", "set_program_registry_clinical_statuses_updated_at", "set_program_registry_clinical_statuses_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_registry_clinical_statuses_changed", "record_program_registry_clinical_statuses_changelog", "set_program_registry_clinical_statuses_updated_at", "set_program_registry_clinical_statuses_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_program_registry_clinical_statuses_changed", "record_program_registry_clinical_statuses_changelog", "set_program_registry_clinical_statuses_updated_at", "set_program_registry_clinical_statuses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_registry_clinical_statuses\"", "created_at": 1782422377.2291377, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_clinical_statuses"]}, "source.tamanu_source_dbt.tamanu.program_registry_conditions": {"database": "app", "schema": "public", "name": "program_registry_conditions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_registry_conditions.yml", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_conditions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_registry_conditions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_registry_conditions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of program registry conditions.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_registry_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_registry_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_registry_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code (identifier) for the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__code"]}, "name": {"name": "name", "description": "The name of the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_conditions.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe condition is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__program_registry_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_registry_conditions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_program_registry_conditions_changed", "record_program_registry_conditions_changelog", "set_program_registry_conditions_updated_at", "set_program_registry_conditions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_registry_conditions_changed", "record_program_registry_conditions_changelog", "set_program_registry_conditions_updated_at", "set_program_registry_conditions_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_program_registry_conditions_changed", "record_program_registry_conditions_changelog", "set_program_registry_conditions_updated_at", "set_program_registry_conditions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_registry_conditions\"", "created_at": 1782422377.2437038, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_conditions"]}, "source.tamanu_source_dbt.tamanu.program_registry_condition_categories": {"database": "app", "schema": "public", "name": "program_registry_condition_categories", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_registry_condition_categories.yml", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_condition_categories", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_registry_condition_categories"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_registry_condition_categories", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Categories to be set against patient program registry conditions. The categories are configured through the program importer for each program registry. There is a hard-loaded list that is seeded by default in the database for each program registry.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_condition_categories.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_registry_condition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_registry_condition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_registry_condition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "The code for the category.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__code"]}, "name": {"name": "name", "description": "The name for the category.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_condition_categories.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "The id of the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__program_registry_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_registry_condition_categories.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_program_registry_condition_categories_changed", "record_program_registry_condition_categories_changelog", "set_program_registry_condition_categories_updated_at", "set_program_registry_condition_categories_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_registry_condition_categories_changed", "record_program_registry_condition_categories_changelog", "set_program_registry_condition_categories_updated_at", "set_program_registry_condition_categories_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_program_registry_condition_categories_changed", "record_program_registry_condition_categories_changelog", "set_program_registry_condition_categories_updated_at", "set_program_registry_condition_categories_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_registry_condition_categories\"", "created_at": 1782422377.2514396, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_condition_categories"]}, "source.tamanu_source_dbt.tamanu.reference_data": {"database": "app", "schema": "public", "name": "reference_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_data.yml", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "User imported reference data for the environment grouped by type.\r\n\r\n- Catch-all for simple reference data types - there are a LOT of kinds of reference data that exist as just an ID, a \r\nstring label, and occasionally a code; these are all grouped into this table to avoid overcomplicating the schema.\r\n- Occasionally a type of simple reference data will gain some complexity, at which point it will be refactored/migrated \r\nout to use its own table.\r\n- Simple reference data types include a code, type, name and visibility status.\r\n- Example types include `diagnosis`, `procedures`", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code of the data item (short value, alphanumerics and hyphens).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__code"]}, "type": {"name": "type", "description": "Class of the data (referred to in code).\r\n\r\nWhenever this table is referred to in a relationship, it's to a specific `type` here. For example a\r\ntable might have a `diagnosis_id`, which is a reference to this table, for specifically only the\r\nrows with `type = diagnosis`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__type"]}, "name": {"name": "name", "description": "Actual data", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in reference_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_data.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "system_required": {"name": "system_required", "description": "Indicates if this record is system-managed and cannot be modified by users", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__system_required"]}}, "meta": {"triggers": ["notify_reference_data_changed", "record_reference_data_changelog", "set_reference_data_updated_at", "set_reference_data_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_data_changed", "record_reference_data_changelog", "set_reference_data_updated_at", "set_reference_data_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_reference_data_changed", "record_reference_data_changelog", "set_reference_data_updated_at", "set_reference_data_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_data\"", "created_at": 1782422377.2514396, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_data"]}, "source.tamanu_source_dbt.tamanu.reference_data_relations": {"database": "app", "schema": "public", "name": "reference_data_relations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_data_relations.yml", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_data_relations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_data_relations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_data_relations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Entity hierarchy for reference data.\r\n\r\nSome reference datas can be organised in a hierarchy. This is how that's done.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_data_relations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_data_relations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_data_relations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_data_relations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "reference_data_id": {"name": "reference_data_id", "description": "The [reference data](#!/source/source.tamanu.tamanu.reference_data) item.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data_relations__reference_data_id"]}, "reference_data_parent_id": {"name": "reference_data_parent_id", "description": "Another [reference data](#!/source/source.tamanu.tamanu.reference_data) item which is the parent of this one.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data_relations__reference_data_parent_id"]}, "type": {"name": "type", "description": "The type of hierarchy being described.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data_relations__type"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_data_relations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_reference_data_relations_changed", "record_reference_data_relations_changelog", "set_reference_data_relations_updated_at", "set_reference_data_relations_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_data_relations_changed", "record_reference_data_relations_changelog", "set_reference_data_relations_updated_at", "set_reference_data_relations_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_reference_data_relations_changed", "record_reference_data_relations_changelog", "set_reference_data_relations_updated_at", "set_reference_data_relations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_data_relations\"", "created_at": 1782422377.2514396, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_data_relations"]}, "source.tamanu_source_dbt.tamanu.reference_drugs": {"database": "app", "schema": "public", "name": "reference_drugs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_drugs.yml", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_drugs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_drugs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_drugs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Additional information about referenceData that is of the type \u201cdrug\u201d", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_drugs.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "reference_data_id": {"name": "reference_data_id", "description": "Id of the associated reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__reference_data_id"]}, "route": {"name": "route", "description": "Route of the drug", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__route"]}, "units": {"name": "units", "description": "Units of the drug", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__units"]}, "notes": {"name": "notes", "description": "Notes of the drug", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__notes"]}, "is_sensitive": {"name": "is_sensitive", "description": "Whether the drug is sensitive and requires special handling", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__is_sensitive"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_drugs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_drugs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_drugs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_drugs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_reference_drugs_changed", "record_reference_drugs_changelog", "set_reference_drugs_updated_at", "set_reference_drugs_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_drugs_changed", "record_reference_drugs_changelog", "set_reference_drugs_updated_at", "set_reference_drugs_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_reference_drugs_changed", "record_reference_drugs_changelog", "set_reference_drugs_updated_at", "set_reference_drugs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_drugs\"", "created_at": 1782422377.2674875, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_drugs"]}, "source.tamanu_source_dbt.tamanu.reference_drug_facilities": {"database": "app", "schema": "public", "name": "reference_drug_facilities", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_drug_facilities.yml", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_drug_facilities", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_drug_facilities"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_drug_facilities", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Tracks the availability status of drugs at specific facilities.\r\n\r\n- Links reference drugs to facilities with their availability status\r\n- Allows facilities to manage which drugs are available, unavailable, or have limited stock\r\n- Used for medication dispensing workflows to determine drug availability at a facility", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_drug_facilities.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "reference_drug_id": {"name": "reference_drug_id", "description": "Foreign key reference to the associated drug in the reference_drugs table", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drug_facilities__reference_drug_id"]}, "facility_id": {"name": "facility_id", "description": "Foreign key reference to the facility where this drug availability applies", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drug_facilities__facility_id"]}, "quantity": {"name": "quantity", "description": "The numeric quantity of the drug available at this facility. Stored as an INTEGER:\r\n- Positive integer: Number of units available (e.g., 10, 50, 100)\r\n- 0: Drug is out of stock\r\n- NULL: Quantity is not tracked or unknown (used when stock_status is 'unknown' or 'unavailable')", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drug_facilities__quantity"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_drug_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_drug_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_drug_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_drug_facilities.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "stock_status": {"name": "stock_status", "description": "Indicates the stock availability status of the drug at this facility. Stored as a STRING with the following valid values:\r\n- 'in_stock': Drug is available (quantity > 0)\r\n- 'out_of_stock': Drug is not available but tracked (quantity = 0)\r\n- 'unavailable': Drug is not available at this facility (quantity IS NULL)\r\n- 'unknown': Stock status is unknown or not tracked (quantity IS NULL)\r\n\r\nThis column is stored separately from quantity and is enforced by database constraints to maintain consistency:\r\n- 'in_stock' requires quantity > 0\r\n- 'out_of_stock' requires quantity = 0\r\n- 'unknown' or 'unavailable' require quantity IS NULL", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drug_facilities__stock_status"]}}, "meta": {"triggers": ["notify_reference_drug_facilities_changed", "record_reference_drug_facilities_changelog", "set_reference_drug_facilities_updated_at", "set_reference_drug_facilities_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_drug_facilities_changed", "record_reference_drug_facilities_changelog", "set_reference_drug_facilities_updated_at", "set_reference_drug_facilities_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_reference_drug_facilities_changed", "record_reference_drug_facilities_changelog", "set_reference_drug_facilities_updated_at", "set_reference_drug_facilities_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_drug_facilities\"", "created_at": 1782422377.2674875, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_drug_facilities"]}, "source.tamanu_source_dbt.tamanu.reference_medication_templates": {"database": "app", "schema": "public", "name": "reference_medication_templates", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_medication_templates.yml", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_medication_templates", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_medication_templates"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_medication_templates", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Stores templates for medications, allowing for pre-defined medication orders.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_medication_templates.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "reference_data_id": {"name": "reference_data_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) for this medication template.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__reference_data_id"]}, "medication_id": {"name": "medication_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) for the specific drug in this template.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__medication_id"]}, "is_variable_dose": {"name": "is_variable_dose", "description": "Boolean indicating if the medication is to be administered \"pro re nata\" (as needed).", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__is_variable_dose"]}, "is_prn": {"name": "is_prn", "description": "Boolean indicating if the medication dose is variable.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__is_prn"]}, "dose_amount": {"name": "dose_amount", "description": "The amount of medication per dose.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__dose_amount"]}, "units": {"name": "units", "description": "The unit for the dose amount (e.g., mg, mL).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__units"]}, "frequency": {"name": "frequency", "description": "How often the medication should be administered (e.g., BID, TID, QID).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__frequency"]}, "route": {"name": "route", "description": "The route of administration for the medication (e.g., Oral, IV, IM).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__route"]}, "duration_value": {"name": "duration_value", "description": "The numeric value for the duration the medication should be taken (e.g., 7, 14).", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__duration_value"]}, "duration_unit": {"name": "duration_unit", "description": "The unit for the medication duration (e.g., days, weeks, months).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__duration_unit"]}, "notes": {"name": "notes", "description": "Additional notes or instructions for the medication template.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__notes"]}, "discharge_quantity": {"name": "discharge_quantity", "description": "The quantity of medication to be dispensed upon patient discharge.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__discharge_quantity"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_medication_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_medication_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_medication_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_medication_templates.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_ongoing": {"name": "is_ongoing", "description": "A boolean indicating if the medication is ongoing", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__is_ongoing"]}}, "meta": {"triggers": ["notify_reference_medication_templates_changed", "record_reference_medication_templates_changelog", "set_reference_medication_templates_updated_at", "set_reference_medication_templates_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_medication_templates_changed", "record_reference_medication_templates_changelog", "set_reference_medication_templates_updated_at", "set_reference_medication_templates_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_reference_medication_templates_changed", "record_reference_medication_templates_changelog", "set_reference_medication_templates_updated_at", "set_reference_medication_templates_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_medication_templates\"", "created_at": 1782422377.2834995, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_medication_templates"]}, "source.tamanu_source_dbt.tamanu.referrals": {"database": "app", "schema": "public", "name": "referrals", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\referrals.yml", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "source.tamanu_source_dbt.tamanu.referrals", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "referrals"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "referrals", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "[Referrals](https://en.wikipedia.org/wiki/Referral_(medicine)).\r\n\r\nReferrals use a confusing mix of data in the `referrals` table and\r\n[`survey_response_answers`](#!/source/source.tamanu.tamanu.survey_response_answers) identified by\r\nthe text of the question they are for. \r\n\r\nSome additional data is captured in\r\n[survey response answers](#!/source/source.tamanu.tamanu.survey_response_answers), but this is\r\nvariable and not enforced through any validation:\r\n- Where the person is being referred to can be captured by a range of questions, sometimes with a\r\n list of hard coded facility name options, or location groups, or departments.\r\n- Who the referral is \"completed by\" can be captured by a question either the name\r\n 'Referring doctor' or 'Referral completed by'.\r\n- Some referrals are the product of a previous screening survey. In some cases (e.g. Samoa) there is\r\n a SurveyLink question that captures which survey led to this referral, in others (e.g. Nauru)\r\n there is no such question so the two survey responses cannot be reliably linked.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in referrals.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in referrals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in referrals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in referrals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "referred_facility": {"name": "referred_facility", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__referred_facility"]}, "initiating_encounter_id": {"name": "initiating_encounter_id", "description": "Reference to the [initiating encounter](#!/source/source.tamanu.tamanu.encounters).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__initiating_encounter_id"]}, "completing_encounter_id": {"name": "completing_encounter_id", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__completing_encounter_id"]}, "survey_response_id": {"name": "survey_response_id", "description": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) with more data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__survey_response_id"]}, "status": {"name": "status", "description": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in referrals.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_referrals_changed", "record_referrals_changelog", "set_referrals_updated_at", "set_referrals_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_referrals_changed", "record_referrals_changelog", "set_referrals_updated_at", "set_referrals_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_referrals_changed", "record_referrals_changelog", "set_referrals_updated_at", "set_referrals_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"referrals\"", "created_at": 1782422377.3065734, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__referrals"]}, "source.tamanu_source_dbt.tamanu.refresh_tokens": {"database": "app", "schema": "public", "name": "refresh_tokens", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\refresh_tokens.yml", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "source.tamanu_source_dbt.tamanu.refresh_tokens", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "refresh_tokens"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "refresh_tokens", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Refresh tokens are used by API clients to refresh their authentication quickly, within a timeout.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in refresh_tokens.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "refresh_id": {"name": "refresh_id", "description": "Random value given to the client to use as this refresh token.", "meta": {"masking": "string"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__refresh_id"]}, "device_id": {"name": "device_id", "description": "Unique device ID from the client.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__device_id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) being authenticated as.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__user_id"]}, "expires_at": {"name": "expires_at", "description": "When the refresh token expires.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__expires_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in refresh_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in refresh_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in refresh_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"refresh_tokens\"", "created_at": 1782422377.3151298, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__refresh_tokens"]}, "source.tamanu_source_dbt.tamanu.report_definitions": {"database": "app", "schema": "public", "name": "report_definitions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\report_definitions.yml", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.report_definitions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "report_definitions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "report_definitions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A name for a report.\r\n\r\nThis is what you see when selecting a report to generate in Tamanu.\r\n\r\nThe actual data is in [versions](#!/source/source.tamanu.tamanu.report_definition_versions).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in report_definitions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in report_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in report_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in report_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Human-friendly name of the report.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definitions__name"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in report_definitions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "db_schema": {"name": "db_schema", "description": "The name of the database schema (namespace) which is queried.\r\n\r\nDefaults to `reporting`, which are standardised and normalised views designed specifically for\r\nreporting; sometimes this is set to `public` to query the raw database directly.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definitions__db_schema"]}}, "meta": {"triggers": ["notify_report_definitions_changed", "record_report_definitions_changelog", "set_report_definitions_updated_at", "set_report_definitions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_report_definitions_changed", "record_report_definitions_changelog", "set_report_definitions_updated_at", "set_report_definitions_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_report_definitions_changed", "record_report_definitions_changelog", "set_report_definitions_updated_at", "set_report_definitions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"report_definitions\"", "created_at": 1782422377.3151298, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__report_definitions"]}, "source.tamanu_source_dbt.tamanu.report_definition_versions": {"database": "app", "schema": "public", "name": "report_definition_versions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\report_definition_versions.yml", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.report_definition_versions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "report_definition_versions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "report_definition_versions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A report definition containing the actual executable SQL query.\r\n\r\nReport versions are immutable and changes to a report create a new version.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in report_definition_versions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in report_definition_versions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in report_definition_versions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in report_definition_versions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "version_number": {"name": "version_number", "description": "The version number.\r\n\r\nVersion numbers are incrementing integers i.e 1,2,3,4.\r\n\r\nThe active version is determined by the highest `status = 'published'` version number", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__version_number"]}, "notes": {"name": "notes", "description": "Free-form description or usage notes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__notes"]}, "status": {"name": "status", "description": "Status of this version of the report.\r\n\r\nOne of:\r\n- `draft`\r\n- `published`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__status"]}, "query": {"name": "query", "description": "The SQL query.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__query"]}, "query_options": {"name": "query_options", "description": "JSON config containing additional options for the query.\r\n\r\n- Form fields to allow customisation of the query when generating reports (query replacements)\r\n- Default date range e.g. last 30 days\r\n- Context for executing query e.g. this facility or all facilities (facility or central server)", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__query_options"]}, "report_definition_id": {"name": "report_definition_id", "description": "The [report definition](#!/source/source.tamanu.tamanu.report_definitions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__report_definition_id"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who saved this report version.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in report_definition_versions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_report_definition_versions_changed", "record_report_definition_versions_changelog", "set_report_definition_versions_updated_at", "set_report_definition_versions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_report_definition_versions_changed", "record_report_definition_versions_changelog", "set_report_definition_versions_updated_at", "set_report_definition_versions_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_report_definition_versions_changed", "record_report_definition_versions_changelog", "set_report_definition_versions_updated_at", "set_report_definition_versions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"report_definition_versions\"", "created_at": 1782422377.330786, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__report_definition_versions"]}, "source.tamanu_source_dbt.tamanu.report_requests": {"database": "app", "schema": "public", "name": "report_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\report_requests.yml", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.report_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "report_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "report_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Queued requests for reports by users.\r\n\r\nReports can be generated on-demand on the server a user is connected to, or it can be queued and\r\nexecuted at the server's leisure, and then sent attached to an email.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in report_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in report_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in report_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in report_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "report_type": {"name": "report_type", "description": "If the report is defined in code, this is the code of that report.\r\n\r\nMost reports are now created in SQL, but there are still a number of legacy reports that are\r\nhardcoded in the Tamanu source code, and this is how they're referenced.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__report_type"]}, "recipients": {"name": "recipients", "description": "JSON array of email addresses.\r\n\r\nSome legacy data may exist that specifies this as a comma-separated values.", "meta": {"masking": "email"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__recipients"]}, "parameters": {"name": "parameters", "description": "JSON parameters for the report.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__parameters"]}, "status": {"name": "status", "description": "Processing status of the report request.\r\n\r\nOne of:\r\n- `Received`\r\n- `Processing`\r\n- `Processed`\r\n- `Error`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__status"]}, "requested_by_user_id": {"name": "requested_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) requesting this report generation.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__requested_by_user_id"]}, "error": {"name": "error", "description": "If the report fails to process, the error.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__error"]}, "process_started_time": {"name": "process_started_time", "description": "When processing started.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__process_started_time"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this report request is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__facility_id"]}, "export_format": {"name": "export_format", "description": "The format the report results must be exported as.\r\n\r\nOne of:\r\n- `xlsx`\r\n- `csv`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__export_format"]}, "report_definition_version_id": {"name": "report_definition_version_id", "description": "The [report version](#!/source/source.tamanu.tamanu.report_definition_versions) being generated.\r\n\r\nNote that this is a version, not a report. If a report is updated after a request is queued, the\r\n\"old\" version will be executed. Additionally, new versions must be synced to facilities to be usable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__report_definition_version_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in report_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_report_requests_changed", "record_report_requests_changelog", "set_report_requests_updated_at", "set_report_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_report_requests_changed", "record_report_requests_changelog", "set_report_requests_updated_at", "set_report_requests_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["notify_report_requests_changed", "record_report_requests_changelog", "set_report_requests_updated_at", "set_report_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"report_requests\"", "created_at": 1782422377.3507583, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__report_requests"]}, "source.tamanu_source_dbt.tamanu.roles": {"database": "app", "schema": "public", "name": "roles", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\roles.yml", "original_file_path": "models\\sources\\roles.yml", "unique_id": "source.tamanu_source_dbt.tamanu.roles", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "roles"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "roles", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "These are sets of permissions that are given to users to determine what they can do in Tamanu.\r\n\r\nThe actual permissions are associated to the role in the\r\n[`permissions`](#!/source/source.tamanu.tamanu.permissions) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in roles.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in roles.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in roles.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in roles.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Readable name for the role.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.roles__name"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in roles.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_roles_changed", "record_roles_changelog", "set_roles_updated_at", "set_roles_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_roles_changed", "record_roles_changelog", "set_roles_updated_at", "set_roles_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_roles_changed", "record_roles_changelog", "set_roles_updated_at", "set_roles_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"roles\"", "created_at": 1782422377.3623884, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__roles"]}, "source.tamanu_source_dbt.tamanu.scheduled_vaccines": {"database": "app", "schema": "public", "name": "scheduled_vaccines", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\scheduled_vaccines.yml", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "source.tamanu_source_dbt.tamanu.scheduled_vaccines", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "scheduled_vaccines"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "scheduled_vaccines", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A vaccine schedule listing all vaccines expected to be given to a child as part of a country wide Expanded Program of \r\nImmunisation can be incorporated into Tamanu to show each dose and due date on the front end of the system. \r\n\r\nFirst dose of a vaccine should use `weeks_from_birth_due` whilst subsequent doses should use \r\n`weeks_from_last_vaccination_due`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in scheduled_vaccines.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in scheduled_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in scheduled_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in scheduled_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "category": {"name": "category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "label": {"name": "label", "description": "Contents of the label column is what will be displayed on the front end of Tamanu \r\nunder fields labelled 'Vaccine'. This is where the vaccine name is listed. E.g. 'BCG'.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__label"]}, "dose_label": {"name": "dose_label", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "weeks_from_birth_due": {"name": "weeks_from_birth_due", "description": "This column is used to tell Tamanu how many weeks from the child's date of birth a vaccine is due. This will populate \r\nthe front end within the Vaccine schedule section in the column 'Due date'. For a vaccine to appear in the Vaccine \r\nschedule a dose must have a `weeksFromBirthDue` entered into the reference data. \r\n\r\nThis field should be used only for the first dose of the vaccine. Subsequent doses should use \r\n`weeks_from_last_vaccination_due`", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_birth_due"]}, "index": {"name": "index", "description": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__index"]}, "vaccine_id": {"name": "vaccine_id", "description": "Use the vaccineId column to link the id column of the Reference Data sheet Drug to the vaccine schedule. Copy the exact \r\nid from the id column in the reference data sheet Drug and paste it in the vaccineId column in the Scheduled Vaccine \r\nsheet.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__vaccine_id"]}, "weeks_from_last_vaccination_due": {"name": "weeks_from_last_vaccination_due", "description": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given. The order of a vaccine dose is defined at the `index` field. \r\n\r\nThis field should not be used for the first dose but for subsequent doses. First dose should use `weeks_from_birth_due`", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_last_vaccination_due"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in scheduled_vaccines.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in scheduled_vaccines.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "hide_from_certificate": {"name": "hide_from_certificate", "description": "Vaccines can be hidden from the vaccine certificate where required\r\n\r\nTo hide a vaccine from appearing on the vaccine certificate across the deployment, use column hideFromCertificate\r\n- true = vaccine will not appear on the vaccine certificate\r\n- blank / false = vaccine will appear on the vaccine certificate", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__hide_from_certificate"]}, "sort_index": {"name": "sort_index", "description": "Sort index defaults to 0", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__sort_index"]}}, "meta": {"triggers": ["notify_scheduled_vaccines_changed", "record_scheduled_vaccines_changelog", "set_scheduled_vaccines_updated_at", "set_scheduled_vaccines_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_scheduled_vaccines_changed", "record_scheduled_vaccines_changelog", "set_scheduled_vaccines_updated_at", "set_scheduled_vaccines_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_scheduled_vaccines_changed", "record_scheduled_vaccines_changelog", "set_scheduled_vaccines_updated_at", "set_scheduled_vaccines_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"scheduled_vaccines\"", "created_at": 1782422377.3736675, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__scheduled_vaccines"]}, "source.tamanu_source_dbt.tamanu.SequelizeMeta": {"database": "app", "schema": "public", "name": "SequelizeMeta", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\SequelizeMeta.yml", "original_file_path": "models\\sources\\SequelizeMeta.yml", "unique_id": "source.tamanu_source_dbt.tamanu.SequelizeMeta", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "SequelizeMeta"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "SequelizeMeta", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This table tracks which migrations have been run. It is automatically managed by Sequelize (within Tamanu's `migrate`\r\nsubcommand), should never be edited manually", "columns": {"name": {"name": "name", "description": "Name of the migration", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.SequelizeMeta__name"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"SequelizeMeta\"", "created_at": 1782422377.3756723, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__SequelizeMeta"]}, "source.tamanu_source_dbt.tamanu.settings": {"database": "app", "schema": "public", "name": "settings", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\settings.yml", "original_file_path": "models\\sources\\settings.yml", "unique_id": "source.tamanu_source_dbt.tamanu.settings", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "settings"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "settings", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Shared and synced configuration values.\r\n\r\nAlways set from the Central server / Admin interfaces and then synced to facilities.\r\n\r\nThose can change dynamically when a server/client is up, some settings are read at point of use and\r\nso change is applied \"immediately\", some settings are read once at server start but those should be\r\nrare and eventually eliminated as there's no facility within Tamanu to restart its own servers.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in settings.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in settings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in settings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in settings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "key": {"name": "key", "description": "Dotted JSON path.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.settings__key"]}, "value": {"name": "value", "description": "JSON value.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.settings__value"]}, "facility_id": {"name": "facility_id", "description": "The [facility](#!/source/source.tamanu.tamanu.facilities) this setting is scoped to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.settings__facility_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in settings.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "scope": {"name": "scope", "description": "Scope of the setting, which determines how it's applied.\r\n\r\nOne of:\r\n- `global`\r\n- `central`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.settings__scope"]}}, "meta": {"triggers": ["notify_settings_changed", "record_settings_changelog", "set_settings_updated_at", "set_settings_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_settings_changed", "record_settings_changelog", "set_settings_updated_at", "set_settings_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["notify_settings_changed", "record_settings_changelog", "set_settings_updated_at", "set_settings_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"settings\"", "created_at": 1782422377.3796804, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__settings"]}, "source.tamanu_source_dbt.tamanu.signers": {"database": "app", "schema": "public", "name": "signers", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\signers.yml", "original_file_path": "models\\sources\\signers.yml", "unique_id": "source.tamanu_source_dbt.tamanu.signers", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "signers"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "signers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of signing key and certificates for EUDCC and ICAO VDS certifications.\r\n\r\nIntroduced during the COVID-19 pandemic, these are standards which can be\r\nused to produce a QR code containing vaccine information and a digital signature\r\nwhich certifies that the vaccines were administered by a competent authority.\r\n\r\nDigital signatures are issued using a key which is rotated every three months,\r\nand which is itself signed by a Certificate Authority. A country's CA is trusted\r\nby verifying authorities such as the ICAO or EU. This completes the trust chain.\r\n\r\nTamanu generates keys and Certificate Signing Requests in this table. The secret\r\nkey material never leaves the server which generates it. CSRs are signed by the\r\ncountry Health CA, which then returns a Certificate, which is loaded in Tamanu.\r\n\r\nThere are two sets of dates associated with each Signing Key:\r\n- the validity period propagates to the Digital Signatures on the QR codes; and\r\n is generally set to 10 years.\r\n- the working period defines when the Signing Key is rotated.\r\n\r\nWhen a key is rotated, the secret material may be erased to ensure the key can\r\nnever be used again; the public information is kept forever.\r\n\r\nThere is always at most one row in this table which has a NULL `certificate`\r\nfield; this is the pending CSR.\r\n\r\nThe Signing Key in use is the row which has a NON-NULL `certificate`, a validity\r\nand working period encompassing the current time, a NON-NULL `private_key`, and\r\nis the newest within that set.\r\n\r\nSee also the `certifiable_vaccines` table.\r\n\r\nThis table is present on Facility Servers, but never populated.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in signers.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in signers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in signers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in signers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "country_code": {"name": "country_code", "description": "ISO country code for the Health CA.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__country_code"]}, "private_key": {"name": "private_key", "description": "Private key data.\r\n\r\nThis is stored encrypted at rest, using the configuration key `integrations.signer.keySecret`.", "meta": {"masking": "zero"}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {"masking": "zero"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__private_key"]}, "public_key": {"name": "public_key", "description": "Public key data.", "meta": {"masking": "zero"}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {"masking": "zero"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__public_key"]}, "request": {"name": "request", "description": "Certificate Signing Request.", "meta": {"masking": "empty"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__request"]}, "certificate": {"name": "certificate", "description": "Signed Certificate (signed by the Health CA).", "meta": {"masking": "empty"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__certificate"]}, "validity_period_start": {"name": "validity_period_start", "description": "Before that date, the key cannot be used, and signatures generated by it cannot be trusted.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__validity_period_start"]}, "validity_period_end": {"name": "validity_period_end", "description": "After that date, the key cannot be used, and signatures generated by it cannot be trusted.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__validity_period_end"]}, "signatures_issued": {"name": "signatures_issued", "description": "Counter of digital signatures issued from this key.\r\n\r\nThis can be used for statistical purposes or for usage policy. For example, one\r\ncould specify that kyes should be rotated every three months or every 1000\r\nsignatures, whichever comes first.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__signatures_issued"]}, "request_sent_at": {"name": "request_sent_at", "description": "Date at which the CSR was sent to be signed by the Health CA.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__request_sent_at"]}, "working_period_start": {"name": "working_period_start", "description": "Before that date, the key cannot be used.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__working_period_start"]}, "working_period_end": {"name": "working_period_end", "description": "After that date, the key cannot be used.\r\n\r\nAfter that date, the private key may also be nulled.\r\n\r\nThis is always less than or equal to `validity_period_end`.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__working_period_end"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"signers\"", "created_at": 1782422377.3933153, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__signers"]}, "source.tamanu_source_dbt.tamanu.socket_io_attachments": {"database": "app", "schema": "public", "name": "socket_io_attachments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\socket_io_attachments.yml", "original_file_path": "models\\sources\\socket_io_attachments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.socket_io_attachments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "socket_io_attachments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "socket_io_attachments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table used by Socket.IO to synchronise WebSocket sessions across server replicas.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in socket_io_attachments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in socket_io_attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "payload": {"name": "payload", "description": "Payload.", "meta": {}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.socket_io_attachments__payload"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in socket_io_attachments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"masking": "truncate", "triggers": ["notify_socket_io_attachments_changed", "record_socket_io_attachments_changelog", "set_socket_io_attachments_updated_at", "set_socket_io_attachments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"masking": "truncate", "triggers": ["notify_socket_io_attachments_changed", "record_socket_io_attachments_changelog", "set_socket_io_attachments_updated_at", "set_socket_io_attachments_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"masking": "truncate", "triggers": ["notify_socket_io_attachments_changed", "record_socket_io_attachments_changelog", "set_socket_io_attachments_updated_at", "set_socket_io_attachments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"socket_io_attachments\"", "created_at": 1782422377.3933153, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__socket_io_attachments"]}, "source.tamanu_source_dbt.tamanu.surveys": {"database": "app", "schema": "public", "name": "surveys", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\surveys.yml", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "source.tamanu_source_dbt.tamanu.surveys", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "surveys"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "surveys", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Surveys, aka custom forms that can be filled by practitioners.\r\n\r\nThese are composed of [screen components](#!/source/source.tamanu.tamanu.survey_screen_components).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in surveys.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Machine-friendly code.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__name"]}, "program_id": {"name": "program_id", "description": "The [program](#!/source/source.tamanu.tamanu.programs) grouping this survey.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__program_id"]}, "survey_type": {"name": "survey_type", "description": "Type of survey.\r\n\r\nOne of:\r\n- `programs`\r\n- `referral`\r\n- `obsolete`\r\n- `vitals`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__survey_type"]}, "is_sensitive": {"name": "is_sensitive", "description": "Whether the data recorded in the survey is sensitive.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__is_sensitive"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in surveys.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "notifiable": {"name": "notifiable", "description": "Whether filling this survey sends a notification email.\r\n\r\nThese are sent by the `SurveyCompletionNotifierProcessor` scheduled task.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__notifiable"]}, "notify_email_addresses": {"name": "notify_email_addresses", "description": "If `notifiable` is true, where to send the notification.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__notify_email_addresses"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in surveys.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_surveys_changed", "record_surveys_changelog", "set_surveys_updated_at", "set_surveys_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_surveys_changed", "record_surveys_changelog", "set_surveys_updated_at", "set_surveys_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_surveys_changed", "record_surveys_changelog", "set_surveys_updated_at", "set_surveys_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"surveys\"", "created_at": 1782422377.4139538, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__surveys"]}, "source.tamanu_source_dbt.tamanu.survey_responses": {"database": "app", "schema": "public", "name": "survey_responses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\survey_responses.yml", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.survey_responses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "survey_responses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "survey_responses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A response to a survey (as recorded by a practitioner).\r\n\r\nTypically surveys are filled on behalf of patients as part of an encounter.\r\n\r\nBecause there are multiple distinct kinds of dates at play here:\r\n- `created_at`, `updated_at`, `deleted_at` are system data for syncing and cannot be relied on for realtime\r\n- `start_time`, `end_time` are real datetimes automatically recorded when starting and submitting a survey response\r\n- in survey response answers, there could be a data element for targeting the date of when exactly the data is recorded in real time.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_responses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "start_time": {"name": "start_time", "description": "When the survey was started.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__start_time"]}, "end_time": {"name": "end_time", "description": "When the survey was completed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__end_time"]}, "result": {"name": "result", "description": "The numeric value that is the summary of the survey response.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__result"]}, "survey_id": {"name": "survey_id", "description": "The [survey](#!/source/source.tamanu.tamanu.surveys) being responded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__survey_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this survey response is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__encounter_id"]}, "result_text": {"name": "result_text", "description": "The textual value that is the summary of the survey response.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__result_text"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) recording this survey response.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__user_id"]}, "start_time_legacy": {"name": "start_time_legacy", "description": "[Deprecated] When the survey was started.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__start_time_legacy"]}, "end_time_legacy": {"name": "end_time_legacy", "description": "[Deprecated] When the survey was completed.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__end_time_legacy"]}, "notified": {"name": "notified", "description": "If the [survey](#!/source/source.tamanu.tamanu.surveys) is `notifiable`, whether this response's\r\nnotification has been sent.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__notified"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in survey_responses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "metadata": {"name": "metadata", "description": "Metadata for a survey response, (eg: if a survey response is linked to another survey response)", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__metadata"]}}, "meta": {"triggers": ["notify_survey_responses_changed", "record_survey_responses_changelog", "set_survey_responses_updated_at", "set_survey_responses_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_survey_responses_changed", "record_survey_responses_changelog", "set_survey_responses_updated_at", "set_survey_responses_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_survey_responses_changed", "record_survey_responses_changelog", "set_survey_responses_updated_at", "set_survey_responses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"survey_responses\"", "created_at": 1782422377.4251337, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_responses"]}, "source.tamanu_source_dbt.tamanu.survey_response_answers": {"database": "app", "schema": "public", "name": "survey_response_answers", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\survey_response_answers.yml", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "source.tamanu_source_dbt.tamanu.survey_response_answers", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "survey_response_answers"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "survey_response_answers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A single answer as part of a [survey response](#!/source/source.tamanu.tamanu.survey_responses).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_response_answers.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in survey_response_answers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in survey_response_answers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in survey_response_answers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of the question.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__name"]}, "body": {"name": "body", "description": "Value of the answer.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__body"]}, "response_id": {"name": "response_id", "description": "The [survey response](#!/source/source.tamanu.tamanu.survey_responses).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__response_id"]}, "data_element_id": {"name": "data_element_id", "description": "Reference to the [question](#!/source/source.tamanu.tamanu.program_data_elements).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__data_element_id"]}, "body_legacy": {"name": "body_legacy", "description": "[Deprecated] Value of the answer in old format.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__body_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in survey_response_answers.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_survey_response_answers_changed", "record_survey_response_answers_changelog", "set_survey_response_answers_updated_at", "set_survey_response_answers_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_survey_response_answers_changed", "record_survey_response_answers_changelog", "set_survey_response_answers_updated_at", "set_survey_response_answers_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_survey_response_answers_changed", "record_survey_response_answers_changelog", "set_survey_response_answers_updated_at", "set_survey_response_answers_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"survey_response_answers\"", "created_at": 1782422377.4339013, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_response_answers"]}, "source.tamanu_source_dbt.tamanu.survey_screen_components": {"database": "app", "schema": "public", "name": "survey_screen_components", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\survey_screen_components.yml", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "source.tamanu_source_dbt.tamanu.survey_screen_components", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "survey_screen_components"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "survey_screen_components", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Describes how a survey question gets displayed.\r\n\r\nSee [program data element](#!/source/source.tamanu.tamanu.program_data_elements), which describes\r\nhow the data from the question is stored.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_screen_components.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in survey_screen_components.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in survey_screen_components.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in survey_screen_components.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "screen_index": {"name": "screen_index", "description": "Screen this component should appear on.\r\n\r\nSurveys can have multiple \"screens\" or pages, this index sets where this particular question sits.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__screen_index"]}, "component_index": {"name": "component_index", "description": "The absolute index (order) of the component in the survey.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__component_index"]}, "text": {"name": "text", "description": "Description or question of this component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__text"]}, "visibility_criteria": {"name": "visibility_criteria", "description": "JSON criteria that determines when this component is visible.\r\n\r\nA criteria is a list of other components' codes and the value that will make this question show up:\r\n\r\n```json\r\n{\r\n \"otherQuestion\": \"Yes\"\r\n}\r\n```\r\n\r\nThere can also be the special criterium `{\"hidden\": true}` which always hides the question, and the\r\nspecial key `\"_conjunction\": \"or\"` which makes it so _any one_ item in the list is sufficient to\r\nshow the question, instead of the default where _all_ items must match.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__visibility_criteria"]}, "validation_criteria": {"name": "validation_criteria", "description": "JSON criteria that determines whether the value entered in this component is accepted.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__validation_criteria"]}, "detail": {"name": "detail", "description": "Longer description or explanatory text of this component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__detail"]}, "config": {"name": "config", "description": "JSON additional config of the component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__config"]}, "options": {"name": "options", "description": "JSON array of strings of options to be selected.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__options"]}, "calculation": {"name": "calculation", "description": "Math expression to do calculations on the entered value before it's saved.\r\n\r\nFor example `questionCode + 3`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__calculation"]}, "survey_id": {"name": "survey_id", "description": "The [survey](#!/source/source.tamanu.tamanu.surveys).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__survey_id"]}, "data_element_id": {"name": "data_element_id", "description": "Reference to the [data element](#!/source/source.tamanu.tamanu.program_data_elements) configuring\r\nhow the data from the question is stored.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__data_element_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in survey_screen_components.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in survey_screen_components.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_survey_screen_components_changed", "record_survey_screen_components_changelog", "set_survey_screen_components_updated_at", "set_survey_screen_components_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_survey_screen_components_changed", "record_survey_screen_components_changelog", "set_survey_screen_components_updated_at", "set_survey_screen_components_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_survey_screen_components_changed", "record_survey_screen_components_changelog", "set_survey_screen_components_updated_at", "set_survey_screen_components_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"survey_screen_components\"", "created_at": 1782422377.440914, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_screen_components"]}, "source.tamanu_source_dbt.tamanu.sync_device_ticks": {"database": "app", "schema": "public", "name": "sync_device_ticks", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_device_ticks.yml", "original_file_path": "models\\sources\\sync_device_ticks.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_device_ticks", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_device_ticks"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_device_ticks", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Cache of which syncing device is at which tick.\r\n\r\nThis is used internally as part of sync.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_device_ticks.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "persisted_at_sync_tick": {"name": "persisted_at_sync_tick", "description": "The sync tick.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_device_ticks__persisted_at_sync_tick"]}, "device_id": {"name": "device_id", "description": "The device that's at this sync tick.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_device_ticks__device_id"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_device_ticks\"", "created_at": 1782422377.440914, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_device_ticks"]}, "source.tamanu_source_dbt.tamanu.sync_lookup": {"database": "app", "schema": "public", "name": "sync_lookup", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_lookup.yml", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_lookup", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_lookup"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_lookup", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Cache of records to use for sync.\r\n\r\nThis is used internally in the sync process.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_lookup.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "record_id": {"name": "record_id", "description": "The `id` field of the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__record_id"]}, "record_type": {"name": "record_type", "description": "The table name of the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__record_type"]}, "data": {"name": "data", "description": "All the fields of the record.", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__data"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in sync_lookup.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "patient_id": {"name": "patient_id", "description": "If the record has a [patient](#!/source/source.tamanu.tamanu.patients) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__patient_id"]}, "encounter_id": {"name": "encounter_id", "description": "If the record has an [encounter](#!/source/source.tamanu.tamanu.encounters) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__encounter_id"]}, "facility_id": {"name": "facility_id", "description": "If the record has a [facility](#!/source/source.tamanu.tamanu.facilitys) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__facility_id"]}, "is_lab_request": {"name": "is_lab_request", "description": "Whether the record is or is related to a lab request.\r\n\r\nThis is used to filter records efficiently during the sync process.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__is_lab_request"]}, "is_deleted": {"name": "is_deleted", "description": "Whether the record is deleted (`deleted_at` is not null).\r\n\r\nThis is used to sort and filter records efficiently during the sync process.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__is_deleted"]}, "updated_at_by_field_sum": {"name": "updated_at_by_field_sum", "description": "If the record has an `updatedAtByField`, the sum of those values.\r\n\r\nThis is used to sort and filter records efficiently during the sync process.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__updated_at_by_field_sum"]}, "pushed_by_device_id": {"name": "pushed_by_device_id", "description": "The unique device that pushed this record.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__pushed_by_device_id"]}}, "meta": {"masking": "truncate", "triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"masking": "truncate", "triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"masking": "truncate", "triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_lookup\"", "created_at": 1782422377.4567597, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_lookup"]}, "source.tamanu_source_dbt.tamanu.sync_lookup_ticks": {"database": "app", "schema": "public", "name": "sync_lookup_ticks", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_lookup_ticks.yml", "original_file_path": "models\\sources\\sync_lookup_ticks.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_lookup_ticks", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_lookup_ticks"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_lookup_ticks", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Stores range of sync lookup ticks per sync.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_lookup_ticks.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "source_start_tick": {"name": "source_start_tick", "description": "Represents the previous lookup up to tick.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup_ticks__source_start_tick"]}, "lookup_end_tick": {"name": "lookup_end_tick", "description": "Represents the new sync tick at time of updating lookup-pending records.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup_ticks__lookup_end_tick"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_lookup_ticks\"", "created_at": 1782422377.4567597, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_lookup_ticks"]}, "source.tamanu_source_dbt.tamanu.sync_queued_devices": {"database": "app", "schema": "public", "name": "sync_queued_devices", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_queued_devices.yml", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_queued_devices", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_queued_devices"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_queued_devices", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Devices waiting their turn to be synced.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_queued_devices.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "last_seen_time": {"name": "last_seen_time", "description": "The last time the device has reached out to the syncing server.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__last_seen_time"]}, "facility_id_legacy": {"name": "facility_id_legacy", "description": "[Deprecated] Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this device is associated with.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__facility_id_legacy"]}, "last_synced_tick": {"name": "last_synced_tick", "description": "The sync tick the device is currently at.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__last_synced_tick"]}, "urgent": {"name": "urgent", "description": "A way for a device to bump its priority in the queue.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__urgent"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in sync_queued_devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in sync_queued_devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in sync_queued_devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "facility_ids": {"name": "facility_ids", "description": "Reference to the [facilities](#!/source/source.tamanu.tamanu.facilities) this device is associated with.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__facility_ids"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_queued_devices\"", "created_at": 1782422377.4567597, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_queued_devices"]}, "source.tamanu_source_dbt.tamanu.sync_sessions": {"database": "app", "schema": "public", "name": "sync_sessions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_sessions.yml", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_sessions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_sessions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_sessions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records of each user that can login to the site", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_sessions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in sync_sessions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in sync_sessions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in sync_sessions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "start_time": {"name": "start_time", "description": "Timestamp when sync session started", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__start_time"]}, "last_connection_time": {"name": "last_connection_time", "description": "Timestamp when sync session made last connection", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__last_connection_time"]}, "snapshot_completed_at": {"name": "snapshot_completed_at", "description": "Timestamp when sync session snapshot was completed", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__snapshot_completed_at"]}, "debug_info": {"name": "debug_info", "description": "Debug information for the sync session", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__debug_info"]}, "parameters": {"name": "parameters", "description": "Parameters for the sync session", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__parameters"]}, "completed_at": {"name": "completed_at", "description": "Timestamp when sync session was completed", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__completed_at"]}, "persist_completed_at": {"name": "persist_completed_at", "description": "Timestamp when sync session completion record is persisted", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__persist_completed_at"]}, "pull_since": {"name": "pull_since", "description": "Sync tick that the sync session pulled since", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__pull_since"]}, "pull_until": {"name": "pull_until", "description": "Sync tick that the sync session pulled until", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__pull_until"]}, "started_at_tick": {"name": "started_at_tick", "description": "Sync tick that the sync session started at", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__started_at_tick"]}, "snapshot_started_at": {"name": "snapshot_started_at", "description": "Timestamp the sync session snapshot started at", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__snapshot_started_at"]}, "errors": {"name": "errors", "description": "If a sync fails, the error(s).", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__errors"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_sessions\"", "created_at": 1782422377.472646, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_sessions"]}, "source.tamanu_source_dbt.tamanu.tasks": {"database": "app", "schema": "public", "name": "tasks", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\tasks.yml", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "source.tamanu_source_dbt.tamanu.tasks", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "tasks"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "tasks", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Tasks related to encounters", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in tasks.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this task is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__encounter_id"]}, "name": {"name": "name", "description": "Name of the task.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__name"]}, "due_time": {"name": "due_time", "description": "When the task is due.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__due_time"]}, "end_time": {"name": "end_time", "description": "When the repeating task is end.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__end_time"]}, "requested_by_user_id": {"name": "requested_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this task.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__requested_by_user_id"]}, "request_time": {"name": "request_time", "description": "When the task is requested.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__request_time"]}, "status": {"name": "status", "description": "Status of the task.\r\n\r\nOne of:\r\n- `todo`\r\n- `completed`\r\n- `non_completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__status"]}, "note": {"name": "note", "description": "Note of the task.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__note"]}, "frequency_value": {"name": "frequency_value", "description": "Frequency value of the task (if the task is repeating), must go with frequency unit.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__frequency_value"]}, "frequency_unit": {"name": "frequency_unit", "description": "Frequency unit of the task (if the task is repeating).\r\n\r\nOne of:\r\n- `minute`\r\n- `hour`\r\n- `day`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__frequency_unit"]}, "high_priority": {"name": "high_priority", "description": "Boolean specify if the task is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__high_priority"]}, "parent_task_id": {"name": "parent_task_id", "description": "Reference to the original [task](#!/source/source.tamanu.tamanu.tasks) that the task is repeated from if it is a repeating task.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__parent_task_id"]}, "completed_by_user_id": {"name": "completed_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as completed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__completed_by_user_id"]}, "completed_time": {"name": "completed_time", "description": "When the task is marked as completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__completed_time"]}, "completed_note": {"name": "completed_note", "description": "Completed note of the task.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__completed_note"]}, "not_completed_by_user_id": {"name": "not_completed_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as not completed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__not_completed_by_user_id"]}, "not_completed_time": {"name": "not_completed_time", "description": "When the task is marked as not completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__not_completed_time"]}, "not_completed_reason_id": {"name": "not_completed_reason_id", "description": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is not completed.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__not_completed_reason_id"]}, "todo_by_user_id": {"name": "todo_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as to-do.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__todo_by_user_id"]}, "todo_time": {"name": "todo_time", "description": "When the task is marked as to-do.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__todo_time"]}, "todo_note": {"name": "todo_note", "description": "To-do note of the task.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__todo_note"]}, "deleted_by_user_id": {"name": "deleted_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who delete this task.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__deleted_by_user_id"]}, "deleted_time": {"name": "deleted_time", "description": "When the task is deleted.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__deleted_time"]}, "deleted_reason_id": {"name": "deleted_reason_id", "description": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is deleted.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__deleted_reason_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in tasks.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in tasks.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in tasks.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "deleted_reason_for_sync_id": {"name": "deleted_reason_for_sync_id", "description": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is deleted if it is deleted by the system.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__deleted_reason_for_sync_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in tasks.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "duration_value": {"name": "duration_value", "description": "Numeric value specifying the expected duration of the task, must be used in conjunction with duration_unit.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__duration_value"]}, "duration_unit": {"name": "duration_unit", "description": "Unit of time for the task duration.\r\n\r\nOne of:\r\n- `hours`\r\n- `days`\r\n- `occurrences`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__duration_unit"]}, "task_type": {"name": "task_type", "description": "Type of the task.\r\n\r\nOne of:\r\n- `normal_task`\r\n- `medication_due_task`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__task_type"]}}, "meta": {"triggers": ["notify_tasks_changed", "record_tasks_changelog", "set_tasks_updated_at", "set_tasks_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_tasks_changed", "record_tasks_changelog", "set_tasks_updated_at", "set_tasks_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_tasks_changed", "record_tasks_changelog", "set_tasks_updated_at", "set_tasks_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"tasks\"", "created_at": 1782422377.4886782, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__tasks"]}, "source.tamanu_source_dbt.tamanu.task_designations": {"database": "app", "schema": "public", "name": "task_designations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\task_designations.yml", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.task_designations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "task_designations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "task_designations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of designation to task.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in task_designations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "task_id": {"name": "task_id", "description": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_designations__task_id"]}, "designation_id": {"name": "designation_id", "description": "The task [task](#!/source/source.tamanu.tamanu.tasks)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_designations__designation_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in task_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in task_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in task_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in task_designations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_task_designations_changed", "record_task_designations_changelog", "set_task_designations_updated_at", "set_task_designations_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_task_designations_changed", "record_task_designations_changelog", "set_task_designations_updated_at", "set_task_designations_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_task_designations_changed", "record_task_designations_changelog", "set_task_designations_updated_at", "set_task_designations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"task_designations\"", "created_at": 1782422377.4886782, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__task_designations"]}, "source.tamanu_source_dbt.tamanu.task_templates": {"database": "app", "schema": "public", "name": "task_templates", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\task_templates.yml", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "source.tamanu_source_dbt.tamanu.task_templates", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "task_templates"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "task_templates", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Template of tasks which then can be created upon", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in task_templates.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "reference_data_id": {"name": "reference_data_id", "description": "The name of task template, referred to ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_templates__reference_data_id"]}, "high_priority": {"name": "high_priority", "description": "Boolean specify if the task template is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_templates__high_priority"]}, "frequency_value": {"name": "frequency_value", "description": "Frequency value of the task template (if the task is repeating), must go with frequency unit.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_templates__frequency_value"]}, "frequency_unit": {"name": "frequency_unit", "description": "Frequency unit of the task template (if the task is repeating).\r\n\r\nOne of:\r\n- `minute`\r\n- `hour`\r\n- `day`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_templates__frequency_unit"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in task_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in task_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in task_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in task_templates.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_task_templates_changed", "record_task_templates_changelog", "set_task_templates_updated_at", "set_task_templates_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_task_templates_changed", "record_task_templates_changelog", "set_task_templates_updated_at", "set_task_templates_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_task_templates_changed", "record_task_templates_changelog", "set_task_templates_updated_at", "set_task_templates_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"task_templates\"", "created_at": 1782422377.4886782, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__task_templates"]}, "source.tamanu_source_dbt.tamanu.task_template_designations": {"database": "app", "schema": "public", "name": "task_template_designations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\task_template_designations.yml", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.task_template_designations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "task_template_designations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "task_template_designations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of designation to task template", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in task_template_designations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "task_template_id": {"name": "task_template_id", "description": "The task template ([Task Template](#!/source/source.tamanu.tamanu.task_templates)).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_template_designations__task_template_id"]}, "designation_id": {"name": "designation_id", "description": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_template_designations__designation_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in task_template_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in task_template_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in task_template_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in task_template_designations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_task_template_designations_changed", "record_task_template_designations_changelog", "set_task_template_designations_updated_at", "set_task_template_designations_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_task_template_designations_changed", "record_task_template_designations_changelog", "set_task_template_designations_updated_at", "set_task_template_designations_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_task_template_designations_changed", "record_task_template_designations_changelog", "set_task_template_designations_updated_at", "set_task_template_designations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"task_template_designations\"", "created_at": 1782422377.5083714, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__task_template_designations"]}, "source.tamanu_source_dbt.tamanu.templates": {"database": "app", "schema": "public", "name": "templates", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\templates.yml", "original_file_path": "models\\sources\\templates.yml", "unique_id": "source.tamanu_source_dbt.tamanu.templates", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "templates"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "templates", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Templates used for patient letters and clinical notes etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in templates.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "name": {"name": "name", "description": "Internal name of the template (used when importing).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__name"]}, "date_created": {"name": "date_created", "description": "When the template was created.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__date_created"]}, "title": {"name": "title", "description": "Title of the template (which will be rendered).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__title"]}, "body": {"name": "body", "description": "Body of the template (which will be rendered).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__body"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in templates.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "created_by_id": {"name": "created_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who created this template.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__created_by_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in templates.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "type": {"name": "type", "description": "Type of the template (referred to in code).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__type"]}}, "meta": {"triggers": ["notify_templates_changed", "record_templates_changelog", "set_templates_updated_at", "set_templates_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_templates_changed", "record_templates_changelog", "set_templates_updated_at", "set_templates_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_templates_changed", "record_templates_changelog", "set_templates_updated_at", "set_templates_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"templates\"", "created_at": 1782422377.5163596, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__templates"]}, "source.tamanu_source_dbt.tamanu.translated_strings": {"database": "app", "schema": "public", "name": "translated_strings", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\translated_strings.yml", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "source.tamanu_source_dbt.tamanu.translated_strings", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "translated_strings"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "translated_strings", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Localisation and translation strings.\r\n\r\nThese are used for two distinct purposes:\r\n- to translate Tamanu in languages other than English\r\n- to adjust the wording of specific items in the UI", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in translated_strings.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "string_id": {"name": "string_id", "description": "The internal reference of the item being translated.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__string_id"]}, "language": {"name": "language", "description": "The language code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__language"]}, "text": {"name": "text", "description": "The actual translated text.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__text"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in translated_strings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in translated_strings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in translated_strings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in translated_strings.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_translated_strings_changed", "record_translated_strings_changelog", "set_translated_strings_updated_at", "set_translated_strings_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_translated_strings_changed", "record_translated_strings_changelog", "set_translated_strings_updated_at", "set_translated_strings_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_translated_strings_changed", "record_translated_strings_changelog", "set_translated_strings_updated_at", "set_translated_strings_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"translated_strings\"", "created_at": 1782422377.5203707, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__translated_strings"]}, "source.tamanu_source_dbt.tamanu.triages": {"database": "app", "schema": "public", "name": "triages", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\triages.yml", "original_file_path": "models\\sources\\triages.yml", "unique_id": "source.tamanu_source_dbt.tamanu.triages", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "triages"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "triages", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Triage data of patients waiting in an emergency department.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in triages.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in triages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in triages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in triages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "arrival_time": {"name": "arrival_time", "description": "When the patient arrived.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time"]}, "triage_time": {"name": "triage_time", "description": "When the patient was triaged.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time"]}, "closed_time": {"name": "closed_time", "description": "When the patient was processed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time"]}, "score": {"name": "score", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__encounter_id"]}, "practitioner_id": {"name": "practitioner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__practitioner_id"]}, "chief_complaint_id": {"name": "chief_complaint_id", "description": "Reference to the primary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__chief_complaint_id"]}, "secondary_complaint_id": {"name": "secondary_complaint_id", "description": "Reference to the secondary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__secondary_complaint_id"]}, "arrival_time_legacy": {"name": "arrival_time_legacy", "description": "[Deprecated] When the patient arrived.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time_legacy"]}, "triage_time_legacy": {"name": "triage_time_legacy", "description": "[Deprecated] When the patient was triaged.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time_legacy"]}, "closed_time_legacy": {"name": "closed_time_legacy", "description": "[Deprecated] When the patient was processed.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time_legacy"]}, "arrival_mode_id": {"name": "arrival_mode_id", "description": "Reference to how the patient arrived ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = arrivalMode`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_mode_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in triages.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_triages_changed", "record_triages_changelog", "set_triages_updated_at", "set_triages_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_triages_changed", "record_triages_changelog", "set_triages_updated_at", "set_triages_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_triages_changed", "record_triages_changelog", "set_triages_updated_at", "set_triages_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"triages\"", "created_at": 1782422377.537889, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__triages"]}, "source.tamanu_source_dbt.tamanu.upcoming_vaccinations": {"database": "app", "schema": "public", "name": "upcoming_vaccinations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\upcoming_vaccinations.yml", "original_file_path": "models\\sources\\upcoming_vaccinations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.upcoming_vaccinations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "upcoming_vaccinations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "upcoming_vaccinations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A **view** which lists patients and next vaccine due for a given vaccine type.\r\n\r\nThe first dose of a vaccine type is based on weeks from birth due whilst subsequent doses are based on weeks from last \r\nvaccination due.\r\n\r\nAge limits in years and thresholds in days for scheduled status are configurable with the following defaults:\r\n\r\n- Age = 15\r\n- Status: Scheduled = 28\r\n- Status: Upcoming = 7\r\n- Status: Due = -7\r\n- Status: Overdue = -55\r\n- Status: Missed = -Infinity", "columns": {"patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__patient_id"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [scheduled vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_category"]}, "vaccine_id": {"name": "vaccine_id", "description": "Reference to the vaccine ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_id"]}, "due_date": {"name": "due_date", "description": "Due date of the scheduled vaccine.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__due_date"]}, "days_till_due": {"name": "days_till_due", "description": "Number of days until the scheduled vaccine is due. Negative numbers indicates the number of days in the past the vaccine\r\nwas due.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__days_till_due"]}, "status": {"name": "status", "description": "Status of the upcoming vaccination listed ['DUE', 'OVERDUE', 'MISSED', 'SCHEDULED', 'UPCOMING']", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__status"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"upcoming_vaccinations\"", "created_at": 1782422377.537889, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__upcoming_vaccinations"]}, "source.tamanu_source_dbt.tamanu.users": {"database": "app", "schema": "public", "name": "users", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\users.yml", "original_file_path": "models\\sources\\users.yml", "unique_id": "source.tamanu_source_dbt.tamanu.users", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "users"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "users", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records of each user that can login to Tamanu.\r\n\r\nThis includes machine users.\r\n\r\nThere is one special user account with an all-zero `id`, which is the global \"system\" user. This is\r\nused as a pseudo identity where the Tamanu system itself takes an action that normally is performed\r\nby a human or API user.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "email": {"name": "email", "description": "Email address for user. This is used to login and receive emails.", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__email"]}, "password": {"name": "password", "description": "Hashed password for user login.\r\n\r\nThe value is encoded as a \"standard password hash\" with a `$[type]$[params]$[salt]$[hash]` general\r\nformat. This allows upgrading algorithms and parameters seamlessly. The current algorithm is bcrypt.\r\n\r\nThis may be null to prevent a user from being able to login.", "meta": {"masking": "nil"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "nil"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__password"]}, "display_name": {"name": "display_name", "description": "The human readable display name for the user.", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "role": {"name": "role", "description": "The role of the user, which sets their permission level.\r\n\r\nThe special values `admin` and `system` indicate a superadmin and a system user respectively.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__role"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in users.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "display_id": {"name": "display_id", "description": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "phone_number": {"name": "phone_number", "description": "Phone number for the user.\r\n\r\nThis is not currently available anywhere visible.", "meta": {"masking": "phone"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "phone"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__phone_number"]}, "device_registration_quota": {"name": "device_registration_quota", "description": "How many devices this user can register (when `features.deviceRegistrationQuota` is enabled).\r\n\r\nSee [`devices`](#!/source/source.tamanu.tamanu.devices) for more.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__device_registration_quota"]}}, "meta": {"triggers": ["notify_users_changed", "record_users_changelog", "set_users_updated_at", "set_users_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_users_changed", "record_users_changelog", "set_users_updated_at", "set_users_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_users_changed", "record_users_changelog", "set_users_updated_at", "set_users_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"users\"", "created_at": 1782422377.551857, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__users"]}, "source.tamanu_source_dbt.tamanu.user_designations": {"database": "app", "schema": "public", "name": "user_designations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_designations.yml", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_designations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_designations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_designations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of user to designation", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_designations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_designations__user_id"]}, "designation_id": {"name": "designation_id", "description": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_designations__designation_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_designations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_user_designations_changed", "record_user_designations_changelog", "set_user_designations_updated_at", "set_user_designations_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_designations_changed", "record_user_designations_changelog", "set_user_designations_updated_at", "set_user_designations_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_user_designations_changed", "record_user_designations_changelog", "set_user_designations_updated_at", "set_user_designations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_designations\"", "created_at": 1782422377.567645, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_designations"]}, "source.tamanu_source_dbt.tamanu.user_facilities": {"database": "app", "schema": "public", "name": "user_facilities", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_facilities.yml", "original_file_path": "models\\sources\\user_facilities.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_facilities", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_facilities"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_facilities", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of users to facilities.\r\n\r\nThis can be used to assign users to certain facilities, for authorisation purposes or for staff convenience.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_facilities.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "facility_id": {"name": "facility_id", "description": "The [facility](#!/source/source.tamanu.tamanu.facilities).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_facilities__facility_id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_facilities__user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_facilities.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_user_facilities_changed", "record_user_facilities_changelog", "set_user_facilities_updated_at", "set_user_facilities_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_facilities_changed", "record_user_facilities_changelog", "set_user_facilities_updated_at", "set_user_facilities_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["notify_user_facilities_changed", "record_user_facilities_changelog", "set_user_facilities_updated_at", "set_user_facilities_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_facilities\"", "created_at": 1782422377.5716546, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_facilities"]}, "source.tamanu_source_dbt.tamanu.user_leaves": {"database": "app", "schema": "public", "name": "user_leaves", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_leaves.yml", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_leaves", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_leaves"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_leaves", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records user leave requests, including leave period and scheduling/removal metadata.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_leaves.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_date": {"name": "start_date", "description": "Start date of the leave.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_leaves__start_date"]}, "end_date": {"name": "end_date", "description": "End date of the leave.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_leaves__end_date"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested the leave.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_leaves__user_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_leaves.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_leaves.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_leaves.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_leaves.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_user_leaves_changed", "record_user_leaves_changelog", "set_user_leaves_updated_at", "set_user_leaves_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_leaves_changed", "record_user_leaves_changelog", "set_user_leaves_updated_at", "set_user_leaves_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_user_leaves_changed", "record_user_leaves_changelog", "set_user_leaves_updated_at", "set_user_leaves_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_leaves\"", "created_at": 1782422377.5779817, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_leaves"]}, "source.tamanu_source_dbt.tamanu.user_localisation_caches": {"database": "app", "schema": "public", "name": "user_localisation_caches", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_localisation_caches.yml", "original_file_path": "models\\sources\\user_localisation_caches.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_localisation_caches", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_localisation_caches"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_localisation_caches", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Cached localisation data.\r\n\r\nLocalisation can be pretty expensive to retrieve, so this caches it per user.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_localisation_caches.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "localisation": {"name": "localisation", "description": "JSON data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_localisation_caches__localisation"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) this cache is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_localisation_caches__user_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_localisation_caches.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_localisation_caches.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_localisation_caches.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}}, "meta": {"masking": "truncate", "triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"masking": "truncate", "triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"masking": "truncate", "triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_localisation_caches\"", "created_at": 1782422377.5779817, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_localisation_caches"]}, "source.tamanu_source_dbt.tamanu.user_login_attempts": {"database": "app", "schema": "public", "name": "user_login_attempts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_login_attempts.yml", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_login_attempts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_login_attempts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_login_attempts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A table that tracks user login attempts for the lockout feature.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_login_attempts.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_login_attempts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_login_attempts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_login_attempts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "outcome": {"name": "outcome", "description": "A string specifying the outcome of the login attempt.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_login_attempts__outcome"]}, "device_id": {"name": "device_id", "description": "The [device](#!/source/source.tamanu.tamanu.devices).", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_login_attempts__device_id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_login_attempts__user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_login_attempts.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_user_login_attempts_changed", "record_user_login_attempts_changelog", "set_user_login_attempts_updated_at", "set_user_login_attempts_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_login_attempts_changed", "record_user_login_attempts_changelog", "set_user_login_attempts_updated_at", "set_user_login_attempts_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_user_login_attempts_changed", "record_user_login_attempts_changelog", "set_user_login_attempts_updated_at", "set_user_login_attempts_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_login_attempts\"", "created_at": 1782422377.5979586, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_login_attempts"]}, "source.tamanu_source_dbt.tamanu.user_preferences": {"database": "app", "schema": "public", "name": "user_preferences", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_preferences.yml", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_preferences", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_preferences"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_preferences", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Per-user preferences.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_preferences.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_preferences.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_preferences.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_preferences.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) these preferences are for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_preferences__user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_preferences.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "key": {"name": "key", "description": "Key of the user preference", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_preferences__key"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) that this preference applies to", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_preferences__facility_id"]}, "value": {"name": "value", "description": "Value of the user preference", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_preferences__value"]}}, "meta": {"triggers": ["notify_user_preferences_changed", "record_user_preferences_changelog", "set_user_preferences_updated_at", "set_user_preferences_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_preferences_changed", "record_user_preferences_changelog", "set_user_preferences_updated_at", "set_user_preferences_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["notify_user_preferences_changed", "record_user_preferences_changelog", "set_user_preferences_updated_at", "set_user_preferences_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_preferences\"", "created_at": 1782422377.604473, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_preferences"]}, "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients": {"database": "app", "schema": "public", "name": "user_recently_viewed_patients", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_recently_viewed_patients.yml", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_recently_viewed_patients"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_recently_viewed_patients", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A list of patients that a user has viewed recently.\r\n\r\nThis powers the \"quick access\" list in Tamanu to get back to patients that a user was last\r\ninteracting with.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_recently_viewed_patients.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_recently_viewed_patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_recently_viewed_patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_recently_viewed_patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_recently_viewed_patients__user_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) that was viewed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_recently_viewed_patients__patient_id"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_recently_viewed_patients\"", "created_at": 1782422377.6104794, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_recently_viewed_patients"]}, "source.tamanu_source_dbt.tamanu.vitals": {"database": "app", "schema": "public", "name": "vitals", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\vitals.yml", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "source.tamanu_source_dbt.tamanu.vitals", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "vitals"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "vitals", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "[Deprecated] Patient's observed vitals. This is now done as a survey response.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vitals.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in vitals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in vitals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in vitals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date_recorded": {"name": "date_recorded", "description": "Local date and time of the event being recorded in vitals.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_recorded"]}, "temperature": {"name": "temperature", "description": "Observed patient's body temperature", "meta": {"masking": {"kind": "float", "range": "35-42"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "35-42"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__temperature"]}, "weight": {"name": "weight", "description": "Observed patient's body weight", "meta": {"masking": {"kind": "float", "range": "20-120"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "20-120"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__weight"]}, "height": {"name": "height", "description": "Observed patient's height", "meta": {"masking": {"kind": "float", "range": "50-220"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "50-220"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__height"]}, "sbp": {"name": "sbp", "description": "Observed patient's systolic blood pressure", "meta": {"masking": {"kind": "float", "range": "60-150"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "60-150"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__sbp"]}, "dbp": {"name": "dbp", "description": "Observed patient's diastolic blood pressure", "meta": {"masking": {"kind": "float", "range": "60-150"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "60-150"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__dbp"]}, "heart_rate": {"name": "heart_rate", "description": "Observed patient's heart rate", "meta": {"masking": {"kind": "float", "range": "60-200"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "60-200"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__heart_rate"]}, "respiratory_rate": {"name": "respiratory_rate", "description": "Observed patient's respiratory rate", "meta": {"masking": {"kind": "float", "range": "10-100"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "10-100"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__respiratory_rate"]}, "spo2": {"name": "spo2", "description": "Observed patient's SpO2 level or saturation of peripheral oxygen", "meta": {"masking": {"kind": "float", "range": "90-100"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "90-100"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__spo2"]}, "avpu": {"name": "avpu", "description": "Observed patient's AVPU (alert, verbal, pain, unresponsive) level", "meta": {}, "data_type": "user-defined", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__avpu"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this recording of vitals is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__encounter_id"]}, "gcs": {"name": "gcs", "description": "Observed patient's Glasgow coma scale (GCS)", "meta": {"masking": {"kind": "integer", "range": "3-15"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "3-15"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__gcs"]}, "hemoglobin": {"name": "hemoglobin", "description": "Observed patient's hemoglobin levels", "meta": {"masking": {"kind": "integer", "range": "10-30"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "10-30"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__hemoglobin"]}, "fasting_blood_glucose": {"name": "fasting_blood_glucose", "description": "Observed patient's fasting blood glucose level", "meta": {"masking": {"kind": "float", "range": "4-10"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "4-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__fasting_blood_glucose"]}, "urine_ph": {"name": "urine_ph", "description": "Observed patient's urine pH", "meta": {"masking": {"kind": "float", "range": "3-10"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "3-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_ph"]}, "urine_leukocytes": {"name": "urine_leukocytes", "description": "Observed patient's urine leukocytes level", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_leukocytes"]}, "urine_nitrites": {"name": "urine_nitrites", "description": "Observed patient's urine nitrites", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_nitrites"]}, "urobilinogen": {"name": "urobilinogen", "description": "Observed patient's urobilinogen level", "meta": {"masking": {"kind": "float", "range": "0-1"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "0-1"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urobilinogen"]}, "urine_protein": {"name": "urine_protein", "description": "Observed patient's urine protein level", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_protein"]}, "blood_in_urine": {"name": "blood_in_urine", "description": "Observed patient's blood in urine", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__blood_in_urine"]}, "urine_specific_gravity": {"name": "urine_specific_gravity", "description": "Observed patient's urine_specific_gravity", "meta": {"masking": {"kind": "float", "range": "1.001-1.03"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "1.001-1.03"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_specific_gravity"]}, "urine_ketone": {"name": "urine_ketone", "description": "Observed patient's urine ketone level", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_ketone"]}, "urine_bilirubin": {"name": "urine_bilirubin", "description": "Observed patient's urine bilirubin level", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_bilirubin"]}, "urine_glucose": {"name": "urine_glucose", "description": "Observed patient's urine glucose levels", "meta": {"masking": {"kind": "float", "range": "0-300"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "0-300"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_glucose"]}, "date_recorded_legacy": {"name": "date_recorded_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in vitals.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_recorded_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in vitals.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "migrated_record": {"name": "migrated_record", "description": "Tamanu identifier for the survey response the vitals record was migrated to", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__migrated_record"]}}, "meta": {"triggers": ["notify_vitals_changed", "record_vitals_changelog", "set_vitals_updated_at", "set_vitals_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical", "deprecated"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_vitals_changed", "record_vitals_changelog", "set_vitals_updated_at", "set_vitals_updated_at_sync_tick"]}, "tags": ["clinical", "deprecated"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical", "deprecated"], "meta": {"triggers": ["notify_vitals_changed", "record_vitals_changelog", "set_vitals_updated_at", "set_vitals_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"vitals\"", "created_at": 1782422377.610978, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__vitals"]}, "source.tamanu_source_dbt.tamanu.vital_logs": {"database": "app", "schema": "public", "name": "vital_logs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\vital_logs.yml", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.vital_logs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "vital_logs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "vital_logs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Change logs for vitals survey responses.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vital_logs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in vital_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in vital_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in vital_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in vital_logs.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "previous_value": {"name": "previous_value", "description": "Previous value before the logged change in vitals survey response.", "meta": {"masking": "string"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__previous_value"]}, "new_value": {"name": "new_value", "description": "New value after the logged change in vitals survey response.", "meta": {"masking": "string"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__new_value"]}, "reason_for_change": {"name": "reason_for_change", "description": "Reason for the logged change in the vitals survey response.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__reason_for_change"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who made this change.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__recorded_by_id"]}, "answer_id": {"name": "answer_id", "description": "The [survey answer](#!/source/source.tamanu.tamanu.survey_response_answers) being changed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__answer_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in vital_logs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_vital_logs_changed", "record_vital_logs_changelog", "set_vital_logs_updated_at", "set_vital_logs_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_vital_logs_changed", "record_vital_logs_changelog", "set_vital_logs_updated_at", "set_vital_logs_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_vital_logs_changed", "record_vital_logs_changelog", "set_vital_logs_updated_at", "set_vital_logs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"vital_logs\"", "created_at": 1782422377.626168, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__vital_logs"]}}, "macros": {"macro.tamanu_source_dbt.is_analytics_target": {"name": "is_analytics_target", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\analytics.sql", "original_file_path": "macros\\analytics.sql", "unique_id": "macro.tamanu_source_dbt.is_analytics_target", "macro_sql": "{% macro is_analytics_target() %}\r\n {{ return(target.name.startswith('analytics')) }}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.859341, "supported_languages": null}, "macro.tamanu_source_dbt._get_current": {"name": "_get_current", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\datetime.sql", "original_file_path": "macros\\datetime.sql", "unique_id": "macro.tamanu_source_dbt._get_current", "macro_sql": "{%- macro _get_current(datetime_type, native_function) -%}\r\n {%- set var_name = 'test_current_' ~ datetime_type -%}\r\n {%- if var(var_name, none) -%}\r\n '{{ var(var_name) }}'::{{ datetime_type }}\r\n {%- else -%}\r\n {{ native_function }}\r\n {%- endif -%}\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.859341, "supported_languages": null}, "macro.tamanu_source_dbt.get_current_date": {"name": "get_current_date", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\datetime.sql", "original_file_path": "macros\\datetime.sql", "unique_id": "macro.tamanu_source_dbt.get_current_date", "macro_sql": "{%- macro get_current_date() -%}\r\n {{ _get_current('date', 'current_date') }}\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.tamanu_source_dbt._get_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.859341, "supported_languages": null}, "macro.tamanu_source_dbt.get_current_timestamp": {"name": "get_current_timestamp", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\datetime.sql", "original_file_path": "macros\\datetime.sql", "unique_id": "macro.tamanu_source_dbt.get_current_timestamp", "macro_sql": "{%- macro get_current_timestamp() -%}\r\n {{ _get_current('timestamp', 'now()') }}\r\n{%- endmacro -%}", "depends_on": {"macros": ["macro.tamanu_source_dbt._get_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.859341, "supported_languages": null}, "macro.tamanu_source_dbt.get_translations": {"name": "get_translations", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\default_translations.sql", "original_file_path": "macros\\default_translations.sql", "unique_id": "macro.tamanu_source_dbt.get_translations", "macro_sql": "\r\n\r\n\r\n{%- macro get_translations() -%}\r\n {%- set translations = {\r\n 'report.reporting.admissionDate': {'default': 'Admission date'},\r\n 'report.reporting.admissionDateTime': {'default': 'Admission date and time'},\r\n 'report.reporting.admissionStatus': {'default': 'Admission status'},\r\n 'report.reporting.admittingClinician': {'default': 'Admitting clinician'},\r\n 'report.reporting.appointmentClinician': {'default': 'Clinician'},\r\n 'report.reporting.appointmentCreatedBy': {'default': 'Appointment created by'},\r\n 'report.reporting.appointmentDateTime': {'default': 'Appointment date and time'},\r\n 'report.reporting.appointmentEndDateTime': {'default': 'Appointment end date and time'},\r\n 'report.reporting.appointmentIsCancelled': {'default': 'Appointment cancelled'},\r\n 'report.reporting.appointmentIsRepeating': {'default': 'Repeating appointment'},\r\n 'report.reporting.appointmentLocationGroup': {'default': 'Area'},\r\n 'report.reporting.appointmentPriority': {'default': 'Priority appointment'},\r\n 'report.reporting.appointmentRepeatingEndDate': {'default': 'Repeating appointment end date'},\r\n 'report.reporting.appointmentStatus': {'default': 'Appointment status'},\r\n 'report.reporting.appointmentType': {'default': 'Appointment type'},\r\n 'report.reporting.auditChangeNumber': {'default': 'Change number'},\r\n 'report.reporting.auditCreatedBy': {'default': 'Appointment created by'},\r\n 'report.reporting.auditModifiedBy': {'default': 'Appointment modified by'},\r\n 'report.reporting.auditModifiedDateTime': {'default': 'Appointment modified date & time'},\r\n 'report.reporting.auditPrevAppointmentDateTime': {'default': 'Previous appointment date & time'},\r\n 'report.reporting.auditPrevAppointmentType': {'default': 'Previous appointment type'},\r\n 'report.reporting.auditPrevClinician': {'default': 'Previous clinician'},\r\n 'report.reporting.auditPrevLocationGroup': {'default': 'Previous area'},\r\n 'report.reporting.auditPrevPriority': {'default': 'Previous priority appointment'},\r\n 'report.reporting.birthApgarScoreFiveMinutes': {'default': 'Apgar score at 5 min'},\r\n 'report.reporting.birthApgarScoreOneMinute': {'default': 'Apgar score at 1 min'},\r\n 'report.reporting.birthApgarScoreTenMinutes': {'default': 'Apgar score at 10 min'},\r\n 'report.reporting.birthAttendant': {'default': 'Name of attendant'},\r\n 'report.reporting.birthAttendantType': {'default': 'Attendant at birth'},\r\n 'report.reporting.birthDeliveryType': {'default': 'Delivery type'},\r\n 'report.reporting.birthFacility': {'default': 'Name of health facility (if selected)'},\r\n 'report.reporting.birthGestationalAgeEstimate': {'default': 'Gestational age (weeks)'},\r\n 'report.reporting.birthLength': {'default': 'Birth length (cm)'},\r\n 'report.reporting.birthRegisteredBy': {'default': 'Registered by'},\r\n 'report.reporting.birthRegisteredDateTime': {'default': 'Registration date'},\r\n 'report.reporting.birthTimeOfBirth': {'default': 'Time of birth'},\r\n 'report.reporting.birthType': {'default': 'Single/Plural birth'},\r\n 'report.reporting.birthWeight': {'default': 'Birth weight (kg)'},\r\n 'report.reporting.bookingClinician': {'default': 'Clinician'},\r\n 'report.reporting.bookingDuration': {'default': 'Booking duration'},\r\n 'report.reporting.bookingEndDateTime': {'default': 'Booking end date and time'},\r\n 'report.reporting.bookingLocation': {'default': 'Location'},\r\n 'report.reporting.bookingLocationGroup': {'default': 'Area'},\r\n 'report.reporting.bookingStartDateTime': {'default': 'Booking start date and time'},\r\n 'report.reporting.bookingStatus': {'default': 'Booking status'},\r\n 'report.reporting.bookingType': {'default': 'Booking type'},\r\n 'report.reporting.conditionOngoing': {'default': 'Ongoing condition'},\r\n 'report.reporting.conditionRecordedBy': {'default': 'Clinician'},\r\n 'report.reporting.conditionRecordedDate': {'default': 'Date recorded'},\r\n 'report.reporting.conditionResolvedBy': {'default': 'Clinician confirming resolution'},\r\n 'report.reporting.conditionResolvedDate': {'default': 'Date resolved'},\r\n 'report.reporting.deathAgeOfMother': {'default': 'Age of mother'},\r\n 'report.reporting.deathAntecedentCause1': {'default': 'Antecedent cause 1'},\r\n 'report.reporting.deathAntecedentCause2': {'default': 'Antecedent cause 2'},\r\n 'report.reporting.deathAttendingClinician': {'default': 'Attending clinician'},\r\n 'report.reporting.deathCompletedWeeksOfPregnancy': {'default': 'Completed weeks of pregnancy'},\r\n 'report.reporting.deathConditionInMother': {'default': 'Condition in mother affecting fetus or newborn'},\r\n 'report.reporting.deathExternalCauseDate': {'default': 'External cause date'},\r\n 'report.reporting.deathExternalCauseLocation': {'default': 'External cause location'},\r\n 'report.reporting.deathHadRecentSurgery': {'default': 'Had recent surgery'},\r\n 'report.reporting.deathHoursSurvivedSinceBirth': {'default': 'Hours survived since birth'},\r\n 'report.reporting.deathLastSurgeryDate': {'default': 'Last surgery date'},\r\n 'report.reporting.deathMannerOfDeath': {'default': 'Manner of death'},\r\n 'report.reporting.deathOtherCondition1': {'default': 'Other condition 1'},\r\n 'report.reporting.deathOtherCondition2': {'default': 'Other condition 2'},\r\n 'report.reporting.deathOtherCondition3': {'default': 'Other condition 3'},\r\n 'report.reporting.deathOtherCondition4': {'default': 'Other condition 4'},\r\n 'report.reporting.deathPlaceOfDeath': {'default': 'Place of death'},\r\n 'report.reporting.deathPregnancyContributed': {'default': 'Pregnancy contributed'},\r\n 'report.reporting.deathPrimaryCause': {'default': 'Primary cause of death'},\r\n 'report.reporting.deathReasonForSurgery': {'default': 'Reason for surgery'},\r\n 'report.reporting.deathTimeBetweenOnsetAndDeath': {'default': 'Time between onset and death'},\r\n 'report.reporting.deathWasFetalOrInfant': {'default': 'Was fetal or infant'},\r\n 'report.reporting.deathWasPregnant': {'default': 'Was pregnant'},\r\n 'report.reporting.deathWasStillborn': {'default': 'Was stillborn'},\r\n 'report.reporting.deathWithinDayOfBirth': {'default': 'Death within day of birth'},\r\n 'report.reporting.department': {'default': 'Department'},\r\n 'report.reporting.departments': {'default': 'Departments'},\r\n 'report.reporting.diagnoses': {'default': 'Diagnoses'},\r\n 'report.reporting.diagnosesPrimary': {'default': 'Primary diagnoses'},\r\n 'report.reporting.diagnosesSecondary': {'default': 'Secondary diagnoses'},\r\n 'report.reporting.diagnosis': {'default': 'Diagnosis'},\r\n 'report.reporting.diagnosisCertainty': {'default': 'Certainty'},\r\n 'report.reporting.diagnosisDateTime': {'default': 'Date & time'},\r\n 'report.reporting.diagnosisIsPrimary': {'default': 'Is primary'},\r\n 'report.reporting.dischargeDate': {'default': 'Discharged date'},\r\n 'report.reporting.dischargeDateTime': {'default': 'Discharge date and time'},\r\n 'report.reporting.dischargeDepartment': {'default': 'Discharging department'},\r\n 'report.reporting.dischargeDisposition': {'default': 'Discharge disposition'},\r\n 'report.reporting.dischargeLocation': {'default': 'Discharging location'},\r\n 'report.reporting.dischargeLocationGroup': {'default': 'Discharging area'},\r\n 'report.reporting.encounterClinician': {'default': 'Clinician'},\r\n 'report.reporting.encounterDepartmentHistory': {'default': 'Department history'},\r\n 'report.reporting.encounterDepartmentHistoryDateTimes': {'default': 'Department history date and times'},\r\n 'report.reporting.encounterDiet': {'default': 'Diet'},\r\n 'report.reporting.encounterEndDateTime': {'default': 'Encounter end date and time'},\r\n 'report.reporting.encounterIsDischarged': {'default': 'Discharges (has the patient been discharged)'},\r\n 'report.reporting.encounterIsHospitalAdmission': {'default': 'Hospital admission'},\r\n 'report.reporting.encounterLengthOfStay': {'default': 'Length of stay (days)'},\r\n 'report.reporting.encounterLocationGroupHistory': {'default': 'Area history'},\r\n 'report.reporting.encounterLocationGroupHistoryDateTimes': {'default': 'Area history date and times'},\r\n 'report.reporting.encounterLocationHistory': {'default': 'Location history'},\r\n 'report.reporting.encounterLocationHistoryDateTimes': {'default': 'Location history date and times'},\r\n 'report.reporting.encounterNonDischargeClinician': {'default': 'Non-discharge by clinicians'},\r\n 'report.reporting.encounterReasonForEncounter': {'default': 'Reason for encounter'},\r\n 'report.reporting.encounterStartDate': {'default': 'Encounter start date'},\r\n 'report.reporting.encounterStartDateTime': {'default': 'Encounter start date and time'},\r\n 'report.reporting.encounterStartTime': {'default': 'Encounter start time'},\r\n 'report.reporting.encounterSupervisingClinician': {'default': 'Supervising clinician'},\r\n 'report.reporting.encounterType': {'default': 'Type'},\r\n 'report.reporting.encounterTypeEmergency': {'default': 'Emergency encounter type'},\r\n 'report.reporting.encounterTypeInpatient': {'default': 'Inpatient encounter type'},\r\n 'report.reporting.encounterTypeOutpatient': {'default': 'Outpatient encounter type'},\r\n 'report.reporting.facility': {'default': 'Facility'},\r\n 'report.reporting.hospitalAdmissionCount': {'default': 'Number of admissions'},\r\n 'report.reporting.hospitalAverageLengthOfStay': {'default': 'Average length of stay'},\r\n 'report.reporting.hospitalBedOccupancyPercent': {'default': 'Bed occupancy (%)'},\r\n 'report.reporting.hospitalDeathCount': {'default': 'Number of deaths'},\r\n 'report.reporting.hospitalDischargeCount': {'default': 'Number of discharges'},\r\n 'report.reporting.hospitalPatientDayCount': {'default': 'Number of patient days'},\r\n 'report.reporting.hospitalTransfersIntoDepartmentCount': {'default': 'Number of transfers into department'},\r\n 'report.reporting.hospitalTransfersIntoLocationCount': {'default': 'Number of transfers into location'},\r\n 'report.reporting.hospitalTransfersOutOfDepartmentCount': {'default': 'Number of transfers out of department'},\r\n 'report.reporting.hospitalTransfersOutOfLocationCount': {'default': 'Number of transfers out of location'},\r\n 'report.reporting.imagingArea': {'default': 'Area to be imaged'},\r\n 'report.reporting.imagingCancellationReason': {'default': 'Reason for cancellation'},\r\n 'report.reporting.imagingCompletedDateTime': {'default': 'Completed date and time'},\r\n 'report.reporting.imagingCompletedRequests': {'default': 'Total requests completed'},\r\n 'report.reporting.imagingPendingRequests': {'default': 'Total requests with a status of pending'},\r\n 'report.reporting.imagingPriority': {'default': 'Priority'},\r\n 'report.reporting.imagingRequestDateTime': {'default': 'Request date and time'},\r\n 'report.reporting.imagingRequestId': {'default': 'Request ID'},\r\n 'report.reporting.imagingRequestingClinician': {'default': 'Requesting clinician'},\r\n 'report.reporting.imagingRequests': {'default': 'Imaging requests'},\r\n 'report.reporting.imagingStatus': {'default': 'Status'},\r\n 'report.reporting.imagingSupervisingClinician': {'default': 'Supervising clinician'},\r\n 'report.reporting.imagingTotalRequests': {'default': 'Total new requests'},\r\n 'report.reporting.imagingType': {'default': 'Imaging type'},\r\n 'report.reporting.insurerId': {'default': 'Insurer ID'},\r\n 'report.reporting.insurerName': {'default': 'Name of insurer'},\r\n 'report.reporting.invoiceInsurerAmount': {'default': 'Total insurer amount'},\r\n 'report.reporting.invoiceInsurerTotal': {'default': 'Insurer total'},\r\n 'report.reporting.invoiceInsurers': {'default': 'Insurer'},\r\n 'report.reporting.invoiceNumber': {'default': 'Invoice number'},\r\n 'report.reporting.invoicePatientAmount': {'default': 'Total patient amount'},\r\n 'report.reporting.invoicePatientDiscount': {'default': 'Total patient discount'},\r\n 'report.reporting.invoiceProductCategory': {'default': 'Category'},\r\n 'report.reporting.invoiceProductCategoryId': {'default': 'Category ID'},\r\n 'report.reporting.invoiceProductId': {'default': 'ID'},\r\n 'report.reporting.invoiceProductInsurable': {'default': 'Insurable'},\r\n 'report.reporting.invoiceProductLabExternalCode': {'default': 'Lab external code'},\r\n 'report.reporting.invoiceProductName': {'default': 'Product name'},\r\n 'report.reporting.invoiceProductVisibilityStatus': {'default': 'Visibility status'},\r\n 'report.reporting.invoiceRemainingInsurerBalance': {'default': 'Remaining balance (insurer payments)'},\r\n 'report.reporting.invoiceRemainingPatientBalance': {'default': 'Remaining balance (patient)'},\r\n 'report.reporting.invoiceTotalAmount': {'default': 'Total invoice amount'},\r\n 'report.reporting.labLaboratory': {'default': 'Laboratory'},\r\n 'report.reporting.labRequestCancellationReason': {'default': 'Reason for cancellation'},\r\n 'report.reporting.labRequestClinician': {'default': 'Requesting clinician'},\r\n 'report.reporting.labRequestCompletedDateTime': {'default': 'Completed date and time'},\r\n 'report.reporting.labRequestDateTime': {'default': 'Lab request date and time'},\r\n 'report.reporting.labRequestDates': {'default': 'Lab request dates'},\r\n 'report.reporting.labRequestDepartment': {'default': 'Requesting department'},\r\n 'report.reporting.labRequestId': {'default': 'Request ID'},\r\n 'report.reporting.labRequestNewCount': {'default': 'Total new requests'},\r\n 'report.reporting.labRequestPendingCount': {'default': 'Total requests with a status of results pending'},\r\n 'report.reporting.labRequestPriority': {'default': 'Priority'},\r\n 'report.reporting.labRequestPublishedCount': {'default': 'Total requests published'},\r\n 'report.reporting.labRequestPublishedDateTime': {'default': 'Lab request published date and time'},\r\n 'report.reporting.labRequestSampleCollectedBy': {'default': 'Sample collected by'},\r\n 'report.reporting.labRequestSampleCollectionDateTime': {'default': 'Sample collection date and time'},\r\n 'report.reporting.labRequestSampleSite': {'default': 'Site'},\r\n 'report.reporting.labRequestSpecimenType': {'default': 'Specimen type'},\r\n 'report.reporting.labRequestStatus': {'default': 'Status'},\r\n 'report.reporting.labRequests': {'default': 'Lab requests'},\r\n 'report.reporting.labTestCategory': {'default': 'Test category'},\r\n 'report.reporting.labTestCompletedDateTime': {'default': 'Lab test completed date and time'},\r\n 'report.reporting.labTestDate': {'default': 'Lab test date'},\r\n 'report.reporting.labTestPanel': {'default': 'Lab test panel'},\r\n 'report.reporting.labTestRequested': {'default': 'Test requested'},\r\n 'report.reporting.labTestResults': {'default': 'Result'},\r\n 'report.reporting.labTestType': {'default': 'Lab test type'},\r\n 'report.reporting.labTestVerification': {'default': 'Verification'},\r\n 'report.reporting.location': {'default': 'Location'},\r\n 'report.reporting.locationGroup': {'default': 'Area'},\r\n 'report.reporting.locationGroups': {'default': 'Areas'},\r\n 'report.reporting.locations': {'default': 'Locations'},\r\n 'report.reporting.logAccessAtFacility': {'default': 'Viewed at facility'},\r\n 'report.reporting.logAccessBy': {'default': 'Viewed by user'},\r\n 'report.reporting.logAccessDatetime': {'default': 'Date and time viewed'},\r\n 'report.reporting.logChangeBy': {'default': 'Edited by user'},\r\n 'report.reporting.logChangeDateTime': {'default': 'Date and time edited'},\r\n 'report.reporting.logChangeRecordCreatedDateTime': {'default': 'Date and time created'},\r\n 'report.reporting.medications': {'default': 'Medications'},\r\n 'report.reporting.noteEndDateTime': {'default': 'Notes end date and time'},\r\n 'report.reporting.noteStartDateTime': {'default': 'Notes start date and time'},\r\n 'report.reporting.notes': {'default': 'Notes'},\r\n 'report.reporting.patientAge': {'default': 'Age'},\r\n 'report.reporting.patientAllergies': {'default': 'Allergies'},\r\n 'report.reporting.patientBillingType': {'default': 'Billing type'},\r\n 'report.reporting.patientBirthCertificate': {'default': 'Birth certificate'},\r\n 'report.reporting.patientBloodType': {'default': 'Blood type'},\r\n 'report.reporting.patientCategory': {'default': 'Patient category'},\r\n 'report.reporting.patientConditions': {'default': 'Patient conditions'},\r\n 'report.reporting.patientContactNumber': {'default': 'Contact number'},\r\n 'report.reporting.patientCountryOfBirth': {'default': 'Country of birth'},\r\n 'report.reporting.patientCulturalName': {'default': 'Cultural name'},\r\n 'report.reporting.patientDateOfBirth': {'default': 'Date of birth'},\r\n 'report.reporting.patientDateOfDeath': {'default': 'Date of death'},\r\n 'report.reporting.patientDeceasedOrActive': {'default': 'Deceased/Active'},\r\n 'report.reporting.patientDisplayId': {'default': 'Patient ID'},\r\n 'report.reporting.patientDivision': {'default': 'Division'},\r\n 'report.reporting.patientDrivingLicense': {'default': 'Driving license'},\r\n 'report.reporting.patientEmergencyContactName': {'default': 'Emergency contact name'},\r\n 'report.reporting.patientEmergencyContactNumber': {'default': 'Emergency contact number'},\r\n 'report.reporting.patientEthnicity': {'default': 'Ethnicity'},\r\n 'report.reporting.patientFather': {'default': 'Father'},\r\n 'report.reporting.patientFemaleCount': {'default': 'Total patients (female)'},\r\n 'report.reporting.patientFirstName': {'default': 'First name'},\r\n 'report.reporting.patientInsurancePolicyNumber': {'default': 'Insurance policy number'},\r\n 'report.reporting.patientLastName': {'default': 'Last name'},\r\n 'report.reporting.patientMaleCount': {'default': 'Total patients (male)'},\r\n 'report.reporting.patientMaritalStatus': {'default': 'Marital status'},\r\n 'report.reporting.patientMedicalArea': {'default': 'Medical area'},\r\n 'report.reporting.patientMiddleName': {'default': 'Middle name'},\r\n 'report.reporting.patientMother': {'default': 'Mother'},\r\n 'report.reporting.patientName': {'default': 'Patient name'},\r\n 'report.reporting.patientNationality': {'default': 'Nationality'},\r\n 'report.reporting.patientOccupation': {'default': 'Occupation'},\r\n 'report.reporting.patientPassport': {'default': 'Passport'},\r\n 'report.reporting.patientPlaceOfBirth': {'default': 'Place of birth'},\r\n 'report.reporting.patientPrimaryContactNumber': {'default': 'Primary contact number'},\r\n 'report.reporting.patientRegisteredBy': {'default': 'Registered by'},\r\n 'report.reporting.patientRegistrationDate': {'default': 'Registration date'},\r\n 'report.reporting.patientRegistrationType': {'default': 'Registration type'},\r\n 'report.reporting.patientReligion': {'default': 'Religion'},\r\n 'report.reporting.patientSSN': {'default': 'Social security number'},\r\n 'report.reporting.patientSecondaryContactNumber': {'default': 'Secondary contact number'},\r\n 'report.reporting.patientSex': {'default': 'Sex'},\r\n 'report.reporting.patientStreetVillage': {'default': 'Street / Village'},\r\n 'report.reporting.patientSubDivision': {'default': 'Sub-division'},\r\n 'report.reporting.patientTitle': {'default': 'Title'},\r\n 'report.reporting.patientTotal': {'default': 'Total patients'},\r\n 'report.reporting.patientTotalBirthRegistrations': {'default': 'Total birth registrations'},\r\n 'report.reporting.patientTotalIncorrectRegistrationsForAgedUnder6Months': {'default': 'Total incorrect registrations for aged under 6 months'},\r\n 'report.reporting.patientTotalMerged': {'default': 'Total patients merged'},\r\n 'report.reporting.patientTotalPatientRegistrations': {'default': 'Total patient registrations'},\r\n 'report.reporting.patientTotalWithIncompleteName': {'default': 'Total patients with incomplete name'},\r\n 'report.reporting.patientTotalWithInvalidDateOfBirth': {'default': 'Total patients with invalid date of birth'},\r\n 'report.reporting.patientTotalWithMissingContact': {'default': 'Total patients with missing contact'},\r\n 'report.reporting.patientTotalWithMissingDateOfBirth': {'default': 'Total patients with missing date of birth'},\r\n 'report.reporting.patientTotalWithMissingLocation': {'default': 'Total patients with missing location'},\r\n 'report.reporting.patientVillage': {'default': 'Village'},\r\n 'report.reporting.paymentAmount': {'default': 'Applied payment (amount)'},\r\n 'report.reporting.paymentDate': {'default': 'Payment date'},\r\n 'report.reporting.paymentMethod': {'default': 'Method'},\r\n 'report.reporting.paymentReceiptNumber': {'default': 'Receipt number'},\r\n 'report.reporting.paymentReceivedBy': {'default': 'Tamanu user name'},\r\n 'report.reporting.prescriptionDate': {'default': 'Prescription date'},\r\n 'report.reporting.prescriptionDoseAmount': {'default': 'Dose amount'},\r\n 'report.reporting.prescriptionFrequency': {'default': 'Frequency'},\r\n 'report.reporting.prescriptionIsOngoing': {'default': 'Is ongoing'},\r\n 'report.reporting.prescriptionIsPRN': {'default': 'Is PRN'},\r\n 'report.reporting.prescriptionIsVariableDose': {'default': 'Is variable dose'},\r\n 'report.reporting.prescriptionMedication': {'default': 'Medication'},\r\n 'report.reporting.prescriptionMedicationCode': {'default': 'Code'},\r\n 'report.reporting.prescriptionQuantity': {'default': 'Quantity'},\r\n 'report.reporting.prescriptionRepeats': {'default': 'Repeats'},\r\n 'report.reporting.prescriptionRoute': {'default': 'Route'},\r\n 'report.reporting.prescriptionSelectedForDischarge': {'default': 'Prescription selected for discharge'},\r\n 'report.reporting.prescriptionUnits': {'default': 'Units'},\r\n 'report.reporting.procedure': {'default': 'Procedure'},\r\n 'report.reporting.procedureAnaesthetist': {'default': 'Procedure anaesthetist'},\r\n 'report.reporting.procedureAssistant': {'default': 'Procedure assistant'},\r\n 'report.reporting.procedureAssistantAnaesthetist': {'default': 'Procedure assistant anesthetist'},\r\n 'report.reporting.procedureClinician': {'default': 'Procedure clinician'},\r\n 'report.reporting.procedureDate': {'default': 'Procedure date'},\r\n 'report.reporting.procedureDuration': {'default': 'Procedure duration'},\r\n 'report.reporting.procedureEndDateTime': {'default': 'Procedure end (date and time)'},\r\n 'report.reporting.procedureFacility': {'default': 'Procedure facility'},\r\n 'report.reporting.procedureIsCompleted': {'default': 'Procedure marked as completed'},\r\n 'report.reporting.procedureLocation': {'default': 'Procedure location'},\r\n 'report.reporting.procedureLocationGroup': {'default': 'Procedure area'},\r\n 'report.reporting.procedureStartDateTime': {'default': 'Procedure start (date and time)'},\r\n 'report.reporting.procedureTimeIn': {'default': 'Procedure time in'},\r\n 'report.reporting.procedureTimeOut': {'default': 'Procedure time out'},\r\n 'report.reporting.procedures': {'default': 'Procedures'},\r\n 'report.reporting.referralCompletedBy': {'default': 'Referring doctor'},\r\n 'report.reporting.referralDate': {'default': 'Referral date'},\r\n 'report.reporting.referralType': {'default': 'Referral name'},\r\n 'report.reporting.registryClinicalStatus': {'default': 'Status'},\r\n 'report.reporting.registryCondition': {'default': 'Related Condition'},\r\n 'report.reporting.registryConditionCategories': {'default': 'Related condition categories'},\r\n 'report.reporting.registryConditionCategory': {'default': 'Related condition category'},\r\n 'report.reporting.registryConditionRecordedBy': {'default': 'Condition added by'},\r\n 'report.reporting.registryConditionRecordedDate': {'default': 'Date condition added'},\r\n 'report.reporting.registryConditions': {'default': 'Related conditions'},\r\n 'report.reporting.registryCurrentlyAt': {'default': 'Currently at'},\r\n 'report.reporting.registryDeactivatedBy': {'default': 'Deactivated by'},\r\n 'report.reporting.registryDeactivatedDate': {'default': 'Date of deactivation'},\r\n 'report.reporting.registryRegisteredBy': {'default': 'Registered by'},\r\n 'report.reporting.registryRegisteredDate': {'default': 'Date of registration'},\r\n 'report.reporting.registryRegisteringFacility': {'default': 'Registering facility'},\r\n 'report.reporting.registryRegistrationStatus': {'default': 'Registration status'},\r\n 'report.reporting.reportingDate': {'default': 'Date'},\r\n 'report.reporting.reportingMonth': {'default': 'Month'},\r\n 'report.reporting.requestingDepartment': {'default': 'Requesting department'},\r\n 'report.reporting.triageArrivalMode': {'default': 'Arrival mode'},\r\n 'report.reporting.triageCategory': {'default': 'Triage category'},\r\n 'report.reporting.triageRecordCount': {'default': 'Number of triage records'},\r\n 'report.reporting.triageWaitingTime': {'default': 'Time seen following triage/Waiting time (hh:mm:ss)'},\r\n 'report.reporting.userEmail': {'default': 'User email'},\r\n 'report.reporting.userName': {'default': 'User name'},\r\n 'report.reporting.userRole': {'default': 'User role'},\r\n 'report.reporting.vaccinationBatch': {'default': 'Batch'},\r\n 'report.reporting.vaccinationDate': {'default': 'Vaccination date'},\r\n 'report.reporting.vaccinationDueDate': {'default': 'Vaccination due date'},\r\n 'report.reporting.vaccinationGivenBy': {'default': 'Given by'},\r\n 'report.reporting.vaccinationGivenElseWhereCircumstances': {'default': 'If given elsewhere, Circumstances'},\r\n 'report.reporting.vaccinationGivenElsewhereCountry': {'default': 'If given elsewhere, Country'},\r\n 'report.reporting.vaccinationIsConsented': {'default': 'Consent given'},\r\n 'report.reporting.vaccinationModifiedBy': {'default': 'Record modified by'},\r\n 'report.reporting.vaccinationModifiedDate': {'default': 'Record modification date'},\r\n 'report.reporting.vaccinationNotGivenClinician': {'default': 'If not given, Supervising clinician'},\r\n 'report.reporting.vaccinationNotGivenDate': {'default': 'Date vaccine not given'},\r\n 'report.reporting.vaccinationNotGivenReason': {'default': 'If not given, Reason not given'},\r\n 'report.reporting.vaccinationRecordedBy': {'default': 'Recorded by'},\r\n 'report.reporting.vaccinationStatus': {'default': 'Vaccine status'},\r\n 'report.reporting.vaccinations': {'default': 'Vaccinations'},\r\n 'report.reporting.vaccineBrand': {'default': 'If category of Other, Vaccine brand'},\r\n 'report.reporting.vaccineCategory': {'default': 'Vaccine category'},\r\n 'report.reporting.vaccineDisease': {'default': 'If category of Other, Disease'},\r\n 'report.reporting.vaccineName': {'default': 'Vaccine name'},\r\n 'report.reporting.vaccineSchedule': {'default': 'Schedule'}\r\n } -%}\r\n {{- return(translations) -}}\r\n{%- endmacro -%}\r\n\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_default_translations": {"name": "get_default_translations", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\default_translations.sql", "original_file_path": "macros\\default_translations.sql", "unique_id": "macro.tamanu_source_dbt.get_default_translations", "macro_sql": "{%- macro get_default_translations() -%}\r\n {#- Backwards compatibility: return just default language -#}\r\n {%- set all_translations = get_translations() -%}\r\n {%- set default_only = {} -%}\r\n {%- for string_id, lang_dict in all_translations.items() -%}\r\n {%- do default_only.update({string_id: lang_dict.get('default', '')}) -%}\r\n {%- endfor -%}\r\n {{- return(default_only) -}}\r\n{%- endmacro -%}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.parameter": {"name": "parameter", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\parameter.sql", "original_file_path": "macros\\parameter.sql", "unique_id": "macro.tamanu_source_dbt.parameter", "macro_sql": "{%- macro parameter(parameter_name, default_value, data_type='text') -%}\r\n {%- if flags.WHICH == 'compile' %}\r\n :{{ parameter_name }}\r\n {%- else -%}\r\n {%- set param_value = var(parameter_name, default_value) -%}\r\n {%- if data_type is none -%}\r\n nullif('{{ param_value }}', '')\r\n {%- else -%}\r\n nullif('{{ param_value }}', '')::{{ data_type }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_nth_weekday": {"name": "get_nth_weekday", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.get_nth_weekday", "macro_sql": "{%- macro get_nth_weekday(nth_weekday) -%}\r\n case {{ nth_weekday }}\r\n when -1 then 'last '\r\n when 1 then 'first '\r\n when 2 then 'second '\r\n when 3 then 'third '\r\n when 4 then 'fourth ' \r\n else ''\r\n end\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_schedule_prefix": {"name": "get_schedule_prefix", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.get_schedule_prefix", "macro_sql": "{%- macro get_schedule_prefix(interval, frequency) -%}\r\n concat(\r\n case when \"{{ interval }}\" = 1 then\r\n case {{ frequency }}\r\n when 'WEEKLY' then 'Weekly on a '\r\n when 'MONTHLY' then 'Monthly on the '\r\n end\r\n else concat('Every ', \"{{ interval }}\",\r\n case {{ frequency }}\r\n when 'WEEKLY' then ' weeks on '\r\n when 'MONTHLY' then ' months on the '\r\n end\r\n )\r\n end\r\n )\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_day_name": {"name": "get_day_name", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.get_day_name", "macro_sql": "{%- macro get_day_name(day) -%}\r\n case {{ day }}\r\n when 'MO' then 'Monday'\r\n when 'TU' then 'Tuesday'\r\n when 'WE' then 'Wednesday'\r\n when 'TH' then 'Thursday'\r\n when 'FR' then 'Friday'\r\n when 'SA' then 'Saturday'\r\n when 'SU' then 'Sunday'\r\n else {{ day }}\r\n end\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.unnest_and_map": {"name": "unnest_and_map", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.unnest_and_map", "macro_sql": "{%- macro unnest_and_map(days_array) -%}\r\n array_to_string(\r\n array(select {{ get_day_name('unnest_day') }} from unnest({{ days_array }}) as unnest_day),\r\n ', '\r\n )\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_recurrence_description": {"name": "get_recurrence_description", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.get_recurrence_description", "macro_sql": "{%- macro get_recurrence_description(interval, frequency, days_of_week, nth_weekday) -%}\r\n concat(\r\n {{ get_schedule_prefix(interval, frequency) }},\r\n {{ get_nth_weekday(nth_weekday) }},\r\n {{ unnest_and_map(days_of_week) }}\r\n )\r\n{%- endmacro -%}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_schedule_prefix", "macro.tamanu_source_dbt.get_nth_weekday", "macro.tamanu_source_dbt.unnest_and_map"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_survey_columns": {"name": "get_survey_columns", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\surveys.sql", "original_file_path": "macros\\surveys.sql", "unique_id": "macro.tamanu_source_dbt.get_survey_columns", "macro_sql": "{% macro get_survey_columns(survey_id) %}\r\n SELECT \r\n pde.id, \r\n replace(pde.code,'-','_') as code,\r\n pde.name \r\n FROM {{ source('tamanu', 'survey_screen_components') }} ssc\r\n JOIN {{ source('tamanu', 'program_data_elements') }} pde\r\n ON ssc.data_element_id = pde.id\r\n WHERE ssc.survey_id = '{{ survey_id }}'\r\n AND ssc.deleted_at IS null\r\n AND pde.type != 'Instruction'\r\n AND pde.deleted_at IS NULL\r\n ORDER BY ssc.screen_index, ssc.component_index\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_survey": {"name": "get_survey", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\surveys.sql", "original_file_path": "macros\\surveys.sql", "unique_id": "macro.tamanu_source_dbt.get_survey", "macro_sql": "{% macro get_survey(survey_id) %}\r\n {%- set query = get_survey_columns(survey_id) -%}\r\n {%- set columns = dbt_utils.get_query_results_as_dict(query) -%}\r\n SELECT \r\n sr.encounter_id,\r\n sra.response_id, \r\n e.patient_id,\r\n sr.start_datetime,\r\n sr.end_datetime,\r\n sr.result_text\r\n {%- for id, code in zip(columns['id'], columns['code']) %},\r\n MAX(CASE WHEN sra.data_element_id = '{{ id }}' THEN NULLIF(sra.body,'') END) AS \"{{ code }}\"\r\n {% endfor %}\r\n FROM {{ ref('survey_responses') }} sr \r\n JOIN {{ ref('survey_response_answers') }} sra \r\n ON sra.response_id = sr.id\r\n JOIN {{ ref('encounters')}} e\r\n ON e.id = sr.encounter_id\r\n WHERE sr.survey_id = '{{ survey_id }}'\r\n GROUP BY sra.response_id, sr.encounter_id, sr.start_datetime, sr.end_datetime, sr.result_text, e.patient_id\r\n{% endmacro %}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_survey_columns", "macro.dbt_utils.get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_surveys_list": {"name": "get_surveys_list", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\surveys.sql", "original_file_path": "macros\\surveys.sql", "unique_id": "macro.tamanu_source_dbt.get_surveys_list", "macro_sql": "{% macro get_surveys_list() %}\r\n {% set query %}\r\n SELECT \r\n id,\r\n name\r\n FROM {{ source('tamanu', 'surveys') }}\r\n WHERE deleted_at IS NULL\r\n AND visibility_status = 'current'\r\n {% endset %}\r\n \r\n {% set results = run_query(query) %}\r\n \r\n {% if execute %}\r\n {% for row in results %}\r\n {{ log(\"SURVEY_DATA:\" ~ row[0] ~ \"|\" ~ row[1], info=true) }}\r\n {% endfor %}\r\n {% endif %}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_survey_docs": {"name": "get_survey_docs", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\surveys.sql", "original_file_path": "macros\\surveys.sql", "unique_id": "macro.tamanu_source_dbt.get_survey_docs", "macro_sql": "{% macro get_survey_docs(survey_id) %}\r\n {%- set query = get_survey_columns(survey_id) -%}\r\n {% set results = run_query(query) %}\r\n \r\n {% if execute %}\r\n {% for row in results %}\r\n {{ log(\"COLUMN_DATA:\" ~ row[0] ~ \"|\" ~ row[1] ~ \"|\" ~ row[2], info=true) }}\r\n {% endfor %}\r\n {% endif %}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_survey_columns", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.translate_label": {"name": "translate_label", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\translations.sql", "original_file_path": "macros\\translations.sql", "unique_id": "macro.tamanu_source_dbt.translate_label", "macro_sql": "{%- macro translate_label(string_id, language=var(\"language\", \"default\")) -%}\r\n {%- set full_string_id = 'report.reporting.' ~ string_id -%}\r\n {%- set translations = get_translations() -%}\r\n\r\n {%- if full_string_id in translations -%}\r\n {%- set lang_dict = translations[full_string_id] -%}\r\n {{- lang_dict.get(language, lang_dict.get('default', string_id)) -}}\r\n {%- elif string_id in translations -%}\r\n {%- set lang_dict = translations[string_id] -%}\r\n {{- lang_dict.get(language, lang_dict.get('default', string_id)) -}}\r\n {%- else -%}\r\n {{- string_id -}}\r\n {%- endif -%}\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_translation_prefix": {"name": "get_translation_prefix", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\translations.sql", "original_file_path": "macros\\translations.sql", "unique_id": "macro.tamanu_source_dbt.get_translation_prefix", "macro_sql": "{%- macro get_translation_prefix(prefix_key) -%}\r\n {%- set mapping = {\r\n 'APPOINTMENT_STATUSES': 'appointment.property.status',\r\n 'ATTENDANT_OF_BIRTH_LABELS': 'birth.property.attendantOfBirth',\r\n 'ASSET_NAME_LABELS': 'asset.property.name',\r\n 'BIRTH_DELIVERY_TYPE_LABELS': 'birth.property.birthDeliveryType',\r\n 'BIRTH_TYPE_LABELS': 'birth.property.birthType',\r\n 'BLOOD_LABELS': 'patient.property.blood',\r\n 'DIAGNOSIS_CERTAINTY_LABELS': 'diagnosis.property.certainty',\r\n 'DRUG_ROUTE_LABELS': 'medication.property.route',\r\n 'EDUCATIONAL_ATTAINMENT_LABELS': 'patient.property.educationalAttainment',\r\n 'ENCOUNTER_TYPE_LABELS': 'encounter.property.type',\r\n 'IMAGING_TYPES': 'imaging.property.type',\r\n 'IMAGING_REQUEST_STATUS_LABELS': 'imaging.property.status',\r\n 'INJECTION_SITE_LABELS': 'vaccine.property.injectionSite',\r\n 'INVOICE_INSURER_PAYMENT_STATUS_LABELS': 'invoice.property.insurerPaymentStatus',\r\n 'INVOICE_ITEMS_CATEGORY_LABELS': 'invoice.property.itemCategory',\r\n 'INVOICE_PATIENT_PAYMENT_STATUSES_LABELS': 'invoice.property.patientPaymentStatus',\r\n 'INVOICE_STATUS_LABELS': 'invoice.property.status',\r\n 'LAB_REQUEST_STATUS_LABELS': 'lab.property.status',\r\n 'LOCATION_AVAILABILITY_STATUS_LABELS': 'bedManagement.property.status',\r\n 'MANNER_OF_DEATHS': 'death.property.mannerOfDeath',\r\n 'MARTIAL_STATUS_LABELS': 'patient.property.maritalStatus',\r\n 'NOTE_TYPE_LABELS': 'note.property.type',\r\n 'PATIENT_ISSUE_LABELS': 'patient.property.issue',\r\n 'PLACE_OF_BIRTH_LABELS': 'birth.property.placeOfBirth',\r\n 'PLACE_OF_DEATHS': 'death.property.placeOfDeath',\r\n 'PROGRAM_REGISTRATION_STATUS_LABELS': 'programRegistry.property.registrationStatus',\r\n 'REFERRAL_STATUS_LABELS': 'referral.property.status',\r\n 'REPEATS_LABELS': 'medication.property.repeats',\r\n 'REPEAT_FREQUENCY_LABELS': 'scheduling.property.repeatFrequency',\r\n 'REPEAT_FREQUENCY_UNIT_LABELS': 'scheduling.property.repeatFrequencyUnit',\r\n 'REPEAT_FREQUENCY_UNIT_PLURAL_LABELS': 'scheduling.property.repeatFrequencyUnitPlural',\r\n 'REPORT_DATA_SOURCE_LABELS': 'report.property.dataSource',\r\n 'REPORT_DB_SCHEMA_LABELS': 'report.property.schema',\r\n 'REPORT_DEFAULT_DATE_RANGES_LABELS': 'report.property.defaultDateRange',\r\n 'REPORT_STATUS_LABELS': 'report.property.status',\r\n 'SEX_LABELS': 'patient.property.sex',\r\n 'TASK_FREQUENCY_UNIT_LABELS': 'task.property.frequencyUnit',\r\n 'TASK_DURATION_UNIT_LABELS': 'task.property.durationUnit',\r\n 'SOCIAL_MEDIA_LABELS': 'patient.property.socialMedia',\r\n 'TEMPLATE_TYPE_LABELS': 'template.property.type',\r\n 'TITLE_LABELS': 'patient.property.title',\r\n 'VACCINE_CATEGORY_LABELS': 'vaccine.property.category',\r\n 'VACCINE_STATUS_LABELS': 'vaccine.property.status'\r\n } -%}\r\n \r\n {%- if prefix_key in mapping -%}\r\n {{- mapping[prefix_key] -}}\r\n {%- else -%}\r\n {{- exceptions.raise_compiler_error(\"Unknown translation prefix key: \" ~ prefix_key) -}}\r\n {%- endif -%}\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.get_translation_lookup": {"name": "get_translation_lookup", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\translations.sql", "original_file_path": "macros\\translations.sql", "unique_id": "macro.tamanu_source_dbt.get_translation_lookup", "macro_sql": "{%- macro get_translation_lookup(prefix_key=none, language=var(\"language\", \"default\")) -%}\r\n {%- if prefix_key is none -%}\r\n {%- set key_list = [] -%}\r\n {%- elif prefix_key is string -%}\r\n {%- set key_list = [prefix_key] -%}\r\n {%- else -%}\r\n {%- set key_list = prefix_key | list -%}\r\n {%- endif -%}\r\n {%- set ns = namespace(where_clauses=[]) -%}\r\n {%- for key in key_list -%}\r\n {%- set p = get_translation_prefix(key) -%}\r\n {%- set escaped = p.replace(\"'\", \"''\") -%}\r\n {%- set ns.where_clauses = ns.where_clauses + [\"string_id like '\" ~ escaped ~ \".%'\"] -%}\r\n {%- endfor -%}\r\n select\r\n string_id,\r\n {%- if language == 'default' %}\r\n max(text) filter (where language = 'default') as text\r\n {%- else %}\r\n coalesce(\r\n max(text) filter (where language = '{{ language }}'),\r\n max(text) filter (where language = 'default')\r\n ) as text\r\n {%- endif %}\r\n from {{ ref('translated_strings') }}\r\n {%- if ns.where_clauses | length > 0 %}\r\n where {{ ns.where_clauses | join('\\n or ') }}\r\n {%- endif %}\r\n group by string_id\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_prefix", "macro.dbt.replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.translate_column_value": {"name": "translate_column_value", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\translations.sql", "original_file_path": "macros\\translations.sql", "unique_id": "macro.tamanu_source_dbt.translate_column_value", "macro_sql": "{%- macro translate_column_value(prefix_key, column_name, language=var(\"language\", \"default\")) -%}\r\n {%- set translations = get_translations() -%}\r\n {%- set prefix = get_translation_prefix(prefix_key) -%}\r\n {%- set ns = namespace(has_translations=false) -%}\r\n {%- for string_id, lang_dict in translations.items() -%}\r\n {%- if string_id.startswith(prefix ~ '.') -%}\r\n {%- set ns.has_translations = true -%}\r\n {%- break -%}\r\n {%- endif -%}\r\n {%- endfor -%}\r\n {%- if ns.has_translations -%}\r\n case\r\n {%- for string_id, lang_dict in translations.items() -%}\r\n {%- if string_id.startswith(prefix ~ '.') -%}\r\n {%- set value = string_id.replace(prefix ~ '.', '') -%}\r\n {%- set translated_text = lang_dict.get(language, lang_dict.get('default', value)).replace(\"'\", \"''\") -%}\r\n when {{ column_name }} = '{{ value }}' then '{{ translated_text }}'\r\n {%- endif -%}\r\n {%- endfor %}\r\n else {{ column_name }}\r\n end\r\n {%- else -%}\r\n {{ column_name }}\r\n {%- endif -%}\r\n{%- endmacro -%}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translations", "macro.tamanu_source_dbt.get_translation_prefix", "macro.dbt.replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.test_valid_visibility_status": {"name": "test_valid_visibility_status", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\data_tests\\test__valid_visibility_status.sql", "original_file_path": "macros\\data_tests\\test__valid_visibility_status.sql", "unique_id": "macro.tamanu_source_dbt.test_valid_visibility_status", "macro_sql": "{% test valid_visibility_status(model, column_name) %}\r\nSELECT *\r\nFROM {{ model }}\r\nWHERE {{ column_name }} NOT IN ('current', 'historical', 'merged')\r\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.admissions_dataset": {"name": "admissions_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\admissions.sql", "original_file_path": "macros\\models\\admissions.sql", "unique_id": "macro.tamanu_source_dbt.admissions_dataset", "macro_sql": "{% macro admissions_dataset(is_sensitive=false) %}\r\n\r\nwith admission_encounters as (\r\n select\r\n e.id,\r\n e.patient_id,\r\n e.start_datetime,\r\n e.end_datetime,\r\n e.location_id,\r\n e.patient_billing_type_id,\r\n f.id as facility_id,\r\n f.name as facility_name\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l on l.id = e.location_id\r\n join {{ ref('facilities') }} f on f.id = l.facility_id\r\n where e.encounter_type = 'admission'\r\n and f.is_sensitive = {{ is_sensitive }}\r\n),\r\n\r\nencounter_history_consolidated as (\r\n select\r\n eh.encounter_id,\r\n eh.datetime,\r\n eh.change_type,\r\n eh.clinician_id,\r\n eh.department_id,\r\n eh.location_id,\r\n u.display_name as clinician_name,\r\n d.name as department_name,\r\n l.name as location_name,\r\n lg.id as location_group_id,\r\n lg.name as location_group_name,\r\n -- Window functions for ordering and lag operations\r\n row_number() over (\r\n partition by eh.encounter_id, ('encounter_type' = any(eh.change_type))\r\n order by eh.datetime\r\n ) as encounter_type_change_sequence,\r\n lag(lg.id) over (\r\n partition by eh.encounter_id\r\n order by eh.datetime\r\n ) as prev_location_group_id\r\n from admission_encounters ae\r\n left join {{ ref('encounter_history') }} eh\r\n on eh.encounter_id = ae.id\r\n and eh.encounter_type = 'admission'\r\n and (eh.change_type is null or eh.change_type && array['encounter_type', 'examiner', 'department', 'location'])\r\n left join {{ ref('users') }} u\r\n on u.id = eh.clinician_id\r\n left join {{ ref('departments') }} d\r\n on d.id = eh.department_id\r\n left join {{ ref('locations') }} l\r\n on l.id = eh.location_id\r\n left join {{ ref('location_groups') }} lg\r\n on lg.id = l.location_group_id\r\n),\r\n\r\n-- Clinician changes and admitting clinician logic\r\nclinician_data as (\r\n select\r\n encounter_id,\r\n bool_or('encounter_type' = any(change_type) and encounter_type_change_sequence = 1) as is_transfer,\r\n min(datetime) filter (where change_type is null or change_type && array['encounter_type', 'examiner']) as admission_datetime,\r\n array_agg(\r\n datetime\r\n order by datetime\r\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\r\n ) as clinician_datetimes,\r\n array_agg(\r\n clinician_id\r\n order by datetime\r\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\r\n ) as clinician_ids,\r\n array_agg(\r\n clinician_name\r\n order by datetime\r\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\r\n ) as clinician_names\r\n from encounter_history_consolidated\r\n group by encounter_id\r\n),\r\n\r\n-- Admitting clinician determination\r\nadmitting_clinicians as (\r\n select\r\n encounter_id,\r\n admission_datetime,\r\n case\r\n when is_transfer and array_length(clinician_ids, 1) > 1\r\n then clinician_ids[2]\r\n else clinician_ids[1]\r\n end as admitting_clinician_id,\r\n case\r\n when is_transfer and array_length(clinician_names, 1) > 1\r\n then clinician_names[2]\r\n else clinician_names[1]\r\n end as admitting_clinician_name\r\n from clinician_data\r\n),\r\n\r\n-- Department changes aggregation\r\ndepartment_changes as (\r\n select\r\n encounter_id,\r\n string_agg(\r\n to_char(datetime, '{{ var(\"datetime_without_seconds_format\") }}'),\r\n '; '\r\n order by datetime\r\n ) as department_datetimes,\r\n array_agg(\r\n department_id\r\n order by datetime\r\n ) as department_ids,\r\n string_agg(\r\n department_name, ', '\r\n order by datetime\r\n ) as departments\r\n from encounter_history_consolidated\r\n where change_type is null or change_type && array['encounter_type', 'department']\r\n group by encounter_id\r\n),\r\n\r\n-- Location changes aggregation\r\nlocation_changes as (\r\n select\r\n encounter_id,\r\n string_agg(\r\n to_char(datetime, '{{ var(\"datetime_without_seconds_format\") }}'),\r\n '; '\r\n order by datetime\r\n ) as location_datetimes,\r\n array_agg(\r\n location_id\r\n order by datetime\r\n ) as location_ids,\r\n string_agg(\r\n location_name, ', '\r\n order by datetime\r\n ) as locations\r\n from encounter_history_consolidated\r\n where change_type is null or change_type && array['encounter_type', 'location']\r\n group by encounter_id\r\n),\r\n\r\n-- Location group changes (deduplicated in single pass)\r\nlocation_group_changes as (\r\n select\r\n encounter_id,\r\n string_agg(\r\n to_char(datetime, '{{ var(\"datetime_without_seconds_format\") }}'),\r\n '; '\r\n order by datetime\r\n ) as location_group_datetimes,\r\n array_agg(\r\n location_group_id\r\n order by datetime\r\n ) as location_group_ids,\r\n string_agg(\r\n location_group_name, ', '\r\n order by datetime\r\n ) as location_groups\r\n from encounter_history_consolidated\r\n where (change_type is null or change_type && array['encounter_type', 'location'])\r\n and (location_group_id != prev_location_group_id or prev_location_group_id is null)\r\n group by encounter_id\r\n),\r\n\r\n-- Diagnoses aggregation\r\nencounter_diagnoses as (\r\n select\r\n ed.encounter_id,\r\n string_agg(\r\n case when ed.is_primary\r\n then rd.name || ' (' || rd.code || ')'\r\n end,\r\n '; '\r\n order by ed.datetime\r\n ) as primary_diagnoses,\r\n string_agg(\r\n case when not ed.is_primary\r\n then rd.name || ' (' || rd.code || ')'\r\n end,\r\n '; '\r\n order by ed.datetime\r\n ) as secondary_diagnoses\r\n from admission_encounters ae\r\n inner join {{ ref('encounter_diagnoses') }} ed\r\n on ed.encounter_id = ae.id\r\n inner join {{ ref('reference_data') }} rd\r\n on rd.id = ed.diagnosis_id\r\n where ed.certainty not in ('disproven', 'error')\r\n group by ed.encounter_id\r\n),\r\n\r\n-- Patient and reference data\r\npatient_data as (\r\n select\r\n ae.id as encounter_id,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n p.village_id,\r\n village.name as village_name,\r\n ae.patient_billing_type_id,\r\n bt.name as billing_type_name,\r\n ae.start_datetime,\r\n ae.end_datetime,\r\n ae.location_id,\r\n ae.facility_id,\r\n ae.facility_name\r\n from admission_encounters ae\r\n left join {{ ref('patients') }} p\r\n on p.id = ae.patient_id\r\n left join {{ ref('reference_data') }} village\r\n on village.id = p.village_id\r\n left join {{ ref('reference_data') }} bt\r\n on bt.id = ae.patient_billing_type_id\r\n)\r\n\r\nselect\r\n pd.patient_id,\r\n pd.display_id,\r\n pd.first_name,\r\n pd.last_name,\r\n pd.date_of_birth,\r\n date_part('year', age(ac.admission_datetime, pd.date_of_birth)) as age,\r\n initcap(pd.sex::text) as sex,\r\n pd.village_id,\r\n pd.village_name as village,\r\n pd.patient_billing_type_id as billing_type_id,\r\n pd.billing_type_name as billing_type,\r\n ac.admitting_clinician_id,\r\n ac.admitting_clinician_name as admitting_clinician,\r\n ac.admission_datetime,\r\n case\r\n when pd.end_datetime is null then 'active'\r\n else 'discharged'\r\n end as admission_status,\r\n pd.end_datetime as discharge_datetime,\r\n pd.facility_id,\r\n pd.facility_name as facility,\r\n dc.department_ids,\r\n dc.departments,\r\n dc.department_datetimes,\r\n lgc.location_group_ids,\r\n lgc.location_groups,\r\n lgc.location_group_datetimes,\r\n lc.location_ids,\r\n lc.locations,\r\n lc.location_datetimes,\r\n ed.primary_diagnoses,\r\n ed.secondary_diagnoses\r\nfrom patient_data pd\r\nleft join admitting_clinicians ac\r\n on ac.encounter_id = pd.encounter_id\r\nleft join department_changes dc\r\n on dc.encounter_id = pd.encounter_id\r\nleft join location_changes lc\r\n on lc.encounter_id = pd.encounter_id\r\nleft join location_group_changes lgc\r\n on lgc.encounter_id = pd.encounter_id\r\nleft join encounter_diagnoses ed\r\n on ed.encounter_id = pd.encounter_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.diagnoses_dataset": {"name": "diagnoses_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\diagnoses.sql", "original_file_path": "macros\\models\\diagnoses.sql", "unique_id": "macro.tamanu_source_dbt.diagnoses_dataset", "macro_sql": "{% macro diagnoses_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n e.id as encounter_id,\r\n p.id as patient_id,\r\n diagnosis.id as diagnosis_id,\r\n diagnosis.name as diagnosis,\r\n ed.datetime as diagnosis_datetime,\r\n p.first_name,\r\n p.last_name,\r\n p.display_id,\r\n date_part('year', age(ed.datetime::date, p.date_of_birth)) as age,\r\n p.sex,\r\n coalesce(pad.primary_contact_number, pad.secondary_contact_number) as contact_number,\r\n village.id as village_id,\r\n village.name as village,\r\n clinician.id as clinician_id,\r\n clinician.display_name as clinician,\r\n d.id as department_id,\r\n d.name as department,\r\n l.id as location_id,\r\n l.name as location,\r\n f.id as facility_id,\r\n f.name as facility,\r\n initcap(ed.certainty) as certainty,\r\n case when ed.is_primary = true then 'Yes' else 'No' end as is_primary\r\nfrom {{ ref('encounter_diagnoses') }} ed\r\njoin {{ ref('reference_data') }} diagnosis on diagnosis.id = ed.diagnosis_id\r\njoin {{ ref('encounters') }} e on e.id = ed.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\nleft join {{ ref('patient_additional_data') }} pad on pad.patient_id = p.id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('users') }} clinician on clinician.id = e.clinician_id\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\njoin {{ ref('locations') }} l on l.id = e.location_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.encounters_emergency_dataset": {"name": "encounters_emergency_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\encounters_emergency.sql", "original_file_path": "macros\\models\\encounters_emergency.sql", "unique_id": "macro.tamanu_source_dbt.encounters_emergency_dataset", "macro_sql": "{% macro encounters_emergency_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n t.id as triage_id,\r\n t.arrival_datetime,\r\n t.triage_datetime,\r\n t.closed_datetime,\r\n t.score,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n p.village_id,\r\n village.name as village,\r\n e.id as encounter_id,\r\n e.encounter_type,\r\n arrival_mode.name as arrival_mode,\r\n chief_complaint.name as chief_complaint,\r\n secondary_complaint.name as secondary_complaint,\r\n clinician.display_name as clinician,\r\n t.clinician_id,\r\n f.id as facility_id,\r\n f.name as facility\r\nfrom {{ ref(\"triages\") }} t\r\njoin {{ ref(\"encounters\") }} e on e.id = t.encounter_id\r\njoin {{ ref(\"patients\") }} p on p.id = e.patient_id\r\nleft join {{ ref(\"locations\") }} l on l.id = e.location_id\r\njoin {{ ref(\"facilities\") }} f on f.id = l.facility_id and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref(\"reference_data\") }} village on village.id = p.village_id\r\nleft join {{ ref(\"reference_data\") }} arrival_mode on arrival_mode.id = t.arrival_mode_id\r\nleft join {{ ref(\"reference_data\") }} chief_complaint on chief_complaint.id = t.chief_complaint_id\r\nleft join {{ ref(\"reference_data\") }} secondary_complaint on secondary_complaint.id = t.secondary_complaint_id\r\nleft join {{ ref(\"users\") }} clinician on clinician.id = t.clinician_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.encounter_diets_dataset": {"name": "encounter_diets_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\encounter_diets.sql", "original_file_path": "macros\\models\\encounter_diets.sql", "unique_id": "macro.tamanu_source_dbt.encounter_diets_dataset", "macro_sql": "{% macro encounter_diets_dataset(is_sensitive=false) %}\r\n\r\nwith diets as (\r\n select\r\n ed.encounter_id,\r\n string_agg(\r\n rd.name, ', '\r\n order by rd.name\r\n ) as diets\r\n from {{ ref('encounter_diets') }} ed\r\n join {{ ref('reference_data') }} rd\r\n on rd.id = ed.diet_id\r\n group by ed.encounter_id\r\n),\r\n\r\nallergies as (\r\n select\r\n pa.patient_id,\r\n string_agg(\r\n rd.name, ', '\r\n order by rd.name\r\n ) as allergies\r\n from {{ ref('patient_allergies') }} pa\r\n join {{ ref('reference_data') }} rd\r\n on rd.id = pa.allergy_id\r\n group by pa.patient_id\r\n)\r\n\r\nselect\r\n e.id as encounter_id,\r\n p.id as patient_id,\r\n p.display_id,\r\n concat(p.first_name, ' ', p.last_name) as patient_name,\r\n e.start_datetime,\r\n case\r\n when age(current_date, p.date_of_birth) < interval '8 days'\r\n then concat(extract(day from age(current_date, p.date_of_birth)), ' days')\r\n when age(current_date, p.date_of_birth) >= interval '8 days'\r\n and age(current_date, p.date_of_birth) < interval '1 month'\r\n then concat(extract(week from age(current_date, p.date_of_birth)), ' weeks')\r\n when age(current_date, p.date_of_birth) >= interval '1 month'\r\n and age(current_date, p.date_of_birth) < interval '2 years'\r\n then concat(extract(month from age(current_date, p.date_of_birth)), ' months')\r\n when age(current_date, p.date_of_birth) >= interval '2 years'\r\n then concat(extract(year from age(current_date, p.date_of_birth)), ' years')\r\n end as age,\r\n l.id as location_id,\r\n l.name as location,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n d.diets,\r\n a.allergies\r\nfrom {{ ref('encounters') }} e\r\njoin {{ ref('patients') }} p\r\n on p.id = e.patient_id\r\njoin {{ ref('locations') }} l\r\n on l.id = e.location_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('location_groups') }} lg\r\n on lg.id = l.location_group_id\r\nleft join diets d\r\n on d.encounter_id = e.id\r\nleft join allergies a\r\n on a.patient_id = p.id\r\nwhere e.end_datetime is null\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8750331, "supported_languages": null}, "macro.tamanu_source_dbt.encounter_prescriptions_dataset": {"name": "encounter_prescriptions_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\encounter_prescriptions.sql", "original_file_path": "macros\\models\\encounter_prescriptions.sql", "unique_id": "macro.tamanu_source_dbt.encounter_prescriptions_dataset", "macro_sql": "{% macro encounter_prescriptions_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n ep.encounter_id,\r\n ep.prescription_id,\r\n pr.datetime,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(pr.datetime, p.date_of_birth)) as age,\r\n p.sex,\r\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\r\n vil.id as village_id,\r\n vil.name as village,\r\n l.facility_id,\r\n f.name as facility,\r\n ep.is_selected_for_discharge,\r\n pr.medication_id,\r\n m.code as medication_code,\r\n m.name as medication,\r\n pr.route,\r\n pr.quantity,\r\n pr.repeats,\r\n pr.is_ongoing,\r\n pr.is_prn,\r\n pr.is_variable_dose,\r\n pr.dose_amount,\r\n pr.units,\r\n pr.frequency,\r\n pr.is_discontinued,\r\n pr.discontinued_by_id,\r\n pr.discontinuing_reason,\r\n pr.discontinued_datetime\r\nfrom {{ ref(\"encounter_prescriptions\") }} ep\r\njoin {{ ref(\"encounters\") }} e on e.id = ep.encounter_id\r\njoin {{ ref(\"patients\") }} p on p.id = e.patient_id\r\njoin {{ ref(\"prescriptions\") }} pr on pr.id = ep.prescription_id\r\njoin {{ ref(\"locations\") }} l on l.id = e.location_id\r\njoin {{ ref(\"facilities\") }} f \r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('patient_additional_data') }} pd on pd.patient_id = p.id\r\nleft join {{ ref('reference_data') }} vil on vil.id = p.village_id\r\njoin {{ ref(\"reference_data\")}} m on m.id = pr.medication_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.890226, "supported_languages": null}, "macro.tamanu_source_dbt.encounter_summary_report": {"name": "encounter_summary_report", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\encounter_summary.sql", "original_file_path": "macros\\models\\encounter_summary.sql", "unique_id": "macro.tamanu_source_dbt.encounter_summary_report", "macro_sql": "{% macro encounter_summary_report(date_field, is_sensitive=false) %}\r\n\r\nwith encounters_in_scope as (\r\n select\r\n e.id as encounter_id,\r\n e.start_datetime,\r\n e.end_datetime,\r\n e.patient_id,\r\n e.location_id,\r\n e.department_id,\r\n e.clinician_id,\r\n e.patient_billing_type_id,\r\n e.reason_for_encounter,\r\n f.id as facility_id,\r\n f.name as facility\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\n where\r\n e.patient_id != '{{ var(\"test_patient\") }}'\r\n {% if date_field == 'end_datetime' %}\r\n and e.end_datetime is not null\r\n {% endif %}\r\n and case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else e.{{ date_field }} >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else e.{{ date_field }} <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case\r\n when {{ parameter('facilityId') }} is null then true\r\n else f.id = {{ parameter('facilityId') }}\r\n end\r\n and case\r\n when {{ parameter('patientBillingTypeId') }} is null then true\r\n else e.patient_billing_type_id = {{ parameter('patientBillingTypeId') }}\r\n end\r\n and case\r\n when {{ parameter('supervisingClinicianId') }} is null then true\r\n else e.clinician_id = {{ parameter('supervisingClinicianId') }}\r\n end\r\n),\r\n\r\nencounter_history_consolidated as (\r\n select\r\n eh.encounter_id,\r\n eh.datetime,\r\n eh.change_type,\r\n eh.updated_by_id,\r\n eh.clinician_id,\r\n eh.department_id,\r\n eh.location_id,\r\n eh.encounter_type,\r\n clinician.display_name as clinician_name,\r\n actor.display_name as updated_by_name,\r\n d.name as department_name,\r\n l.name as location_name,\r\n lg.id as location_group_id,\r\n lg.name as location_group_name,\r\n row_number() over (\r\n partition by eh.encounter_id, eh.change_type\r\n order by eh.datetime\r\n ) as change_sequence,\r\n lag(lg.id) over (\r\n partition by eh.encounter_id\r\n order by eh.datetime\r\n ) as prev_location_group_id\r\n from {{ ref('encounter_history') }} eh\r\n join encounters_in_scope eis\r\n on eis.encounter_id = eh.encounter_id\r\n join {{ ref('users') }} actor\r\n on actor.id = eh.updated_by_id\r\n join {{ ref('users') }} clinician\r\n on clinician.id = eh.clinician_id\r\n join {{ ref('departments') }} d\r\n on d.id = eh.department_id\r\n join {{ ref('locations') }} l\r\n on l.id = eh.location_id\r\n left join {{ ref('location_groups') }} lg\r\n on lg.id = l.location_group_id\r\n),\r\n\r\nencounter_changes as (\r\n select\r\n encounter_id,\r\n \r\n -- Location changes: tracks all location changes throughout the encounter\r\n array_agg(\r\n to_char(datetime, '{{ var(\"datetime_format\") }}')\r\n order by datetime\r\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\r\n array_agg(\r\n location_id\r\n order by datetime\r\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\r\n string_agg(\r\n location_name, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\r\n\r\n -- Location group changes: tracks location group changes (only when group actually changes)\r\n array_agg(\r\n to_char(datetime, '{{ var(\"datetime_format\") }}')\r\n order by datetime\r\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\r\n array_agg(\r\n location_group_id\r\n order by datetime\r\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\r\n string_agg(\r\n location_group_name, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\r\n\r\n -- Department changes: tracks all department changes throughout the encounter\r\n array_agg(\r\n to_char(datetime, '{{ var(\"datetime_format\") }}')\r\n order by datetime\r\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\r\n array_agg(\r\n department_id\r\n order by datetime\r\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\r\n string_agg(\r\n department_name, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\r\n\r\n -- Encounter type changes: tracks encounter type progression (emergency types)\r\n string_agg(\r\n case\r\n when encounter_type = 'triage' then 'Triage'\r\n when encounter_type = 'observation' then 'Active ED care'\r\n when encounter_type = 'emergency' then 'Emergency short stay'\r\n end, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\r\n\r\n -- Encounter type changes: tracks encounter type progression (inpatient types)\r\n string_agg(\r\n case\r\n when encounter_type = 'admission' then 'Hospital admission'\r\n end, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\r\n\r\n -- Encounter type changes: tracks encounter type progression (outpatient types)\r\n string_agg(\r\n case\r\n when encounter_type = 'clinic' then 'Clinic'\r\n when encounter_type = 'imaging' then 'Imaging'\r\n when encounter_type = 'surveyResponse' then 'Survey response'\r\n when encounter_type = 'vaccination' then 'Vaccination'\r\n end, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\r\n\r\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\r\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\r\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\r\n from encounter_history_consolidated\r\n group by encounter_id\r\n),\r\n\r\nencounter_diagnoses as (\r\n select\r\n ed.encounter_id,\r\n string_agg(\r\n concat(\r\n 'Name: ', d.name,\r\n ', Code: ', d.code,\r\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\r\n ', Certainty: ', ed.certainty\r\n ),\r\n E'\\n'\r\n order by ed.is_primary desc, ed.datetime asc\r\n ) as diagnoses\r\n from {{ ref('encounter_diagnoses') }} ed\r\n join encounters_in_scope eis\r\n on eis.encounter_id = ed.encounter_id\r\n join {{ ref('reference_data') }} d\r\n on d.id = ed.diagnosis_id\r\n group by ed.encounter_id\r\n),\r\n\r\nencounter_prescriptions as (\r\n select\r\n ep.encounter_id,\r\n string_agg(\r\n concat(\r\n 'Name: ', m.name,\r\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\r\n ', Discontinuing reason: ', p.discontinuing_reason\r\n ),\r\n '' || E'\\n' || ''\r\n order by p.datetime\r\n ) as medications\r\n from {{ ref('encounter_prescriptions') }} ep\r\n join encounters_in_scope eis\r\n on eis.encounter_id = ep.encounter_id\r\n join {{ ref('prescriptions') }} p\r\n on p.id = ep.prescription_id\r\n join {{ ref('reference_data') }} m\r\n on m.id = p.medication_id\r\n group by ep.encounter_id\r\n),\r\n\r\nencounter_vaccinations as (\r\n select\r\n av.encounter_id,\r\n string_agg(\r\n concat(\r\n v.name,\r\n ', Label: ', sv.label,\r\n ', Schedule: ', sv.dose_label\r\n ),\r\n E'\\n'\r\n order by av.datetime\r\n ) as vaccinations\r\n from {{ ref('vaccine_administrations') }} av\r\n join encounters_in_scope eis\r\n on eis.encounter_id = av.encounter_id\r\n join {{ ref('vaccine_schedules') }} sv\r\n on sv.id = av.scheduled_vaccine_id\r\n join {{ ref('reference_data') }} v\r\n on v.id = sv.vaccine_id\r\n group by av.encounter_id\r\n),\r\n\r\nencounter_procedures as (\r\n select\r\n p.encounter_id,\r\n string_agg(\r\n concat(\r\n 'Name: ', proc.name,\r\n ', Date: ', to_char(p.date, '{{ var(\"date_format\") }}'),\r\n ', Location: ', loc.name,\r\n ', Notes: ', p.note,\r\n ', Completed notes: ', p.completed_note\r\n ),\r\n E'\\n'\r\n order by p.date\r\n ) as procedures\r\n from {{ ref('procedures') }} p\r\n join encounters_in_scope eis\r\n on eis.encounter_id = p.encounter_id\r\n left join {{ ref('reference_data') }} proc\r\n on proc.id = p.procedure_type_id\r\n left join {{ ref('locations') }} loc\r\n on loc.id = p.location_id\r\n group by p.encounter_id\r\n),\r\n\r\nencounter_lab_requests as (\r\n select\r\n lr.encounter_id,\r\n string_agg(\r\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\r\n order by lr.collected_datetime\r\n ) as lab_requests\r\n from {{ ref('lab_requests') }} lr\r\n join encounters_in_scope eis\r\n on eis.encounter_id = lr.encounter_id\r\n left join {{ ref('lab_test_panel_requests') }} ltpr\r\n on ltpr.id = lr.lab_test_panel_request_id\r\n left join {{ ref('lab_test_panels') }} ltp\r\n on ltp.id = ltpr.lab_test_panel_id\r\n left join {{ ref('lab_tests') }} lt\r\n on lt.lab_request_id = lr.id\r\n and lr.lab_test_panel_request_id isnull\r\n left join {{ ref('lab_test_types') }} ltt\r\n on ltt.id = lt.lab_test_type_id\r\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\r\n group by lr.encounter_id\r\n),\r\n\r\nnotes_raw as (\r\n select\r\n n.id,\r\n n.datetime,\r\n n.content,\r\n n.note_type_id,\r\n n.note_type,\r\n n.record_type,\r\n n.record_id,\r\n n.updated_note_id,\r\n n.visibility_status\r\n from {{ ref('notes') }} n\r\n left join {{ ref('imaging_requests') }} ir\r\n on n.record_type = 'ImagingRequest'\r\n and ir.id = n.record_id\r\n join encounters_in_scope eis\r\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\r\n where n.record_type in ('Encounter', 'ImagingRequest')\r\n),\r\n\r\nencounter_notes_deduped as (\r\n select\r\n id,\r\n datetime,\r\n content,\r\n note_type,\r\n record_id,\r\n visibility_status,\r\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\r\n from notes_raw\r\n where\r\n record_type = 'Encounter'\r\n and note_type_id != 'notetype-system'\r\n),\r\n\r\nimaging_request_areas as (\r\n select\r\n ir.encounter_id,\r\n ira.imaging_request_id,\r\n case\r\n when ir.imaging_type = 'xRay' then 'X-Ray'\r\n when ir.imaging_type = 'ctScan' then 'CT Scan'\r\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\r\n when ir.imaging_type = 'mri' then 'MRI'\r\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\r\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\r\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\r\n when ir.imaging_type = 'mammogram' then 'Mammogram'\r\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\r\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\r\n when ir.imaging_type = 'angiogram' then 'Angiogram'\r\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\r\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\r\n when ir.imaging_type = 'stressTest' then 'Stress Test'\r\n else ir.imaging_type\r\n end as imaging_type,\r\n coalesce(\r\n string_agg(\r\n area.name, ', '\r\n order by area.name\r\n ),\r\n string_agg(case\r\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\r\n end, ', '\r\n order by n.datetime)\r\n ) as areas_to_be_imaged,\r\n string_agg(case\r\n when n.note_type_id = 'notetype-other' then n.content\r\n end, ','\r\n order by n.datetime) as notes\r\n from {{ ref('imaging_requests') }} ir\r\n join encounters_in_scope eis\r\n on eis.encounter_id = ir.encounter_id\r\n left join {{ ref('imaging_request_areas') }} ira\r\n on ira.imaging_request_id = ir.id\r\n left join {{ ref('reference_data') }} area\r\n on area.id = ira.area_id\r\n left join notes_raw n\r\n on n.record_id = ir.id\r\n and n.record_type = 'ImagingRequest'\r\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\r\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\r\n),\r\n\r\nencounter_imaging_requests as (\r\n select\r\n encounter_id,\r\n string_agg(\r\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\r\n ) as imaging_requests\r\n from imaging_request_areas\r\n group by encounter_id\r\n),\r\n\r\nencounter_notes as (\r\n select\r\n n.record_id as encounter_id,\r\n string_agg(concat(\r\n 'Note type: ',\r\n n.note_type,\r\n ', Content: ', n.content,\r\n ', Note date: ', to_char(n.datetime, '{{ var(\"datetime_format\") }}')\r\n ),\r\n E'\\n'\r\n order by n.datetime) as notes\r\n from encounter_notes_deduped n\r\n where n.row_number = 1\r\n group by n.record_id\r\n),\r\n\r\ninvoice_data as (\r\n select\r\n i.encounter_id,\r\n max(\r\n case\r\n when i.status = 'finalised'\r\n then to_char(i.datetime, '{{ var(\"datetime_format\") }}')\r\n end\r\n ) as invoice_finalised_datetime,\r\n string_agg(distinct ip.category, ', ') as invoice_product_categories\r\n from {{ ref('invoices') }} i\r\n join encounters_in_scope eis\r\n on eis.encounter_id = i.encounter_id\r\n left join {{ ref('invoice_items') }} ii\r\n on ii.invoice_id = i.id\r\n left join {{ ref('invoice_products') }} ip\r\n on ip.id = ii.product_id\r\n group by i.encounter_id\r\n)\r\n\r\nselect\r\n p.display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n p.first_name as \"{{ translate_label('patientFirstName') }}\",\r\n p.last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(p.date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"{{ translate_label('patientAge') }}\",\r\n p.sex as \"{{ translate_label('patientSex') }}\",\r\n eth.name as \"{{ translate_label('patientEthnicity') }}\",\r\n bt.name as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(eis.start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(eis.end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n case\r\n when eis.end_datetime is not null then\r\n case\r\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\r\n else eis.end_datetime::date - eis.start_datetime::date\r\n end\r\n end as \"{{ translate_label('encounterLengthOfStay') }}\",\r\n eis.facility as \"{{ translate_label('facility') }}\",\r\n ec.encounter_type_emergency as \"{{ translate_label('encounterTypeEmergency') }}\",\r\n ec.encounter_type_inpatient as \"{{ translate_label('encounterTypeInpatient') }}\",\r\n ec.encounter_type_outpatient as \"{{ translate_label('encounterTypeOutpatient') }}\",\r\n dd.name as \"{{ translate_label('dischargeDisposition') }}\",\r\n t.score as \"{{ translate_label('triageCategory') }}\",\r\n am.name as \"{{ translate_label('triageArrivalMode') }}\",\r\n case\r\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\r\n then concat(\r\n lpad((\r\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\r\n + extract(hour from (t.closed_datetime - t.triage_datetime))\r\n )::text, 2, '0'), ':',\r\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\r\n lpad(\r\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\r\n )\r\n )\r\n end as \"{{ translate_label('triageWaitingTime') }}\",\r\n ec.encountering_clinician as \"{{ translate_label('encounterClinician') }}\",\r\n c.display_name as \"{{ translate_label('encounterSupervisingClinician') }}\",\r\n dp.name as \"{{ translate_label('dischargeDepartment') }}\",\r\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"{{ translate_label('dischargeDateTime') }} of {{ translate_label('dischargeDepartment') }}\",\r\n lg.name as \"{{ translate_label('dischargeLocationGroup') }}\",\r\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"{{ translate_label('dischargeDateTime') }} of {{ translate_label('dischargeLocationGroup') }}\",\r\n l.name as \"{{ translate_label('dischargeLocation') }}\",\r\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"{{ translate_label('dischargeDateTime') }} of {{ translate_label('dischargeLocation') }}\",\r\n ec.departments as \"{{ translate_label('encounterDepartmentHistory') }}\",\r\n array_to_string(ec.department_datetimes, ', ') as \"{{ translate_label('encounterDepartmentHistoryDateTimes') }}\",\r\n ec.location_groups as \"{{ translate_label('encounterLocationGroupHistory') }}\",\r\n array_to_string(ec.location_group_datetimes, ', ') as \"{{ translate_label('encounterLocationGroupHistoryDateTimes') }}\",\r\n ec.locations as \"{{ translate_label('encounterLocationHistory') }}\",\r\n array_to_string(ec.location_datetimes, ', ') as \"{{ translate_label('encounterLocationHistoryDateTimes') }}\",\r\n eis.reason_for_encounter as \"{{ translate_label('encounterReasonForEncounter') }}\",\r\n ed.diagnoses as \"{{ translate_label('diagnoses') }}\",\r\n ep.medications as \"{{ translate_label('medications') }}\",\r\n ev.vaccinations as \"{{ translate_label('vaccinations') }}\",\r\n epr.procedures as \"{{ translate_label('procedures') }}\",\r\n elr.lab_requests as \"{{ translate_label('labRequests') }}\",\r\n eir.imaging_requests as \"{{ translate_label('imagingRequests') }}\",\r\n case\r\n when length(en.notes) > 32000\r\n then concat(\r\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\r\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\r\n )\r\n else en.notes\r\n end as \"{{ translate_label('notes') }}\",\r\n invd.invoice_finalised_datetime as \"{{ translate_label('invoiceFinalisedDateTime') }}\",\r\n invd.invoice_product_categories as \"{{ translate_label('invoiceProductCategories') }}\"\r\nfrom encounters_in_scope eis\r\njoin {{ ref('patients') }} p\r\n on p.id = eis.patient_id\r\njoin {{ ref('locations') }} l\r\n on l.id = eis.location_id\r\njoin {{ ref('departments') }} dp\r\n on dp.id = eis.department_id\r\nleft join {{ ref('location_groups') }} lg\r\n on lg.id = l.location_group_id\r\nleft join {{ ref('users') }} c\r\n on c.id = eis.clinician_id\r\njoin encounter_changes ec\r\n on ec.encounter_id = eis.encounter_id\r\nleft join {{ ref('triages') }} t\r\n on t.encounter_id = eis.encounter_id\r\nleft join {{ ref('discharges') }} d\r\n on d.encounter_id = eis.encounter_id\r\nleft join {{ ref('patient_additional_data') }} pad\r\n on pad.patient_id = eis.patient_id\r\nleft join {{ ref('reference_data') }} eth\r\n on eth.id = pad.ethnicity_id\r\nleft join {{ ref('reference_data') }} bt\r\n on bt.id = eis.patient_billing_type_id\r\nleft join {{ ref('reference_data') }} am\r\n on am.id = t.arrival_mode_id\r\nleft join {{ ref('reference_data') }} dd\r\n on dd.id = d.disposition_id\r\nleft join encounter_diagnoses ed\r\n on ed.encounter_id = eis.encounter_id\r\nleft join encounter_prescriptions ep\r\n on ep.encounter_id = eis.encounter_id\r\nleft join encounter_vaccinations ev\r\n on ev.encounter_id = eis.encounter_id\r\nleft join encounter_procedures epr\r\n on epr.encounter_id = eis.encounter_id\r\nleft join encounter_lab_requests elr\r\n on elr.encounter_id = eis.encounter_id\r\nleft join encounter_imaging_requests eir\r\n on eir.encounter_id = eis.encounter_id\r\nleft join encounter_notes en\r\n on en.encounter_id = eis.encounter_id\r\nleft join invoice_data invd\r\n on invd.encounter_id = eis.encounter_id\r\nwhere\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else {{ parameter('departmentId') }} = any(ec.department_ids::text [])\r\n end\r\n and case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else {{ parameter('locationGroupId') }} = any(ec.location_group_ids::text [])\r\n end\r\norder by eis.{{ date_field }} desc\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8944638, "supported_languages": null}, "macro.tamanu_source_dbt.imaging_requests_dataset": {"name": "imaging_requests_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\imaging_requests.sql", "original_file_path": "macros\\models\\imaging_requests.sql", "unique_id": "macro.tamanu_source_dbt.imaging_requests_dataset", "macro_sql": "{% macro imaging_requests_dataset(is_sensitive=false) %}\r\n\r\nwith results as (\r\n select\r\n imaging_request_id,\r\n min(datetime) as completed_datetime\r\n from {{ ref('imaging_results') }}\r\n group by imaging_request_id\r\n),\r\n\r\nimaging_area_notes as (\r\n select\r\n record_id as imaging_request_id,\r\n string_agg(content, ', ' order by datetime) as imaging_area\r\n from {{ ref('notes') }}\r\n where record_type = 'ImagingRequest'\r\n and note_type_id = 'notetype-areaToBeImaged'\r\n group by record_id\r\n),\r\n\r\nimaging_areas as (\r\n select\r\n ir.id as imaging_request_id,\r\n coalesce(\r\n string_agg(ia.name, ', ' order by ia.name),\r\n n.imaging_area\r\n ) as imaging_area\r\n from {{ ref('imaging_requests') }} ir\r\n left join {{ ref('imaging_request_areas') }} ira on ira.imaging_request_id = ir.id\r\n left join {{ ref('reference_data') }} ia on ia.id = ira.area_id\r\n left join imaging_area_notes n on n.imaging_request_id = ir.id\r\n group by ir.id, n.imaging_area\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(ir.datetime::date, p.date_of_birth)) as age,\r\n p.sex,\r\n v.id as village_id,\r\n v.name as village,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n ir.display_id as request_id,\r\n ir.datetime as requested_datetime,\r\n su.id as supervising_clinician_id,\r\n su.display_name as supervising_clinician,\r\n ru.id as requesting_clinician_id,\r\n ru.display_name as requesting_clinician,\r\n case\r\n when ir.priority = 'routine' then 'Routine'\r\n when ir.priority = 'urgent' then 'Urgent'\r\n when ir.priority = 'asap' then 'ASAP'\r\n when ir.priority = 'stat' then 'STAT'\r\n when ir.priority = 'today' then 'Today'\r\n else ir.priority\r\n end as priority,\r\n ir.imaging_type,\r\n areas.imaging_area,\r\n ir.status as status_id,\r\n case\r\n when ir.status = 'pending' then 'Pending'\r\n when ir.status = 'in_progress' then 'In progress'\r\n when ir.status = 'completed' then 'Completed'\r\n when ir.status = 'cancelled' then 'Cancelled'\r\n when ir.status = 'deleted' then 'Deleted'\r\n when ir.status = 'entered_in_error' then 'Entered in error'\r\n else 'Unknown'\r\n end as status,\r\n case\r\n when ir.status = 'completed' then irs.completed_datetime\r\n end as completed_datetime,\r\n case\r\n when ir.reason_for_cancellation = 'clinical' then 'Clinical reason'\r\n when ir.reason_for_cancellation = 'duplicate' then 'Duplicate'\r\n when ir.reason_for_cancellation = 'entered-in-error' then 'Entered in error'\r\n when ir.reason_for_cancellation = 'patient-discharged' then 'Patient discharged'\r\n when ir.reason_for_cancellation = 'patient-refused' then 'Patient refused'\r\n when ir.reason_for_cancellation = 'other' then 'Other'\r\n end as reason_for_cancellation\r\nfrom {{ ref('imaging_requests') }} ir\r\njoin {{ ref('encounters') }} e on e.id = ir.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('locations') }} l on l.id = e.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\nleft join {{ ref('users') }} su on su.id = e.clinician_id\r\nleft join {{ ref('users') }} ru on ru.id = ir.requested_by_id\r\nleft join imaging_areas areas on areas.imaging_request_id = ir.id\r\nleft join {{ ref('reference_data') }} v on v.id = p.village_id\r\nleft join results irs on irs.imaging_request_id = ir.id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8944638, "supported_languages": null}, "macro.tamanu_source_dbt.lab_requests_dataset": {"name": "lab_requests_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\lab_requests.sql", "original_file_path": "macros\\models\\lab_requests.sql", "unique_id": "macro.tamanu_source_dbt.lab_requests_dataset", "macro_sql": "{% macro lab_requests_dataset(is_sensitive=false) %}\r\n\r\nwith lab_test_data as (\r\n select\r\n lr.id as lab_request_id,\r\n string_agg(ltt.name, ', '\r\n order by ltt.name\r\n ) as tests,\r\n max(lt.completed_datetime) as completed_datetime\r\n from {{ ref('lab_requests') }} lr\r\n join {{ ref('lab_tests') }} lt on lt.lab_request_id = lr.id\r\n join {{ ref('lab_test_types') }} ltt on ltt.id = lt.lab_test_type_id\r\n where ltt.is_sensitive = {{ is_sensitive }}\r\n group by lr.id\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(lr.requested_datetime, p.date_of_birth)) as age,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.name as department,\r\n d.id as department_id,\r\n l.id as location_id,\r\n l.name as location,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n laboratory.id as laboratory_id,\r\n laboratory.name as laboratory,\r\n lr.display_id as request_id,\r\n case lr.status\r\n when 'reception_pending' then 'Reception pending'\r\n when 'results_pending' then 'Results pending'\r\n when 'to_be_verified' then 'To be verified'\r\n when 'verified' then 'Verified'\r\n when 'published' then 'Published'\r\n when 'cancelled' then 'Cancelled'\r\n when 'deleted' then 'Deleted'\r\n when 'sample-not-collected' then 'Sample not collected'\r\n when 'entered-in-error' then 'Entered in error'\r\n else lr.status\r\n end as status,\r\n lr.status as status_id,\r\n lr.requested_datetime,\r\n req_clinician.id as requested_by_id,\r\n req_clinician.display_name as requested_by,\r\n lr.department_id as requesting_department_id,\r\n req_department.name as requesting_department,\r\n lr.lab_test_priority_id as priority_id,\r\n priority.name as priority,\r\n category.id as lab_test_category_id,\r\n category.name as lab_test_category,\r\n ltp.name as lab_test_panel,\r\n lta.tests,\r\n lr.collected_datetime,\r\n lr.collected_by_id,\r\n collector.display_name as collected_by,\r\n lr.specimen_type_id,\r\n specimen.name as specimen_type,\r\n site.name as site,\r\n lta.completed_datetime,\r\n case lr.reason_for_cancellation\r\n when 'clinical' then 'Clinical reason'\r\n when 'duplicate' then 'Duplicate'\r\n when 'entered-in-error' then 'Entered in error'\r\n when 'patient-discharged' then 'Patient discharged'\r\n when 'patient-refused' then 'Patient refused'\r\n when 'other' then 'Other'\r\n else lr.reason_for_cancellation\r\n end as reason_for_cancellation\r\nfrom {{ ref('lab_requests') }} lr\r\njoin lab_test_data lta on lta.lab_request_id = lr.id\r\njoin {{ ref('encounters') }} e on e.id = lr.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('locations') }} l on l.id = e.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\nleft join {{ ref('facilities') }} f on f.id = l.facility_id\r\nleft join {{ ref('reference_data') }} laboratory on laboratory.id = lr.lab_test_laboratory_id\r\nleft join {{ ref('users') }} req_clinician on req_clinician.id = lr.requested_by_id\r\nleft join {{ ref('departments') }} req_department on req_department.id = lr.department_id\r\nleft join {{ ref('reference_data') }} priority on priority.id = lr.lab_test_priority_id\r\nleft join {{ ref('reference_data') }} category on category.id = lr.lab_test_category_id\r\nleft join {{ ref('users') }} collector on collector.id = lr.collected_by_id\r\nleft join {{ ref('reference_data') }} specimen on specimen.id = lr.specimen_type_id\r\nleft join {{ ref('reference_data') }} site on site.id = lr.lab_sample_site_id\r\nleft join {{ ref('lab_test_panel_requests') }} ltpr\r\n on ltpr.id = lr.lab_test_panel_request_id\r\nleft join {{ ref('lab_test_panels') }} ltp on ltp.id = ltpr.lab_test_panel_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.lab_tests_dataset": {"name": "lab_tests_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\lab_tests.sql", "original_file_path": "macros\\models\\lab_tests.sql", "unique_id": "macro.tamanu_source_dbt.lab_tests_dataset", "macro_sql": "{% macro lab_tests_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(lr.requested_datetime, p.date_of_birth::date)) as age,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n req_dept.id as requesting_department_id,\r\n req_dept.name as requesting_department,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n l.id as location_id,\r\n l.name as location,\r\n lr.display_id as lab_request_id,\r\n lr.status as status_id,\r\n case lr.status\r\n when 'reception_pending' then 'Reception pending'\r\n when 'results_pending' then 'Results pending'\r\n when 'to_be_verified' then 'To be verified'\r\n when 'verified' then 'Verified'\r\n when 'published' then 'Published'\r\n when 'cancelled' then 'Cancelled'\r\n when 'deleted' then 'Deleted'\r\n when 'sample-not-collected' then 'Sample not collected'\r\n when 'entered-in-error' then 'Entered in error'\r\n else lr.status\r\n end as status,\r\n ltp.id as lab_test_panel_id,\r\n ltp.name as lab_test_panel,\r\n category.id as lab_test_category_id,\r\n category.name as lab_test_category,\r\n lr.requested_datetime,\r\n requester.id as requested_by_id,\r\n requester.display_name as requested_by,\r\n lr.published_datetime as lab_request_published_datetime,\r\n lt.date as lab_test_date,\r\n lt.result,\r\n lt.verification,\r\n ltt.id as lab_test_type_id,\r\n ltt.name as lab_test_type,\r\n lt.completed_datetime as lab_test_completed_datetime\r\nfrom {{ ref('lab_requests') }} lr\r\njoin {{ ref('encounters') }} e on e.id = lr.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('locations') }} l on l.id = e.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\nleft join {{ ref('departments') }} req_dept on req_dept.id = lr.department_id\r\nleft join {{ ref('facilities') }} f on f.id = l.facility_id\r\nleft join {{ ref('users') }} requester on requester.id = lr.requested_by_id\r\nleft join {{ ref('lab_test_panel_requests') }} ltpr on ltpr.id = lr.lab_test_panel_request_id\r\nleft join {{ ref('lab_test_panels') }} ltp on ltp.id = ltpr.lab_test_panel_id\r\nleft join {{ ref('reference_data') }} category on category.id = lr.lab_test_category_id\r\njoin {{ ref('lab_tests') }} lt on lt.lab_request_id = lr.id\r\njoin {{ ref('lab_test_types') }} ltt on ltt.id = lt.lab_test_type_id\r\nwhere ltt.is_sensitive = {{ is_sensitive }}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.location_bookings_dataset": {"name": "location_bookings_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\location_bookings.sql", "original_file_path": "macros\\models\\location_bookings.sql", "unique_id": "macro.tamanu_source_dbt.location_bookings_dataset", "macro_sql": "{% macro location_bookings_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(a.start_datetime::date, p.date_of_birth)) as age,\r\n p.sex,\r\n vil.id as village_id,\r\n vil.name as village,\r\n billing.id as billing_type_id,\r\n billing.name as billing_type,\r\n a.start_datetime as booking_start_datetime,\r\n a.end_datetime as booking_end_datetime,\r\n a.status as booking_status,\r\n u.id as clinician_id,\r\n u.display_name as clinician,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n l.id as location_id,\r\n l.name as location,\r\n a.booking_type_id,\r\n bt.name as booking_type\r\nfrom {{ ref('location_bookings') }} a\r\njoin {{ ref('patients') }} p on p.id = a.patient_id\r\nleft join {{ ref('users') }} u on u.id = a.clinician_id\r\njoin {{ ref('locations') }} l on l.id = a.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\njoin {{ ref('facilities') }} f on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('patient_additional_data') }} pd on pd.patient_id = p.id\r\nleft join {{ ref('reference_data') }} billing on billing.id = pd.patient_billing_type_id\r\nleft join {{ ref('reference_data') }} vil on vil.id = p.village_id\r\nleft join {{ ref('reference_data') }} bt on bt.id = a.booking_type_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.base_history_from_log": {"name": "base_history_from_log", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\logs.sql", "original_file_path": "macros\\models\\logs.sql", "unique_id": "macro.tamanu_source_dbt.base_history_from_log", "macro_sql": "{%- macro base_history_from_log(table_name, schema_name='logs__tamanu', source_name='changes') -%}\r\n select \r\n id as changelog_id,\r\n logged_at,\r\n updated_by_user_id,\r\n record_created_at,\r\n record_updated_at,\r\n record_id,\r\n record_data\r\n from {{ source(schema_name, source_name) }}\r\n where table_name = '{{ table_name }}'\r\n and record_id not in (\r\n select id::text\r\n from {{ source('tamanu', table_name) }} t\r\n where t.deleted_at notnull\r\n )\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.medication_dispenses_dataset": {"name": "medication_dispenses_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\medication_dispenses.sql", "original_file_path": "macros\\models\\medication_dispenses.sql", "unique_id": "macro.tamanu_source_dbt.medication_dispenses_dataset", "macro_sql": "{% macro medication_dispenses_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n md.id,\r\n md.quantity,\r\n md.dispensed_at,\r\n po.facility_id,\r\n f.name as facility,\r\n pr.medication_id,\r\n m.code as medication_code,\r\n m.name as medication\r\nfrom {{ ref('medication_dispenses') }} md\r\njoin {{ ref('pharmacy_order_prescriptions') }} pop\r\n on pop.id = md.pharmacy_order_prescription_id\r\njoin {{ ref('pharmacy_orders') }} po\r\n on po.id = pop.pharmacy_order_id\r\n-- prescription_id is not null on all pharmacy_order_prescriptions rows (enforced by source not_null test).\r\n-- ongoing_prescription_id is the nullable supplementary reference and is not used for the medication lookup\r\njoin {{ ref('prescriptions') }} pr\r\n on pr.id = pop.prescription_id\r\njoin {{ ref('reference_data') }} m\r\n on m.id = pr.medication_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = po.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.get_metadata_from_changes": {"name": "get_metadata_from_changes", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\metadata.sql", "original_file_path": "macros\\models\\metadata.sql", "unique_id": "macro.tamanu_source_dbt.get_metadata_from_changes", "macro_sql": "{%- macro get_metadata_from_changes(table_name) -%}\r\nwith change_logs as (\r\n select \r\n record_id,\r\n logged_at,\r\n least(record_created_at, logged_at) as created_datetime\r\n from {{ source('logs__tamanu', 'changes') }}\r\n where table_name = '{{ table_name }}'\r\n)\r\nselect \r\n record_id as id,\r\n min(created_datetime) as created_datetime,\r\n max(logged_at) as updated_datetime\r\nfrom change_logs\r\ngroup by record_id\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.outpatient_appointments_dataset": {"name": "outpatient_appointments_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\outpatient_appointments.sql", "original_file_path": "macros\\models\\outpatient_appointments.sql", "unique_id": "macro.tamanu_source_dbt.outpatient_appointments_dataset", "macro_sql": "{% macro outpatient_appointments_dataset(is_sensitive=false) %}\r\n\r\nwith appointment_creators as (\r\n select\r\n appointment_id,\r\n created_by_user_id\r\n from {{ ref('outpatient_appointments_change_logs') }}\r\n where change_sequence = 1\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(a.start_datetime, p.date_of_birth)) as age,\r\n p.sex,\r\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\r\n vil.id as village_id,\r\n vil.name as village,\r\n billing.id as billing_type_id,\r\n billing.name as billing_type,\r\n a.start_datetime as appointment_start_datetime,\r\n a.end_datetime as appointment_end_datetime,\r\n a.appointment_type_id,\r\n apt.name as appointment_type,\r\n a.status as appointment_status,\r\n u.id as clinician_id,\r\n u.display_name as clinician,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n a.priority,\r\n a.schedule_id,\r\n a.until_date,\r\n a.interval,\r\n a.days_of_week,\r\n a.frequency,\r\n a.nth_weekday,\r\n ac.created_by_user_id,\r\n creator.display_name as created_by\r\nfrom {{ ref('outpatient_appointments') }} a\r\njoin {{ ref('patients') }} p on p.id = a.patient_id\r\nleft join {{ ref('users') }} u on u.id = a.clinician_id\r\njoin {{ ref('location_groups') }} lg on lg.id = a.location_group_id\r\njoin {{ ref('facilities') }} f on f.id = lg.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('patient_additional_data') }} pd on pd.patient_id = p.id\r\nleft join {{ ref('reference_data') }} billing on billing.id = pd.patient_billing_type_id\r\nleft join {{ ref('reference_data') }} vil on vil.id = p.village_id\r\nleft join {{ ref('reference_data') }} apt on apt.id = a.appointment_type_id\r\nleft join appointment_creators ac on ac.appointment_id = a.id\r\nleft join {{ ref('users') }} creator on creator.id = ac.created_by_user_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.outpatient_appointments_audit_dataset": {"name": "outpatient_appointments_audit_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\outpatient_appointments_audit.sql", "original_file_path": "macros\\models\\outpatient_appointments_audit.sql", "unique_id": "macro.tamanu_source_dbt.outpatient_appointments_audit_dataset", "macro_sql": "{% macro outpatient_appointments_audit_dataset(is_sensitive=false) %}\r\n\r\n-- Outpatient Appointments Audit Dataset\r\n-- This dataset tracks changes/modifications to outpatient appointments\r\n-- Each row represents a modification event (excludes initial creation)\r\n--\r\n-- Included changes:\r\n-- - Status changed to 'Cancelled' (individual cancellations only)\r\n-- - Changes to: start/end datetime, clinician, location group, appointment type, priority\r\n--\r\n-- Excluded changes:\r\n-- - Initial appointment creation (change_sequence = 1)\r\n-- - Status-only changes (unless changing to 'Cancelled')\r\n-- - Appointments automatically cancelled when their schedule was cancelled\r\n-- (i.e., bulk cancellations via \"cancel this and all future appointments\")\r\n--\r\n-- change_number: starts from 1 for the first modification, increments for subsequent changes\r\n--\r\n-- Note: schedule_id never changes on existing appointments in Tamanu.\r\n-- When a schedule is modified, old appointments are cancelled and new ones are created.\r\n\r\nwith change_evaluation as (\r\n select\r\n cl.*,\r\n -- Determine if this change has meaningful field modifications\r\n case\r\n -- Status changed to Cancelled\r\n when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true\r\n -- Any non-status fields changed\r\n when (\r\n cl.prev_start_datetime is distinct from cl.start_datetime\r\n or cl.prev_end_datetime is distinct from cl.end_datetime\r\n or cl.prev_clinician_id is distinct from cl.clinician_id\r\n or cl.prev_location_group_id is distinct from cl.location_group_id\r\n or cl.prev_appointment_type_id is distinct from cl.appointment_type_id\r\n or cl.prev_is_high_priority is distinct from cl.is_high_priority\r\n ) then true\r\n else false\r\n end as is_meaningful_change\r\n from {{ ref('outpatient_appointments_change_logs') }} cl\r\n left join {{ source('tamanu', 'appointment_schedules') }} s on s.id = cl.schedule_id\r\n where\r\n -- Exclude appointments that were automatically cancelled when the schedule was cancelled\r\n -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule)\r\n not (\r\n cl.status = 'Cancelled'\r\n and s.cancelled_at_date is not null\r\n and cl.start_datetime::date > s.cancelled_at_date::date\r\n )\r\n),\r\n\r\nnumbered_changes as (\r\n select\r\n ce.*,\r\n -- Assign change number: starts from 1 for first modification\r\n row_number() over (\r\n partition by ce.appointment_id\r\n order by ce.modified_datetime\r\n ) as change_number\r\n from change_evaluation ce\r\n where ce.is_meaningful_change = true\r\n and ce.change_sequence > 1 -- Exclude initial creation\r\n)\r\n\r\nselect\r\n fc.change_id,\r\n fc.appointment_id,\r\n fc.change_number,\r\n -- Patient details\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n -- Current appointment details\r\n fc.start_datetime as appointment_start_datetime,\r\n fc.end_datetime as appointment_end_datetime,\r\n apt.name as appointment_type,\r\n fc.appointment_type_id,\r\n clinician.display_name as clinician,\r\n fc.clinician_id,\r\n lg.name as location_group,\r\n fc.location_group_id,\r\n case when fc.is_high_priority then 'Yes' else 'No' end as priority,\r\n fc.schedule_id,\r\n case\r\n when fc.schedule_id is not null then 'Yes'\r\n else 'No'\r\n end as is_repeating,\r\n -- Modification details\r\n creator.display_name as created_by,\r\n fc.created_by_user_id,\r\n modifier.display_name as modified_by,\r\n fc.modified_by_user_id,\r\n fc.modified_datetime,\r\n case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled,\r\n -- Previous appointment details (only shown if different from current)\r\n case\r\n when fc.prev_start_datetime is distinct from fc.start_datetime\r\n then fc.prev_start_datetime\r\n end as prev_start_datetime,\r\n case\r\n when fc.prev_end_datetime is distinct from fc.end_datetime\r\n then fc.prev_end_datetime\r\n end as prev_end_datetime,\r\n case\r\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\r\n then prev_apt.name\r\n end as prev_appointment_type,\r\n case\r\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\r\n then fc.prev_appointment_type_id\r\n end as prev_appointment_type_id,\r\n case\r\n when fc.prev_clinician_id is distinct from fc.clinician_id\r\n then prev_clinician.display_name\r\n end as prev_clinician,\r\n case\r\n when fc.prev_clinician_id is distinct from fc.clinician_id\r\n then fc.prev_clinician_id\r\n end as prev_clinician_id,\r\n case\r\n when fc.prev_location_group_id is distinct from fc.location_group_id\r\n then prev_lg.name\r\n end as prev_location_group,\r\n case\r\n when fc.prev_location_group_id is distinct from fc.location_group_id\r\n then fc.prev_location_group_id\r\n end as prev_location_group_id,\r\n case\r\n when fc.prev_is_high_priority is not null\r\n and fc.prev_is_high_priority is distinct from fc.is_high_priority\r\n then case when fc.prev_is_high_priority then 'Yes' else 'No' end\r\n end as prev_priority,\r\n -- Facility details for filtering\r\n f.id as facility_id,\r\n f.name as facility\r\nfrom numbered_changes fc\r\njoin {{ ref('patients') }} p on p.id = fc.patient_id\r\nleft join {{ ref('users') }} clinician on clinician.id = fc.clinician_id\r\nleft join {{ ref('users') }} prev_clinician on prev_clinician.id = fc.prev_clinician_id\r\nleft join {{ ref('users') }} creator on creator.id = fc.created_by_user_id\r\nleft join {{ ref('users') }} modifier on modifier.id = fc.modified_by_user_id\r\njoin {{ ref('location_groups') }} lg on lg.id = fc.location_group_id\r\nleft join {{ ref('location_groups') }} prev_lg on prev_lg.id = fc.prev_location_group_id\r\nleft join {{ ref('reference_data') }} apt on apt.id = fc.appointment_type_id\r\nleft join {{ ref('reference_data') }} prev_apt on prev_apt.id = fc.prev_appointment_type_id\r\nleft join {{ source('tamanu', 'appointment_schedules') }} s on s.id = fc.schedule_id\r\n-- Join to facility for filtering by sensitivity\r\njoin {{ ref('facilities') }} f on f.id = lg.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.procedures_dataset": {"name": "procedures_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\procedures.sql", "original_file_path": "macros\\models\\procedures.sql", "unique_id": "macro.tamanu_source_dbt.procedures_dataset", "macro_sql": "{% macro procedures_dataset(is_sensitive=false) %}\r\n\r\nwith filtered_procedure as (\r\n select\r\n pc.*,\r\n eh.department_id,\r\n eh.encounter_type,\r\n row_number() over (\r\n partition by pc.id\r\n order by eh.datetime desc\r\n ) as encounter_history_record\r\n from {{ ref('procedures') }} pc\r\n left join {{ ref('encounter_history') }} eh\r\n on eh.encounter_id = pc.encounter_id\r\n and eh.datetime::date <= pc.date\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(pc.date, p.date_of_birth)) as age,\r\n p.sex,\r\n nationality.name as nationality,\r\n encounter_facility.id as encounter_facility_id,\r\n encounter_facility.name as encounter_facility,\r\n encounter_department.id as encounter_department_id,\r\n encounter_department.name as encounter_department,\r\n case\r\n when coalesce(pc.encounter_type, e.encounter_type) = 'admission' then 'Hospital Admission'\r\n when coalesce(pc.encounter_type, e.encounter_type) = 'clinic' then 'Clinic'\r\n when coalesce(pc.encounter_type, e.encounter_type) in ('triage', 'observation', 'emergency') then 'Triage'\r\n end as encounter_type,\r\n e.start_datetime as encounter_start_datetime,\r\n e.end_datetime as encounter_end_datetime,\r\n procedure_facility.id as procedure_facility_id,\r\n procedure_facility.name as procedure_facility,\r\n procedure_area.id as procedure_area_id,\r\n procedure_area.name as procedure_area,\r\n procedure_location.id as procedure_location_id,\r\n procedure_location.name as procedure_location,\r\n procedure_type.id as procedure_type_id,\r\n procedure_type.name as procedure_type,\r\n pc.date as procedure_date,\r\n pc.start_time as procedure_start_time,\r\n pc.end_time as procedure_end_time,\r\n case\r\n when pc.end_time is not null and pc.start_time is not null then\r\n concat(\r\n lpad((\r\n case\r\n when pc.end_time < pc.start_time\r\n then\r\n (24 + extract(hour from pc.end_time) - extract(hour from pc.start_time))\r\n else\r\n extract(hour from (pc.end_time - pc.start_time))\r\n end\r\n )::text, 2, '0'), ':',\r\n lpad((\r\n case\r\n when pc.end_time < pc.start_time\r\n then\r\n (extract(minute from pc.end_time) - extract(minute from pc.start_time))\r\n else\r\n extract(minute from (pc.end_time - pc.start_time))\r\n end\r\n )::text, 2, '0')\r\n )\r\n end as procedure_duration,\r\n clinician.id as procedure_clinician_id,\r\n clinician.display_name as procedure_clinician,\r\n anaesthetist.id as procedure_anaesthetist_id,\r\n anaesthetist.display_name as procedure_anaesthetist,\r\n assistant_anaesthetist.id as procedure_assistant_anaesthetist_id,\r\n assistant_anaesthetist.display_name as procedure_assistant_anaesthetist,\r\n case\r\n when pc.is_completed then 'Y' else 'N'\r\n end as is_completed,\r\n pc.time_in,\r\n pc.time_out\r\nfrom filtered_procedure pc\r\njoin {{ ref('encounters') }} e on e.id = pc.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('reference_data') }} procedure_type on procedure_type.id = pc.procedure_type_id\r\njoin {{ ref('locations') }} procedure_location\r\n on procedure_location.id = pc.location_id\r\nleft join {{ ref('location_groups') }} procedure_area\r\n on procedure_area.id = procedure_location.location_group_id\r\njoin {{ ref('facilities') }} procedure_facility\r\n on procedure_facility.id = procedure_location.facility_id\r\n and procedure_facility.is_sensitive = {{ is_sensitive }}\r\njoin {{ ref('locations') }} encounter_location\r\n on encounter_location.id = e.location_id\r\njoin {{ ref('facilities') }} encounter_facility\r\n on encounter_facility.id = encounter_location.facility_id\r\n and encounter_facility.is_sensitive = {{ is_sensitive }}\r\njoin {{ ref('departments') }} encounter_department\r\n on encounter_department.id = coalesce(pc.department_id, e.department_id)\r\nleft join {{ ref('patient_additional_data') }} pd on pd.patient_id = p.id\r\nleft join {{ ref('reference_data') }} nationality on nationality.id = pd.nationality_id\r\nleft join {{ ref('users') }} assistant_anaesthetist on assistant_anaesthetist.id = pc.assistant_anaesthetist_id\r\nleft join {{ ref('users') }} anaesthetist on anaesthetist.id = pc.anaesthetist_id\r\nleft join {{ ref('users') }} clinician on clinician.id = pc.clinician_id\r\nwhere pc.encounter_history_record = 1\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.referrals_dataset": {"name": "referrals_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\referrals.sql", "original_file_path": "macros\\models\\referrals.sql", "unique_id": "macro.tamanu_source_dbt.referrals_dataset", "macro_sql": "{% macro referrals_dataset(is_sensitive=false) %}\r\n\r\nwith diagnoses as (\r\n select\r\n ed.encounter_id,\r\n string_agg(concat(d.name), '; ') as diagnoses\r\n from {{ ref('encounter_diagnoses') }} ed\r\n left join {{ ref('reference_data') }} d on d.id = ed.diagnosis_id\r\n group by ed.encounter_id\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.village_id,\r\n ed.diagnoses,\r\n s.name as referral_type,\r\n u.id as referring_doctor_id,\r\n u.display_name as referring_doctor_name,\r\n sr.end_datetime as referral_datetime,\r\n rf.status,\r\n d.name as department\r\nfrom {{ ref('referrals') }} rf\r\njoin {{ ref('encounters') }} e on e.id = rf.initiating_encounter_id\r\njoin {{ ref('locations') }} l on l.id = e.location_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\njoin {{ ref('survey_responses') }} sr on sr.id = rf.survey_response_id\r\njoin {{ ref('surveys') }} s on s.id = sr.survey_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('users') }} u on u.id = e.clinician_id\r\njoin {{ ref('departments') }} d on d.id = e.department_id\r\nleft join diagnoses ed on ed.encounter_id = rf.initiating_encounter_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.8994088, "supported_languages": null}, "macro.tamanu_source_dbt.user_audit_dataset": {"name": "user_audit_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\user_audit.sql", "original_file_path": "macros\\models\\user_audit.sql", "unique_id": "macro.tamanu_source_dbt.user_audit_dataset", "macro_sql": "{% macro user_audit_dataset(is_sensitive=false) %}\r\n\r\nwith non_system_notes as (\r\n select distinct on (n.record_id)\r\n n.record_id,\r\n first_value(n.datetime) over w as first_note_datetime,\r\n last_value(n.datetime) over w as last_note_datetime,\r\n last_value(concat_ws(' on behalf of ', author.display_name, on_behalf.display_name)) over w as last_clinician\r\n from {{ ref('notes') }} n\r\n left join {{ ref('users') }} author on author.id = n.authored_by_id\r\n left join {{ ref('users') }} on_behalf on on_behalf.id = n.on_behalf_of_id\r\n where n.note_type_id != 'notetype-system'\r\n window w as (\r\n partition by n.record_id\r\n order by n.datetime\r\n rows between unbounded preceding and unbounded following\r\n )\r\n)\r\n\r\nselect\r\n u.id as user_id,\r\n u.display_name as user_name,\r\n r.name as user_role,\r\n p.id as patient_id,\r\n p.display_id,\r\n bt.name as patient_category,\r\n t.score as triage_category,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n l.id as location_id,\r\n l.name as location,\r\n e.start_datetime as encounter_start_datetime,\r\n e.end_datetime as encounter_end_datetime,\r\n n.first_note_datetime,\r\n n.last_note_datetime,\r\n case when e.end_datetime isnull then 'Patient not discharged'\r\n else 'Patient discharged'\r\n end as is_discharged,\r\n case when ds.note like 'Automatically discharged%' then n.last_clinician\r\n end as non_discharge_by_clinicians\r\nfrom {{ ref('encounters') }} e\r\nleft join {{ ref('users') }} u on u.id = e.clinician_id\r\nleft join {{ ref('roles') }} r on r.id = u.role\r\nleft join {{ ref('patients') }} p on p.id = e.patient_id\r\nleft join {{ ref('patient_additional_data') }} pad on pad.patient_id = e.patient_id\r\nleft join {{ ref('reference_data') }} bt\r\n on bt.id = coalesce(e.patient_billing_type_id, pad.patient_billing_type_id)\r\nleft join {{ ref('triages') }} t on t.encounter_id = e.id\r\njoin {{ ref('locations') }} l on l.id = e.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\nleft join {{ ref('discharges') }} ds on ds.encounter_id = e.id\r\nleft join non_system_notes n on n.record_id = e.id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.906258, "supported_languages": null}, "macro.tamanu_source_dbt.vaccinations_dataset": {"name": "vaccinations_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\vaccinations.sql", "original_file_path": "macros\\models\\vaccinations.sql", "unique_id": "macro.tamanu_source_dbt.vaccinations_dataset", "macro_sql": "{% macro vaccinations_dataset(is_sensitive=false) %}\r\n\r\nwith vaccine_administrations_metadata as (\r\n select\r\n id,\r\n max(updated_at) as updated_at\r\n from {{ ref(\"vaccine_administrations_change_logs\") }}\r\n group by id\r\n),\r\n\r\nadministered_circumstances as (\r\n select\r\n a.id,\r\n string_agg(rd_cir.name, '; ') as circumstance_name\r\n from {{ ref(\"vaccine_administrations\") }} a\r\n cross join lateral unnest(a.circumstance_ids) c (unnest_circumstance_id)\r\n left join {{ ref(\"reference_data\") }} rd_cir\r\n on rd_cir.id = c.unnest_circumstance_id\r\n group by a.id\r\n)\r\n\r\nselect\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.id as patient_id,\r\n p.date_of_birth,\r\n date_part('year', age(p.date_of_birth)) as age,\r\n p.sex,\r\n p.village_id,\r\n rd_vil.name as village,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n l.id as location_id,\r\n l.name as location,\r\n av.scheduled_vaccine_id,\r\n case\r\n when av.is_given_elsewhere = true and av.datetime is null then null\r\n else av.datetime::date\r\n end as vaccination_date,\r\n sv.category as vaccine_category,\r\n sv.label as vaccine_name,\r\n case when sv.category = 'Other' then av.vaccine_brand end as vaccine_brand,\r\n case when sv.category = 'Other' then av.disease end as disease,\r\n case\r\n when av.status = 'GIVEN' then 'Given'\r\n when av.status = 'NOT_GIVEN' then 'Not given'\r\n when av.status = 'RECORDED_IN_ERROR' then 'Recorded in error'\r\n when av.status = 'HISTORICAL' then 'Historical'\r\n end as vaccine_status,\r\n sv.dose_label as vaccine_schedule,\r\n av.batch,\r\n case\r\n when av.status in ('GIVEN', 'NOT_GIVEN', 'RECORDED_IN_ERROR') then u.display_name\r\n end as recorded_by,\r\n case\r\n when av.is_given_elsewhere = true then ac.circumstance_name\r\n end as circumstances,\r\n case\r\n when av.status = 'NOT_GIVEN' then null\r\n when av.status = 'GIVEN' and av.is_given_elsewhere = true then null\r\n when av.status in ('HISTORICAL', 'RECORDED_IN_ERROR') and av.is_given_elsewhere = true then av.given_by\r\n when av.status = 'GIVEN' then av.given_by\r\n end as given_by,\r\n case when av.is_given_elsewhere = true then av.given_by end as given_elsewhere_by,\r\n case\r\n when av.status = 'NOT_GIVEN' then av.given_by\r\n end as not_given_clinician,\r\n case\r\n when av.status = 'NOT_GIVEN' then rd_reason.name\r\n end as not_given_reason,\r\n case\r\n when av.status = 'HISTORICAL' then u.display_name\r\n end as modified_by,\r\n vam.updated_at\r\nfrom {{ ref(\"vaccine_administrations\") }} av\r\njoin {{ ref(\"encounters\") }} e on e.id = av.encounter_id\r\njoin {{ ref(\"patients\") }} p on p.id = e.patient_id\r\nleft join vaccine_administrations_metadata vam on vam.id = av.id\r\njoin {{ ref(\"locations\") }} l on l.id = av.location_id\r\nleft join {{ ref(\"departments\") }} d on d.id = av.department_id\r\nleft join {{ ref(\"location_groups\") }} lg on lg.id = l.location_group_id\r\njoin {{ ref(\"facilities\") }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref(\"vaccine_schedules\") }} sv on sv.id = av.scheduled_vaccine_id\r\nleft join {{ ref(\"users\") }} u on u.id = av.recorded_by_id\r\nleft join {{ ref(\"reference_data\") }} rd_vil on rd_vil.id = p.village_id\r\nleft join {{ ref(\"reference_data\") }} rd_reason on rd_reason.id = av.not_given_reason_id\r\nleft join administered_circumstances ac on ac.id = av.id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\catalog.sql", "original_file_path": "macros\\catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\catalog.sql", "original_file_path": "macros\\catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations.sql", "original_file_path": "macros\\relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations.sql", "original_file_path": "macros\\relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\materializations\\incremental_strategies.sql", "original_file_path": "macros\\materializations\\incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\materializations\\incremental_strategies.sql", "original_file_path": "macros\\materializations\\incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\materializations\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\create.sql", "original_file_path": "macros\\relations\\materialized_view\\create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9070005, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\describe.sql", "original_file_path": "macros\\relations\\materialized_view\\describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\drop.sql", "original_file_path": "macros\\relations\\materialized_view\\drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\refresh.sql", "original_file_path": "macros\\relations\\materialized_view\\refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\rename.sql", "original_file_path": "macros\\relations\\materialized_view\\rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\table\\drop.sql", "original_file_path": "macros\\relations\\table\\drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\table\\rename.sql", "original_file_path": "macros\\relations\\table\\rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\table\\replace.sql", "original_file_path": "macros\\relations\\table\\replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\view\\drop.sql", "original_file_path": "macros\\relations\\view\\drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\view\\rename.sql", "original_file_path": "macros\\relations\\view\\rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9222693, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9335122, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9335122, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9335122, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9335122, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9335122, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9335122, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9363973, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9363973, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9363973, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9363973, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9363973, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9363973, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9381347, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9381347, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9381347, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9381347, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9381347, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9401398, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9401398, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9401398, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9401398, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9401398, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9421442, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9421442, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9421442, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9421442, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9421442, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9421442, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9421442, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9441483, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9441483, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9461517, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\show.sql", "original_file_path": "macros\\adapters\\show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\show.sql", "original_file_path": "macros\\adapters\\show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\show.sql", "original_file_path": "macros\\adapters\\show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9541347, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\validate_sql.sql", "original_file_path": "macros\\adapters\\validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\validate_sql.sql", "original_file_path": "macros\\adapters\\validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\accepted_values.sql", "original_file_path": "macros\\generic_test_sql\\accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\not_null.sql", "original_file_path": "macros\\generic_test_sql\\not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\relationships.sql", "original_file_path": "macros\\generic_test_sql\\relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\unique.sql", "original_file_path": "macros\\generic_test_sql\\unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_database.sql", "original_file_path": "macros\\get_custom_name\\get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_database.sql", "original_file_path": "macros\\get_custom_name\\get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9576216, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\function.sql", "original_file_path": "macros\\materializations\\functions\\function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": ["sql", "python"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\helpers.sql", "original_file_path": "macros\\materializations\\functions\\helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\helpers.sql", "original_file_path": "macros\\materializations\\functions\\helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table.sql", "original_file_path": "macros\\materializations\\models\\table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": ["sql"]}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view.sql", "original_file_path": "macros\\materializations\\models\\view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\can_clone_table.sql", "original_file_path": "macros\\materializations\\models\\clone\\can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\can_clone_table.sql", "original_file_path": "macros\\materializations\\models\\clone\\can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9699817, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\clone.sql", "original_file_path": "macros\\materializations\\models\\clone\\clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9860792, "supported_languages": ["sql"]}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\create_or_replace_clone.sql", "original_file_path": "macros\\materializations\\models\\clone\\create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9860792, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\create_or_replace_clone.sql", "original_file_path": "macros\\materializations\\models\\clone\\create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9860792, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9860792, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9860792, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\incremental.sql", "original_file_path": "macros\\materializations\\models\\incremental\\incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\is_incremental.sql", "original_file_path": "macros\\materializations\\models\\incremental\\is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n\t {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n\t {% set unique_key_match = equals(source_unique_key, target_unique_key) | trim %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9880855, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9994886, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9994886, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9994886, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422372.9994886, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0020485, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\seed.sql", "original_file_path": "macros\\materializations\\seeds\\seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": ["sql"]}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.002783, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_sql_cols = get_column_schema_from_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {#/*\n If a column has been added to the source it won't yet exist in the\n snapshotted table so we insert a null value as a placeholder for the column.\n */#}\n {%- for col in source_sql_cols -%}\n {%- if col.name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col.column) }},\n {%- else -%}\n NULL as {{ adapter.quote(col.column) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": ["sql"]}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.017784, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\test.sql", "original_file_path": "macros\\materializations\\tests\\test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": ["sql"]}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\unit.sql", "original_file_path": "macros\\materializations\\tests\\unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": ["sql"]}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\where_subquery.sql", "original_file_path": "macros\\materializations\\tests\\where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\where_subquery.sql", "original_file_path": "macros\\materializations\\tests\\where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create.sql", "original_file_path": "macros\\relations\\create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create.sql", "original_file_path": "macros\\relations\\create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create_backup.sql", "original_file_path": "macros\\relations\\create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create_backup.sql", "original_file_path": "macros\\relations\\create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create_intermediate.sql", "original_file_path": "macros\\relations\\create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create_intermediate.sql", "original_file_path": "macros\\relations\\create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop_backup.sql", "original_file_path": "macros\\relations\\drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop_backup.sql", "original_file_path": "macros\\relations\\drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename.sql", "original_file_path": "macros\\relations\\rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename.sql", "original_file_path": "macros\\relations\\rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename.sql", "original_file_path": "macros\\relations\\rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename.sql", "original_file_path": "macros\\relations\\rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0336926, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename_intermediate.sql", "original_file_path": "macros\\relations\\rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename_intermediate.sql", "original_file_path": "macros\\relations\\rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\replace.sql", "original_file_path": "macros\\relations\\replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\replace.sql", "original_file_path": "macros\\relations\\replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\schema.sql", "original_file_path": "macros\\relations\\schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\schema.sql", "original_file_path": "macros\\relations\\schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\create.sql", "original_file_path": "macros\\relations\\materialized_view\\create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\create.sql", "original_file_path": "macros\\relations\\materialized_view\\create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\drop.sql", "original_file_path": "macros\\relations\\materialized_view\\drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\drop.sql", "original_file_path": "macros\\relations\\materialized_view\\drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\refresh.sql", "original_file_path": "macros\\relations\\materialized_view\\refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\refresh.sql", "original_file_path": "macros\\relations\\materialized_view\\refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\rename.sql", "original_file_path": "macros\\relations\\materialized_view\\rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\rename.sql", "original_file_path": "macros\\relations\\materialized_view\\rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\replace.sql", "original_file_path": "macros\\relations\\materialized_view\\replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\replace.sql", "original_file_path": "macros\\relations\\materialized_view\\replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\drop.sql", "original_file_path": "macros\\relations\\table\\drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\drop.sql", "original_file_path": "macros\\relations\\table\\drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\rename.sql", "original_file_path": "macros\\relations\\table\\rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\rename.sql", "original_file_path": "macros\\relations\\table\\rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\replace.sql", "original_file_path": "macros\\relations\\table\\replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\replace.sql", "original_file_path": "macros\\relations\\table\\replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\create.sql", "original_file_path": "macros\\relations\\view\\create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\create.sql", "original_file_path": "macros\\relations\\view\\create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\create.sql", "original_file_path": "macros\\relations\\view\\create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\create.sql", "original_file_path": "macros\\relations\\view\\create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\drop.sql", "original_file_path": "macros\\relations\\view\\drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\drop.sql", "original_file_path": "macros\\relations\\view\\drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\rename.sql", "original_file_path": "macros\\relations\\view\\rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\rename.sql", "original_file_path": "macros\\relations\\view\\rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0494282, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_append.sql", "original_file_path": "macros\\utils\\array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_append.sql", "original_file_path": "macros\\utils\\array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_concat.sql", "original_file_path": "macros\\utils\\array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_concat.sql", "original_file_path": "macros\\utils\\array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast.sql", "original_file_path": "macros\\utils\\cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast.sql", "original_file_path": "macros\\utils\\cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast_bool_to_text.sql", "original_file_path": "macros\\utils\\cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast_bool_to_text.sql", "original_file_path": "macros\\utils\\cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\concat.sql", "original_file_path": "macros\\utils\\concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\concat.sql", "original_file_path": "macros\\utils\\concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date.sql", "original_file_path": "macros\\utils\\date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date.sql", "original_file_path": "macros\\utils\\date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_spine.sql", "original_file_path": "macros\\utils\\date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_spine.sql", "original_file_path": "macros\\utils\\date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_spine.sql", "original_file_path": "macros\\utils\\date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_spine.sql", "original_file_path": "macros\\utils\\date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_trunc.sql", "original_file_path": "macros\\utils\\date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_trunc.sql", "original_file_path": "macros\\utils\\date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\equals.sql", "original_file_path": "macros\\utils\\equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\equals.sql", "original_file_path": "macros\\utils\\equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\except.sql", "original_file_path": "macros\\utils\\except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\except.sql", "original_file_path": "macros\\utils\\except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\generate_series.sql", "original_file_path": "macros\\utils\\generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\generate_series.sql", "original_file_path": "macros\\utils\\generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\generate_series.sql", "original_file_path": "macros\\utils\\generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0654137, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\generate_series.sql", "original_file_path": "macros\\utils\\generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\hash.sql", "original_file_path": "macros\\utils\\hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\hash.sql", "original_file_path": "macros\\utils\\hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\intersect.sql", "original_file_path": "macros\\utils\\intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\intersect.sql", "original_file_path": "macros\\utils\\intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\length.sql", "original_file_path": "macros\\utils\\length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\length.sql", "original_file_path": "macros\\utils\\length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\literal.sql", "original_file_path": "macros\\utils\\literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\literal.sql", "original_file_path": "macros\\utils\\literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\position.sql", "original_file_path": "macros\\utils\\position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\position.sql", "original_file_path": "macros\\utils\\position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\replace.sql", "original_file_path": "macros\\utils\\replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\replace.sql", "original_file_path": "macros\\utils\\replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\accepted_range.sql", "original_file_path": "macros\\generic_tests\\accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\accepted_range.sql", "original_file_path": "macros\\generic_tests\\accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\at_least_one.sql", "original_file_path": "macros\\generic_tests\\at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\at_least_one.sql", "original_file_path": "macros\\generic_tests\\at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\cardinality_equality.sql", "original_file_path": "macros\\generic_tests\\cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\cardinality_equality.sql", "original_file_path": "macros\\generic_tests\\cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equality.sql", "original_file_path": "macros\\generic_tests\\equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equality.sql", "original_file_path": "macros\\generic_tests\\equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equal_rowcount.sql", "original_file_path": "macros\\generic_tests\\equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equal_rowcount.sql", "original_file_path": "macros\\generic_tests\\equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\expression_is_true.sql", "original_file_path": "macros\\generic_tests\\expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.0815268, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\expression_is_true.sql", "original_file_path": "macros\\generic_tests\\expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.097232, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\fewer_rows_than.sql", "original_file_path": "macros\\generic_tests\\fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.097232, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\fewer_rows_than.sql", "original_file_path": "macros\\generic_tests\\fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.097232, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "original_file_path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "original_file_path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_accepted_values.sql", "original_file_path": "macros\\generic_tests\\not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_accepted_values.sql", "original_file_path": "macros\\generic_tests\\not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_constant.sql", "original_file_path": "macros\\generic_tests\\not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_constant.sql", "original_file_path": "macros\\generic_tests\\not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_empty_string.sql", "original_file_path": "macros\\generic_tests\\not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_empty_string.sql", "original_file_path": "macros\\generic_tests\\not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_null_proportion.sql", "original_file_path": "macros\\generic_tests\\not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_null_proportion.sql", "original_file_path": "macros\\generic_tests\\not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\recency.sql", "original_file_path": "macros\\generic_tests\\recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\recency.sql", "original_file_path": "macros\\generic_tests\\recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n or most_recent is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\relationships_where.sql", "original_file_path": "macros\\generic_tests\\relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\relationships_where.sql", "original_file_path": "macros\\generic_tests\\relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\sequential_values.sql", "original_file_path": "macros\\generic_tests\\sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\sequential_values.sql", "original_file_path": "macros\\generic_tests\\sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\unique_combination_of_columns.sql", "original_file_path": "macros\\generic_tests\\unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\unique_combination_of_columns.sql", "original_file_path": "macros\\generic_tests\\unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\log_info.sql", "original_file_path": "macros\\jinja_helpers\\log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\log_info.sql", "original_file_path": "macros\\jinja_helpers\\log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_log_format.sql", "original_file_path": "macros\\jinja_helpers\\pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_log_format.sql", "original_file_path": "macros\\jinja_helpers\\pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_time.sql", "original_file_path": "macros\\jinja_helpers\\pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_time.sql", "original_file_path": "macros\\jinja_helpers\\pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\slugify.sql", "original_file_path": "macros\\jinja_helpers\\slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\_is_ephemeral.sql", "original_file_path": "macros\\jinja_helpers\\_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\_is_relation.sql", "original_file_path": "macros\\jinja_helpers\\_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.099754, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_surrogate_key.sql", "original_file_path": "macros\\sql\\generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_surrogate_key.sql", "original_file_path": "macros\\sql\\generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_column_values.sql", "original_file_path": "macros\\sql\\get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_column_values.sql", "original_file_path": "macros\\sql\\get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_filtered_columns_in_relation.sql", "original_file_path": "macros\\sql\\get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_filtered_columns_in_relation.sql", "original_file_path": "macros\\sql\\get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_query_results_as_dict.sql", "original_file_path": "macros\\sql\\get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_query_results_as_dict.sql", "original_file_path": "macros\\sql\\get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_pattern.sql", "original_file_path": "macros\\sql\\get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_pattern.sql", "original_file_path": "macros\\sql\\get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_prefix.sql", "original_file_path": "macros\\sql\\get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_prefix.sql", "original_file_path": "macros\\sql\\get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_single_value.sql", "original_file_path": "macros\\sql\\get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_single_value.sql", "original_file_path": "macros\\sql\\get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_prefix_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_prefix_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.113018, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\groupby.sql", "original_file_path": "macros\\sql\\groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.128652, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\groupby.sql", "original_file_path": "macros\\sql\\groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.128652, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.128652, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.128652, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.128652, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.128652, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck.sql", "original_file_path": "macros\\sql\\nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.128652, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck.sql", "original_file_path": "macros\\sql\\nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.1330419, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck_table.sql", "original_file_path": "macros\\sql\\nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.1330419, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck_table.sql", "original_file_path": "macros\\sql\\nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.1330419, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\pivot.sql", "original_file_path": "macros\\sql\\pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.135047, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\pivot.sql", "original_file_path": "macros\\sql\\pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.135047, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_add.sql", "original_file_path": "macros\\sql\\safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.135047, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_add.sql", "original_file_path": "macros\\sql\\safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.135047, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_divide.sql", "original_file_path": "macros\\sql\\safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.135047, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_divide.sql", "original_file_path": "macros\\sql\\safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.135047, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_subtract.sql", "original_file_path": "macros\\sql\\safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.1370504, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_subtract.sql", "original_file_path": "macros\\sql\\safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.1370504, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\star.sql", "original_file_path": "macros\\sql\\star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.1370504, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\star.sql", "original_file_path": "macros\\sql\\star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col in rename %} as {{ rename[col] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col in rename %} as {{ rename[col] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.139054, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\surrogate_key.sql", "original_file_path": "macros\\sql\\surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.139054, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\surrogate_key.sql", "original_file_path": "macros\\sql\\surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.139054, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\union.sql", "original_file_path": "macros\\sql\\union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.1410584, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\union.sql", "original_file_path": "macros\\sql\\union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.1430619, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\unpivot.sql", "original_file_path": "macros\\sql\\unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\unpivot.sql", "original_file_path": "macros\\sql\\unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_host.sql", "original_file_path": "macros\\web\\get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_host.sql", "original_file_path": "macros\\web\\get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_parameter.sql", "original_file_path": "macros\\web\\get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_parameter.sql", "original_file_path": "macros\\web\\get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_path.sql", "original_file_path": "macros\\web\\get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_path.sql", "original_file_path": "macros\\web\\get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782422373.144565, "supported_languages": null}}, "docs": {"doc.tamanu_source_dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "overview.md", "original_file_path": "models\\overview.md", "unique_id": "doc.tamanu_source_dbt.__overview__", "block_contents": "# Tamanu Models Documentation\r\n\r\n## Purpose\r\nThis documentation serves as a guide to Tamanu's standard models for developers, data stewards, and analysts looking to understand and utilise the data structure for reporting and analytics.\r\n\r\n## Project Overview\r\nThis dbt project transforms Tamanu healthcare system data into optimised datasets following a structured data flow: **sources/logs \u2192 bases \u2192 datasets \u2192 reports**. The architecture supports both reporting and analytics use cases while maintaining data governance and privacy standards.\r\n\r\n## Model Architecture & Data Flow\r\n\r\n### Layer 1: Sources & Logs\r\n- **`models/sources`**: Raw operational database tables from the `public` schema\r\n- **`models/logs`**: System-generated audit and event data from the `logs` schema\r\n- **Purpose**: Foundation layer representing the operational database structure\r\n- **Status**: Read-only definitions managed externally\r\n\r\n### Layer 2: Bases\r\n- **`models/bases`**: Cleaned and filtered source data with soft-deleted records and test patients removed\r\n- **Purpose**: Clean, reliable foundation for all downstream transformations\r\n- **Usage**: Building block for datasets and reports\r\n\r\n### Layer 3: Datasets\r\n- **`models/datasets`**: Business-ready, denormalised views built on bases models\r\n- **Features**: User-friendly column names, joined data, calculated fields\r\n- **Purpose**: Optimised for data analysis and report development\r\n- **Target Audience**: Data analysts and report developers\r\n\r\n### Layer 4: Reports\r\n- **`models/reports`**: Final reporting layer with translations and formatting applied\r\n- **Features**: \r\n - Localised field labels using the translation system\r\n - Standardised date/time formatting\r\n - Optimised for end-user consumption\r\n- **Configuration**: Each report includes a corresponding `.json` config file in `models/reports/config/`\r\n\r\n## Deployment Targets\r\n\r\n### Reporting Schema\r\n**Command**: `dbt run --target reporting_release`\r\n- Complete functionality with all models and columns\r\n- Full data fidelity for comprehensive reporting\r\n- Used for standardised reports on Tamanu facility servers\r\n\r\n### Analytics Schema (Tupaia Integration)\r\n**Command**: `dbt run --target analytics_release --select tag:base`\r\n- Privacy-compliant deployment excluding direct identifiers\r\n- Automatically filters columns tagged with `direct_identifier`\r\n- Preserves all transformations and business logic\r\n- Optimised for aggregated analysis and population health insights\r\n\r\n## Data Classification System\r\n\r\n### Data Type Tags\r\n- **`administration`** - System operation data that changes during normal use (e.g., user passwords, email addresses)\r\n- **`clinical`** - Patient medical records, always attached to a Patient (often via an Encounter), always considered sensitive\r\n- **`financial`** - Patient billing, invoicing, and payment for services and goods provided, sometimes sensitive\r\n- **`log`** - System-generated records capturing events, actions, or state changes within the application\r\n- **`patient`** - Patient demographic information, can be masked or aggregated for privacy in reporting\r\n- **`reference`** - System-wide configuration and lists (diagnoses, facilities, locations, surveys, vaccination schedules), populated centrally and synced to all facilities, never sensitive/restricted\r\n- **`system`** - Internal Tamanu operation data (configuration, sync status, task queues), usually invisible to clinicians, sometimes sensitive, not available for reporting\r\n\r\n### Privacy Classification Tags\r\n- **`direct_identifier`** - Identifiers that can uniquely identify an individual on their own (e.g., full name, email, passport ID)\r\n - These identifiers are excluded from analytics deployments\r\n- **`quasi_identifier`** - Identifiers that are not uniquely identifying alone but can identify an individual when combined (e.g., sex, location)\r\n - These identifiers should be aggregated or generalised for data analysis\r\n\r\n### Operational Status Tags\r\n- **`deprecated`** - Models that are no longer in use; data from these models is usually migrated to another part of the database\r\n - These models will not be available for reporting\r\n\r\n## Extensions & Customisations\r\n\r\n### Survey Models\r\nSurvey models are not part of the standard model set but are available as extensions in individual project deployments. These handle:\r\n- Custom form-based data collection\r\n- Patient-specific survey responses\r\n- Program-specific data elements\r\n\r\nSurvey models follow the same architectural patterns as standard models when implemented.\r\n\r\n## Exploring the Documentation\r\n\r\n### Navigation Options\r\n\r\n#### Project Tab\r\nThe Project tab mirrors the directory structure of your dbt project, showing all models defined in the project as well as models imported from dbt packages.\r\n\r\n#### Database Tab\r\nThe Database tab presents models in a database explorer format, showing relations (tables and views) grouped into database schemas. Note that ephemeral models are not shown in this interface as they do not exist in the database.\r\n\r\n### Lineage Graph Exploration\r\nClick the blue icon on the bottom-right corner of any page to view the lineage graph of your models.\r\n\r\n#### Model Page Lineage\r\nOn individual model pages, you'll see the immediate parents and children of the model you're exploring. Click the **Expand** button at the top-right of the lineage pane to see all models that are used to build, or are built from, the current model.\r\n\r\n#### Interactive Graph Features\r\n- Use `--select` and `--exclude` model selection syntax to filter models in the graph\r\n- Right-click on models to interactively filter and explore the graph\r\n- Navigate through the complete data lineage to understand dependencies"}, "doc.tamanu_source_dbt.generic__metadata": {"name": "generic__metadata", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\generic.md", "original_file_path": "models\\bases\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__metadata", "block_contents": "Metadata information extracted from the change logs"}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id": {"name": "outpatient_appointments_change_logs__change_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id", "block_contents": "Unique identifier for the change log entry (UUID from logs.changes)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id": {"name": "outpatient_appointments_change_logs__appointment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id", "block_contents": "Reference to the [appointment](#!/model/model.tamanu_source_dbt.outpatient_appointments) that was modified."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime": {"name": "outpatient_appointments_change_logs__modified_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime", "block_contents": "Timestamp when the change was logged (from logs.changes.logged_at)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id": {"name": "outpatient_appointments_change_logs__modified_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id", "block_contents": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who made the modification."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id": {"name": "outpatient_appointments_change_logs__created_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id", "block_contents": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who originally created the appointment."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id": {"name": "outpatient_appointments_change_logs__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id", "block_contents": "Reference to the [patient](#!/model/model.tamanu_source_dbt.patients) associated with the appointment."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime": {"name": "outpatient_appointments_change_logs__start_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime", "block_contents": "Current appointment start date and time (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime": {"name": "outpatient_appointments_change_logs__end_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime", "block_contents": "Current appointment end date and time (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id": {"name": "outpatient_appointments_change_logs__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id", "block_contents": "Current [clinician](#!/model/model.tamanu_source_dbt.users) ID (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id": {"name": "outpatient_appointments_change_logs__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id", "block_contents": "Current [location group](#!/model/model.tamanu_source_dbt.location_groups)/area ID (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id": {"name": "outpatient_appointments_change_logs__appointment_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id", "block_contents": "Current [appointment type](#!/model/model.tamanu_source_dbt.reference_data) ID (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority": {"name": "outpatient_appointments_change_logs__is_high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority", "block_contents": "Current priority status (after the change). Boolean indicating if the appointment is high priority."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__status": {"name": "outpatient_appointments_change_logs__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__status", "block_contents": "Current appointment status (after the change).\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`"}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id": {"name": "outpatient_appointments_change_logs__schedule_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id", "block_contents": "Current recurring schedule ID (after the change). References appointment_schedules table."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime": {"name": "outpatient_appointments_change_logs__prev_start_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime", "block_contents": "Previous appointment start date and time (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime": {"name": "outpatient_appointments_change_logs__prev_end_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime", "block_contents": "Previous appointment end date and time (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id": {"name": "outpatient_appointments_change_logs__prev_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id", "block_contents": "Previous clinician ID (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id": {"name": "outpatient_appointments_change_logs__prev_location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id", "block_contents": "Previous location group/area ID (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id": {"name": "outpatient_appointments_change_logs__prev_appointment_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id", "block_contents": "Previous appointment type ID (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority": {"name": "outpatient_appointments_change_logs__prev_is_high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority", "block_contents": "Previous priority status (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_status": {"name": "outpatient_appointments_change_logs__prev_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_status", "block_contents": "Previous appointment status (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_sequence": {"name": "outpatient_appointments_change_logs__change_sequence", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_sequence", "block_contents": "Sequential number of this change for the appointment.\r\n- 1 = initial creation event\r\n- 2+ = subsequent modifications\r\n\r\nUses ROW_NUMBER() partitioned by appointment_id and ordered by logged_at."}, "doc.tamanu_source_dbt.generic__department": {"name": "generic__department", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__department", "block_contents": "Full readable name of the department"}, "doc.tamanu_source_dbt.generic__departments": {"name": "generic__departments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__departments", "block_contents": "A comma separated list of names of the departments"}, "doc.tamanu_source_dbt.generic__department_id": {"name": "generic__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__department_id", "block_contents": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments)"}, "doc.tamanu_source_dbt.generic__department_ids": {"name": "generic__department_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__department_ids", "block_contents": "An array referencing the [department](#!/source/tamanu-source-dbt.tamanu.departments)"}, "doc.tamanu_source_dbt.generic__datetimes": {"name": "generic__datetimes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__datetimes", "block_contents": "A comma separated list of dates and times"}, "doc.tamanu_source_dbt.generic__diagnoses": {"name": "generic__diagnoses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__diagnoses", "block_contents": "Full list of diagnoses"}, "doc.tamanu_source_dbt.generic__medications": {"name": "generic__medications", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__medications", "block_contents": "Full list of medications"}, "doc.tamanu_source_dbt.generic__vaccinations": {"name": "generic__vaccinations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__vaccinations", "block_contents": "Full list of vaccinations"}, "doc.tamanu_source_dbt.generic__procedures": {"name": "generic__procedures", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__procedures", "block_contents": "Full list of procedures"}, "doc.tamanu_source_dbt.generic__lab_requests": {"name": "generic__lab_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__lab_requests", "block_contents": "Full list of lab requests"}, "doc.tamanu_source_dbt.generic__imaging_requests": {"name": "generic__imaging_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__imaging_requests", "block_contents": "Full list of imaging requests"}, "doc.tamanu_source_dbt.generic__notes": {"name": "generic__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__notes", "block_contents": "Full list of notes (cropped if exceeds 32,000 characters)"}, "doc.tamanu_source_dbt.generic__encounter_types": {"name": "generic__encounter_types", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__encounter_types", "block_contents": "Full list of encounter types an encounter has been"}, "doc.tamanu_source_dbt.generic__duration": {"name": "generic__duration", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__duration", "block_contents": "Duration"}, "doc.tamanu_source_dbt.generic__facility": {"name": "generic__facility", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__facility", "block_contents": "Full readable name of the facility"}, "doc.tamanu_source_dbt.generic__facility_id": {"name": "generic__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__facility_id", "block_contents": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities)"}, "doc.tamanu_source_dbt.generic__insurance_policy_number": {"name": "generic__insurance_policy_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__insurance_policy_number", "block_contents": "Insurance policy number of the patient."}, "doc.tamanu_source_dbt.generic__insurers": {"name": "generic__insurers", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__insurers", "block_contents": "List of insurers covering the patient."}, "doc.tamanu_source_dbt.generic__invoice_remaining_patient_balance": {"name": "generic__invoice_remaining_patient_balance", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_remaining_patient_balance", "block_contents": "Remaining balance to be paid by the patient."}, "doc.tamanu_source_dbt.generic__invoice_total_amount_paid": {"name": "generic__invoice_total_amount_paid", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_amount_paid", "block_contents": "Total amount paid."}, "doc.tamanu_source_dbt.generic__invoice_total_insurer_amount": {"name": "generic__invoice_total_insurer_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_insurer_amount", "block_contents": "Total amount covered by insurers."}, "doc.tamanu_source_dbt.generic__invoice_total_invoice_amount": {"name": "generic__invoice_total_invoice_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_invoice_amount", "block_contents": "Total invoicing amount."}, "doc.tamanu_source_dbt.generic__invoice_total_patient_amount": {"name": "generic__invoice_total_patient_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_patient_amount", "block_contents": "Total amount payable by the patient."}, "doc.tamanu_source_dbt.generic__invoice_total_patient_discount": {"name": "generic__invoice_total_patient_discount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_patient_discount", "block_contents": "Total discount applied to the patient."}, "doc.tamanu_source_dbt.generic__location": {"name": "generic__location", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location", "block_contents": "Full readable name of the location"}, "doc.tamanu_source_dbt.generic__location_group": {"name": "generic__location_group", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_group", "block_contents": "Full readable name of the location group"}, "doc.tamanu_source_dbt.generic__location_groups": {"name": "generic__location_groups", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_groups", "block_contents": "A comma separated list of names of the location groups"}, "doc.tamanu_source_dbt.generic__location_group_id": {"name": "generic__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_group_id", "block_contents": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups)"}, "doc.tamanu_source_dbt.generic__location_group_ids": {"name": "generic__location_group_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_group_ids", "block_contents": "An array referencing the [group](#!/source/tamanu-source-dbt.tamanu.location_groups)"}, "doc.tamanu_source_dbt.generic__location_id": {"name": "generic__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_id", "block_contents": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations)"}, "doc.tamanu_source_dbt.generic__location_ids": {"name": "generic__location_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_ids", "block_contents": "An array referencing the [location](#!/source/tamanu-source-dbt.tamanu.locations)"}, "doc.tamanu_source_dbt.generic__locations": {"name": "generic__locations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__locations", "block_contents": "A comma separated list of names of the locations"}, "doc.tamanu_source_dbt.generic__patient_conditions": {"name": "generic__patient_conditions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patient_conditions", "block_contents": "Full list of conditions"}, "doc.tamanu_source_dbt.generic__patient_is_deceased": {"name": "generic__patient_is_deceased", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patient_is_deceased", "block_contents": "Indicates whether the patient has been deceased."}, "doc.tamanu_source_dbt.generic__patient_is_discharged": {"name": "generic__patient_is_discharged", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patient_is_discharged", "block_contents": "Indicates whether the patient has been discharged."}, "doc.tamanu_source_dbt.generic__patients_age": {"name": "generic__patients_age", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patients_age", "block_contents": "Patient's age"}, "doc.tamanu_source_dbt.generic__patients_name": {"name": "generic__patients_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patients_name", "block_contents": "Patient Name"}, "doc.tamanu_source_dbt.generic__reference_data": {"name": "generic__reference_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__reference_data", "block_contents": "Full readable name"}, "doc.tamanu_source_dbt.generic__social_security_number": {"name": "generic__social_security_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__social_security_number", "block_contents": "Social security number of the patient."}, "doc.tamanu_source_dbt.generic__tests": {"name": "generic__tests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__tests", "block_contents": "Full list of tests"}, "doc.tamanu_source_dbt.generic__user": {"name": "generic__user", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__user", "block_contents": "Display identifier for the user"}, "doc.tamanu_source_dbt.generic__admission_status": {"name": "generic__admission_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__admission_status", "block_contents": "The current status of the admission.\r\n\r\n- `active` indicates the patient is currently admitted\r\n- `discharged` indicates the patient has been discharged"}, "doc.tamanu_source_dbt.generic__length_of_stay": {"name": "generic__length_of_stay", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__length_of_stay", "block_contents": "Length of stay in days for the encounter (null if encounter is still active)"}, "doc.tamanu_source_dbt.generic__triage_wait_time": {"name": "generic__triage_wait_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__triage_wait_time", "block_contents": "Time between triage and being seen (HH:MM:SS format)"}, "doc.tamanu_source_dbt.ds__invoice_products": {"name": "ds__invoice_products", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\admin\\ds__invoice_products.md", "original_file_path": "models\\datasets\\admin\\ds__invoice_products.md", "unique_id": "doc.tamanu_source_dbt.ds__invoice_products", "block_contents": "Invoice products pivoted with their prices across all price lists and insurance coverage across all insurance plans. One row per product."}, "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__change_number": {"name": "ds__outpatient_appointments_audit__change_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments_audit.md", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments_audit.md", "unique_id": "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__change_number", "block_contents": "Sequential change number for this appointment where initial creation is excluded. 1 = first modification, 2 = second modification, etc."}, "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_cancelled": {"name": "ds__outpatient_appointments_audit__is_cancelled", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments_audit.md", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments_audit.md", "unique_id": "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_cancelled", "block_contents": "Whether the appointment status is 'Cancelled'. Values: Yes/No."}, "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_repeating": {"name": "ds__outpatient_appointments_audit__is_repeating", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments_audit.md", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments_audit.md", "unique_id": "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_repeating", "block_contents": "Whether the appointment is part of a repeating schedule. Values: Yes (has schedule_id), No (no schedule_id)."}, "doc.tamanu_source_dbt.logs__table__accesses": {"name": "logs__table__accesses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__table__accesses", "block_contents": "Audit logs for users accessing records"}, "doc.tamanu_source_dbt.logs__accesses__id": {"name": "logs__accesses__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__id", "block_contents": "UUID"}, "doc.tamanu_source_dbt.logs__accesses__created_at": {"name": "logs__accesses__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__created_at", "block_contents": "Timestamp of when record was created"}, "doc.tamanu_source_dbt.logs__accesses__updated_at": {"name": "logs__accesses__updated_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__updated_at", "block_contents": "Timestamp of when record was last updated"}, "doc.tamanu_source_dbt.logs__accesses__deleted_at": {"name": "logs__accesses__deleted_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__deleted_at", "block_contents": "Timestamp of when record was deleted"}, "doc.tamanu_source_dbt.logs__accesses__user_id": {"name": "logs__accesses__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__user_id", "block_contents": "The user that accessed the records"}, "doc.tamanu_source_dbt.logs__accesses__record_id": {"name": "logs__accesses__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__record_id", "block_contents": "The ID of the accessed record"}, "doc.tamanu_source_dbt.logs__accesses__record_type": {"name": "logs__accesses__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__record_type", "block_contents": "The type of record accessed"}, "doc.tamanu_source_dbt.logs__accesses__facility_id": {"name": "logs__accesses__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__facility_id", "block_contents": "The facility that the record was accessed on"}, "doc.tamanu_source_dbt.logs__accesses__session_id": {"name": "logs__accesses__session_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__session_id", "block_contents": "The user session that the record was accessed on"}, "doc.tamanu_source_dbt.logs__accesses__device_id": {"name": "logs__accesses__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__device_id", "block_contents": "The id for the device that the user was accessing the record on"}, "doc.tamanu_source_dbt.logs__accesses__logged_at": {"name": "logs__accesses__logged_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__logged_at", "block_contents": "The time string of when the record was accessed"}, "doc.tamanu_source_dbt.logs__accesses__front_end_context": {"name": "logs__accesses__front_end_context", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__front_end_context", "block_contents": "A JSON object containing front end information about the record access"}, "doc.tamanu_source_dbt.logs__accesses__back_end_context": {"name": "logs__accesses__back_end_context", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__back_end_context", "block_contents": "A JSON object containing back end information about the record access"}, "doc.tamanu_source_dbt.logs__accesses__is_mobile": {"name": "logs__accesses__is_mobile", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__is_mobile", "block_contents": "Whether or not the user accessed the record from mobile"}, "doc.tamanu_source_dbt.logs__accesses__version": {"name": "logs__accesses__version", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__version", "block_contents": "The version of tamanu the record was created on"}, "doc.tamanu_source_dbt.logs__accesses__updated_at_sync_tick": {"name": "logs__accesses__updated_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__updated_at_sync_tick", "block_contents": "TODO"}, "doc.tamanu_source_dbt.logs__table__changes": {"name": "logs__table__changes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__table__changes", "block_contents": "Contains a full log of all changes made to the core database records.\r\n\r\nThe changes are logged via triggers on source tables. The full row data is\r\nlogged in this table on every change to every row for every table that's covered.\r\nThese triggers are applied by Tamanu rather than being hardcoded in migrations.\r\n\r\nSome tables are excluded from logging. These are listed in the `NON_LOGGED_TABLES`\r\nconstant in the database package, and include the sync subsystem and other\r\ninternal system tables.\r\n\r\nNote that changes before this table was put in service will of course not have\r\nbeen logged."}, "doc.tamanu_source_dbt.logs__changes__id": {"name": "logs__changes__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__id", "block_contents": "The ID of the change log row. UUID"}, "doc.tamanu_source_dbt.logs__changes__table_oid": {"name": "logs__changes__table_oid", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__table_oid", "block_contents": "The Postgres OID of the table this change is from.\r\n\r\nPostgres OIDs are much more precise than `schema.name`, and are not susceptible\r\nto search path conflicts, so should be preferred for querying within the same\r\ndatabase. However, they are not easily relatable from outside the database, so\r\nthe schema and name fields are also recorded for those uses, plus human readers."}, "doc.tamanu_source_dbt.logs__changes__table_schema": {"name": "logs__changes__table_schema", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__table_schema", "block_contents": "The schema (~database namespace) of the table this change is from.\r\n\r\nThis will typically be `public`; as of writing tables from other schemas are not\r\nautomatically logged."}, "doc.tamanu_source_dbt.logs__changes__table_name": {"name": "logs__changes__table_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__table_name", "block_contents": "The name of the table this change is from."}, "doc.tamanu_source_dbt.logs__changes__logged_at": {"name": "logs__changes__logged_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__logged_at", "block_contents": "The timestamp this change was logged."}, "doc.tamanu_source_dbt.logs__changes__created_at": {"name": "logs__changes__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__created_at", "block_contents": "Then sequelize metadata for the records created time"}, "doc.tamanu_source_dbt.logs__changes__updated_by_user_id": {"name": "logs__changes__updated_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__updated_by_user_id", "block_contents": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on."}, "doc.tamanu_source_dbt.logs__changes__device_id": {"name": "logs__changes__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__device_id", "block_contents": "The `device_id` of the user behind the change"}, "doc.tamanu_source_dbt.logs__changes__version": {"name": "logs__changes__version", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__version", "block_contents": "The Tamanu version at time of change"}, "doc.tamanu_source_dbt.logs__changes__record_id": {"name": "logs__changes__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_id", "block_contents": "The value of the `id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on."}, "doc.tamanu_source_dbt.logs__changes__record_created_at": {"name": "logs__changes__record_created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_created_at", "block_contents": "The `created_at` metadata from record the changelog was recorded against"}, "doc.tamanu_source_dbt.logs__changes__record_updated_at": {"name": "logs__changes__record_updated_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_updated_at", "block_contents": "The `updated_at` metadata from record the changelog was recorded against"}, "doc.tamanu_source_dbt.logs__changes__record_deleted_at": {"name": "logs__changes__record_deleted_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_deleted_at", "block_contents": "The `deleted_at` metadata from record the changelog was recorded against"}, "doc.tamanu_source_dbt.logs__changes__record_data": {"name": "logs__changes__record_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_data", "block_contents": "The full row data of the change.\r\n\r\nNote that as this is `JSONB`, some type information may be lost. However, row\r\ndata in a Tamanu system is transported using JSON via the sync system anyway, so\r\nit is expected that all data trivially round-trips via JSON."}, "doc.tamanu_source_dbt.logs__changes__reason": {"name": "logs__changes__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__reason", "block_contents": "A string representing the reason for the change."}, "doc.tamanu_source_dbt.logs__changes__migration_context": {"name": "logs__changes__migration_context", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__migration_context", "block_contents": "Stores a JSON string (as type TEXT) with migration context information\r\nif the changelog was created from a migration."}, "doc.tamanu_source_dbt.logs__table__debug_logs": {"name": "logs__table__debug_logs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\debug_logs.md", "original_file_path": "models\\logs\\debug_logs.md", "unique_id": "doc.tamanu_source_dbt.logs__table__debug_logs", "block_contents": "Debugging logs stored in the database for easy reporting.\r\n\r\nTamanu has an associated tool called [Tamanu Alerts] which runs queries on the Tamanu database to\r\ndetermine alert conditions, especially for the Sync mechanisms. However, sometimes the information\r\nnecessary to determine an alert condition lives in logs, not in database tables. In those cases,\r\nthis table is used.\r\n\r\n[Tamanu Alerts]: https://docs.rs/bestool/latest/bestool/__help/tamanu/alerts/struct.AlertsArgs.html"}, "doc.tamanu_source_dbt.logs__debug_logs__id": {"name": "logs__debug_logs__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\debug_logs.md", "original_file_path": "models\\logs\\debug_logs.md", "unique_id": "doc.tamanu_source_dbt.logs__debug_logs__id", "block_contents": "UUID"}, "doc.tamanu_source_dbt.logs__debug_logs__type": {"name": "logs__debug_logs__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\debug_logs.md", "original_file_path": "models\\logs\\debug_logs.md", "unique_id": "doc.tamanu_source_dbt.logs__debug_logs__type", "block_contents": "Stable classifier for the log message."}, "doc.tamanu_source_dbt.logs__debug_logs__info": {"name": "logs__debug_logs__info", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\debug_logs.md", "original_file_path": "models\\logs\\debug_logs.md", "unique_id": "doc.tamanu_source_dbt.logs__debug_logs__info", "block_contents": "Arbitrary JSON log message.\r\n\r\nNot that unlike typical JSON-based log messages (only top-level string key to scalar value), this\r\ncan be nested arbitrarily deep, as it can include objects directly from the application."}, "doc.tamanu_source_dbt.logs__table__dhis2_pushes": {"name": "logs__table__dhis2_pushes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__table__dhis2_pushes", "block_contents": "Audit logs for DHIS2 integration pushes.\r\n\r\nThis table tracks the results of automated pushes of report data to DHIS2 instances.\r\nThe DHIS2IntegrationProcessor scheduled task processes configured reports and pushes\r\ntheir data to external DHIS2 systems. Each push attempt is logged here with details\r\nabout the success/failure status, import counts, and any conflicts encountered.\r\n\r\nThe table stores metadata about data synchronization operations including how many\r\nrecords were imported, updated, ignored, or deleted during each push operation."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__id": {"name": "logs__dhis2_pushes__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__id", "block_contents": "UUID primary key for the push log entry."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__created_at": {"name": "logs__dhis2_pushes__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__created_at", "block_contents": "Timestamp of when the push log entry was created."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__report_id": {"name": "logs__dhis2_pushes__report_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__report_id", "block_contents": "The ID of the report that was pushed to DHIS2."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__status": {"name": "logs__dhis2_pushes__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__status", "block_contents": "The status of the push operation: \"success\", \"failure\", or \"warning\"."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__imported": {"name": "logs__dhis2_pushes__imported", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__imported", "block_contents": "Number of records that were successfully imported to DHIS2."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__updated": {"name": "logs__dhis2_pushes__updated", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__updated", "block_contents": "Number of records that were updated in DHIS2."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__deleted": {"name": "logs__dhis2_pushes__deleted", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__deleted", "block_contents": "Number of records that were deleted from DHIS2."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__ignored": {"name": "logs__dhis2_pushes__ignored", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__ignored", "block_contents": "Number of records that were ignored during the push operation."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__updated_at": {"name": "logs__dhis2_pushes__updated_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__updated_at", "block_contents": "Timestamp of when the push log entry was last updated."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__deleted_at": {"name": "logs__dhis2_pushes__deleted_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__deleted_at", "block_contents": "Timestamp of when the push log entry was deleted (soft delete)."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__conflicts": {"name": "logs__dhis2_pushes__conflicts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__conflicts", "block_contents": "JSON array of conflict details encountered during the push operation."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__message": {"name": "logs__dhis2_pushes__message", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__message", "block_contents": "Human-readable message describing the result of the push operation."}, "doc.tamanu_source_dbt.logs__table__fhir_writes": {"name": "logs__table__fhir_writes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__table__fhir_writes", "block_contents": "Full-request logs of writes (creates and modifies) coming over the FHIR API.\r\n\r\nFHIR is an extensive standard and we current support a small subset of it. There's an even tinier\r\nsubset of that which supports writes instead of just reads and searches. To avoid missing or losing\r\ndata which we could support accepting as writes in the future, and for development purposes, this\r\ntable logs the full request bodies for FHIR endpoints. This is not just the endpoints that we\r\ncurrently support, but all incoming write requests."}, "doc.tamanu_source_dbt.logs__fhir_writes__id": {"name": "logs__fhir_writes__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__id", "block_contents": "UUID"}, "doc.tamanu_source_dbt.logs__fhir_writes__created_at": {"name": "logs__fhir_writes__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__created_at", "block_contents": "When Tamanu received the request."}, "doc.tamanu_source_dbt.logs__fhir_writes__verb": {"name": "logs__fhir_writes__verb", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__verb", "block_contents": "HTTP verb (GET, POST, etc)"}, "doc.tamanu_source_dbt.logs__fhir_writes__url": {"name": "logs__fhir_writes__url", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__url", "block_contents": "HTTP URL"}, "doc.tamanu_source_dbt.logs__fhir_writes__body": {"name": "logs__fhir_writes__body", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__body", "block_contents": "Full request body"}, "doc.tamanu_source_dbt.logs__fhir_writes__headers": {"name": "logs__fhir_writes__headers", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__headers", "block_contents": "Selected request headers.\r\n\r\nSome headers are stripped for sensitivity."}, "doc.tamanu_source_dbt.logs__fhir_writes__user_id": {"name": "logs__fhir_writes__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__user_id", "block_contents": "The authenticated user for the API request."}, "doc.tamanu_source_dbt.logs__generic__schema": {"name": "logs__generic__schema", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\generic.md", "original_file_path": "models\\logs\\generic.md", "unique_id": "doc.tamanu_source_dbt.logs__generic__schema", "block_contents": "Contains logging tables across different domains."}, "doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick": {"name": "logs__generic__updated_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\generic.md", "original_file_path": "models\\logs\\generic.md", "unique_id": "doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick", "block_contents": "Last tick that the record was updated. Used to figure out old vs new data when syncing"}, "doc.tamanu_source_dbt.logs__table__migrations": {"name": "logs__table__migrations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__table__migrations", "block_contents": "This table keeps track of when migrations are run.\r\n\r\nThe SequelizeMeta table in the public schema is internal migration state, and\r\nonly records which migrations are currently applied. This table instead logs\r\nwhenever migrations are performed, up and down, with additional timing info."}, "doc.tamanu_source_dbt.logs__migrations__id": {"name": "logs__migrations__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__id", "block_contents": "A randomly generated UUID."}, "doc.tamanu_source_dbt.logs__migrations__logged_at": {"name": "logs__migrations__logged_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__logged_at", "block_contents": "The local server time when the migration run happened."}, "doc.tamanu_source_dbt.logs__migrations__record_sync_tick": {"name": "logs__migrations__record_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__record_sync_tick", "block_contents": "TODO"}, "doc.tamanu_source_dbt.logs__migrations__device_id": {"name": "logs__migrations__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__device_id", "block_contents": "TODO"}, "doc.tamanu_source_dbt.logs__migrations__version": {"name": "logs__migrations__version", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__version", "block_contents": "TODO"}, "doc.tamanu_source_dbt.logs__migrations__direction": {"name": "logs__migrations__direction", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__direction", "block_contents": "What kind of migration operation this was (typically `up`)."}, "doc.tamanu_source_dbt.logs__migrations__migrations": {"name": "logs__migrations__migrations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__migrations", "block_contents": "The list of migrations applied during this operation."}, "doc.tamanu_source_dbt.logs__migrations__updated_at_sync_tick": {"name": "logs__migrations__updated_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__updated_at_sync_tick", "block_contents": "TODO"}, "doc.tamanu_source_dbt.table__administered_vaccines": {"name": "table__administered_vaccines", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.table__administered_vaccines", "block_contents": "Table of vaccines administered to patients.\r\n\r\nVaccinations are recorded via the Vaccinations modal; they are selected\r\nfrom a list of Scheduled Vaccines and linked to a Patient via an Encounter."}, "doc.tamanu_source_dbt.administered_vaccines__id": {"name": "administered_vaccines__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__id", "block_contents": "Tamanu identifier for vaccine administrations recorded"}, "doc.tamanu_source_dbt.administered_vaccines__batch": {"name": "administered_vaccines__batch", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__batch", "block_contents": "Batch identifier of vaccine administrations recorded"}, "doc.tamanu_source_dbt.administered_vaccines__status": {"name": "administered_vaccines__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__status", "block_contents": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord."}, "doc.tamanu_source_dbt.administered_vaccines__reason": {"name": "administered_vaccines__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__reason", "block_contents": "Reason for vaccine administrations `NOT_GIVEN` status. This is a free text field"}, "doc.tamanu_source_dbt.administered_vaccines__injection_site": {"name": "administered_vaccines__injection_site", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__injection_site", "block_contents": "Injection site of the vaccine administrations recorded"}, "doc.tamanu_source_dbt.administered_vaccines__consent": {"name": "administered_vaccines__consent", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__consent", "block_contents": "Consent of the vaccine administrations recorded"}, "doc.tamanu_source_dbt.administered_vaccines__given_elsewhere": {"name": "administered_vaccines__given_elsewhere", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__given_elsewhere", "block_contents": "Checks if the vaccine was given elsewhere"}, "doc.tamanu_source_dbt.administered_vaccines__vaccine_name": {"name": "administered_vaccines__vaccine_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__vaccine_name", "block_contents": "Vaccine name of the vaccine administration recorded"}, "doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id": {"name": "administered_vaccines__scheduled_vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id", "block_contents": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered."}, "doc.tamanu_source_dbt.administered_vaccines__encounter_id": {"name": "administered_vaccines__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__encounter_id", "block_contents": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) this vaccine was given in."}, "doc.tamanu_source_dbt.administered_vaccines__vaccine_brand": {"name": "administered_vaccines__vaccine_brand", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__vaccine_brand", "block_contents": "Vaccine brand of the vaccine administration recorded"}, "doc.tamanu_source_dbt.administered_vaccines__disease": {"name": "administered_vaccines__disease", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__disease", "block_contents": "Disease the vaccine addresses of the vaccine administration recorded"}, "doc.tamanu_source_dbt.administered_vaccines__recorder_id": {"name": "administered_vaccines__recorder_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__recorder_id", "block_contents": "Reference to the [User](#!/source/source.tamanu.tamanu.users) who recorded this vaccination.\r\nThis may differ from the User or person who administered the vaccine."}, "doc.tamanu_source_dbt.administered_vaccines__location_id": {"name": "administered_vaccines__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__location_id", "block_contents": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven."}, "doc.tamanu_source_dbt.administered_vaccines__department_id": {"name": "administered_vaccines__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__department_id", "block_contents": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven."}, "doc.tamanu_source_dbt.administered_vaccines__given_by": {"name": "administered_vaccines__given_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__given_by", "block_contents": "Free text field for the name of the health practitioner who administered the\r\nvaccine. This is defaulted to the `display_name` of the logged-in User, but can\r\nbe changed. It is not a requirement that the administerer is a Tamanu User."}, "doc.tamanu_source_dbt.administered_vaccines__consent_given_by": {"name": "administered_vaccines__consent_given_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__consent_given_by", "block_contents": "Free text field recording who gave consent for the vaccination.\r\nThis is usually the patient themselves, but may differ for children or dependent\r\npersons or other cases."}, "doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id": {"name": "administered_vaccines__not_given_reason_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field."}, "doc.tamanu_source_dbt.administered_vaccines__circumstance_ids": {"name": "administered_vaccines__circumstance_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__circumstance_ids", "block_contents": "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineCircumstance`)."}, "doc.tamanu_source_dbt.table__appointments": {"name": "table__appointments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.table__appointments", "block_contents": "Table of appointments."}, "doc.tamanu_source_dbt.appointments__id": {"name": "appointments__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__id", "block_contents": "Tamanu identifier for appointment."}, "doc.tamanu_source_dbt.appointments__start_datetime": {"name": "appointments__start_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__start_datetime", "block_contents": "Start date and time of the appointment."}, "doc.tamanu_source_dbt.appointments__end_datetime": {"name": "appointments__end_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__end_datetime", "block_contents": "End date and time of the appointment."}, "doc.tamanu_source_dbt.appointments__start_time": {"name": "appointments__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__start_time", "block_contents": "When the appointment starts."}, "doc.tamanu_source_dbt.appointments__end_time": {"name": "appointments__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__end_time", "block_contents": "When the appointment ends."}, "doc.tamanu_source_dbt.appointments__patient_id": {"name": "appointments__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.appointments__clinician_id": {"name": "appointments__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__clinician_id", "block_contents": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment."}, "doc.tamanu_source_dbt.appointments__location_id": {"name": "appointments__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__location_id", "block_contents": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place."}, "doc.tamanu_source_dbt.appointments__schedule_id": {"name": "appointments__schedule_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__schedule_id", "block_contents": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments."}, "doc.tamanu_source_dbt.appointments__status": {"name": "appointments__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__status", "block_contents": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`"}, "doc.tamanu_source_dbt.appointments__type_legacy": {"name": "appointments__type_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__type_legacy", "block_contents": "The legacy type of appointment.\r\n\r\nOne of:\r\n- `Standard`\r\n- `Emergency`\r\n- `Specialist`\r\n- `Other`"}, "doc.tamanu_source_dbt.appointments__start_time_legacy": {"name": "appointments__start_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__start_time_legacy", "block_contents": "[Deprecated] Start time."}, "doc.tamanu_source_dbt.appointments__end_time_legacy": {"name": "appointments__end_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__end_time_legacy", "block_contents": "[Deprecated] End time."}, "doc.tamanu_source_dbt.appointments__location_group_id": {"name": "appointments__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__location_group_id", "block_contents": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place."}, "doc.tamanu_source_dbt.appointments__booking_type_id": {"name": "appointments__booking_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__booking_type_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`)."}, "doc.tamanu_source_dbt.appointments__appointment_type_id": {"name": "appointments__appointment_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__appointment_type_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`)."}, "doc.tamanu_source_dbt.appointments__is_high_priority": {"name": "appointments__is_high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__is_high_priority", "block_contents": "Boolean specify if the appointment is high priority."}, "doc.tamanu_source_dbt.appointments__encounter_id": {"name": "appointments__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) linked to this appointment"}, "doc.tamanu_source_dbt.appointments__additional_clinician_id": {"name": "appointments__additional_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__additional_clinician_id", "block_contents": "Reference to an additional [clinician](#!/source/source.tamanu.tamanu.users)"}, "doc.tamanu_source_dbt.appointments__link_encounter_id": {"name": "appointments__link_encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__link_encounter_id", "block_contents": "Reference to the related [encounter](#!/source/source.tamanu.tamanu.encounters) of the appointment"}, "doc.tamanu_source_dbt.table__appointment_procedure_types": {"name": "table__appointment_procedure_types", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_procedure_types.md", "original_file_path": "models\\sources\\appointment_procedure_types.md", "unique_id": "doc.tamanu_source_dbt.table__appointment_procedure_types", "block_contents": "Junction table linking appointments to procedure types, allowing multiple procedure types to be associated with a single appointment."}, "doc.tamanu_source_dbt.appointment_procedure_types__appointment_id": {"name": "appointment_procedure_types__appointment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_procedure_types.md", "original_file_path": "models\\sources\\appointment_procedure_types.md", "unique_id": "doc.tamanu_source_dbt.appointment_procedure_types__appointment_id", "block_contents": "Reference to the [appointment](#!/source/source.tamanu.tamanu.appointments) this procedure type is associated with."}, "doc.tamanu_source_dbt.appointment_procedure_types__procedure_type_id": {"name": "appointment_procedure_types__procedure_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_procedure_types.md", "original_file_path": "models\\sources\\appointment_procedure_types.md", "unique_id": "doc.tamanu_source_dbt.appointment_procedure_types__procedure_type_id", "block_contents": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`) associated with this appointment."}, "doc.tamanu_source_dbt.table__appointment_schedules": {"name": "table__appointment_schedules", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.table__appointment_schedules", "block_contents": "Defines recurrence rules for appointments."}, "doc.tamanu_source_dbt.appointment_schedules__until_date": {"name": "appointment_schedules__until_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__until_date", "block_contents": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition."}, "doc.tamanu_source_dbt.appointment_schedules__interval": {"name": "appointment_schedules__interval", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__interval", "block_contents": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\""}, "doc.tamanu_source_dbt.appointment_schedules__frequency": {"name": "appointment_schedules__frequency", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__frequency", "block_contents": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`"}, "doc.tamanu_source_dbt.appointment_schedules__days_of_week": {"name": "appointment_schedules__days_of_week", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__days_of_week", "block_contents": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`"}, "doc.tamanu_source_dbt.appointment_schedules__nth_weekday": {"name": "appointment_schedules__nth_weekday", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__nth_weekday", "block_contents": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month"}, "doc.tamanu_source_dbt.appointment_schedules__occurrence_count": {"name": "appointment_schedules__occurrence_count", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__occurrence_count", "block_contents": "When this value is set, the recurrence ends after generating the specified number of occurrences\r\nAt least one of `occurrence_count` or `until_date` must be set."}, "doc.tamanu_source_dbt.appointment_schedules__is_fully_generated": {"name": "appointment_schedules__is_fully_generated", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__is_fully_generated", "block_contents": "Whether or not all repeating appointments have been created for a schedule"}, "doc.tamanu_source_dbt.appointment_schedules__generated_until_date": {"name": "appointment_schedules__generated_until_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__generated_until_date", "block_contents": "The date of the most recent appointment in a schedule, this is set after generation of the repeated appointment and then updated if it is necessary to generate further appointments."}, "doc.tamanu_source_dbt.appointment_schedules__cancelled_at_date": {"name": "appointment_schedules__cancelled_at_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__cancelled_at_date", "block_contents": "The date from which appointments in a schedule have been cancelled, this is set when cancelling 'this and all future appointments'."}, "doc.tamanu_source_dbt.table__assets": {"name": "table__assets", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.table__assets", "block_contents": "Table of assets used in the tamanu app ui and patient letters."}, "doc.tamanu_source_dbt.assets__id": {"name": "assets__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__id", "block_contents": "Tamanu identifier for the asset."}, "doc.tamanu_source_dbt.assets__name": {"name": "assets__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__name", "block_contents": "Name of the asset set by the user on upload."}, "doc.tamanu_source_dbt.assets__type": {"name": "assets__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__type", "block_contents": "This is the type of asset stored."}, "doc.tamanu_source_dbt.assets__data": {"name": "assets__data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__data", "block_contents": "Contains a binary version of image data uploaded by user."}, "doc.tamanu_source_dbt.assets__facility_id": {"name": "assets__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__facility_id", "block_contents": "Reference to the [facilities](#!/source/source.tamanu.tamanu.facilities) this asset is associated with."}, "doc.tamanu_source_dbt.table__attachments": {"name": "table__attachments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.table__attachments", "block_contents": "Uploaded files.\r\n\r\nThese can be documents, photo IDs, patient letters...\r\n\r\nMost direct uploads will have a corresponding [`document_metadata`](#!/source/source.tamanu.tamanu.document_metadata),\r\nbut there's other ways to upload files, such as [for lab requests](#!/source/source.tamanu.tamanu.lab_request_attachments).\r\n\r\nUploaded files are not currently synced to facility servers. Instead, servers request the contents\r\nof documents just-in-time. This does require facility servers to be \"online\" but significantly\r\nreduces sync pressure."}, "doc.tamanu_source_dbt.attachments__name": {"name": "attachments__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.attachments__name", "block_contents": "The name for the attachment set on upload.\r\n\r\nTypically this is the filename."}, "doc.tamanu_source_dbt.attachments__type": {"name": "attachments__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.attachments__type", "block_contents": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file."}, "doc.tamanu_source_dbt.attachments__size": {"name": "attachments__size", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.attachments__size", "block_contents": "The file size in bytes."}, "doc.tamanu_source_dbt.attachments__data": {"name": "attachments__data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.attachments__data", "block_contents": "The file data."}, "doc.tamanu_source_dbt.table__certifiable_vaccines": {"name": "table__certifiable_vaccines", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.table__certifiable_vaccines", "block_contents": "Table of scheduled vaccines which can be certified via EUDCC or ICAO VDC.\r\n\r\nIntroduced during the COVID-19 pandemic, these are standards which can be\r\nused to produce a QR code containing vaccine information and a digital signature\r\nwhich certifies that the vaccines were administered by a competent authority.\r\n\r\nThis table both contains additional information about scheduled vaccines which is\r\nrequired for those to be certified, and signals that the vaccines listed may be\r\nincluded in certification QR codes.\r\n\r\nSee also the [`signers`](#!/source/source.tamanu.tamanu.signers) table."}, "doc.tamanu_source_dbt.certifiable_vaccines__vaccine_id": {"name": "certifiable_vaccines__vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__vaccine_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=vaccine`)\r\nfor the vaccine drug."}, "doc.tamanu_source_dbt.certifiable_vaccines__manufacturer_id": {"name": "certifiable_vaccines__manufacturer_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__manufacturer_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=manufacturer`)\r\nfor the organisation that manufactured the drug."}, "doc.tamanu_source_dbt.certifiable_vaccines__icd11_drug_code": {"name": "certifiable_vaccines__icd11_drug_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__icd11_drug_code", "block_contents": "Free-text for the ICD11 code for the drug."}, "doc.tamanu_source_dbt.certifiable_vaccines__icd11_disease_code": {"name": "certifiable_vaccines__icd11_disease_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__icd11_disease_code", "block_contents": "Free-text for the ICD11 code for the disease targeted by the drug."}, "doc.tamanu_source_dbt.certifiable_vaccines__vaccine_code": {"name": "certifiable_vaccines__vaccine_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__vaccine_code", "block_contents": "SNOMED CT or ATC code for the vaccine type."}, "doc.tamanu_source_dbt.certifiable_vaccines__target_code": {"name": "certifiable_vaccines__target_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__target_code", "block_contents": "SNOMED CT or ATC code for targeted disease."}, "doc.tamanu_source_dbt.certifiable_vaccines__eu_product_code": {"name": "certifiable_vaccines__eu_product_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__eu_product_code", "block_contents": "EU authorisation code for the vaccine product."}, "doc.tamanu_source_dbt.certifiable_vaccines__maximum_dosage": {"name": "certifiable_vaccines__maximum_dosage", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__maximum_dosage", "block_contents": "Maximum number of doses. Defaults to 1."}, "doc.tamanu_source_dbt.table__certificate_notifications": {"name": "table__certificate_notifications", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.table__certificate_notifications", "block_contents": "Various medical certificates being sent to patients.\r\n\r\nThese rows are processed by the `CertificateNotificationProcessor` scheduled task, and generate a\r\n[`patient_communications`](#!/source/source.tamanu.tamanu.patient_communications) row.\r\n\r\nThe actual certificate itself is stored separately on the filesystem while it's generated."}, "doc.tamanu_source_dbt.certificate_notifications__type": {"name": "certificate_notifications__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__type", "block_contents": "Type of certificate being generated.\r\n\r\nThis dictates both from which resource the certificate is generated, and also the template being\r\nused for generating the certificate itself.\r\n\r\nOne of:\r\n- `covid_19_clearance`\r\n- `vaccination_certificate`\r\n- `icao.test`\r\n- `icao.vacc`"}, "doc.tamanu_source_dbt.certificate_notifications__require_signing": {"name": "certificate_notifications__require_signing", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__require_signing", "block_contents": "If the certificates requires cryptographic signing.\r\n\r\nSee [`certifiable_vaccines`](#!/source/source.tamanu.tamanu.certifiable_vaccines).\r\n\r\nOnly applicable to `icao.test` and `icao.vacc` types."}, "doc.tamanu_source_dbt.certificate_notifications__patient_id": {"name": "certificate_notifications__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__patient_id", "block_contents": "Reference to a [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.certificate_notifications__forward_address": {"name": "certificate_notifications__forward_address", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__forward_address", "block_contents": "An email address to send the generated certificate to."}, "doc.tamanu_source_dbt.certificate_notifications__lab_test_id": {"name": "certificate_notifications__lab_test_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__lab_test_id", "block_contents": "The [lab test](#!/source/source.tamanu.tamanu.lab_tests) this certificate is for, if applicable."}, "doc.tamanu_source_dbt.certificate_notifications__status": {"name": "certificate_notifications__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__status", "block_contents": "Processing status.\r\n\r\nOne of:\r\n- `Queued`\r\n- `Processed`\r\n- `Error`\r\n- `Ignore`"}, "doc.tamanu_source_dbt.certificate_notifications__error": {"name": "certificate_notifications__error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__error", "block_contents": "If the certificate generation fails, this is the error."}, "doc.tamanu_source_dbt.certificate_notifications__created_by": {"name": "certificate_notifications__created_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__created_by", "block_contents": "The name of the user who initiated the creation of this certificate."}, "doc.tamanu_source_dbt.certificate_notifications__lab_request_id": {"name": "certificate_notifications__lab_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__lab_request_id", "block_contents": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this certificate is for, if applicable."}, "doc.tamanu_source_dbt.certificate_notifications__printed_date": {"name": "certificate_notifications__printed_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__printed_date", "block_contents": "When this certificate was printed, if applicable."}, "doc.tamanu_source_dbt.certificate_notifications__facility_name": {"name": "certificate_notifications__facility_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__facility_name", "block_contents": "The name of the facility where the creation of this certificate was initiated."}, "doc.tamanu_source_dbt.certificate_notifications__language": {"name": "certificate_notifications__language", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__language", "block_contents": "Used to translate the certificate."}, "doc.tamanu_source_dbt.table__contributing_death_causes": {"name": "table__contributing_death_causes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\contributing_death_causes.md", "original_file_path": "models\\sources\\contributing_death_causes.md", "unique_id": "doc.tamanu_source_dbt.table__contributing_death_causes", "block_contents": "Contributing causes recorded with the patient's death data."}, "doc.tamanu_source_dbt.contributing_death_causes__time_after_onset": {"name": "contributing_death_causes__time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\contributing_death_causes.md", "original_file_path": "models\\sources\\contributing_death_causes.md", "unique_id": "doc.tamanu_source_dbt.contributing_death_causes__time_after_onset", "block_contents": "Time between onset of recorded cause and death in minutes."}, "doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id": {"name": "contributing_death_causes__patient_death_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\contributing_death_causes.md", "original_file_path": "models\\sources\\contributing_death_causes.md", "unique_id": "doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id", "block_contents": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record."}, "doc.tamanu_source_dbt.contributing_death_causes__condition_id": {"name": "contributing_death_causes__condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\contributing_death_causes.md", "original_file_path": "models\\sources\\contributing_death_causes.md", "unique_id": "doc.tamanu_source_dbt.contributing_death_causes__condition_id", "block_contents": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`)."}, "doc.tamanu_source_dbt.table__death_revert_logs": {"name": "table__death_revert_logs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.table__death_revert_logs", "block_contents": "Patient deaths can be reverted if they were recorded in error, this tracks those reverts.\r\n\r\nSee [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data)."}, "doc.tamanu_source_dbt.death_revert_logs__revert_time": {"name": "death_revert_logs__revert_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.death_revert_logs__revert_time", "block_contents": "When the reversion happened."}, "doc.tamanu_source_dbt.death_revert_logs__death_data_id": {"name": "death_revert_logs__death_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.death_revert_logs__death_data_id", "block_contents": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record this is reverting."}, "doc.tamanu_source_dbt.death_revert_logs__patient_id": {"name": "death_revert_logs__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.death_revert_logs__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.death_revert_logs__reverted_by_id": {"name": "death_revert_logs__reverted_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.death_revert_logs__reverted_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who reverted this death record."}, "doc.tamanu_source_dbt.table__departments": {"name": "table__departments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\departments.md", "original_file_path": "models\\sources\\departments.md", "unique_id": "doc.tamanu_source_dbt.table__departments", "block_contents": "Basic department info with a reference to parent facility."}, "doc.tamanu_source_dbt.departments__code": {"name": "departments__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\departments.md", "original_file_path": "models\\sources\\departments.md", "unique_id": "doc.tamanu_source_dbt.departments__code", "block_contents": "Code for department."}, "doc.tamanu_source_dbt.departments__name": {"name": "departments__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\departments.md", "original_file_path": "models\\sources\\departments.md", "unique_id": "doc.tamanu_source_dbt.departments__name", "block_contents": "Full readable name for department."}, "doc.tamanu_source_dbt.departments__facility_id": {"name": "departments__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\departments.md", "original_file_path": "models\\sources\\departments.md", "unique_id": "doc.tamanu_source_dbt.departments__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this department is in."}, "doc.tamanu_source_dbt.table__devices": {"name": "table__devices", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.table__devices", "block_contents": "Devices that are authorised to login.\r\n\r\nDevices not in the table can only connect if the user they're\r\n**first** logging in as has enough quota (`device_registration_quota`\r\non the [`users`](#!/source/source.tamanu.tamanu.users) table.)\r\n\r\nThis check is not performed when `features.deviceRegistrationQuota` is disabled."}, "doc.tamanu_source_dbt.devices__last_seen_at": {"name": "devices__last_seen_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.devices__last_seen_at", "block_contents": "When this device last logged in."}, "doc.tamanu_source_dbt.devices__registered_by_id": {"name": "devices__registered_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.devices__registered_by_id", "block_contents": "Which user registered this device.\r\n\r\nThis is used for quota calculations."}, "doc.tamanu_source_dbt.devices__name": {"name": "devices__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.devices__name", "block_contents": "Optional descriptive name, to make it easier to map device IDs to real devices\r\nin debugging and troubleshooting situations."}, "doc.tamanu_source_dbt.devices__scopes": {"name": "devices__scopes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.devices__scopes", "block_contents": "Scopes the device is authorised to access.\r\n\r\nScopes allow access to parts of the API that are closed to other devices\r\notherwise. Some scopes are restricted by quota. Devices aren't allowed to\r\nrequest more scopes than they currently have, but may login without\r\nspecifying the full scopes they have."}, "doc.tamanu_source_dbt.table__discharges": {"name": "table__discharges", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.table__discharges", "block_contents": "Information about a discharge.\r\n\r\nA discharge is the end of the lifecycle for an encounter."}, "doc.tamanu_source_dbt.discharges__note": {"name": "discharges__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__note", "block_contents": "Free-form notes about the discharge.\r\n\r\nMay include treatment plan and follow-ups, written by the discharging clinician.\r\n\r\nSince v2.0, also see the [`notes`](#!/source/source.tamanu.tamanu.notes) table for encounter and discharge notes."}, "doc.tamanu_source_dbt.discharges__encounter_id": {"name": "discharges__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this discharge is for."}, "doc.tamanu_source_dbt.discharges__discharger_id": {"name": "discharges__discharger_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__discharger_id", "block_contents": "The [discharging clinician](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.discharges__disposition_id": {"name": "discharges__disposition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__disposition_id", "block_contents": "The discharge disposition or classification of the discharge ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.discharges__facility_name": {"name": "discharges__facility_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__facility_name", "block_contents": "Name of the discharging facility."}, "doc.tamanu_source_dbt.discharges__facility_address": {"name": "discharges__facility_address", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__facility_address", "block_contents": "Address of the discharging facility."}, "doc.tamanu_source_dbt.discharges__facility_town": {"name": "discharges__facility_town", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__facility_town", "block_contents": "Town of the discharging facility."}, "doc.tamanu_source_dbt.table__document_metadata": {"name": "table__document_metadata", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.table__document_metadata", "block_contents": "Information about an uploaded document or file, typically attached to an encounter or directly to a patient.\r\n\r\nThe actual file data is stored in [`attachments`](#!/source/source.tamanu.tamanu.attachments)."}, "doc.tamanu_source_dbt.document_metadata__name": {"name": "document_metadata__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__name", "block_contents": "Free-form name of the document.\r\n\r\nOften this is the filename."}, "doc.tamanu_source_dbt.document_metadata__type": {"name": "document_metadata__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__type", "block_contents": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file."}, "doc.tamanu_source_dbt.document_metadata__document_created_at": {"name": "document_metadata__document_created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_created_at", "block_contents": "When the document was created.\r\n\r\nHistorically (before v2.0) this was the \"created at\" timestamp of the file itself, as reported by\r\nthe OS. However that information is no longer available to Tamanu in most contexts, so this is now\r\nusually set to the upload time."}, "doc.tamanu_source_dbt.document_metadata__document_uploaded_at": {"name": "document_metadata__document_uploaded_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_uploaded_at", "block_contents": "When the document was uploaded."}, "doc.tamanu_source_dbt.document_metadata__document_owner": {"name": "document_metadata__document_owner", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_owner", "block_contents": "Name of the person who owns the document.\r\n\r\nTypically this is the uploader's name."}, "doc.tamanu_source_dbt.document_metadata__patient_id": {"name": "document_metadata__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) the document was uploaded to."}, "doc.tamanu_source_dbt.document_metadata__encounter_id": {"name": "document_metadata__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) the document was uploaded to."}, "doc.tamanu_source_dbt.document_metadata__attachment_id": {"name": "document_metadata__attachment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__attachment_id", "block_contents": "The [file data](#!/source/source.tamanu.tamanu.attachments)."}, "doc.tamanu_source_dbt.document_metadata__department_id": {"name": "document_metadata__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__department_id", "block_contents": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the document was uploaded from."}, "doc.tamanu_source_dbt.document_metadata__note": {"name": "document_metadata__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__note", "block_contents": "Free-form description of the document."}, "doc.tamanu_source_dbt.document_metadata__document_created_at_legacy": {"name": "document_metadata__document_created_at_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_created_at_legacy", "block_contents": "[Deprecated] When the document was created."}, "doc.tamanu_source_dbt.document_metadata__document_uploaded_at_legacy": {"name": "document_metadata__document_uploaded_at_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_uploaded_at_legacy", "block_contents": "[Deprecated] When the document was uploaded."}, "doc.tamanu_source_dbt.document_metadata__source": {"name": "document_metadata__source", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__source", "block_contents": "Where the document came from.\r\n\r\nOne of:\r\n- `patient_letter`\r\n- `uploaded`"}, "doc.tamanu_source_dbt.table__encounters": {"name": "table__encounters", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.table__encounters", "block_contents": "Tracks the basic information of the patient encounters within Tamanu from start to finish"}, "doc.tamanu_source_dbt.encounters__encounter_type": {"name": "encounters__encounter_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__encounter_type", "block_contents": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`"}, "doc.tamanu_source_dbt.encounters__start_date": {"name": "encounters__start_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__start_date", "block_contents": "The beginning of the encounter"}, "doc.tamanu_source_dbt.encounters__end_date": {"name": "encounters__end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__end_date", "block_contents": "The date encounter was discharged/ended"}, "doc.tamanu_source_dbt.encounters__reason_for_encounter": {"name": "encounters__reason_for_encounter", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__reason_for_encounter", "block_contents": "Free-form information about the encounter.\r\n\r\nCan include info like type of survey submitted, emergency diagnosis, etc."}, "doc.tamanu_source_dbt.encounters__device_id": {"name": "encounters__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__device_id", "block_contents": "Unique identifier for the device that created the encounter.\r\n\r\nDevice IDs are proper to each device and not globally recorded in e.g. a `devices` table."}, "doc.tamanu_source_dbt.encounters__start_date_legacy": {"name": "encounters__start_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__start_date_legacy", "block_contents": "[Deprecated] Start date."}, "doc.tamanu_source_dbt.encounters__end_date_legacy": {"name": "encounters__end_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__end_date_legacy", "block_contents": "[Deprecated] End date."}, "doc.tamanu_source_dbt.encounters__planned_location_id": {"name": "encounters__planned_location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__planned_location_id", "block_contents": "The [location](#!/source/source.tamanu.tamanu.locations) that the encounter will transfer to at the\r\n`planned_location_start_time`."}, "doc.tamanu_source_dbt.encounters__patient_id": {"name": "encounters__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.encounters__examiner_id": {"name": "encounters__examiner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__examiner_id", "block_contents": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.encounters__location_id": {"name": "encounters__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__location_id", "block_contents": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in."}, "doc.tamanu_source_dbt.encounters__department_id": {"name": "encounters__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__department_id", "block_contents": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) this encounter is in."}, "doc.tamanu_source_dbt.encounters__planned_location_start_time": {"name": "encounters__planned_location_start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__planned_location_start_time", "block_contents": "The time that the encounter will transfer to the planned location."}, "doc.tamanu_source_dbt.encounters__patient_billing_type_id": {"name": "encounters__patient_billing_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__patient_billing_type_id", "block_contents": "The billing type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient."}, "doc.tamanu_source_dbt.encounters__referral_source_id": {"name": "encounters__referral_source_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__referral_source_id", "block_contents": "The referral source ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient."}, "doc.tamanu_source_dbt.encounters__discharge_draft": {"name": "encounters__discharge_draft", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__discharge_draft", "block_contents": "Draft data of the encounter"}, "doc.tamanu_source_dbt.encounters__estimated_end_date": {"name": "encounters__estimated_end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__estimated_end_date", "block_contents": "The estimated discharge date of the encounter"}, "doc.tamanu_source_dbt.table__encounter_diagnoses": {"name": "table__encounter_diagnoses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_diagnoses", "block_contents": "Records diagnoses made during an encounter"}, "doc.tamanu_source_dbt.encounter_diagnoses__certainty": {"name": "encounter_diagnoses__certainty", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__certainty", "block_contents": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting"}, "doc.tamanu_source_dbt.encounter_diagnoses__is_primary": {"name": "encounter_diagnoses__is_primary", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__is_primary", "block_contents": "A boolean indicating if this is a primary diagnosis"}, "doc.tamanu_source_dbt.encounter_diagnoses__encounter_id": {"name": "encounter_diagnoses__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for."}, "doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id": {"name": "encounter_diagnoses__diagnosis_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id", "block_contents": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.encounter_diagnoses__clinician_id": {"name": "encounter_diagnoses__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__clinician_id", "block_contents": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that diagnosis."}, "doc.tamanu_source_dbt.table__encounter_diets": {"name": "table__encounter_diets", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diets.md", "original_file_path": "models\\sources\\encounter_diets.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_diets", "block_contents": "A diet associated with an encounter.\r\n\r\nA patient can be placed on a diet for various medical purposes.\r\nDiets are specified in reference data."}, "doc.tamanu_source_dbt.encounter_diets__encounter_id": {"name": "encounter_diets__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diets.md", "original_file_path": "models\\sources\\encounter_diets.md", "unique_id": "doc.tamanu_source_dbt.encounter_diets__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diet is for."}, "doc.tamanu_source_dbt.encounter_diets__diet_id": {"name": "encounter_diets__diet_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diets.md", "original_file_path": "models\\sources\\encounter_diets.md", "unique_id": "doc.tamanu_source_dbt.encounter_diets__diet_id", "block_contents": "The diet ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diet`)."}, "doc.tamanu_source_dbt.table__encounter_history": {"name": "table__encounter_history", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_history", "block_contents": "Records changes to an encounter's basic details."}, "doc.tamanu_source_dbt.encounter_history__encounter_id": {"name": "encounter_history__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__encounter_id", "block_contents": "Reference to the original [encounter](#!/source/source.tamanu.tamanu.encounters) this history is for."}, "doc.tamanu_source_dbt.encounter_history__department_id": {"name": "encounter_history__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__department_id", "block_contents": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the encounter was in."}, "doc.tamanu_source_dbt.encounter_history__location_id": {"name": "encounter_history__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the encounter was in."}, "doc.tamanu_source_dbt.encounter_history__examiner_id": {"name": "encounter_history__examiner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__examiner_id", "block_contents": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users) for the encounter."}, "doc.tamanu_source_dbt.encounter_history__encounter_type": {"name": "encounter_history__encounter_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__encounter_type", "block_contents": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`"}, "doc.tamanu_source_dbt.encounter_history__actor_id": {"name": "encounter_history__actor_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__actor_id", "block_contents": "[Who](#!/source/source.tamanu.tamanu.users) made the change."}, "doc.tamanu_source_dbt.encounter_history__change_type": {"name": "encounter_history__change_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__change_type", "block_contents": "The field which was changed.\r\n\r\nOne of:\r\n- `encounter_type`\r\n- `location`\r\n- `department`\r\n- `examiner`"}, "doc.tamanu_source_dbt.table__encounter_pause_prescriptions": {"name": "table__encounter_pause_prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_pause_prescriptions", "block_contents": "Records details about the prescription being paused, the duration and timing of the pause, and the clinician responsible for initiating the pause."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__encounter_prescription_id": {"name": "encounter_pause_prescriptions__encounter_prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__encounter_prescription_id", "block_contents": "References the unique identifier of the prescription being paused. This links to the `encounter_prescriptions` table to provide context about the specific prescription."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_duration": {"name": "encounter_pause_prescriptions__pause_duration", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_duration", "block_contents": "Describes the length of time for which the prescription is paused. This value works in conjunction with the `pause_time_unit` field to specify the duration (e.g., 5 days, 2 weeks)."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_time_unit": {"name": "encounter_pause_prescriptions__pause_time_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_time_unit", "block_contents": "Specifies the unit of time for the pause duration. Common values include days, weeks and it works in conjunction with the `pause_duration` field to define the total pause period."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_start_date": {"name": "encounter_pause_prescriptions__pause_start_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_start_date", "block_contents": "Indicates the date when the prescription pause begins. This field is used to track the start of the pause period."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_end_date": {"name": "encounter_pause_prescriptions__pause_end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_end_date", "block_contents": "Indicates the date when the prescription pause ends. This field is used to track the end of the pause period."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__notes": {"name": "encounter_pause_prescriptions__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__notes", "block_contents": "Provides additional information or context about the prescription pause."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pausing_clinician_id": {"name": "encounter_pause_prescriptions__pausing_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pausing_clinician_id", "block_contents": "References the unique identifier of the clinician responsible for initiating the pause."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__created_by": {"name": "encounter_pause_prescriptions__created_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__created_by", "block_contents": "References the unique identifier of the user who created the record."}, "doc.tamanu_source_dbt.table__encounter_pause_prescription_histories": {"name": "table__encounter_pause_prescription_histories", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_pause_prescription_histories", "block_contents": "This table tracks the history of paused prescriptions for encounters, including details about the action, user, and duration."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__encounter_prescription_id": {"name": "encounter_pause_prescription_histories__encounter_prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__encounter_prescription_id", "block_contents": "The ID of the prescription associated with the encounter."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action": {"name": "encounter_pause_prescription_histories__action", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action", "block_contents": "The type of action performed, such as \"pause\" or \"resume.\""}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_date": {"name": "encounter_pause_prescription_histories__action_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_date", "block_contents": "The date and time when the action was performed."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_user_id": {"name": "encounter_pause_prescription_histories__action_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_user_id", "block_contents": "The ID of the user who performed the action."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__notes": {"name": "encounter_pause_prescription_histories__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__notes", "block_contents": "Additional notes or comments of the paused prescription."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_duration": {"name": "encounter_pause_prescription_histories__pause_duration", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_duration", "block_contents": "The duration for which the prescription was paused."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_time_unit": {"name": "encounter_pause_prescription_histories__pause_time_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_time_unit", "block_contents": "The unit of time for the pause duration, such as \"days\" or \"hours.\""}, "doc.tamanu_source_dbt.table__encounter_prescriptions": {"name": "table__encounter_prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_prescriptions.md", "original_file_path": "models\\sources\\encounter_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_prescriptions", "block_contents": "Association of encounter to prescription"}, "doc.tamanu_source_dbt.encounter_prescriptions__encounter_id": {"name": "encounter_prescriptions__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_prescriptions.md", "original_file_path": "models\\sources\\encounter_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_prescriptions__encounter_id", "block_contents": "The [encounter](#!/source/source.tamanu.tamanu.encounters)"}, "doc.tamanu_source_dbt.encounter_prescriptions__prescription_id": {"name": "encounter_prescriptions__prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_prescriptions.md", "original_file_path": "models\\sources\\encounter_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_prescriptions__prescription_id", "block_contents": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)"}, "doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge": {"name": "encounter_prescriptions__is_selected_for_discharge", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_prescriptions.md", "original_file_path": "models\\sources\\encounter_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge", "block_contents": "Whether the prescription is for when the patient is discharged."}, "doc.tamanu_source_dbt.table__facilities": {"name": "table__facilities", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.table__facilities", "block_contents": "Table of facilities.\r\n\r\nFacilities may be either or both of:\r\n\r\n- Any healthcare facility, like hospitals, clinics, mobile vaccination vans, laboratories, etc\r\n- A Tamanu Facility deployment.\r\n\r\nWhen syncing, patient and related records are scoped to a facility, according to the\r\n[`patient_facilities`](#!/source/source.tamanu.tamanu.patient_facilities) table."}, "doc.tamanu_source_dbt.facilities__code": {"name": "facilities__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__code", "block_contents": "Code (identifier) for the facility."}, "doc.tamanu_source_dbt.facilities__name": {"name": "facilities__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__name", "block_contents": "Full readable name."}, "doc.tamanu_source_dbt.facilities__division": {"name": "facilities__division", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__division", "block_contents": "Administrative division this facility lives in."}, "doc.tamanu_source_dbt.facilities__type": {"name": "facilities__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__type", "block_contents": "Type of the facility."}, "doc.tamanu_source_dbt.facilities__email": {"name": "facilities__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__email", "block_contents": "Administrative email address of the facility."}, "doc.tamanu_source_dbt.facilities__contact_number": {"name": "facilities__contact_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__contact_number", "block_contents": "Administrative contact number of the facility."}, "doc.tamanu_source_dbt.facilities__city_town": {"name": "facilities__city_town", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__city_town", "block_contents": "City or town of the facility."}, "doc.tamanu_source_dbt.facilities__street_address": {"name": "facilities__street_address", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__street_address", "block_contents": "Street address of the facility."}, "doc.tamanu_source_dbt.facilities__catchment_id": {"name": "facilities__catchment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__catchment_id", "block_contents": "Catchment area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.facilities__is_sensitive": {"name": "facilities__is_sensitive", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__is_sensitive", "block_contents": "If set to `true`, encounters created on this facility will only be viewable when logged into this facility"}, "doc.tamanu_source_dbt.generic__schema": {"name": "generic__schema", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__schema", "block_contents": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication."}, "doc.tamanu_source_dbt.generic__id": {"name": "generic__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__id", "block_contents": "Tamanu internal identifier (generally a UUID)"}, "doc.tamanu_source_dbt.generic__created_at": {"name": "generic__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__created_at", "block_contents": "Timestamp of when record was created"}, "doc.tamanu_source_dbt.generic__updated_at": {"name": "generic__updated_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__updated_at", "block_contents": "Timestamp of when record was last updated"}, "doc.tamanu_source_dbt.generic__deleted_at": {"name": "generic__deleted_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__deleted_at", "block_contents": "Timestamp of when record was deleted"}, "doc.tamanu_source_dbt.generic__updated_by": {"name": "generic__updated_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__updated_by", "block_contents": "The identifier of the user logged on when the record was created, updated or deleted"}, "doc.tamanu_source_dbt.generic__date": {"name": "generic__date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__date", "block_contents": "Local date for the record"}, "doc.tamanu_source_dbt.generic__datetime": {"name": "generic__datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__datetime", "block_contents": "Local date and time for the record"}, "doc.tamanu_source_dbt.generic__start_datetime": {"name": "generic__start_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__start_datetime", "block_contents": "Local start date and time for the record"}, "doc.tamanu_source_dbt.generic__end_datetime": {"name": "generic__end_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__end_datetime", "block_contents": "Local end date and time for the record"}, "doc.tamanu_source_dbt.generic__date_legacy": {"name": "generic__date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__date_legacy", "block_contents": "[Deprecated] date field which is a timestamp of the event being recorded"}, "doc.tamanu_source_dbt.generic__date_recorded": {"name": "generic__date_recorded", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__date_recorded", "block_contents": "Local date and time of the event being recorded"}, "doc.tamanu_source_dbt.generic__date_recorded_legacy": {"name": "generic__date_recorded_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__date_recorded_legacy", "block_contents": "[Deprecated] date field which is a timestamp of the event being recorded"}, "doc.tamanu_source_dbt.generic__deletion_date": {"name": "generic__deletion_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__deletion_date", "block_contents": "Date field which is a timestamp of record being deleted"}, "doc.tamanu_source_dbt.generic__visibility_status": {"name": "generic__visibility_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__visibility_status", "block_contents": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`."}, "doc.tamanu_source_dbt.generic__updated_at_sync_tick": {"name": "generic__updated_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__updated_at_sync_tick", "block_contents": "Last tick that the record was updated. Used to figure out old vs new data when syncing"}, "doc.tamanu_source_dbt.table__imaging_area_external_codes": {"name": "table__imaging_area_external_codes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_area_external_codes.md", "original_file_path": "models\\sources\\imaging_area_external_codes.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_area_external_codes", "block_contents": "External codes for imaging areas (such as for [PACS](https://en.wikipedia.org/wiki/Picture_archiving_and_communication_system)).\r\n\r\nImaging areas are stored in [Reference Data](#!/source/source.tamanu.tamanu.reference_data), this\r\ntable adds additional (external) codes."}, "doc.tamanu_source_dbt.imaging_area_external_codes__area_id": {"name": "imaging_area_external_codes__area_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_area_external_codes.md", "original_file_path": "models\\sources\\imaging_area_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_area_external_codes__area_id", "block_contents": "Reference to the imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.imaging_area_external_codes__code": {"name": "imaging_area_external_codes__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_area_external_codes.md", "original_file_path": "models\\sources\\imaging_area_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_area_external_codes__code", "block_contents": "External code."}, "doc.tamanu_source_dbt.imaging_area_external_codes__description": {"name": "imaging_area_external_codes__description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_area_external_codes.md", "original_file_path": "models\\sources\\imaging_area_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_area_external_codes__description", "block_contents": "Human-friendly description for the area/code."}, "doc.tamanu_source_dbt.table__imaging_requests": {"name": "table__imaging_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_requests", "block_contents": "Imaging requests are the entrypoint of imaging workflows in Tamanu.\r\n\r\nEach row is a request for radiology to perform one or more imagings on a patient.\r\n\r\nImagings can have one or more [request areas](#!/source/source.tamanu.tamanu.imaging_request_areas)\r\nattached, and when completed will have [results](#!/source/source.tamanu.tamanu.imaging_results)."}, "doc.tamanu_source_dbt.imaging_requests__status": {"name": "imaging_requests__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__status", "block_contents": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`"}, "doc.tamanu_source_dbt.imaging_requests__requested_date": {"name": "imaging_requests__requested_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__requested_date", "block_contents": "When the imaging was requested."}, "doc.tamanu_source_dbt.imaging_requests__encounter_id": {"name": "imaging_requests__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this imaging request is a part of."}, "doc.tamanu_source_dbt.imaging_requests__requested_by_id": {"name": "imaging_requests__requested_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__requested_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging."}, "doc.tamanu_source_dbt.imaging_requests__legacy_results": {"name": "imaging_requests__legacy_results", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__legacy_results", "block_contents": "[Deprecated] Description of the results.\r\n\r\nSince v1.24 this has moved to the [imaging results](#!/source/source.tamanu.tamanu.imaging_results) table."}, "doc.tamanu_source_dbt.imaging_requests__completed_by_id": {"name": "imaging_requests__completed_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__completed_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging."}, "doc.tamanu_source_dbt.imaging_requests__location_id": {"name": "imaging_requests__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) for this imaging request."}, "doc.tamanu_source_dbt.imaging_requests__imaging_type": {"name": "imaging_requests__imaging_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__imaging_type", "block_contents": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`"}, "doc.tamanu_source_dbt.imaging_requests__requested_date_legacy": {"name": "imaging_requests__requested_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__requested_date_legacy", "block_contents": "[Deprecated] Timestamp when the imaging was requested."}, "doc.tamanu_source_dbt.imaging_requests__priority": {"name": "imaging_requests__priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__priority", "block_contents": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`."}, "doc.tamanu_source_dbt.imaging_requests__location_group_id": {"name": "imaging_requests__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__location_group_id", "block_contents": "Reference to the [location group](#!/source/source.tamanu.tamanu.location_groups) for this imaging request."}, "doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation": {"name": "imaging_requests__reason_for_cancellation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation", "block_contents": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113)."}, "doc.tamanu_source_dbt.imaging_requests__display_id": {"name": "imaging_requests__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__display_id", "block_contents": "Short unique identifier used on the frontend."}, "doc.tamanu_source_dbt.table__imaging_request_areas": {"name": "table__imaging_request_areas", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_request_areas.md", "original_file_path": "models\\sources\\imaging_request_areas.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_request_areas", "block_contents": "Areas to be imaged as part of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests)."}, "doc.tamanu_source_dbt.imaging_request_areas__imaging_request_id": {"name": "imaging_request_areas__imaging_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_request_areas.md", "original_file_path": "models\\sources\\imaging_request_areas.md", "unique_id": "doc.tamanu_source_dbt.imaging_request_areas__imaging_request_id", "block_contents": "The [imaging request](#!/source/source.tamanu.tamanu.imaging_requests)."}, "doc.tamanu_source_dbt.imaging_request_areas__area_id": {"name": "imaging_request_areas__area_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_request_areas.md", "original_file_path": "models\\sources\\imaging_request_areas.md", "unique_id": "doc.tamanu_source_dbt.imaging_request_areas__area_id", "block_contents": "The imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__imaging_results": {"name": "table__imaging_results", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_results", "block_contents": "Result of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).\r\n\r\nIn practice, there is usually one or two results per request:\r\n- one containing a reference to a PACS image, when imaging integrations are enabled;\r\n- one containing notes from a doctor who analysed the image.\r\n\r\nHowever there is no limit; for example there may be multiple notes from multiple doctors."}, "doc.tamanu_source_dbt.imaging_results__imaging_request_id": {"name": "imaging_results__imaging_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__imaging_request_id", "block_contents": "Reference to the [imaging request](#!/source/source.tamanu.tamanu.imaging_requests)."}, "doc.tamanu_source_dbt.imaging_results__completed_by_id": {"name": "imaging_results__completed_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__completed_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging."}, "doc.tamanu_source_dbt.imaging_results__description": {"name": "imaging_results__description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__description", "block_contents": "Free-form description / notes about this imaging."}, "doc.tamanu_source_dbt.imaging_results__external_code": {"name": "imaging_results__external_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__external_code", "block_contents": "External code for this result, used with PACS integration (generally via FHIR)."}, "doc.tamanu_source_dbt.imaging_results__completed_at": {"name": "imaging_results__completed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__completed_at", "block_contents": "When this result was completed."}, "doc.tamanu_source_dbt.imaging_results__result_image_url": {"name": "imaging_results__result_image_url", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__result_image_url", "block_contents": "Link to external imaging result viewer."}, "doc.tamanu_source_dbt.table__imaging_type_external_codes": {"name": "table__imaging_type_external_codes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_type_external_codes.md", "original_file_path": "models\\sources\\imaging_type_external_codes.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_type_external_codes", "block_contents": "Mapping table for imaging types to external codes."}, "doc.tamanu_source_dbt.imaging_type_external_codes__imaging_type_code": {"name": "imaging_type_external_codes__imaging_type_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_type_external_codes.md", "original_file_path": "models\\sources\\imaging_type_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_type_external_codes__imaging_type_code", "block_contents": "Tamanu's imaging type code."}, "doc.tamanu_source_dbt.imaging_type_external_codes__code": {"name": "imaging_type_external_codes__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_type_external_codes.md", "original_file_path": "models\\sources\\imaging_type_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_type_external_codes__code", "block_contents": "External code."}, "doc.tamanu_source_dbt.imaging_type_external_codes__description": {"name": "imaging_type_external_codes__description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_type_external_codes.md", "original_file_path": "models\\sources\\imaging_type_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_type_external_codes__description", "block_contents": "Description of code."}, "doc.tamanu_source_dbt.table__invoices": {"name": "table__invoices", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.table__invoices", "block_contents": "Invoices related to encounters."}, "doc.tamanu_source_dbt.invoices__display_id": {"name": "invoices__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__display_id", "block_contents": "Short unique identifier used on the frontend."}, "doc.tamanu_source_dbt.invoices__status": {"name": "invoices__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__status", "block_contents": "Status of the invoice.\r\n\r\nOne of:\r\n- `cancelled`\r\n- `in_progress`\r\n- `finalised`"}, "doc.tamanu_source_dbt.invoices__encounter_id": {"name": "invoices__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this invoice is a part of."}, "doc.tamanu_source_dbt.invoices__patient_payment_status": {"name": "invoices__patient_payment_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__patient_payment_status", "block_contents": "Payment status (patient portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`"}, "doc.tamanu_source_dbt.invoices__insurer_payment_status": {"name": "invoices__insurer_payment_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__insurer_payment_status", "block_contents": "Payment status (insurer portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`"}, "doc.tamanu_source_dbt.table__invoices_invoice_insurance_plans": {"name": "table__invoices_invoice_insurance_plans", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices_invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.table__invoices_invoice_insurance_plans", "block_contents": "Junction table linking invoices to insurance contracts. This many-to-many relationship allows an invoice to be associated with multiple insurance contracts."}, "doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_id": {"name": "invoices_invoice_insurance_plans__invoice_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices_invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_id", "block_contents": "Reference to the [invoice](#!/source/source.tamanu.tamanu.invoices) that this insurance contract applies to."}, "doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_insurance_plan_id": {"name": "invoices_invoice_insurance_plans__invoice_insurance_plan_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices_invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_insurance_plan_id", "block_contents": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans) being applied to the invoice."}, "doc.tamanu_source_dbt.table__invoice_discounts": {"name": "table__invoice_discounts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_discounts", "block_contents": "Invoice discount that is applied to the patient's portion of the discountable costs."}, "doc.tamanu_source_dbt.invoice_discounts__id": {"name": "invoice_discounts__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__id", "block_contents": "Tamanu identifier for invoice discounts"}, "doc.tamanu_source_dbt.invoice_discounts__invoice_id": {"name": "invoice_discounts__invoice_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__invoice_id", "block_contents": "The [invoice](#!/source/source.tamanu.tamanu.invoices)."}, "doc.tamanu_source_dbt.invoice_discounts__percentage": {"name": "invoice_discounts__percentage", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__percentage", "block_contents": "Percentage discount to apply to the invoice"}, "doc.tamanu_source_dbt.invoice_discounts__reason": {"name": "invoice_discounts__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__reason", "block_contents": "Reason the discount is given"}, "doc.tamanu_source_dbt.invoice_discounts__is_manual": {"name": "invoice_discounts__is_manual", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__is_manual", "block_contents": "Indicates if the discount was manually added or based on an assessment"}, "doc.tamanu_source_dbt.invoice_discounts__applied_by_user_id": {"name": "invoice_discounts__applied_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__applied_by_user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users) who applied this discount."}, "doc.tamanu_source_dbt.invoice_discounts__applied_time": {"name": "invoice_discounts__applied_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__applied_time", "block_contents": "When this discount was applied."}, "doc.tamanu_source_dbt.table__invoice_insurance_plans": {"name": "table__invoice_insurance_plans", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_insurance_plans", "block_contents": "Table for insurance contracts used for invoicing."}, "doc.tamanu_source_dbt.invoice_insurance_plans__code": {"name": "invoice_insurance_plans__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plans__code", "block_contents": "Unique identifier code for the insurance contract."}, "doc.tamanu_source_dbt.invoice_insurance_plans__name": {"name": "invoice_insurance_plans__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plans__name", "block_contents": "Human-readable name of the insurance contract."}, "doc.tamanu_source_dbt.invoice_insurance_plans__default_coverage": {"name": "invoice_insurance_plans__default_coverage", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plans__default_coverage", "block_contents": "The default coverage (in percentage) of the insurance contract."}, "doc.tamanu_source_dbt.table__invoice_insurance_plan_items": {"name": "table__invoice_insurance_plan_items", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plan_items.md", "original_file_path": "models\\sources\\invoice_insurance_plan_items.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_insurance_plan_items", "block_contents": "Table for insurance contract items used for invoicing."}, "doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_insurance_plan_id": {"name": "invoice_insurance_plan_items__invoice_insurance_plan_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plan_items.md", "original_file_path": "models\\sources\\invoice_insurance_plan_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_insurance_plan_id", "block_contents": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans)."}, "doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_product_id": {"name": "invoice_insurance_plan_items__invoice_product_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plan_items.md", "original_file_path": "models\\sources\\invoice_insurance_plan_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_product_id", "block_contents": "Reference to the [invoice product](#!/source/source.tamanu.tamanu.invoice_products)."}, "doc.tamanu_source_dbt.invoice_insurance_plan_items__coverage_value": {"name": "invoice_insurance_plan_items__coverage_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plan_items.md", "original_file_path": "models\\sources\\invoice_insurance_plan_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plan_items__coverage_value", "block_contents": "The amount of coverage (in percentage) of the insurance contract item."}, "doc.tamanu_source_dbt.table__invoice_insurer_payments": {"name": "table__invoice_insurer_payments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_insurer_payments", "block_contents": "Extra metadata about a payment when it was done by a patient."}, "doc.tamanu_source_dbt.invoice_insurer_payments__invoice_payment_id": {"name": "invoice_insurer_payments__invoice_payment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurer_payments__invoice_payment_id", "block_contents": "The [payment](#!/source/source.tamanu.tamanu.invoice_payments)."}, "doc.tamanu_source_dbt.invoice_insurer_payments__insurer_id": {"name": "invoice_insurer_payments__insurer_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurer_payments__insurer_id", "block_contents": "The insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.invoice_insurer_payments__status": {"name": "invoice_insurer_payments__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurer_payments__status", "block_contents": "The status of this payment.\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`"}, "doc.tamanu_source_dbt.invoice_insurer_payments__reason": {"name": "invoice_insurer_payments__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurer_payments__reason", "block_contents": "The reason for the payment. Generally this is used for rejections."}, "doc.tamanu_source_dbt.table__invoice_items": {"name": "table__invoice_items", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_items", "block_contents": "Items (products) on invoices."}, "doc.tamanu_source_dbt.invoice_items__invoice_id": {"name": "invoice_items__invoice_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__invoice_id", "block_contents": "The [invoice](#!/source/source.tamanu.tamanu.invoices)."}, "doc.tamanu_source_dbt.invoice_items__order_date": {"name": "invoice_items__order_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__order_date", "block_contents": "When the item was ordered."}, "doc.tamanu_source_dbt.invoice_items__product_id": {"name": "invoice_items__product_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__product_id", "block_contents": "The [product](#!/source/source.tamanu.tamanu.invoice_products)."}, "doc.tamanu_source_dbt.invoice_items__quantity": {"name": "invoice_items__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__quantity", "block_contents": "Quantity ordered."}, "doc.tamanu_source_dbt.invoice_items__ordered_by_user_id": {"name": "invoice_items__ordered_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__ordered_by_user_id", "block_contents": "[Who](#!/source/source.tamanu.tamanu.users) ordered the item."}, "doc.tamanu_source_dbt.invoice_items__product_name_final": {"name": "invoice_items__product_name_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__product_name_final", "block_contents": "The final product name used on the invoice. Saved from the product name field when the invoice is finalised."}, "doc.tamanu_source_dbt.invoice_items__manual_entry_price": {"name": "invoice_items__manual_entry_price", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__manual_entry_price", "block_contents": "Manually entered price override for this item, if specified. When set, this takes precedence over the product's standard price."}, "doc.tamanu_source_dbt.invoice_items__note": {"name": "invoice_items__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__note", "block_contents": "Free-form note for this item."}, "doc.tamanu_source_dbt.invoice_items__source_record_type": {"name": "invoice_items__source_record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__source_record_type", "block_contents": "The underlying model that the source record belongs to."}, "doc.tamanu_source_dbt.invoice_items__source_record_id": {"name": "invoice_items__source_record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__source_record_id", "block_contents": "Foreign key relation for record type."}, "doc.tamanu_source_dbt.invoice_items__product_code_final": {"name": "invoice_items__product_code_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__product_code_final", "block_contents": "The final product code used on the invoice. Saved from the product code field when the invoice is finalised."}, "doc.tamanu_source_dbt.invoice_items__price_final": {"name": "invoice_items__price_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__price_final", "block_contents": "The final price per unit for this item on the invoice. This is determined by the manual_entry_price if provided, otherwise from the product's price when the invoice is finalised."}, "doc.tamanu_source_dbt.invoice_items__approved": {"name": "invoice_items__approved", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__approved", "block_contents": "A boolean field that enables clinicians to track the approval status of individual invoice line items"}, "doc.tamanu_source_dbt.table__invoice_item_discounts": {"name": "table__invoice_item_discounts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_item_discounts", "block_contents": "Discounts applied to invoice items."}, "doc.tamanu_source_dbt.invoice_item_discounts__invoice_item_id": {"name": "invoice_item_discounts__invoice_item_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_discounts__invoice_item_id", "block_contents": "The [invoice item](#!/source/source.tamanu.tamanu.invoice_items)."}, "doc.tamanu_source_dbt.invoice_item_discounts__reason": {"name": "invoice_item_discounts__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_discounts__reason", "block_contents": "Free-form reason for the discount."}, "doc.tamanu_source_dbt.invoice_item_discounts__amount": {"name": "invoice_item_discounts__amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_discounts__amount", "block_contents": "Discount amount of invoice items (can be percentage or a whole number)"}, "doc.tamanu_source_dbt.invoice_item_discounts__type": {"name": "invoice_item_discounts__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_discounts__type", "block_contents": "Discount type of invoice items"}, "doc.tamanu_source_dbt.table__invoice_item_finalised_insurances": {"name": "table__invoice_item_finalised_insurances", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_finalised_insurances.md", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_item_finalised_insurances", "block_contents": "Finalised insurance coverage values for invoice items.\r\n\r\nThis table stores the insurance coverage amounts that were locked in when an invoice item is finalised, \r\npreserving the coverage percentage at that point in time even if the insurance plan's coverage changes later."}, "doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_item_id": {"name": "invoice_item_finalised_insurances__invoice_item_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_finalised_insurances.md", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_item_id", "block_contents": "The [invoice item](#!/source/source.tamanu.tamanu.invoice_items) this insurance coverage applies to."}, "doc.tamanu_source_dbt.invoice_item_finalised_insurances__coverage_value_final": {"name": "invoice_item_finalised_insurances__coverage_value_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_finalised_insurances.md", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_finalised_insurances__coverage_value_final", "block_contents": "The finalised coverage percentage for this invoice item.\r\n\r\nThis value is copied from the insurance plan's coverage at the time the invoice item is finalised,\r\npreserving it for the record even if the insurance plan's coverage percentage changes later."}, "doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_insurance_plan_id": {"name": "invoice_item_finalised_insurances__invoice_insurance_plan_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_finalised_insurances.md", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_insurance_plan_id", "block_contents": "The [insurance plan](#!/source/source.tamanu.tamanu.invoice_insurance_plans) providing the coverage."}, "doc.tamanu_source_dbt.table__invoice_patient_payments": {"name": "table__invoice_patient_payments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_patient_payments.md", "original_file_path": "models\\sources\\invoice_patient_payments.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_patient_payments", "block_contents": "Extra metadata about a payment when it was done by a patient."}, "doc.tamanu_source_dbt.invoice_patient_payments__invoice_payment_id": {"name": "invoice_patient_payments__invoice_payment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_patient_payments.md", "original_file_path": "models\\sources\\invoice_patient_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_patient_payments__invoice_payment_id", "block_contents": "The [payment](#!/source/source.tamanu.tamanu.invoice_payments)."}, "doc.tamanu_source_dbt.invoice_patient_payments__method_id": {"name": "invoice_patient_payments__method_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_patient_payments.md", "original_file_path": "models\\sources\\invoice_patient_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_patient_payments__method_id", "block_contents": "The method used to pay ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.invoice_patient_payments__cheque_number": {"name": "invoice_patient_payments__cheque_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_patient_payments.md", "original_file_path": "models\\sources\\invoice_patient_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_patient_payments__cheque_number", "block_contents": "The cheque number for cheque payments."}, "doc.tamanu_source_dbt.table__invoice_payments": {"name": "table__invoice_payments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_payments", "block_contents": "Individual payment against an invoice.\r\n\r\nInvoices can be paid in installments, by different parties, etc."}, "doc.tamanu_source_dbt.invoice_payments__invoice_id": {"name": "invoice_payments__invoice_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_payments__invoice_id", "block_contents": "The [invoice](#!/source/source.tamanu.tamanu.invoices)."}, "doc.tamanu_source_dbt.invoice_payments__receipt_number": {"name": "invoice_payments__receipt_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_payments__receipt_number", "block_contents": "Receipt number. Usually auto-generated."}, "doc.tamanu_source_dbt.invoice_payments__amount": {"name": "invoice_payments__amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_payments__amount", "block_contents": "Amount paid."}, "doc.tamanu_source_dbt.invoice_payments__updated_by_user_id": {"name": "invoice_payments__updated_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_payments__updated_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this invoice payment."}, "doc.tamanu_source_dbt.table__invoice_price_lists": {"name": "table__invoice_price_lists", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_lists.md", "original_file_path": "models\\sources\\invoice_price_lists.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_price_lists", "block_contents": "Contains price list definitions used for invoice line item pricing. Each price list represents a set of pricing rules that can be applied to different types of invoices, patients, or services."}, "doc.tamanu_source_dbt.invoice_price_lists__code": {"name": "invoice_price_lists__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_lists.md", "original_file_path": "models\\sources\\invoice_price_lists.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_lists__code", "block_contents": "Unique identifier code for the price list. Used for referencing the price list in business logic and integrations."}, "doc.tamanu_source_dbt.invoice_price_lists__name": {"name": "invoice_price_lists__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_lists.md", "original_file_path": "models\\sources\\invoice_price_lists.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_lists__name", "block_contents": "Human-readable name of the price list, displayed in user interfaces and reports."}, "doc.tamanu_source_dbt.invoice_price_lists__rules": {"name": "invoice_price_lists__rules", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_lists.md", "original_file_path": "models\\sources\\invoice_price_lists.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_lists__rules", "block_contents": "JSON configuration containing the pricing rules and logic for this price list. Defines how prices are calculated or retrieved for invoice line items."}, "doc.tamanu_source_dbt.table__invoice_price_list_items": {"name": "table__invoice_price_list_items", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_price_list_items", "block_contents": "Contains individual pricing entries for specific products within a price list. Each record defines the price or pricing configuration for a particular product in the context of a specific price list."}, "doc.tamanu_source_dbt.invoice_price_list_items__invoice_price_list_id": {"name": "invoice_price_list_items__invoice_price_list_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_list_items__invoice_price_list_id", "block_contents": "Foreign key reference to the invoice_price_lists table. Links this pricing item to its parent price list."}, "doc.tamanu_source_dbt.invoice_price_list_items__invoice_product_id": {"name": "invoice_price_list_items__invoice_product_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_list_items__invoice_product_id", "block_contents": "Foreign key reference to the invoice products/services that can be priced. Identifies which product or service this pricing item applies to."}, "doc.tamanu_source_dbt.invoice_price_list_items__price": {"name": "invoice_price_list_items__price", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_list_items__price", "block_contents": "The price amount for this product in the context of this price list. Stored as a numeric value representing the cost in the system's base currency."}, "doc.tamanu_source_dbt.invoice_price_list_items__is_hidden": {"name": "invoice_price_list_items__is_hidden", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_list_items__is_hidden", "block_contents": "Determines whether the related invoice product should be hidden from searches on the frontend and also whether it should be automatically added to the invoice."}, "doc.tamanu_source_dbt.table__invoice_products": {"name": "table__invoice_products", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_products", "block_contents": "Products which can be invoiced."}, "doc.tamanu_source_dbt.invoice_products__name": {"name": "invoice_products__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__name", "block_contents": "Name of the product."}, "doc.tamanu_source_dbt.invoice_products__category": {"name": "invoice_products__category", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__category", "block_contents": "The category of the product."}, "doc.tamanu_source_dbt.invoice_products__source_record_type": {"name": "invoice_products__source_record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__source_record_type", "block_contents": "The underlying database model of the source record for the product."}, "doc.tamanu_source_dbt.invoice_products__source_record_id": {"name": "invoice_products__source_record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__source_record_id", "block_contents": "The id of the source record for the product."}, "doc.tamanu_source_dbt.invoice_products__insurable": {"name": "invoice_products__insurable", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__insurable", "block_contents": "Whether or not discounts can be applied to a product"}, "doc.tamanu_source_dbt.table__ips_requests": {"name": "table__ips_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.table__ips_requests", "block_contents": "Queue of requests to generate [International Patient Summaries](https://international-patient-summary.net/) (IPS)."}, "doc.tamanu_source_dbt.ips_requests__patient_id": {"name": "ips_requests__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.ips_requests__created_by": {"name": "ips_requests__created_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__created_by", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who created this request."}, "doc.tamanu_source_dbt.ips_requests__status": {"name": "ips_requests__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__status", "block_contents": "Processing status."}, "doc.tamanu_source_dbt.ips_requests__email": {"name": "ips_requests__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__email", "block_contents": "Email to send the generated IPS to."}, "doc.tamanu_source_dbt.ips_requests__error": {"name": "ips_requests__error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__error", "block_contents": "If processing fails, the error."}, "doc.tamanu_source_dbt.table__lab_requests": {"name": "table__lab_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.table__lab_requests", "block_contents": "Lab requests are the entrypoint of laboratory workflows in Tamanu.\r\n\r\nEach row is a request for a laboratory to perform a group of tests on a sample taken from a patient.\r\n\r\nIt will be updated over the course of the workflow to various statuses, starting with\r\n`reception_pending` (lab has not received the request yet), up to `published` (lab has completed the\r\ntests and has attached verified results).\r\n\r\nSee also: `lab_request_attachments`, `lab_request_logs`, `lab_results`, `lab_tests`,\r\n`lab_test_panels`, and related tables to those."}, "doc.tamanu_source_dbt.lab_requests__sample_time": {"name": "lab_requests__sample_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__sample_time", "block_contents": "When the sample was collected."}, "doc.tamanu_source_dbt.lab_requests__requested_date": {"name": "lab_requests__requested_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__requested_date", "block_contents": "When the request was submitted."}, "doc.tamanu_source_dbt.lab_requests__urgent": {"name": "lab_requests__urgent", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__urgent", "block_contents": "Deprecated."}, "doc.tamanu_source_dbt.lab_requests__specimen_attached": {"name": "lab_requests__specimen_attached", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__specimen_attached", "block_contents": "Whether a specimen is attached.\r\n\r\nThis implies `specimen_type_id`."}, "doc.tamanu_source_dbt.lab_requests__status": {"name": "lab_requests__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__status", "block_contents": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`"}, "doc.tamanu_source_dbt.lab_requests__senaite_id": {"name": "lab_requests__senaite_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__senaite_id", "block_contents": "When the [SENAITE](https://www.senaite.com/) integration is enabled, this is filled to the SENAITE\r\nID for the request."}, "doc.tamanu_source_dbt.lab_requests__sample_id": {"name": "lab_requests__sample_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__sample_id", "block_contents": "When the [SENAITE](https://www.senaite.com/) integration is enabled, this is filled to the SENAITE\r\nID for the sample."}, "doc.tamanu_source_dbt.lab_requests__requested_by_id": {"name": "lab_requests__requested_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__requested_by_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request."}, "doc.tamanu_source_dbt.lab_requests__encounter_id": {"name": "lab_requests__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__encounter_id", "block_contents": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) the request is a part of."}, "doc.tamanu_source_dbt.lab_requests__lab_test_category_id": {"name": "lab_requests__lab_test_category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_test_category_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ncategory of this request's test."}, "doc.tamanu_source_dbt.lab_requests__display_id": {"name": "lab_requests__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__display_id", "block_contents": "Short unique identifier used on the frontend."}, "doc.tamanu_source_dbt.lab_requests__lab_test_priority_id": {"name": "lab_requests__lab_test_priority_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_test_priority_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request."}, "doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id": {"name": "lab_requests__lab_test_laboratory_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request."}, "doc.tamanu_source_dbt.lab_requests__sample_time_legacy": {"name": "lab_requests__sample_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__sample_time_legacy", "block_contents": "[Deprecated] When the sample was collected."}, "doc.tamanu_source_dbt.lab_requests__requested_date_legacy": {"name": "lab_requests__requested_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__requested_date_legacy", "block_contents": "[Deprecated] When the request was submitted."}, "doc.tamanu_source_dbt.lab_requests__reason_for_cancellation": {"name": "lab_requests__reason_for_cancellation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__reason_for_cancellation", "block_contents": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`"}, "doc.tamanu_source_dbt.lab_requests__department_id": {"name": "lab_requests__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__department_id", "block_contents": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) the request comes from."}, "doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id": {"name": "lab_requests__lab_test_panel_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id", "block_contents": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any."}, "doc.tamanu_source_dbt.lab_requests__lab_sample_site_id": {"name": "lab_requests__lab_sample_site_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_sample_site_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing where\r\non the patient the sample was taken."}, "doc.tamanu_source_dbt.lab_requests__published_date": {"name": "lab_requests__published_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__published_date", "block_contents": "When this lab request's results were published."}, "doc.tamanu_source_dbt.lab_requests__specimen_type_id": {"name": "lab_requests__specimen_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__specimen_type_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified."}, "doc.tamanu_source_dbt.lab_requests__collected_by_id": {"name": "lab_requests__collected_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__collected_by_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample."}, "doc.tamanu_source_dbt.lab_requests__results_interpretation": {"name": "lab_requests__results_interpretation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__results_interpretation", "block_contents": "Free-text interpretation and clinical commentary on the laboratory test results."}, "doc.tamanu_source_dbt.table__lab_request_attachments": {"name": "table__lab_request_attachments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.table__lab_request_attachments", "block_contents": "Attachments (uploaded documents) to a lab request.\r\n\r\nThis could be forms for authorisation or consent, notes, instructions, etc."}, "doc.tamanu_source_dbt.lab_request_attachments__attachment_id": {"name": "lab_request_attachments__attachment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.lab_request_attachments__attachment_id", "block_contents": "The [attachment](#!/source/source.tamanu.tamanu.attachments) (obtained by uploading the file)."}, "doc.tamanu_source_dbt.lab_request_attachments__lab_request_id": {"name": "lab_request_attachments__lab_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.lab_request_attachments__lab_request_id", "block_contents": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests)."}, "doc.tamanu_source_dbt.lab_request_attachments__title": {"name": "lab_request_attachments__title", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.lab_request_attachments__title", "block_contents": "Short name of the attachment."}, "doc.tamanu_source_dbt.lab_request_attachments__replaced_by_id": {"name": "lab_request_attachments__replaced_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.lab_request_attachments__replaced_by_id", "block_contents": "Another lab request attachment which replaces this one."}, "doc.tamanu_source_dbt.table__lab_request_logs": {"name": "table__lab_request_logs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_logs.md", "original_file_path": "models\\sources\\lab_request_logs.md", "unique_id": "doc.tamanu_source_dbt.table__lab_request_logs", "block_contents": "This is a log of who changed the status of a lab request when."}, "doc.tamanu_source_dbt.lab_request_logs__status": {"name": "lab_request_logs__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_logs.md", "original_file_path": "models\\sources\\lab_request_logs.md", "unique_id": "doc.tamanu_source_dbt.lab_request_logs__status", "block_contents": "The status the lab request was updated to."}, "doc.tamanu_source_dbt.lab_request_logs__lab_request_id": {"name": "lab_request_logs__lab_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_logs.md", "original_file_path": "models\\sources\\lab_request_logs.md", "unique_id": "doc.tamanu_source_dbt.lab_request_logs__lab_request_id", "block_contents": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests)."}, "doc.tamanu_source_dbt.lab_request_logs__updated_by_id": {"name": "lab_request_logs__updated_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_logs.md", "original_file_path": "models\\sources\\lab_request_logs.md", "unique_id": "doc.tamanu_source_dbt.lab_request_logs__updated_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this lab request."}, "doc.tamanu_source_dbt.table__lab_tests": {"name": "table__lab_tests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.table__lab_tests", "block_contents": "A single test as part of a [lab request](#!/source/source.tamanu.tamanu.lab_requests)."}, "doc.tamanu_source_dbt.lab_tests__result": {"name": "lab_tests__result", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__result", "block_contents": "The result of the test."}, "doc.tamanu_source_dbt.lab_tests__lab_request_id": {"name": "lab_tests__lab_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__lab_request_id", "block_contents": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this test is part of."}, "doc.tamanu_source_dbt.lab_tests__lab_test_type_id": {"name": "lab_tests__lab_test_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__lab_test_type_id", "block_contents": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test."}, "doc.tamanu_source_dbt.lab_tests__category_id": {"name": "lab_tests__category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__category_id", "block_contents": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test."}, "doc.tamanu_source_dbt.lab_tests__lab_test_method_id": {"name": "lab_tests__lab_test_method_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__lab_test_method_id", "block_contents": "Reference to the method ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test."}, "doc.tamanu_source_dbt.lab_tests__laboratory_officer": {"name": "lab_tests__laboratory_officer", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__laboratory_officer", "block_contents": "Name of the lab officer performing the test."}, "doc.tamanu_source_dbt.lab_tests__completed_date": {"name": "lab_tests__completed_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__completed_date", "block_contents": "Datetime at which the test was completed."}, "doc.tamanu_source_dbt.lab_tests__verification": {"name": "lab_tests__verification", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__verification", "block_contents": "Free-form field for a verification indication.\r\n\r\nMay be a verifying or supervising officer's name, a department, lab notes..."}, "doc.tamanu_source_dbt.lab_tests__completed_date_legacy": {"name": "lab_tests__completed_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__completed_date_legacy", "block_contents": "[Deprecated] Timestamp at which the test was completed."}, "doc.tamanu_source_dbt.table__lab_test_panels": {"name": "table__lab_test_panels", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.table__lab_test_panels", "block_contents": "A panel is a collection of lab test types, usually standardised.\r\n\r\nFor example the BMP (basic metabolic panel) is a panel of 8 blood tests. Instead of ordering all 8\r\ntests individually, a clinician can order the panel all at once. This may also used to more\r\nefficiently use samples.\r\n\r\nThis table defines the available test panels, and\r\n[`lab_test_panel_lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_panel_lab_test_types)\r\ncontains the actual test types that are part of each panel. See\r\n[`lab_test_panel_requests`](#!/source/source.tamanu.tamanu.lab_test_panel_requests) for requesting\r\npanels specifically, and [`lab_test_requests`](#!/source/source.tamanu.tamanu.lab_test_requests) for\r\nrequesting lab tests in general."}, "doc.tamanu_source_dbt.lab_test_panels__name": {"name": "lab_test_panels__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panels__name", "block_contents": "Name of the test panel."}, "doc.tamanu_source_dbt.lab_test_panels__code": {"name": "lab_test_panels__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panels__code", "block_contents": "Internal Tamanu code of the panel."}, "doc.tamanu_source_dbt.lab_test_panels__external_code": {"name": "lab_test_panels__external_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panels__external_code", "block_contents": "External code, such as for interfacing with LIMS."}, "doc.tamanu_source_dbt.lab_test_panels__category_id": {"name": "lab_test_panels__category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panels__category_id", "block_contents": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel."}, "doc.tamanu_source_dbt.table__lab_test_panel_lab_test_types": {"name": "table__lab_test_panel_lab_test_types", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_lab_test_types.md", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.table__lab_test_panel_lab_test_types", "block_contents": "The lab tests contained in a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about lab test\r\npanels, and [`lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_types) for the test types."}, "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_panel_id": {"name": "lab_test_panel_lab_test_types__lab_test_panel_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_lab_test_types.md", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_panel_id", "block_contents": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels)."}, "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_type_id": {"name": "lab_test_panel_lab_test_types__lab_test_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_lab_test_types.md", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_type_id", "block_contents": "The [test type](#!/source/source.tamanu.tamanu.lab_test_types)."}, "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__order": {"name": "lab_test_panel_lab_test_types__order", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_lab_test_types.md", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__order", "block_contents": "The position of this test within the panel, used to control the display\r\nand processing order of lab tests in a lab test panel. Lower values are\r\nshown and processed before higher values."}, "doc.tamanu_source_dbt.table__lab_test_panel_requests": {"name": "table__lab_test_panel_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_requests.md", "original_file_path": "models\\sources\\lab_test_panel_requests.md", "unique_id": "doc.tamanu_source_dbt.table__lab_test_panel_requests", "block_contents": "A request for a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about those."}, "doc.tamanu_source_dbt.lab_test_panel_requests__lab_test_panel_id": {"name": "lab_test_panel_requests__lab_test_panel_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_requests.md", "original_file_path": "models\\sources\\lab_test_panel_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_requests__lab_test_panel_id", "block_contents": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels)."}, "doc.tamanu_source_dbt.lab_test_panel_requests__encounter_id": {"name": "lab_test_panel_requests__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_requests.md", "original_file_path": "models\\sources\\lab_test_panel_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_requests__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this lab test panel request is a part of."}, "doc.tamanu_source_dbt.table__lab_test_types": {"name": "table__lab_test_types", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.table__lab_test_types", "block_contents": "A kind of test that's possible to request.\r\n\r\nThis includes information about the test itself, and also parameters around result formatting, like\r\ndata type, expected ranges, etc."}, "doc.tamanu_source_dbt.lab_test_types__code": {"name": "lab_test_types__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__code", "block_contents": "Internal Tamanu code of the test."}, "doc.tamanu_source_dbt.lab_test_types__name": {"name": "lab_test_types__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__name", "block_contents": "Human-friendly name of the test."}, "doc.tamanu_source_dbt.lab_test_types__unit": {"name": "lab_test_types__unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__unit", "block_contents": "Unit the test result is measured in."}, "doc.tamanu_source_dbt.lab_test_types__male_min": {"name": "lab_test_types__male_min", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__male_min", "block_contents": "Minimum typical range for males."}, "doc.tamanu_source_dbt.lab_test_types__male_max": {"name": "lab_test_types__male_max", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__male_max", "block_contents": "Maximum typical range for males."}, "doc.tamanu_source_dbt.lab_test_types__female_min": {"name": "lab_test_types__female_min", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__female_min", "block_contents": "Minimum typical range for females."}, "doc.tamanu_source_dbt.lab_test_types__female_max": {"name": "lab_test_types__female_max", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__female_max", "block_contents": "Maximum typical range for females."}, "doc.tamanu_source_dbt.lab_test_types__range_text": {"name": "lab_test_types__range_text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__range_text", "block_contents": "Unused."}, "doc.tamanu_source_dbt.lab_test_types__result_type": {"name": "lab_test_types__result_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__result_type", "block_contents": "Input type of result.\r\n\r\nOne of:\r\n- `FreeText`\r\n- `Number`\r\n- `Select`"}, "doc.tamanu_source_dbt.lab_test_types__options": {"name": "lab_test_types__options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__options", "block_contents": "Comma-separated list of options. Unused."}, "doc.tamanu_source_dbt.lab_test_types__lab_test_category_id": {"name": "lab_test_types__lab_test_category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__lab_test_category_id", "block_contents": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test."}, "doc.tamanu_source_dbt.lab_test_types__external_code": {"name": "lab_test_types__external_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__external_code", "block_contents": "External code for the test (such as for LIMS)."}, "doc.tamanu_source_dbt.lab_test_types__is_sensitive": {"name": "lab_test_types__is_sensitive", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__is_sensitive", "block_contents": "Used to indicate if the lab test type is sensitive and should be hidden accordingly."}, "doc.tamanu_source_dbt.table__local_system_facts": {"name": "table__local_system_facts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\local_system_facts.md", "original_file_path": "models\\sources\\local_system_facts.md", "unique_id": "doc.tamanu_source_dbt.table__local_system_facts", "block_contents": "A set of values that are proper to this installation of Tamanu.\r\n\r\nThese are never synchronised.\r\nUsage is entirely internal to Tamanu and should never be used externally."}, "doc.tamanu_source_dbt.local_system_facts__key": {"name": "local_system_facts__key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\local_system_facts.md", "original_file_path": "models\\sources\\local_system_facts.md", "unique_id": "doc.tamanu_source_dbt.local_system_facts__key", "block_contents": "Key of the fact."}, "doc.tamanu_source_dbt.local_system_facts__value": {"name": "local_system_facts__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\local_system_facts.md", "original_file_path": "models\\sources\\local_system_facts.md", "unique_id": "doc.tamanu_source_dbt.local_system_facts__value", "block_contents": "Value of the fact.\r\n\r\nThis is `text`, but may be interpreted as other things, e.g. JSON objects or numbers."}, "doc.tamanu_source_dbt.table__locations": {"name": "table__locations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.table__locations", "block_contents": "Information on the hospital locations."}, "doc.tamanu_source_dbt.locations__code": {"name": "locations__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__code", "block_contents": "Code for location"}, "doc.tamanu_source_dbt.locations__name": {"name": "locations__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__name", "block_contents": "Full readable name for location"}, "doc.tamanu_source_dbt.locations__max_occupancy": {"name": "locations__max_occupancy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__max_occupancy", "block_contents": "The maximum number of patients that can be in this location"}, "doc.tamanu_source_dbt.locations__facility_id": {"name": "locations__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location is in."}, "doc.tamanu_source_dbt.locations__location_group_id": {"name": "locations__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__location_group_id", "block_contents": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in."}, "doc.tamanu_source_dbt.table__location_assignments": {"name": "table__location_assignments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.table__location_assignments", "block_contents": "Individual location assignment records representing specific time periods when healthcare staff are scheduled to work at particular locations."}, "doc.tamanu_source_dbt.location_assignments__user_id": {"name": "location_assignments__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) assigned to this location."}, "doc.tamanu_source_dbt.location_assignments__location_id": {"name": "location_assignments__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) where the user is assigned."}, "doc.tamanu_source_dbt.location_assignments__start_time": {"name": "location_assignments__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__start_time", "block_contents": "Start time of the assignment period."}, "doc.tamanu_source_dbt.location_assignments__end_time": {"name": "location_assignments__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__end_time", "block_contents": "End time of the assignment period."}, "doc.tamanu_source_dbt.location_assignments__template_id": {"name": "location_assignments__template_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__template_id", "block_contents": "Reference to the [location assignment template](#!/source/source.tamanu.tamanu.location_assignment_templates) that generated this assignment."}, "doc.tamanu_source_dbt.table__location_assignment_templates": {"name": "table__location_assignment_templates", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.table__location_assignment_templates", "block_contents": "Templates for recurring location assignments that define when healthcare staff are scheduled to work at specific locations."}, "doc.tamanu_source_dbt.location_assignment_templates__user_id": {"name": "location_assignment_templates__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) assigned to this location."}, "doc.tamanu_source_dbt.location_assignment_templates__location_id": {"name": "location_assignment_templates__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) where the user is assigned."}, "doc.tamanu_source_dbt.location_assignment_templates__start_time": {"name": "location_assignment_templates__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__start_time", "block_contents": "Start time of the daily assignment period."}, "doc.tamanu_source_dbt.location_assignment_templates__end_time": {"name": "location_assignment_templates__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__end_time", "block_contents": "End time of the daily assignment period."}, "doc.tamanu_source_dbt.location_assignment_templates__repeat_end_date": {"name": "location_assignment_templates__repeat_end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__repeat_end_date", "block_contents": "Date when the repeating assignments should stop being generated."}, "doc.tamanu_source_dbt.location_assignment_templates__repeat_frequency": {"name": "location_assignment_templates__repeat_frequency", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__repeat_frequency", "block_contents": "Number of frequency units between each assignment (e.g., every 2 weeks)."}, "doc.tamanu_source_dbt.location_assignment_templates__repeat_unit": {"name": "location_assignment_templates__repeat_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__repeat_unit", "block_contents": "Frequency unit for repeating assignments.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`"}, "doc.tamanu_source_dbt.table__location_groups": {"name": "table__location_groups", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.table__location_groups", "block_contents": "A group of locations managed as a single unit (e.g. a ward in hospital)"}, "doc.tamanu_source_dbt.location_groups__name": {"name": "location_groups__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.location_groups__name", "block_contents": "Full readable name for location group"}, "doc.tamanu_source_dbt.location_groups__code": {"name": "location_groups__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.location_groups__code", "block_contents": "Code for location group"}, "doc.tamanu_source_dbt.location_groups__facility_id": {"name": "location_groups__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.location_groups__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location group is in."}, "doc.tamanu_source_dbt.location_groups__is_bookable": {"name": "location_groups__is_bookable", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.location_groups__is_bookable", "block_contents": "Controls whether and where this location group appears in the booking calendar: \r\n- `all`: shown on both views \r\n- `weekly`: shown only on weekly view\r\n- `daily`: shown only on daily view\r\n- `no`: hidden from calendar (default)"}, "doc.tamanu_source_dbt.table__medication_administration_records": {"name": "table__medication_administration_records", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.table__medication_administration_records", "block_contents": "Records of medication administrations to patients, tracking when medications prescribed in the system were given, not given, or otherwise administered."}, "doc.tamanu_source_dbt.medication_administration_records__status": {"name": "medication_administration_records__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__status", "block_contents": "Status of the medication administration.\r\n\r\nOne of:\r\n- `GIVEN` - The medication was administered to the patient\r\n- `NOT_GIVEN` - The medication was not administered to the patient"}, "doc.tamanu_source_dbt.medication_administration_records__prescription_id": {"name": "medication_administration_records__prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__prescription_id", "block_contents": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions) that this administration record is associated with. Links this administration event to the specific medication order it fulfills."}, "doc.tamanu_source_dbt.medication_administration_records__due_at": {"name": "medication_administration_records__due_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__due_at", "block_contents": "The scheduled date and time when the medication administration was planned to occur, based on the prescription's frequency and start date."}, "doc.tamanu_source_dbt.medication_administration_records__recorded_at": {"name": "medication_administration_records__recorded_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__recorded_at", "block_contents": "The timestamp indicating when the administration status (e.g., `GIVEN` or `NOT_GIVEN`) was actually recorded in the system. May be null if the status has not yet been recorded."}, "doc.tamanu_source_dbt.medication_administration_records__recorded_by_user_id": {"name": "medication_administration_records__recorded_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__recorded_by_user_id", "block_contents": "Reference to the [user](#!/model/model.public.users) who recorded that the medication was given or not given."}, "doc.tamanu_source_dbt.medication_administration_records__reason_not_given_id": {"name": "medication_administration_records__reason_not_given_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__reason_not_given_id", "block_contents": "Reference to the reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why the medication was not administered to the patient. Only applicable when status is `NOT_GIVEN`."}, "doc.tamanu_source_dbt.medication_administration_records__is_auto_generated": {"name": "medication_administration_records__is_auto_generated", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__is_auto_generated", "block_contents": "Indicates whether this administration record was automatically generated by the system based on the prescription's frequency and schedule. This is typically true for scheduled medications and false for one-time or as-needed medications."}, "doc.tamanu_source_dbt.medication_administration_records__changing_status_reason": {"name": "medication_administration_records__changing_status_reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__changing_status_reason", "block_contents": "Optional free text field that allows healthcare professionals to document the reason for changing the status of a medication administration record. This is particularly useful when changing a previously recorded status to a different one."}, "doc.tamanu_source_dbt.medication_administration_records__is_error": {"name": "medication_administration_records__is_error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__is_error", "block_contents": "Indicates whether this medication administration record is marked as error."}, "doc.tamanu_source_dbt.medication_administration_records__error_notes": {"name": "medication_administration_records__error_notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__error_notes", "block_contents": "Detailed description of any errors or discrepancies associated with this medication administration record."}, "doc.tamanu_source_dbt.medication_administration_records__changing_not_given_info_reason": {"name": "medication_administration_records__changing_not_given_info_reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__changing_not_given_info_reason", "block_contents": "Optional free text field that allows healthcare professionals to document the reason for modifying information about why a medication was not given. This is used when updating or changing the details of a previously recorded 'not given' status, providing an audit trail of why the information was changed."}, "doc.tamanu_source_dbt.medication_administration_records__is_edited": {"name": "medication_administration_records__is_edited", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__is_edited", "block_contents": "Indicates whether this medication administration record has been manually edited after its initial creation or recording."}, "doc.tamanu_source_dbt.table__medication_administration_record_doses": {"name": "table__medication_administration_record_doses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.table__medication_administration_record_doses", "block_contents": "Stores details about individual doses given as part of a medication administration record. A single administration event may involve multiple distinct doses (e.g., taking two tablets)."}, "doc.tamanu_source_dbt.medication_administration_record_doses__dose_amount": {"name": "medication_administration_record_doses__dose_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__dose_amount", "block_contents": "The amount or quantity of the medication administered in this specific dose entry."}, "doc.tamanu_source_dbt.medication_administration_record_doses__given_time": {"name": "medication_administration_record_doses__given_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__given_time", "block_contents": "The precise date and time when this specific dose was administered to the patient. This may differ slightly from the overall `administered_at` time in the parent record if multiple doses were given sequentially."}, "doc.tamanu_source_dbt.medication_administration_record_doses__given_by_user_id": {"name": "medication_administration_record_doses__given_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__given_by_user_id", "block_contents": "Reference to the [user](#!/model/model.public.users) who physically administered this dose to the patient."}, "doc.tamanu_source_dbt.medication_administration_record_doses__mar_id": {"name": "medication_administration_record_doses__mar_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__mar_id", "block_contents": "Reference to the MAR [medication administration record](#!/model/model.public.medication_administration_records) to which this dose belongs."}, "doc.tamanu_source_dbt.medication_administration_record_doses__recorded_by_user_id": {"name": "medication_administration_record_doses__recorded_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__recorded_by_user_id", "block_contents": "Reference to the [user](#!/model/model.public.users) who recorded the details of this specific dose administration in the system. This may or may not be the same user who physically administered the dose (`given_by_user_id`)."}, "doc.tamanu_source_dbt.medication_administration_record_doses__is_removed": {"name": "medication_administration_record_doses__is_removed", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__is_removed", "block_contents": "Indicates whether this dose record has been removed or voided."}, "doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_removal": {"name": "medication_administration_record_doses__reason_for_removal", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_removal", "block_contents": "A text field explaining why this dose record was removed or voided."}, "doc.tamanu_source_dbt.medication_administration_record_doses__dose_index": {"name": "medication_administration_record_doses__dose_index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__dose_index", "block_contents": "A sequential number indicating the order of this dose within a multi-dose administration. Helps track the sequence when multiple doses are given in a single administration event."}, "doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_change": {"name": "medication_administration_record_doses__reason_for_change", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_change", "block_contents": "A text field documenting the reason for any modifications made to this dose record after it was initially recorded. This helps maintain an audit trail of changes and ensures proper documentation of why dose details were updated."}, "doc.tamanu_source_dbt.table__medication_dispenses": {"name": "table__medication_dispenses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.table__medication_dispenses", "block_contents": "Records of medication dispensing events, tracking when medications from pharmacy orders are physically dispensed to patients. Each record represents a single dispensing event for a specific prescription within a pharmacy order."}, "doc.tamanu_source_dbt.medication_dispenses__pharmacy_order_prescription_id": {"name": "medication_dispenses__pharmacy_order_prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__pharmacy_order_prescription_id", "block_contents": "Reference to the [pharmacy_order_prescription](#!/source/source.tamanu.tamanu.pharmacy_order_prescriptions) that this dispense record fulfills. Links this dispensing event to the specific medication order being filled."}, "doc.tamanu_source_dbt.medication_dispenses__quantity": {"name": "medication_dispenses__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__quantity", "block_contents": "The quantity of medication units dispensed to the patient in each dispensing."}, "doc.tamanu_source_dbt.medication_dispenses__instructions": {"name": "medication_dispenses__instructions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__instructions", "block_contents": "Additional instructions provided to the patient when dispensing the medication, such as dosage guidance, timing, storage requirements, or special considerations for administration."}, "doc.tamanu_source_dbt.medication_dispenses__dispensed_by_user_id": {"name": "medication_dispenses__dispensed_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__dispensed_by_user_id", "block_contents": "Reference to the [user](#!/model/model.public.users) (typically a pharmacist or pharmacy staff member) who dispensed the medication."}, "doc.tamanu_source_dbt.medication_dispenses__dispensed_at": {"name": "medication_dispenses__dispensed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__dispensed_at", "block_contents": "The timestamp indicating when the medication was physically dispensed to the patient."}, "doc.tamanu_source_dbt.table__notes": {"name": "table__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.table__notes", "block_contents": "Notes recorded by clinicians or system generated.\r\n\r\nAlso see the deprecated [`note_items`](#!/source/source.tamanu.tamanu.note_items),\r\n[`note_pages`](#!/source/source.tamanu.tamanu.note_pages), and the even older\r\n[`notes_legacy`](#!/source/source.tamanu.tamanu.notes_legacy).\r\n\r\nThis is the current version (3) of the notes system."}, "doc.tamanu_source_dbt.notes__record_id": {"name": "notes__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__record_id", "block_contents": "Polymorphic relationship to the record to which the note is attached (id)."}, "doc.tamanu_source_dbt.notes__record_type": {"name": "notes__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__record_type", "block_contents": "Polymorphic relationship to the record to which the note is attached (type)."}, "doc.tamanu_source_dbt.notes__content": {"name": "notes__content", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__content", "block_contents": "The content of the note recorded."}, "doc.tamanu_source_dbt.notes__author_id": {"name": "notes__author_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__author_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note."}, "doc.tamanu_source_dbt.notes__on_behalf_of_id": {"name": "notes__on_behalf_of_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__on_behalf_of_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note, if it wasn't the user who published it."}, "doc.tamanu_source_dbt.notes__revised_by_id": {"name": "notes__revised_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__revised_by_id", "block_contents": "Reference to the [note](#!/source/source.tamanu.tamanu.notes) that is being revised."}, "doc.tamanu_source_dbt.notes__note_type_id": {"name": "notes__note_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__note_type_id", "block_contents": "Reference to the note type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = noteType`)."}, "doc.tamanu_source_dbt.table__notes_legacy": {"name": "table__notes_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.table__notes_legacy", "block_contents": "Legacy notes"}, "doc.tamanu_source_dbt.notes_legacy__record_id": {"name": "notes_legacy__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__record_id", "block_contents": "Legacy notes record_id"}, "doc.tamanu_source_dbt.notes_legacy__record_type": {"name": "notes_legacy__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__record_type", "block_contents": "Legacy notes record_type"}, "doc.tamanu_source_dbt.notes_legacy__note_type": {"name": "notes_legacy__note_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__note_type", "block_contents": "Legacy notes note_type"}, "doc.tamanu_source_dbt.notes_legacy__content": {"name": "notes_legacy__content", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__content", "block_contents": "Legacy notes content"}, "doc.tamanu_source_dbt.notes_legacy__author_id": {"name": "notes_legacy__author_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__author_id", "block_contents": "Legacy notes author_id"}, "doc.tamanu_source_dbt.notes_legacy__on_behalf_of_id": {"name": "notes_legacy__on_behalf_of_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__on_behalf_of_id", "block_contents": "Legacy notes on_behalf_of_id"}, "doc.tamanu_source_dbt.table__note_items": {"name": "table__note_items", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.table__note_items", "block_contents": "Version 2 of note management.\r\n\r\nIn this version, notes were split between note pages and actual note (item) content.\r\n\r\nDeprecated.\r\n\r\nSee also [`note_pages`](#!/source/source.tamanu.tamanu.note_pages)."}, "doc.tamanu_source_dbt.note_items__note_page_id": {"name": "note_items__note_page_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__note_page_id", "block_contents": "The [note page](#!/source/source.tamanu.tamanu.note_pages) this item belongs to."}, "doc.tamanu_source_dbt.note_items__revised_by_id": {"name": "note_items__revised_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__revised_by_id", "block_contents": "Reference to the [note_item](#!/source/source.tamanu.tamanu.note_items) that is revised."}, "doc.tamanu_source_dbt.note_items__author_id": {"name": "note_items__author_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__author_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note item."}, "doc.tamanu_source_dbt.note_items__on_behalf_of_id": {"name": "note_items__on_behalf_of_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__on_behalf_of_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note item, if different from `author_id`."}, "doc.tamanu_source_dbt.note_items__content": {"name": "note_items__content", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__content", "block_contents": "Text content of the note."}, "doc.tamanu_source_dbt.table__note_pages": {"name": "table__note_pages", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_pages.md", "original_file_path": "models\\sources\\note_pages.md", "unique_id": "doc.tamanu_source_dbt.table__note_pages", "block_contents": "Version 2 of note management.\r\n\r\nIn this version, notes were split between note pages and actual note (item) content.\r\n\r\nDeprecated.\r\n\r\nSee also [`note_items`](#!/source/source.tamanu.tamanu.note_items)."}, "doc.tamanu_source_dbt.note_pages__note_type": {"name": "note_pages__note_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_pages.md", "original_file_path": "models\\sources\\note_pages.md", "unique_id": "doc.tamanu_source_dbt.note_pages__note_type", "block_contents": "Type of the note page."}, "doc.tamanu_source_dbt.note_pages__record_id": {"name": "note_pages__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_pages.md", "original_file_path": "models\\sources\\note_pages.md", "unique_id": "doc.tamanu_source_dbt.note_pages__record_id", "block_contents": "Polymorphic relationship to the record to which the note is attached (id)."}, "doc.tamanu_source_dbt.note_pages__record_type": {"name": "note_pages__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_pages.md", "original_file_path": "models\\sources\\note_pages.md", "unique_id": "doc.tamanu_source_dbt.note_pages__record_type", "block_contents": "Polymorphic relationship to the record to which the note is attached (type)."}, "doc.tamanu_source_dbt.table__notifications": {"name": "table__notifications", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.table__notifications", "block_contents": "Notifications for the clinician dashboard"}, "doc.tamanu_source_dbt.notifications__type": {"name": "notifications__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__type", "block_contents": "Type of the notification\r\n\r\nOne of:\r\n- `imaging_request`\r\n- `lab_request`"}, "doc.tamanu_source_dbt.notifications__status": {"name": "notifications__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__status", "block_contents": "Status of the notification\r\n\r\nOne of:\r\n- `unread`\r\n- `read`"}, "doc.tamanu_source_dbt.notifications__user_id": {"name": "notifications__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) that get the notification."}, "doc.tamanu_source_dbt.notifications__created_time": {"name": "notifications__created_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__created_time", "block_contents": "When the notification was created"}, "doc.tamanu_source_dbt.notifications__patient_id": {"name": "notifications__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__patient_id", "block_contents": "Related patient of the notification"}, "doc.tamanu_source_dbt.notifications__metadata": {"name": "notifications__metadata", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__metadata", "block_contents": "Metadata of the notification"}, "doc.tamanu_source_dbt.table__one_time_logins": {"name": "table__one_time_logins", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.table__one_time_logins", "block_contents": "One time logins are used for password resets."}, "doc.tamanu_source_dbt.one_time_logins__user_id": {"name": "one_time_logins__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.one_time_logins__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users) for whom this one time login is for."}, "doc.tamanu_source_dbt.one_time_logins__token": {"name": "one_time_logins__token", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.one_time_logins__token", "block_contents": "A random value to use as the login code.\r\n\r\nThis is sent to the user in an email and then entered in a form to reset their password."}, "doc.tamanu_source_dbt.one_time_logins__expires_at": {"name": "one_time_logins__expires_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.one_time_logins__expires_at", "block_contents": "Beyond this time, the one time login can no longer be used."}, "doc.tamanu_source_dbt.one_time_logins__used_at": {"name": "one_time_logins__used_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.one_time_logins__used_at", "block_contents": "When this token was used."}, "doc.tamanu_source_dbt.table__patients": {"name": "table__patients", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.table__patients", "block_contents": "The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table)."}, "doc.tamanu_source_dbt.patients__display_id": {"name": "patients__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__display_id", "block_contents": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table."}, "doc.tamanu_source_dbt.patients__first_name": {"name": "patients__first_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__first_name", "block_contents": "First name of patient"}, "doc.tamanu_source_dbt.patients__middle_name": {"name": "patients__middle_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__middle_name", "block_contents": "Middle name of patient"}, "doc.tamanu_source_dbt.patients__last_name": {"name": "patients__last_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__last_name", "block_contents": "Last name of patient"}, "doc.tamanu_source_dbt.patients__cultural_name": {"name": "patients__cultural_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__cultural_name", "block_contents": "Cultural name of patient"}, "doc.tamanu_source_dbt.patients__email": {"name": "patients__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__email", "block_contents": "Email address of patient"}, "doc.tamanu_source_dbt.patients__date_of_birth": {"name": "patients__date_of_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__date_of_birth", "block_contents": "Date of birth of patient"}, "doc.tamanu_source_dbt.patients__sex": {"name": "patients__sex", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__sex", "block_contents": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`"}, "doc.tamanu_source_dbt.patients__village_id": {"name": "patients__village_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__village_id", "block_contents": "Tamanu village identifier defined in the reference data"}, "doc.tamanu_source_dbt.patients__additional_details": {"name": "patients__additional_details", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__additional_details", "block_contents": "[Deprecated] Additional details of the patient"}, "doc.tamanu_source_dbt.patients__merged_into_id": {"name": "patients__merged_into_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__merged_into_id", "block_contents": "Tamanu identifier for the patient the patient record was merged into"}, "doc.tamanu_source_dbt.patients__date_of_death_legacy": {"name": "patients__date_of_death_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__date_of_death_legacy", "block_contents": "[Deprecated] Timestamp of death of patient"}, "doc.tamanu_source_dbt.patients__date_of_death": {"name": "patients__date_of_death", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__date_of_death", "block_contents": "Date and time of death of patient"}, "doc.tamanu_source_dbt.patients__date_of_birth_legacy": {"name": "patients__date_of_birth_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__date_of_birth_legacy", "block_contents": "[Deprecated] Timestamp of birth of patient"}, "doc.tamanu_source_dbt.table__patient_additional_data": {"name": "table__patient_additional_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.table__patient_additional_data", "block_contents": "Core or adjunct patient data that doesn't fit elsewhere, but is only downloaded to a facility once a\r\npatient is marked for sync.\r\n\r\nThis is often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`, `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and specify custom/non-standard data to be stored against patients."}, "doc.tamanu_source_dbt.patient_additional_data__place_of_birth": {"name": "patient_additional_data__place_of_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__place_of_birth", "block_contents": "Free-form place of birth (typically a place name or country)."}, "doc.tamanu_source_dbt.patient_additional_data__primary_contact_number": {"name": "patient_additional_data__primary_contact_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__primary_contact_number", "block_contents": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`."}, "doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number": {"name": "patient_additional_data__secondary_contact_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number", "block_contents": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`."}, "doc.tamanu_source_dbt.patient_additional_data__marital_status": {"name": "patient_additional_data__marital_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__marital_status", "block_contents": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`"}, "doc.tamanu_source_dbt.patient_additional_data__city_town": {"name": "patient_additional_data__city_town", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__city_town", "block_contents": "Patient current address city or town.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured."}, "doc.tamanu_source_dbt.patient_additional_data__street_village": {"name": "patient_additional_data__street_village", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__street_village", "block_contents": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured."}, "doc.tamanu_source_dbt.patient_additional_data__educational_level": {"name": "patient_additional_data__educational_level", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__educational_level", "block_contents": "Highest educational attainment."}, "doc.tamanu_source_dbt.patient_additional_data__social_media": {"name": "patient_additional_data__social_media", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__social_media", "block_contents": "Free-form social media contact.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`."}, "doc.tamanu_source_dbt.patient_additional_data__blood_type": {"name": "patient_additional_data__blood_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__blood_type", "block_contents": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-`"}, "doc.tamanu_source_dbt.patient_additional_data__title": {"name": "patient_additional_data__title", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__title", "block_contents": "Patient name: title."}, "doc.tamanu_source_dbt.patient_additional_data__ethnicity_id": {"name": "patient_additional_data__ethnicity_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__ethnicity_id", "block_contents": "Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__nationality_id": {"name": "patient_additional_data__nationality_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__nationality_id", "block_contents": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__country_id": {"name": "patient_additional_data__country_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__country_id", "block_contents": "Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__division_id": {"name": "patient_additional_data__division_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__division_id", "block_contents": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__subdivision_id": {"name": "patient_additional_data__subdivision_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__subdivision_id", "block_contents": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__medical_area_id": {"name": "patient_additional_data__medical_area_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__medical_area_id", "block_contents": "Reference to patient administrative medical area of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id": {"name": "patient_additional_data__nursing_zone_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id", "block_contents": "Reference to patient administrative nursing zone of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__settlement_id": {"name": "patient_additional_data__settlement_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__settlement_id", "block_contents": "Reference to patient residence settlement ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__occupation_id": {"name": "patient_additional_data__occupation_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__occupation_id", "block_contents": "Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__patient_id": {"name": "patient_additional_data__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_additional_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this."}, "doc.tamanu_source_dbt.patient_additional_data__birth_certificate": {"name": "patient_additional_data__birth_certificate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__birth_certificate", "block_contents": "Birth certificate identifier."}, "doc.tamanu_source_dbt.patient_additional_data__driving_license": {"name": "patient_additional_data__driving_license", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__driving_license", "block_contents": "Driving licence identifier."}, "doc.tamanu_source_dbt.patient_additional_data__passport": {"name": "patient_additional_data__passport", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__passport", "block_contents": "Passport number."}, "doc.tamanu_source_dbt.patient_additional_data__religion_id": {"name": "patient_additional_data__religion_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__religion_id", "block_contents": "Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id": {"name": "patient_additional_data__patient_billing_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id", "block_contents": "Reference to patient billing type."}, "doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id": {"name": "patient_additional_data__country_of_birth_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id", "block_contents": "Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__registered_by_id": {"name": "patient_additional_data__registered_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__registered_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who registered the patient in Tamanu."}, "doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name": {"name": "patient_additional_data__emergency_contact_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name", "block_contents": "Name of emergency contact."}, "doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number": {"name": "patient_additional_data__emergency_contact_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number", "block_contents": "Phone number of emergency contact."}, "doc.tamanu_source_dbt.patient_additional_data__mother_id": {"name": "patient_additional_data__mother_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__mother_id", "block_contents": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent."}, "doc.tamanu_source_dbt.patient_additional_data__father_id": {"name": "patient_additional_data__father_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__father_id", "block_contents": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent."}, "doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field": {"name": "patient_additional_data__updated_at_by_field", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field", "block_contents": "JSON object recording the updated datetime for individual columns.\r\n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields are edited separately in\r\ndifferent facilities. The default sync strategy is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict, but this can lead to discarding important data in the case of PADs. This field\r\nis used to implement per-field \"last edit wins\" instead."}, "doc.tamanu_source_dbt.patient_additional_data__health_center_id": {"name": "patient_additional_data__health_center_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__health_center_id", "block_contents": "Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__insurer_id": {"name": "patient_additional_data__insurer_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__insurer_id", "block_contents": "Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number": {"name": "patient_additional_data__insurer_policy_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number", "block_contents": "Policy number of patient insurance."}, "doc.tamanu_source_dbt.patient_additional_data__secondary_village_id": {"name": "patient_additional_data__secondary_village_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__secondary_village_id", "block_contents": "Reference to patient administrative village of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\nSee also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.table__patient_allergies": {"name": "table__patient_allergies", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.table__patient_allergies", "block_contents": "List of allergies known of the patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Allergies\".\r\n\r\nSee also: `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`, `public.patient_issues`."}, "doc.tamanu_source_dbt.patient_allergies__note": {"name": "patient_allergies__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__note", "block_contents": "Free-form description of this allergy."}, "doc.tamanu_source_dbt.patient_allergies__recorded_date": {"name": "patient_allergies__recorded_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__recorded_date", "block_contents": "Datetime at which this allergy was recorded."}, "doc.tamanu_source_dbt.patient_allergies__patient_id": {"name": "patient_allergies__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_allergies__practitioner_id": {"name": "patient_allergies__practitioner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__practitioner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this allergy."}, "doc.tamanu_source_dbt.patient_allergies__allergy_id": {"name": "patient_allergies__allergy_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__allergy_id", "block_contents": "Reference to an allergy ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_allergies__recorded_date_legacy": {"name": "patient_allergies__recorded_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__recorded_date_legacy", "block_contents": "[Deprecated] Timestamp at which this allergy was recorded."}, "doc.tamanu_source_dbt.patient_allergies__reaction_id": {"name": "patient_allergies__reaction_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__reaction_id", "block_contents": "Reference to an allergic reaction ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__patient_birth_data": {"name": "table__patient_birth_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.table__patient_birth_data", "block_contents": "Information about the birth of the patient, if their birth was recorded into Tamanu.\r\n\r\nThis is specifically data about the newborn, and only the birth-relevant data.\r\nOther patient data is found in the normal tables i.e. `patients`, `patient_additional_data`, etc."}, "doc.tamanu_source_dbt.patient_birth_data__patient_id": {"name": "patient_birth_data__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_birth_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this."}, "doc.tamanu_source_dbt.patient_birth_data__birth_weight": {"name": "patient_birth_data__birth_weight", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_weight", "block_contents": "Weight in kg at birth."}, "doc.tamanu_source_dbt.patient_birth_data__birth_length": {"name": "patient_birth_data__birth_length", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_length", "block_contents": "Length in cm at birth."}, "doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type": {"name": "patient_birth_data__birth_delivery_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type", "block_contents": "Type of delivery.\r\n\r\nOne of:\r\n- `normal_vaginal_delivery`\r\n- `breech`\r\n- `emergency_c_section`\r\n- `elective_c_section`\r\n- `vacuum_extraction`\r\n- `forceps`\r\n- `other`"}, "doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate": {"name": "patient_birth_data__gestational_age_estimate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate", "block_contents": "Gestational age estimate (weeks)."}, "doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute": {"name": "patient_birth_data__apgar_score_one_minute", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute", "block_contents": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) one minute after birth."}, "doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes": {"name": "patient_birth_data__apgar_score_five_minutes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes", "block_contents": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) five minutes after birth."}, "doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes": {"name": "patient_birth_data__apgar_score_ten_minutes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes", "block_contents": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) ten minutes after birth."}, "doc.tamanu_source_dbt.patient_birth_data__time_of_birth": {"name": "patient_birth_data__time_of_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__time_of_birth", "block_contents": "Datetime of birth."}, "doc.tamanu_source_dbt.patient_birth_data__birth_type": {"name": "patient_birth_data__birth_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_type", "block_contents": "`single` or `plural` birth."}, "doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth": {"name": "patient_birth_data__attendant_at_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth", "block_contents": "The type of the attendant at birth.\r\n\r\nOne of:\r\n- `doctor`\r\n- `midwife`\r\n- `nurse`\r\n- `traditional_birth_attentdant`\r\n- `other`"}, "doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth": {"name": "patient_birth_data__name_of_attendant_at_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth", "block_contents": "Name of attendant at birth."}, "doc.tamanu_source_dbt.patient_birth_data__birth_facility_id": {"name": "patient_birth_data__birth_facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) the birth was recorded at.\r\n\r\nThis is only required when `registered_birth_place` is `health_facility`."}, "doc.tamanu_source_dbt.patient_birth_data__registered_birth_place": {"name": "patient_birth_data__registered_birth_place", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__registered_birth_place", "block_contents": "Type of the actual birth place.\r\n\r\nOne of:\r\n- `health_facility`\r\n- `home`\r\n- `other`"}, "doc.tamanu_source_dbt.patient_birth_data__time_of_birth_legacy": {"name": "patient_birth_data__time_of_birth_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__time_of_birth_legacy", "block_contents": "[Deprecated] Time of birth."}, "doc.tamanu_source_dbt.table__patient_care_plans": {"name": "table__patient_care_plans", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_care_plans.md", "original_file_path": "models\\sources\\patient_care_plans.md", "unique_id": "doc.tamanu_source_dbt.table__patient_care_plans", "block_contents": "List of current care plans the patient is on.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Care plans\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_conditions`, `public.patient_family_histories`,\r\n`public.patient_issues`."}, "doc.tamanu_source_dbt.patient_care_plans__patient_id": {"name": "patient_care_plans__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_care_plans.md", "original_file_path": "models\\sources\\patient_care_plans.md", "unique_id": "doc.tamanu_source_dbt.patient_care_plans__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_care_plans__examiner_id": {"name": "patient_care_plans__examiner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_care_plans.md", "original_file_path": "models\\sources\\patient_care_plans.md", "unique_id": "doc.tamanu_source_dbt.patient_care_plans__examiner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) who prescribed this care plan."}, "doc.tamanu_source_dbt.patient_care_plans__care_plan_id": {"name": "patient_care_plans__care_plan_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_care_plans.md", "original_file_path": "models\\sources\\patient_care_plans.md", "unique_id": "doc.tamanu_source_dbt.patient_care_plans__care_plan_id", "block_contents": "Reference to the care plan ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__patient_communications": {"name": "table__patient_communications", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.table__patient_communications", "block_contents": "Messages being sent to a patient, via a variety of channels.\r\n\r\nThis is a multiplexed queue to send emails, SMS, IM messages, etc specifically to patients.\r\n\r\nProcessed by the `PatientEmailCommunicationProcessor` scheduled task."}, "doc.tamanu_source_dbt.patient_communications__type": {"name": "patient_communications__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__type", "block_contents": "The type of communication.\r\n\r\nThis affects the template or action being taken."}, "doc.tamanu_source_dbt.patient_communications__channel": {"name": "patient_communications__channel", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__channel", "block_contents": "The channel to send the message with.\r\n\r\nOne of:\r\n- Email\r\n- Sms\r\n- WhatsApp\r\n- Telegram"}, "doc.tamanu_source_dbt.patient_communications__subject": {"name": "patient_communications__subject", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__subject", "block_contents": "Subject line (short summary of the message).\r\n\r\nThis is the subject line of an email, or equivalent for other channels."}, "doc.tamanu_source_dbt.patient_communications__content": {"name": "patient_communications__content", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__content", "block_contents": "Content of the message."}, "doc.tamanu_source_dbt.patient_communications__status": {"name": "patient_communications__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__status", "block_contents": "Processing status of the communication.\r\n\r\nOne of:\r\n- `Queued`\r\n- `Processed`\r\n- `Sent`\r\n- `Error`\r\n- `Delivered`\r\n- `Bad Format`"}, "doc.tamanu_source_dbt.patient_communications__error": {"name": "patient_communications__error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__error", "block_contents": "If the communication sending fails, this is the error."}, "doc.tamanu_source_dbt.patient_communications__retry_count": {"name": "patient_communications__retry_count", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__retry_count", "block_contents": "How many times the sending has been retried."}, "doc.tamanu_source_dbt.patient_communications__patient_id": {"name": "patient_communications__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients) that communication is for."}, "doc.tamanu_source_dbt.patient_communications__destination": {"name": "patient_communications__destination", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__destination", "block_contents": "Destination address to send this message to.\r\n\r\nIf this is not provided here, it will be derived from the patient, such as using the\r\n[`patient_contacts`](#!/source/source.tamanu.tamanu.patient_contacts) table."}, "doc.tamanu_source_dbt.patient_communications__attachment": {"name": "patient_communications__attachment", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__attachment", "block_contents": "The attachment as a string."}, "doc.tamanu_source_dbt.patient_communications__hash": {"name": "patient_communications__hash", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__hash", "block_contents": "Hash of original data that went into creating the row, for purposes of deduplication.\r\n\r\nThe hashing is done with the `hashtext` postgres function."}, "doc.tamanu_source_dbt.table__patient_conditions": {"name": "table__patient_conditions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.table__patient_conditions", "block_contents": "List of ongoing conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Ongoing conditions\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`,\r\n`public.patient_family_histories`, `public.patient_issues`."}, "doc.tamanu_source_dbt.patient_conditions__note": {"name": "patient_conditions__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__note", "block_contents": "Free-form description of this condition."}, "doc.tamanu_source_dbt.patient_conditions__recorded_date": {"name": "patient_conditions__recorded_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__recorded_date", "block_contents": "Datetime at which this issue was recorded."}, "doc.tamanu_source_dbt.patient_conditions__resolved": {"name": "patient_conditions__resolved", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__resolved", "block_contents": "Whether the condition has resolved."}, "doc.tamanu_source_dbt.patient_conditions__patient_id": {"name": "patient_conditions__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_conditions__examiner_id": {"name": "patient_conditions__examiner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__examiner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording this\r\ncondition."}, "doc.tamanu_source_dbt.patient_conditions__condition_id": {"name": "patient_conditions__condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__condition_id", "block_contents": "Reference to a diagnosis describing this issue ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_conditions__recorded_date_legacy": {"name": "patient_conditions__recorded_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__recorded_date_legacy", "block_contents": "[Deprecated] Timestamp at which this issue was recorded."}, "doc.tamanu_source_dbt.patient_conditions__resolution_date": {"name": "patient_conditions__resolution_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__resolution_date", "block_contents": "Datetime at which this issue was resolved."}, "doc.tamanu_source_dbt.patient_conditions__resolution_practitioner_id": {"name": "patient_conditions__resolution_practitioner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__resolution_practitioner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording the\r\nresolution of this condition."}, "doc.tamanu_source_dbt.patient_conditions__resolution_note": {"name": "patient_conditions__resolution_note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__resolution_note", "block_contents": "Free-form description or notes about the resolution of this condition."}, "doc.tamanu_source_dbt.table__patient_contacts": {"name": "table__patient_contacts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.table__patient_contacts", "block_contents": "Describes how a patient may be contacted, via email, SMS, or IM apps.\r\n\r\nAt present, this is used for:\r\n- display in the application (all methods)\r\n- emailing the patient (`method=Email`)\r\n- sending Telegram reminders for appointments (`method=Telegram`)"}, "doc.tamanu_source_dbt.patient_contacts__name": {"name": "patient_contacts__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__name", "block_contents": "Free-form name of the contact method.\r\n\r\nThis could be the name of the patient, or a relationship if the contact method is via another person\r\n(e.g. `Spouse`, `Parent`, `Caregiver`), or a logical keyword if multiple contacts of the same method\r\nare provided (e.g. `Main`, `Primary`, `Work`, `Home`), etc."}, "doc.tamanu_source_dbt.patient_contacts__method": {"name": "patient_contacts__method", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__method", "block_contents": "What application the contact uses:\r\n- `Email`\r\n- `Sms`\r\n- `WhatsApp`\r\n- `Telegram`"}, "doc.tamanu_source_dbt.patient_contacts__connection_details": {"name": "patient_contacts__connection_details", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__connection_details", "block_contents": "JSON structure containing the details of the contact.\r\n\r\nIts schema varies based on the `method`."}, "doc.tamanu_source_dbt.patient_contacts__patient_id": {"name": "patient_contacts__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_contacts__relationship_id": {"name": "patient_contacts__relationship_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__relationship_id", "block_contents": "If the contact method is via another person."}, "doc.tamanu_source_dbt.table__patient_death_data": {"name": "table__patient_death_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.table__patient_death_data", "block_contents": "Information about a patient's death."}, "doc.tamanu_source_dbt.patient_death_data__patient_id": {"name": "patient_death_data__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients) who died."}, "doc.tamanu_source_dbt.patient_death_data__clinician_id": {"name": "patient_death_data__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__clinician_id", "block_contents": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who is recording this death."}, "doc.tamanu_source_dbt.patient_death_data__facility_id": {"name": "patient_death_data__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where this death is being recorded."}, "doc.tamanu_source_dbt.patient_death_data__manner": {"name": "patient_death_data__manner", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__manner", "block_contents": "A descriptive text specifying the manner of death."}, "doc.tamanu_source_dbt.patient_death_data__recent_surgery": {"name": "patient_death_data__recent_surgery", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__recent_surgery", "block_contents": "Whether the deceased patient had a recent surgery, if any."}, "doc.tamanu_source_dbt.patient_death_data__last_surgery_date": {"name": "patient_death_data__last_surgery_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__last_surgery_date", "block_contents": "Datetime of the most recent surgery the patient received, if any."}, "doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id": {"name": "patient_death_data__last_surgery_reason_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id", "block_contents": "Reference to a `diagnosis` ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) for the\r\nreason of the most recent surgery the patient received, if any."}, "doc.tamanu_source_dbt.patient_death_data__external_cause_date": {"name": "patient_death_data__external_cause_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__external_cause_date", "block_contents": "Datetime of external cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__external_cause_location": {"name": "patient_death_data__external_cause_location", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__external_cause_location", "block_contents": "Physical location of external cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__external_cause_notes": {"name": "patient_death_data__external_cause_notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__external_cause_notes", "block_contents": "Free-form description of the location of external cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__was_pregnant": {"name": "patient_death_data__was_pregnant", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__was_pregnant", "block_contents": "Whether the deceased was pregnant."}, "doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed": {"name": "patient_death_data__pregnancy_contributed", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed", "block_contents": "Whether the pregnancy contributed to the death."}, "doc.tamanu_source_dbt.patient_death_data__fetal_or_infant": {"name": "patient_death_data__fetal_or_infant", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__fetal_or_infant", "block_contents": "Whether the deceased was themselves a foetus or infant."}, "doc.tamanu_source_dbt.patient_death_data__stillborn": {"name": "patient_death_data__stillborn", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__stillborn", "block_contents": "Whether the deceased was themselves stillborn."}, "doc.tamanu_source_dbt.patient_death_data__birth_weight": {"name": "patient_death_data__birth_weight", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__birth_weight", "block_contents": "If the deceased was a foetus, stillborn, or infant, their birth weight."}, "doc.tamanu_source_dbt.patient_death_data__within_day_of_birth": {"name": "patient_death_data__within_day_of_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__within_day_of_birth", "block_contents": "If the deceased was a foetus, stillborn, or infant, whether their passing was on the day of their birth."}, "doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth": {"name": "patient_death_data__hours_survived_since_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth", "block_contents": "If the deceased was an infant, how many days since the birth passed before their death."}, "doc.tamanu_source_dbt.patient_death_data__carrier_age": {"name": "patient_death_data__carrier_age", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__carrier_age", "block_contents": "If the deceased was a foetus, stillborn, or infant, the age of the carrier."}, "doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks": {"name": "patient_death_data__carrier_pregnancy_weeks", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks", "block_contents": "If the deceased was a foetus, stillborn, or infant, how many weeks pregnant their carrier was."}, "doc.tamanu_source_dbt.patient_death_data__outside_health_facility": {"name": "patient_death_data__outside_health_facility", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__outside_health_facility", "block_contents": "Whether the death occurred outside of the facility."}, "doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset": {"name": "patient_death_data__primary_cause_time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset", "block_contents": "The time in minutes after onset of the primary cause of death, if known."}, "doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id": {"name": "patient_death_data__primary_cause_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id", "block_contents": "Reference to the primary cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if known."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_time_after_onset": {"name": "patient_death_data__antecedent_cause1_time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_time_after_onset", "block_contents": "The time in minutes after onset of an antecedent (1) cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id": {"name": "patient_death_data__antecedent_cause1_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id", "block_contents": "Reference to an antecedent (1) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_time_after_onset": {"name": "patient_death_data__antecedent_cause2_time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_time_after_onset", "block_contents": "The time in minutes after onset of an antecedent (2) cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id": {"name": "patient_death_data__antecedent_cause2_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id", "block_contents": "Reference to an antecedent (2) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable."}, "doc.tamanu_source_dbt.patient_death_data__external_cause_date_legacy": {"name": "patient_death_data__external_cause_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__external_cause_date_legacy", "block_contents": "[Deprecated] Timestamp of external cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__last_surgery_date_legacy": {"name": "patient_death_data__last_surgery_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__last_surgery_date_legacy", "block_contents": "[Deprecated] Timestamp of the most recent surgery the patient received, if any."}, "doc.tamanu_source_dbt.patient_death_data__is_final": {"name": "patient_death_data__is_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__is_final", "block_contents": "Whether this date record is final.\r\n\r\nIn Tamanu, this is set by a supervisor after review, and cannot be reversed; it causes all fields to\r\nbecome read-only. The only way to undo this record is through a `death_revert_logs`."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_time_after_onset": {"name": "patient_death_data__antecedent_cause3_time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_time_after_onset", "block_contents": "The time in minutes after onset of an antecedent (3) cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_condition_id": {"name": "patient_death_data__antecedent_cause3_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_condition_id", "block_contents": "Reference to an antecedent (3) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable."}, "doc.tamanu_source_dbt.patient_death_data__autopsy_requested": {"name": "patient_death_data__autopsy_requested", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__autopsy_requested", "block_contents": "Whether an autopsy was requested."}, "doc.tamanu_source_dbt.patient_death_data__autopsy_findings_used": {"name": "patient_death_data__autopsy_findings_used", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__autopsy_findings_used", "block_contents": "If an autopsy was requested, whether the findings were used in the death certification."}, "doc.tamanu_source_dbt.patient_death_data__manner_of_death_description": {"name": "patient_death_data__manner_of_death_description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__manner_of_death_description", "block_contents": "If an external cause occurred, a text description on how and if applicable, notes of poisoning agent."}, "doc.tamanu_source_dbt.patient_death_data__pregnancy_moment": {"name": "patient_death_data__pregnancy_moment", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__pregnancy_moment", "block_contents": "The status of the pregnancy of the deceased, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__multiple_pregnancy": {"name": "patient_death_data__multiple_pregnancy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__multiple_pregnancy", "block_contents": "Whether the deceased infant happened in a multiple pregnancy."}, "doc.tamanu_source_dbt.patient_death_data__mother_condition_description": {"name": "patient_death_data__mother_condition_description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__mother_condition_description", "block_contents": "A text description stating the conditions of mother that affected the fetus/newborn, if the death was perinatal."}, "doc.tamanu_source_dbt.table__patient_facilities": {"name": "table__patient_facilities", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_facilities.md", "original_file_path": "models\\sources\\patient_facilities.md", "unique_id": "doc.tamanu_source_dbt.table__patient_facilities", "block_contents": "Tracks which patients are of interest to which facilities.\r\n\r\nThis is used to refine sync data: only patient data related to these patients is synced to a\r\nfacility (plus general data, and some exceptions apply like vaccine data under some conditions).\r\n\r\nIn Tamanu, this can be set manually on the facility server (via the \"mark for sync\" button), or\r\ncentrally (via some labs / vaccine programs, or via bulk-imports).\r\n\r\n_(\"Joe Patient attends X Clinic\" is clinical info; even though an entry in patient facilities\r\ndoesn't necessarily imply this, it often does.)_"}, "doc.tamanu_source_dbt.patient_facilities__facility_id": {"name": "patient_facilities__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_facilities.md", "original_file_path": "models\\sources\\patient_facilities.md", "unique_id": "doc.tamanu_source_dbt.patient_facilities__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities)."}, "doc.tamanu_source_dbt.patient_facilities__patient_id": {"name": "patient_facilities__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_facilities.md", "original_file_path": "models\\sources\\patient_facilities.md", "unique_id": "doc.tamanu_source_dbt.patient_facilities__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.table__patient_family_histories": {"name": "table__patient_family_histories", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.table__patient_family_histories", "block_contents": "List of family history conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Family history\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_issues`."}, "doc.tamanu_source_dbt.patient_family_histories__note": {"name": "patient_family_histories__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__note", "block_contents": "Free-form description of this issue."}, "doc.tamanu_source_dbt.patient_family_histories__recorded_date": {"name": "patient_family_histories__recorded_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__recorded_date", "block_contents": "Datetime at which this issue was recorded."}, "doc.tamanu_source_dbt.patient_family_histories__relationship": {"name": "patient_family_histories__relationship", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__relationship", "block_contents": "Free-form description of the family relationship."}, "doc.tamanu_source_dbt.patient_family_histories__patient_id": {"name": "patient_family_histories__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_family_histories__practitioner_id": {"name": "patient_family_histories__practitioner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__practitioner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this history."}, "doc.tamanu_source_dbt.patient_family_histories__diagnosis_id": {"name": "patient_family_histories__diagnosis_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__diagnosis_id", "block_contents": "Reference to a diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))\r\ndescribing this issue."}, "doc.tamanu_source_dbt.patient_family_histories__recorded_date_legacy": {"name": "patient_family_histories__recorded_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__recorded_date_legacy", "block_contents": "[Deprecated] Timestamp at which this issue was recorded."}, "doc.tamanu_source_dbt.table__patient_field_definitions": {"name": "table__patient_field_definitions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.table__patient_field_definitions", "block_contents": "Custom inputs to be included in the Tamanu patient details screens.\r\n\r\nThese are grouped using [categories](#!/source/source.tamanu.tamanu.patient_field_definition_categories)."}, "doc.tamanu_source_dbt.patient_field_definitions__name": {"name": "patient_field_definitions__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definitions__name", "block_contents": "Name of the input."}, "doc.tamanu_source_dbt.patient_field_definitions__field_type": {"name": "patient_field_definitions__field_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definitions__field_type", "block_contents": "Input field type.\r\n\r\nOne of:\r\n- `string`\r\n- `number`\r\n- `select`"}, "doc.tamanu_source_dbt.patient_field_definitions__options": {"name": "patient_field_definitions__options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definitions__options", "block_contents": "When `type = 'select'`, the list of options for this select.\r\n\r\nPostgreSQL array of strings."}, "doc.tamanu_source_dbt.patient_field_definitions__category_id": {"name": "patient_field_definitions__category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definitions__category_id", "block_contents": "The [category](#!/source/source.tamanu.tamanu.patient_field_definition_categories) this field is in."}, "doc.tamanu_source_dbt.table__patient_field_definition_categories": {"name": "table__patient_field_definition_categories", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definition_categories.md", "original_file_path": "models\\sources\\patient_field_definition_categories.md", "unique_id": "doc.tamanu_source_dbt.table__patient_field_definition_categories", "block_contents": "Groupings for [patient field definitions](#!/source/source.tamanu.tamanu.patient_field_definitions)."}, "doc.tamanu_source_dbt.patient_field_definition_categories__name": {"name": "patient_field_definition_categories__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definition_categories.md", "original_file_path": "models\\sources\\patient_field_definition_categories.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definition_categories__name", "block_contents": "Name of category."}, "doc.tamanu_source_dbt.table__patient_field_values": {"name": "table__patient_field_values", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_values.md", "original_file_path": "models\\sources\\patient_field_values.md", "unique_id": "doc.tamanu_source_dbt.table__patient_field_values", "block_contents": "Values recorded in custom patient fields.\r\n\r\nThe `id` column is generated to enforce one value row per field definition per patient."}, "doc.tamanu_source_dbt.patient_field_values__value": {"name": "patient_field_values__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_values.md", "original_file_path": "models\\sources\\patient_field_values.md", "unique_id": "doc.tamanu_source_dbt.patient_field_values__value", "block_contents": "Value."}, "doc.tamanu_source_dbt.patient_field_values__definition_id": {"name": "patient_field_values__definition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_values.md", "original_file_path": "models\\sources\\patient_field_values.md", "unique_id": "doc.tamanu_source_dbt.patient_field_values__definition_id", "block_contents": "The [field definition](#!/source/source.tamanu.tamanu.patient_field_definitions)."}, "doc.tamanu_source_dbt.patient_field_values__patient_id": {"name": "patient_field_values__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_values.md", "original_file_path": "models\\sources\\patient_field_values.md", "unique_id": "doc.tamanu_source_dbt.patient_field_values__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.table__patient_issues": {"name": "table__patient_issues", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.table__patient_issues", "block_contents": "List of \"other issues\" known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Other patient issues\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`."}, "doc.tamanu_source_dbt.patient_issues__note": {"name": "patient_issues__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__note", "block_contents": "Free-form description of this issue."}, "doc.tamanu_source_dbt.patient_issues__recorded_date": {"name": "patient_issues__recorded_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__recorded_date", "block_contents": "Datetime at which this issue was recorded."}, "doc.tamanu_source_dbt.patient_issues__type": {"name": "patient_issues__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__type", "block_contents": "If set to `Warning`, an alert will pop up when visiting the patient."}, "doc.tamanu_source_dbt.patient_issues__patient_id": {"name": "patient_issues__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_issues__recorded_date_legacy": {"name": "patient_issues__recorded_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__recorded_date_legacy", "block_contents": "[Deprecated] Timestamp at which this issue was recorded."}, "doc.tamanu_source_dbt.table__patient_ongoing_prescriptions": {"name": "table__patient_ongoing_prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_ongoing_prescriptions.md", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__patient_ongoing_prescriptions", "block_contents": "Association of patient to prescription"}, "doc.tamanu_source_dbt.patient_ongoing_prescriptions__patient_id": {"name": "patient_ongoing_prescriptions__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_ongoing_prescriptions.md", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.patient_ongoing_prescriptions__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients)"}, "doc.tamanu_source_dbt.patient_ongoing_prescriptions__prescription_id": {"name": "patient_ongoing_prescriptions__prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_ongoing_prescriptions.md", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.patient_ongoing_prescriptions__prescription_id", "block_contents": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)"}, "doc.tamanu_source_dbt.table__patient_program_registrations": {"name": "table__patient_program_registrations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.table__patient_program_registrations", "block_contents": "Table with information about the program registrations of a patient. This is helpful\r\nto enroll a specific patient within a program that will be followed for an extended\r\nperiod of time.\r\n\r\n**This table is append-only.**\r\nA new record is created every time there is a change to the status of a registration. \r\n\r\nAt the moment, this implies that when merging two patients, both with a registration to the same\r\nregistry, the merged patient ends up with two registrations."}, "doc.tamanu_source_dbt.patient_program_registrations__registration_status": {"name": "patient_program_registrations__registration_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__registration_status", "block_contents": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError`"}, "doc.tamanu_source_dbt.patient_program_registrations__patient_id": {"name": "patient_program_registrations__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__patient_id", "block_contents": "Reference to the [Patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_program_registrations__program_registry_id": {"name": "patient_program_registrations__program_registry_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__program_registry_id", "block_contents": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration."}, "doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id": {"name": "patient_program_registrations__clinical_status_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id", "block_contents": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration."}, "doc.tamanu_source_dbt.patient_program_registrations__clinician_id": {"name": "patient_program_registrations__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__clinician_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration."}, "doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id": {"name": "patient_program_registrations__registering_facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id", "block_contents": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in."}, "doc.tamanu_source_dbt.patient_program_registrations__facility_id": {"name": "patient_program_registrations__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__facility_id", "block_contents": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) this program\r\nregistration is from."}, "doc.tamanu_source_dbt.patient_program_registrations__village_id": {"name": "patient_program_registrations__village_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__village_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=village`) this program registration is from."}, "doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id": {"name": "patient_program_registrations__deactivated_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id", "block_contents": "The clinician that removed the patient from the program registry."}, "doc.tamanu_source_dbt.patient_program_registrations__deactivated_date": {"name": "patient_program_registrations__deactivated_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__deactivated_date", "block_contents": "The date that the patient from the program registry."}, "doc.tamanu_source_dbt.table__patient_program_registration_conditions": {"name": "table__patient_program_registration_conditions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.table__patient_program_registration_conditions", "block_contents": "Table of conditions related to patients in a program registration."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id": {"name": "patient_program_registration_conditions__program_registry_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id", "block_contents": "Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions)."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id": {"name": "patient_program_registration_conditions__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that condition."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id": {"name": "patient_program_registration_conditions__deletion_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) that removed the condition."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change": {"name": "patient_program_registration_conditions__reason_for_change", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change", "block_contents": "Optional field for recording the reason for changing the condition."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__condition": {"name": "patient_program_registration_conditions__condition", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__condition", "block_contents": ""}, "doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id": {"name": "patient_program_registration_conditions__patient_program_registration_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id", "block_contents": "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\nof the condition."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id": {"name": "patient_program_registration_conditions__program_registry_condition_category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id", "block_contents": "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\nof the condition."}, "doc.tamanu_source_dbt.table__patient_secondary_ids": {"name": "table__patient_secondary_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_secondary_ids.md", "original_file_path": "models\\sources\\patient_secondary_ids.md", "unique_id": "doc.tamanu_source_dbt.table__patient_secondary_ids", "block_contents": "Alternative IDs to be checked for when searching for patient by ID.\r\n\r\nFor example, driver licence or passport numbers, or other national or local health numbers, if there\r\nare disparate systems or the country is in a transitional period."}, "doc.tamanu_source_dbt.patient_secondary_ids__value": {"name": "patient_secondary_ids__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_secondary_ids.md", "original_file_path": "models\\sources\\patient_secondary_ids.md", "unique_id": "doc.tamanu_source_dbt.patient_secondary_ids__value", "block_contents": "Value of the identifier."}, "doc.tamanu_source_dbt.patient_secondary_ids__type_id": {"name": "patient_secondary_ids__type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_secondary_ids.md", "original_file_path": "models\\sources\\patient_secondary_ids.md", "unique_id": "doc.tamanu_source_dbt.patient_secondary_ids__type_id", "block_contents": "Reference to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\nwith `type=secondaryIdType`."}, "doc.tamanu_source_dbt.patient_secondary_ids__patient_id": {"name": "patient_secondary_ids__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_secondary_ids.md", "original_file_path": "models\\sources\\patient_secondary_ids.md", "unique_id": "doc.tamanu_source_dbt.patient_secondary_ids__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere may be zero or more `patient_secondary_ids` per patient."}, "doc.tamanu_source_dbt.table__patient_vrs_data": {"name": "table__patient_vrs_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.table__patient_vrs_data", "block_contents": "Data for Fiji's VRS integration only."}, "doc.tamanu_source_dbt.patient_vrs_data__id_type": {"name": "patient_vrs_data__id_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__id_type", "block_contents": "TBC"}, "doc.tamanu_source_dbt.patient_vrs_data__identifier": {"name": "patient_vrs_data__identifier", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__identifier", "block_contents": "TBC"}, "doc.tamanu_source_dbt.patient_vrs_data__unmatched_village_name": {"name": "patient_vrs_data__unmatched_village_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__unmatched_village_name", "block_contents": "if we don't have a matching village, persist the unmatched name here"}, "doc.tamanu_source_dbt.patient_vrs_data__patient_id": {"name": "patient_vrs_data__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_vrs_data__is_deleted_by_remote": {"name": "patient_vrs_data__is_deleted_by_remote", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__is_deleted_by_remote", "block_contents": "TBC"}, "doc.tamanu_source_dbt.table__permissions": {"name": "table__permissions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.table__permissions", "block_contents": "These are associations of permissions to roles.\r\n\r\nPermissions are modeled on the concept of a sentence like\r\n\r\n```\r\nROLE can VERB the NOUN\r\nROLE can VERB the NOUN which is specifically the OBJECT ID\r\n```\r\n\r\nSee also the [`roles`](#!/source/source.tamanu.tamanu.roles) and\r\n[`users`](#!/source/source.tamanu.tamanu.users) tables."}, "doc.tamanu_source_dbt.permissions__role_id": {"name": "permissions__role_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.permissions__role_id", "block_contents": "The [`role`](#!/source/source.tamanu.tamanu.roles) authorised for this permission."}, "doc.tamanu_source_dbt.permissions__noun": {"name": "permissions__noun", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.permissions__noun", "block_contents": "The subject of the action/permission, usually the model or resource being affected.\r\n\r\nNouns are defined in `PascalCase` and are singular."}, "doc.tamanu_source_dbt.permissions__verb": {"name": "permissions__verb", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.permissions__verb", "block_contents": "The action verb for this permission.\r\n\r\nSome common verbs include: `create`, `read`, `write`, `list`."}, "doc.tamanu_source_dbt.permissions__object_id": {"name": "permissions__object_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.permissions__object_id", "block_contents": "An optional object ID to specialise the permission.\r\n\r\nIf this is not set the permission is generally for the entire class of objects, if it _is_ set then\r\nthe permission is _only_ for the specific object."}, "doc.tamanu_source_dbt.table__pharmacy_orders": {"name": "table__pharmacy_orders", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.table__pharmacy_orders", "block_contents": "An order for prescriptions placed by Tamanu to a Pharmacy"}, "doc.tamanu_source_dbt.pharmacy_orders__ordering_clinician_id": {"name": "pharmacy_orders__ordering_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__ordering_clinician_id", "block_contents": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who placed the order."}, "doc.tamanu_source_dbt.pharmacy_orders__encounter_id": {"name": "pharmacy_orders__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) for the order."}, "doc.tamanu_source_dbt.pharmacy_orders__comments": {"name": "pharmacy_orders__comments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__comments", "block_contents": "Comments provided by the clinician when placing the order."}, "doc.tamanu_source_dbt.pharmacy_orders__is_discharge_prescription": {"name": "pharmacy_orders__is_discharge_prescription", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__is_discharge_prescription", "block_contents": "If the patient is being discharged with this prescription."}, "doc.tamanu_source_dbt.pharmacy_orders__facility_id": {"name": "pharmacy_orders__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where the pharmacy order was placed."}, "doc.tamanu_source_dbt.table__pharmacy_order_prescriptions": {"name": "table__pharmacy_order_prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__pharmacy_order_prescriptions", "block_contents": "Individual prescriptions that are included in a [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders)."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__pharmacy_order_id": {"name": "pharmacy_order_prescriptions__pharmacy_order_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__pharmacy_order_id", "block_contents": "Reference to the [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders)."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__prescription_id": {"name": "pharmacy_order_prescriptions__prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__prescription_id", "block_contents": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions)."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__ongoing_prescription_id": {"name": "pharmacy_order_prescriptions__ongoing_prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__ongoing_prescription_id", "block_contents": "When this pharmacy order prescription was created from an ongoing prescription (send to pharmacy flow), references the ongoing [prescription](#!/source/source.tamanu.tamanu.prescriptions). Null for encounter-based pharmacy orders."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__display_id": {"name": "pharmacy_order_prescriptions__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__display_id", "block_contents": "Human-readable request number for this prescription order. A new request number is generated each time a prescription is sent to pharmacy."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__quantity": {"name": "pharmacy_order_prescriptions__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__quantity", "block_contents": "Quantity of medication ordered."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__repeats": {"name": "pharmacy_order_prescriptions__repeats", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__repeats", "block_contents": "Number of repeats for the prescription."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__is_completed": {"name": "pharmacy_order_prescriptions__is_completed", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__is_completed", "block_contents": "Indicates whether this prescription has been fully completed. Set to `true` when all repeats have been dispensed for a discharge prescription (outpatient medication). Used to filter completed prescriptions from active medication request lists."}, "doc.tamanu_source_dbt.table__portal_one_time_tokens": {"name": "table__portal_one_time_tokens", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.table__portal_one_time_tokens", "block_contents": "A table that stores one-time tokens for portal users. These tokens are used for secure operations such as login, password reset, and other temporary authentication requirements. Each token is associated with a specific portal user and has an expiration date."}, "doc.tamanu_source_dbt.portal_one_time_tokens__portal_user_id": {"name": "portal_one_time_tokens__portal_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.portal_one_time_tokens__portal_user_id", "block_contents": "Foreign key that references the id of the portal user to whom this token belongs. When the user is deleted, all associated tokens are automatically deleted (CASCADE)."}, "doc.tamanu_source_dbt.portal_one_time_tokens__type": {"name": "portal_one_time_tokens__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.portal_one_time_tokens__type", "block_contents": "Specifies the purpose of the token\r\nOne of:\r\n- `login` (default)\r\n- `password-reset`"}, "doc.tamanu_source_dbt.portal_one_time_tokens__token": {"name": "portal_one_time_tokens__token", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.portal_one_time_tokens__token", "block_contents": "The unique, secure token string that is used for verification. This token should be generated with strong cryptographic methods to ensure security."}, "doc.tamanu_source_dbt.portal_one_time_tokens__expires_at": {"name": "portal_one_time_tokens__expires_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.portal_one_time_tokens__expires_at", "block_contents": "The timestamp at which this token expires and becomes invalid. Tokens should have a limited lifespan appropriate to their purpose, typically ranging from a few minutes to 24 hours depending on the token type."}, "doc.tamanu_source_dbt.table__portal_survey_assignments": {"name": "table__portal_survey_assignments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.table__portal_survey_assignments", "block_contents": "Assignments of surveys to patients for completion through the patient portal.\r\n\r\nThis table tracks which surveys have been assigned to which patients for self-completion through\r\nthe patient portal application. Patients can log into the portal to view their assigned surveys\r\nand complete them independently. Surveys can be assigned to patients for various purposes such as\r\nhealth assessments, follow-up questionnaires, or program evaluations."}, "doc.tamanu_source_dbt.portal_survey_assignments__patient_id": {"name": "portal_survey_assignments__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) who has been assigned the survey."}, "doc.tamanu_source_dbt.portal_survey_assignments__survey_id": {"name": "portal_survey_assignments__survey_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__survey_id", "block_contents": "Reference to the [survey](#!/source/source.tamanu.tamanu.surveys) that has been assigned to the patient."}, "doc.tamanu_source_dbt.portal_survey_assignments__status": {"name": "portal_survey_assignments__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__status", "block_contents": "The current status of the survey assignment in the patient portal.\r\n\r\nOne of:\r\n- `assigned` - Survey has been assigned but the patient has not yet started it in the portal\r\n- `in_progress` - Patient has started the survey in the portal but not completed it\r\n- `completed` - Survey has been fully completed by the patient through the portal\r\n- `expired` - Survey assignment has expired and can no longer be completed in the portal"}, "doc.tamanu_source_dbt.portal_survey_assignments__assigned_by_id": {"name": "portal_survey_assignments__assigned_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__assigned_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who assigned the survey to the patient."}, "doc.tamanu_source_dbt.portal_survey_assignments__survey_response_id": {"name": "portal_survey_assignments__survey_response_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__survey_response_id", "block_contents": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) containing the patient's answers from the portal.\r\n\r\nThis field is only populated when the survey has been completed through the patient portal and a response has been recorded."}, "doc.tamanu_source_dbt.portal_survey_assignments__assigned_at": {"name": "portal_survey_assignments__assigned_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__assigned_at", "block_contents": "Timestamp when the survey was assigned to the patient for completion through the patient portal.\r\n\r\nThis field is provided a value by the Tamanu web frontend when a survey assignment is created."}, "doc.tamanu_source_dbt.portal_survey_assignments__facility_id": {"name": "portal_survey_assignments__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__facility_id", "block_contents": "The facility that the survey was assigned from"}, "doc.tamanu_source_dbt.table__portal_users": {"name": "table__portal_users", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_users.md", "original_file_path": "models\\sources\\portal_users.md", "unique_id": "doc.tamanu_source_dbt.table__portal_users", "block_contents": "This table manages user accounts for patients who can access the patient portal. It establishes the relationship between patients and their portal login credentials, tracking their registration status and access permissions. Each record represents a patient's portal account with authentication and role information."}, "doc.tamanu_source_dbt.portal_users__patient_id": {"name": "portal_users__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_users.md", "original_file_path": "models\\sources\\portal_users.md", "unique_id": "doc.tamanu_source_dbt.portal_users__patient_id", "block_contents": "Foreign key reference to the patients table. Links the portal user account to a specific patient record in the system. This field is required and establishes the one-to-one relationship between a patient and their portal access."}, "doc.tamanu_source_dbt.portal_users__email": {"name": "portal_users__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_users.md", "original_file_path": "models\\sources\\portal_users.md", "unique_id": "doc.tamanu_source_dbt.portal_users__email", "block_contents": "Unique email address used for patient portal authentication and communication. This serves as the primary identifier for login purposes and must be unique across all patient portal accounts. The field is optional to allow for patients who may not have email addresses, or who have not yet completed the\r\nregistration flow."}, "doc.tamanu_source_dbt.portal_users__status": {"name": "portal_users__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_users.md", "original_file_path": "models\\sources\\portal_users.md", "unique_id": "doc.tamanu_source_dbt.portal_users__status", "block_contents": "Current registration status of the patient portal account. Possible values are 'pending' (default, when account is first created) and 'registered' (when patient has completed the registration process). This field tracks the progression of patient portal onboarding and account activation."}, "doc.tamanu_source_dbt.table__prescriptions": {"name": "table__prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__prescriptions", "block_contents": "Records prescriptions for medications."}, "doc.tamanu_source_dbt.prescriptions__end_date": {"name": "prescriptions__end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__end_date", "block_contents": "When the prescription ends."}, "doc.tamanu_source_dbt.prescriptions__indication": {"name": "prescriptions__indication", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__indication", "block_contents": "The [indication of use](https://en.wikipedia.org/wiki/Indication_(medicine)) for the medicine."}, "doc.tamanu_source_dbt.prescriptions__route": {"name": "prescriptions__route", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__route", "block_contents": "Administration route for the medication."}, "doc.tamanu_source_dbt.prescriptions__medication_id": {"name": "prescriptions__medication_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__medication_id", "block_contents": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`)."}, "doc.tamanu_source_dbt.prescriptions__prescriber_id": {"name": "prescriptions__prescriber_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__prescriber_id", "block_contents": "[Who](#!/source/source.tamanu.tamanu.users) prescribed the medication."}, "doc.tamanu_source_dbt.prescriptions__notes": {"name": "prescriptions__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__notes", "block_contents": "Free-form note about the prescription."}, "doc.tamanu_source_dbt.prescriptions__quantity": {"name": "prescriptions__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__quantity", "block_contents": "Quantity of medicine to dispense."}, "doc.tamanu_source_dbt.prescriptions__discontinued": {"name": "prescriptions__discontinued", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__discontinued", "block_contents": "Whether the prescription was discontinued."}, "doc.tamanu_source_dbt.prescriptions__discontinuing_clinician_id": {"name": "prescriptions__discontinuing_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__discontinuing_clinician_id", "block_contents": "If the prescription was discontinued, who did it."}, "doc.tamanu_source_dbt.prescriptions__discontinuing_reason": {"name": "prescriptions__discontinuing_reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__discontinuing_reason", "block_contents": "If the prescription was discontinued, why that happened."}, "doc.tamanu_source_dbt.prescriptions__repeats": {"name": "prescriptions__repeats", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__repeats", "block_contents": "How many times this prescription can be repeatedly dispensed without a new prescription."}, "doc.tamanu_source_dbt.prescriptions__discontinued_date": {"name": "prescriptions__discontinued_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__discontinued_date", "block_contents": "If the prescription was discontinued, when that happened."}, "doc.tamanu_source_dbt.prescriptions__end_date_legacy": {"name": "prescriptions__end_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__end_date_legacy", "block_contents": "[Deprecated] When the prescription ends."}, "doc.tamanu_source_dbt.prescriptions__is_ongoing": {"name": "prescriptions__is_ongoing", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__is_ongoing", "block_contents": "A flag to determine whether or not the current prescription is ongoing"}, "doc.tamanu_source_dbt.prescriptions__is_prn": {"name": "prescriptions__is_prn", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__is_prn", "block_contents": "A flag to determine whether or not the current prescription is prn"}, "doc.tamanu_source_dbt.prescriptions__is_variable_dose": {"name": "prescriptions__is_variable_dose", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__is_variable_dose", "block_contents": "A flag to determine whether or not the current prescription is variable does"}, "doc.tamanu_source_dbt.prescriptions__dose_amount": {"name": "prescriptions__dose_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__dose_amount", "block_contents": "Numeric field to record dose amount"}, "doc.tamanu_source_dbt.prescriptions__units": {"name": "prescriptions__units", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__units", "block_contents": "The units of the prescription"}, "doc.tamanu_source_dbt.prescriptions__frequency": {"name": "prescriptions__frequency", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__frequency", "block_contents": "The frequency of the prescription"}, "doc.tamanu_source_dbt.prescriptions__start_date": {"name": "prescriptions__start_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__start_date", "block_contents": "The start date of the prescription"}, "doc.tamanu_source_dbt.prescriptions__duration_value": {"name": "prescriptions__duration_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__duration_value", "block_contents": "The duration value of the prescription"}, "doc.tamanu_source_dbt.prescriptions__duration_unit": {"name": "prescriptions__duration_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__duration_unit", "block_contents": "The duration unit of the prescription"}, "doc.tamanu_source_dbt.prescriptions__is_phone_order": {"name": "prescriptions__is_phone_order", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__is_phone_order", "block_contents": "A flag to determine whether or not the current prescription is phone order"}, "doc.tamanu_source_dbt.prescriptions__ideal_times": {"name": "prescriptions__ideal_times", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__ideal_times", "block_contents": "Ideal times which are specified by prescriber"}, "doc.tamanu_source_dbt.prescriptions__pharmacy_notes": {"name": "prescriptions__pharmacy_notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__pharmacy_notes", "block_contents": "Free-form pharmacy note of the prescription."}, "doc.tamanu_source_dbt.prescriptions__display_pharmacy_notes_in_mar": {"name": "prescriptions__display_pharmacy_notes_in_mar", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__display_pharmacy_notes_in_mar", "block_contents": "A flag to determine whether to display 'Pharmacy notes' on the medication administration record"}, "doc.tamanu_source_dbt.table__procedures": {"name": "table__procedures", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.table__procedures", "block_contents": "Record of each procedure in progress or completed."}, "doc.tamanu_source_dbt.procedures__completed": {"name": "procedures__completed", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__completed", "block_contents": "Whether the procedure has completed."}, "doc.tamanu_source_dbt.procedures__end_time": {"name": "procedures__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__end_time", "block_contents": "When the procedure ended, if it's completed."}, "doc.tamanu_source_dbt.procedures__note": {"name": "procedures__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__note", "block_contents": "Free-form description of the procedure."}, "doc.tamanu_source_dbt.procedures__completed_note": {"name": "procedures__completed_note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__completed_note", "block_contents": "Free-form notes at completion of the procedure."}, "doc.tamanu_source_dbt.procedures__encounter_id": {"name": "procedures__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__encounter_id", "block_contents": "The [encounter](#!/source/source.tamanu.tamanu.encounters) this procedure is a part of."}, "doc.tamanu_source_dbt.procedures__location_id": {"name": "procedures__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the procedure happens in."}, "doc.tamanu_source_dbt.procedures__procedure_type_id": {"name": "procedures__procedure_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__procedure_type_id", "block_contents": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`)."}, "doc.tamanu_source_dbt.procedures__anaesthetic_id": {"name": "procedures__anaesthetic_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__anaesthetic_id", "block_contents": "Reference to the anaesthetic ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`)."}, "doc.tamanu_source_dbt.procedures__physician_id": {"name": "procedures__physician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__physician_id", "block_contents": "Reference to the [physician](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.procedures__anaesthetist_id": {"name": "procedures__anaesthetist_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__anaesthetist_id", "block_contents": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.procedures__start_time": {"name": "procedures__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__start_time", "block_contents": "When the procedure started."}, "doc.tamanu_source_dbt.procedures__start_time_legacy": {"name": "procedures__start_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__start_time_legacy", "block_contents": "[Deprecated] When the procedure started."}, "doc.tamanu_source_dbt.procedures__end_time_legacy": {"name": "procedures__end_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__end_time_legacy", "block_contents": "[Deprecated] When the procedure ended."}, "doc.tamanu_source_dbt.procedures__department_id": {"name": "procedures__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__department_id", "block_contents": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) where the procedure is performed."}, "doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id": {"name": "procedures__assistant_anaesthetist_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id", "block_contents": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.procedures__time_in": {"name": "procedures__time_in", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__time_in", "block_contents": "The time when the patient entered the procedure room or when the procedure setup began."}, "doc.tamanu_source_dbt.procedures__time_out": {"name": "procedures__time_out", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__time_out", "block_contents": "The time when the patient left the procedure room or when the procedure cleanup was completed."}, "doc.tamanu_source_dbt.table__procedure_assistant_clinicians": {"name": "table__procedure_assistant_clinicians", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_assistant_clinicians.md", "original_file_path": "models\\sources\\procedure_assistant_clinicians.md", "unique_id": "doc.tamanu_source_dbt.table__procedure_assistant_clinicians", "block_contents": "Junction table that links procedures to their assistant clinicians. Records which users served as assistant clinicians for specific procedures."}, "doc.tamanu_source_dbt.procedure_assistant_clinicians__procedure_id": {"name": "procedure_assistant_clinicians__procedure_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_assistant_clinicians.md", "original_file_path": "models\\sources\\procedure_assistant_clinicians.md", "unique_id": "doc.tamanu_source_dbt.procedure_assistant_clinicians__procedure_id", "block_contents": "Reference to the [procedure](#!/source/source.tamanu.tamanu.procedures) this assistant clinician is associated with."}, "doc.tamanu_source_dbt.procedure_assistant_clinicians__user_id": {"name": "procedure_assistant_clinicians__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_assistant_clinicians.md", "original_file_path": "models\\sources\\procedure_assistant_clinicians.md", "unique_id": "doc.tamanu_source_dbt.procedure_assistant_clinicians__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who served as an assistant clinician for the procedure."}, "doc.tamanu_source_dbt.table__procedure_survey_responses": {"name": "table__procedure_survey_responses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_survey_responses.md", "original_file_path": "models\\sources\\procedure_survey_responses.md", "unique_id": "doc.tamanu_source_dbt.table__procedure_survey_responses", "block_contents": "Junction table linking procedures to their associated survey responses."}, "doc.tamanu_source_dbt.procedure_survey_responses__procedure_id": {"name": "procedure_survey_responses__procedure_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_survey_responses.md", "original_file_path": "models\\sources\\procedure_survey_responses.md", "unique_id": "doc.tamanu_source_dbt.procedure_survey_responses__procedure_id", "block_contents": "Reference to the [procedure](#!/source/source.tamanu.tamanu.procedures) this survey response is associated with."}, "doc.tamanu_source_dbt.procedure_survey_responses__survey_response_id": {"name": "procedure_survey_responses__survey_response_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_survey_responses.md", "original_file_path": "models\\sources\\procedure_survey_responses.md", "unique_id": "doc.tamanu_source_dbt.procedure_survey_responses__survey_response_id", "block_contents": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) linked to the procedure."}, "doc.tamanu_source_dbt.table__procedure_type_surveys": {"name": "table__procedure_type_surveys", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_type_surveys.md", "original_file_path": "models\\sources\\procedure_type_surveys.md", "unique_id": "doc.tamanu_source_dbt.table__procedure_type_surveys", "block_contents": "Association between procedure types and surveys\r\n\r\nThis link is used to populate an embedded survey in the procedure modal"}, "doc.tamanu_source_dbt.procedure_type_surveys__procedure_type_id": {"name": "procedure_type_surveys__procedure_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_type_surveys.md", "original_file_path": "models\\sources\\procedure_type_surveys.md", "unique_id": "doc.tamanu_source_dbt.procedure_type_surveys__procedure_type_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=procedureType`)"}, "doc.tamanu_source_dbt.procedure_type_surveys__survey_id": {"name": "procedure_type_surveys__survey_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_type_surveys.md", "original_file_path": "models\\sources\\procedure_type_surveys.md", "unique_id": "doc.tamanu_source_dbt.procedure_type_surveys__survey_id", "block_contents": "Reference to a [survey](#!/source/source.tamanu.tamanu.surveys)."}, "doc.tamanu_source_dbt.table__programs": {"name": "table__programs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\programs.md", "original_file_path": "models\\sources\\programs.md", "unique_id": "doc.tamanu_source_dbt.table__programs", "block_contents": "Groups of [surveys](#!/source/source.tamanu.tamanu.surveys) or [program registries](#!/source/source.tamanu.tamanu.program_registries)."}, "doc.tamanu_source_dbt.programs__code": {"name": "programs__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\programs.md", "original_file_path": "models\\sources\\programs.md", "unique_id": "doc.tamanu_source_dbt.programs__code", "block_contents": "Machine-friendly code."}, "doc.tamanu_source_dbt.programs__name": {"name": "programs__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\programs.md", "original_file_path": "models\\sources\\programs.md", "unique_id": "doc.tamanu_source_dbt.programs__name", "block_contents": "Human-friendly name."}, "doc.tamanu_source_dbt.table__program_data_elements": {"name": "table__program_data_elements", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.table__program_data_elements", "block_contents": "Describes how a survey question gets stored.\r\n\r\nSee [survey screen components](#!/source/source.tamanu.tamanu.survey_screen_components), which\r\ndescribes how the question is displayed."}, "doc.tamanu_source_dbt.program_data_elements__code": {"name": "program_data_elements__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__code", "block_contents": "Machine-friendly short name for the question.\r\n\r\nThis is also used to refer to questions within criteria and such."}, "doc.tamanu_source_dbt.program_data_elements__name": {"name": "program_data_elements__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__name", "block_contents": "Human-friendly name"}, "doc.tamanu_source_dbt.program_data_elements__indicator": {"name": "program_data_elements__indicator", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__indicator", "block_contents": "Another name for the data element.\r\n\r\nIt's named `indicator` from mimicry of Tupaia."}, "doc.tamanu_source_dbt.program_data_elements__default_text": {"name": "program_data_elements__default_text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__default_text", "block_contents": "Default value."}, "doc.tamanu_source_dbt.program_data_elements__default_options": {"name": "program_data_elements__default_options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__default_options", "block_contents": "Default options if this is a dropdown."}, "doc.tamanu_source_dbt.program_data_elements__type": {"name": "program_data_elements__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__type", "block_contents": "Type of the field.\r\n\r\nTypes are here: "}, "doc.tamanu_source_dbt.program_data_elements__visualisation_config": {"name": "program_data_elements__visualisation_config", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__visualisation_config", "block_contents": "JSON visualisation configuration."}, "doc.tamanu_source_dbt.table__program_registries": {"name": "table__program_registries", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.table__program_registries", "block_contents": "Table of program registries.\r\n\r\nThis provides functionality to track a patient population defined by a particular disease or\r\ncondition, and follow this population over time.\r\n\r\nThis table defines the different registries available to track users with."}, "doc.tamanu_source_dbt.program_registries__code": {"name": "program_registries__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.program_registries__code", "block_contents": "Machine-friendly identifier."}, "doc.tamanu_source_dbt.program_registries__name": {"name": "program_registries__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.program_registries__name", "block_contents": "Human-friendly name."}, "doc.tamanu_source_dbt.program_registries__currently_at_type": {"name": "program_registries__currently_at_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.program_registries__currently_at_type", "block_contents": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`"}, "doc.tamanu_source_dbt.program_registries__program_id": {"name": "program_registries__program_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.program_registries__program_id", "block_contents": "Reference to a [program](#!/source/source.tamanu.tamanu.programs)."}, "doc.tamanu_source_dbt.table__program_registry_clinical_statuses": {"name": "table__program_registry_clinical_statuses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.table__program_registry_clinical_statuses", "block_contents": "Table of clinical statuses used in program registries."}, "doc.tamanu_source_dbt.program_registry_clinical_statuses__code": {"name": "program_registry_clinical_statuses__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.program_registry_clinical_statuses__code", "block_contents": "Code (identifier) for the clinical status."}, "doc.tamanu_source_dbt.program_registry_clinical_statuses__name": {"name": "program_registry_clinical_statuses__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.program_registry_clinical_statuses__name", "block_contents": "The name of the clinical status."}, "doc.tamanu_source_dbt.program_registry_clinical_statuses__color": {"name": "program_registry_clinical_statuses__color", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.program_registry_clinical_statuses__color", "block_contents": "A color for the clinical status.\r\n\r\nOne of:\r\n- `purple`\r\n- `pink`\r\n- `orange`\r\n- `yellow`\r\n- `blue`\r\n- `green`\r\n- `grey`\r\n- `red`\r\n- `brown`\r\n- `teal`"}, "doc.tamanu_source_dbt.program_registry_clinical_statuses__program_registry_id": {"name": "program_registry_clinical_statuses__program_registry_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.program_registry_clinical_statuses__program_registry_id", "block_contents": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe status is a part of."}, "doc.tamanu_source_dbt.table__program_registry_conditions": {"name": "table__program_registry_conditions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_conditions.md", "original_file_path": "models\\sources\\program_registry_conditions.md", "unique_id": "doc.tamanu_source_dbt.table__program_registry_conditions", "block_contents": "Table of program registry conditions."}, "doc.tamanu_source_dbt.program_registry_conditions__code": {"name": "program_registry_conditions__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_conditions.md", "original_file_path": "models\\sources\\program_registry_conditions.md", "unique_id": "doc.tamanu_source_dbt.program_registry_conditions__code", "block_contents": "Code (identifier) for the condition."}, "doc.tamanu_source_dbt.program_registry_conditions__name": {"name": "program_registry_conditions__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_conditions.md", "original_file_path": "models\\sources\\program_registry_conditions.md", "unique_id": "doc.tamanu_source_dbt.program_registry_conditions__name", "block_contents": "The name of the condition."}, "doc.tamanu_source_dbt.program_registry_conditions__program_registry_id": {"name": "program_registry_conditions__program_registry_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_conditions.md", "original_file_path": "models\\sources\\program_registry_conditions.md", "unique_id": "doc.tamanu_source_dbt.program_registry_conditions__program_registry_id", "block_contents": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe condition is a part of."}, "doc.tamanu_source_dbt.table__program_registry_condition_categories": {"name": "table__program_registry_condition_categories", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_condition_categories.md", "original_file_path": "models\\sources\\program_registry_condition_categories.md", "unique_id": "doc.tamanu_source_dbt.table__program_registry_condition_categories", "block_contents": "Categories to be set against patient program registry conditions. The categories are configured through the program importer for each program registry. There is a hard-loaded list that is seeded by default in the database for each program registry."}, "doc.tamanu_source_dbt.program_registry_condition_categories__code": {"name": "program_registry_condition_categories__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_condition_categories.md", "original_file_path": "models\\sources\\program_registry_condition_categories.md", "unique_id": "doc.tamanu_source_dbt.program_registry_condition_categories__code", "block_contents": "The code for the category."}, "doc.tamanu_source_dbt.program_registry_condition_categories__name": {"name": "program_registry_condition_categories__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_condition_categories.md", "original_file_path": "models\\sources\\program_registry_condition_categories.md", "unique_id": "doc.tamanu_source_dbt.program_registry_condition_categories__name", "block_contents": "The name for the category."}, "doc.tamanu_source_dbt.program_registry_condition_categories__program_registry_id": {"name": "program_registry_condition_categories__program_registry_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_condition_categories.md", "original_file_path": "models\\sources\\program_registry_condition_categories.md", "unique_id": "doc.tamanu_source_dbt.program_registry_condition_categories__program_registry_id", "block_contents": "The id of the program registry."}, "doc.tamanu_source_dbt.table__reference_data": {"name": "table__reference_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.table__reference_data", "block_contents": "User imported reference data for the environment grouped by type.\r\n\r\n- Catch-all for simple reference data types - there are a LOT of kinds of reference data that exist as just an ID, a \r\nstring label, and occasionally a code; these are all grouped into this table to avoid overcomplicating the schema.\r\n- Occasionally a type of simple reference data will gain some complexity, at which point it will be refactored/migrated \r\nout to use its own table.\r\n- Simple reference data types include a code, type, name and visibility status.\r\n- Example types include `diagnosis`, `procedures`"}, "doc.tamanu_source_dbt.reference_data__code": {"name": "reference_data__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.reference_data__code", "block_contents": "Code of the data item (short value, alphanumerics and hyphens)."}, "doc.tamanu_source_dbt.reference_data__type": {"name": "reference_data__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.reference_data__type", "block_contents": "Class of the data (referred to in code).\r\n\r\nWhenever this table is referred to in a relationship, it's to a specific `type` here. For example a\r\ntable might have a `diagnosis_id`, which is a reference to this table, for specifically only the\r\nrows with `type = diagnosis`."}, "doc.tamanu_source_dbt.reference_data__name": {"name": "reference_data__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.reference_data__name", "block_contents": "Actual data"}, "doc.tamanu_source_dbt.reference_data__system_required": {"name": "reference_data__system_required", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.reference_data__system_required", "block_contents": "Indicates if this record is system-managed and cannot be modified by users"}, "doc.tamanu_source_dbt.table__reference_data_relations": {"name": "table__reference_data_relations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data_relations.md", "original_file_path": "models\\sources\\reference_data_relations.md", "unique_id": "doc.tamanu_source_dbt.table__reference_data_relations", "block_contents": "Entity hierarchy for reference data.\r\n\r\nSome reference datas can be organised in a hierarchy. This is how that's done."}, "doc.tamanu_source_dbt.reference_data_relations__reference_data_id": {"name": "reference_data_relations__reference_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data_relations.md", "original_file_path": "models\\sources\\reference_data_relations.md", "unique_id": "doc.tamanu_source_dbt.reference_data_relations__reference_data_id", "block_contents": "The [reference data](#!/source/source.tamanu.tamanu.reference_data) item."}, "doc.tamanu_source_dbt.reference_data_relations__reference_data_parent_id": {"name": "reference_data_relations__reference_data_parent_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data_relations.md", "original_file_path": "models\\sources\\reference_data_relations.md", "unique_id": "doc.tamanu_source_dbt.reference_data_relations__reference_data_parent_id", "block_contents": "Another [reference data](#!/source/source.tamanu.tamanu.reference_data) item which is the parent of this one."}, "doc.tamanu_source_dbt.reference_data_relations__type": {"name": "reference_data_relations__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data_relations.md", "original_file_path": "models\\sources\\reference_data_relations.md", "unique_id": "doc.tamanu_source_dbt.reference_data_relations__type", "block_contents": "The type of hierarchy being described."}, "doc.tamanu_source_dbt.table__reference_drugs": {"name": "table__reference_drugs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.table__reference_drugs", "block_contents": "Additional information about referenceData that is of the type \u201cdrug\u201d"}, "doc.tamanu_source_dbt.reference_drugs__reference_data_id": {"name": "reference_drugs__reference_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__reference_data_id", "block_contents": "Id of the associated reference data"}, "doc.tamanu_source_dbt.reference_drugs__route": {"name": "reference_drugs__route", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__route", "block_contents": "Route of the drug"}, "doc.tamanu_source_dbt.reference_drugs__units": {"name": "reference_drugs__units", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__units", "block_contents": "Units of the drug"}, "doc.tamanu_source_dbt.reference_drugs__notes": {"name": "reference_drugs__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__notes", "block_contents": "Notes of the drug"}, "doc.tamanu_source_dbt.reference_drugs__is_sensitive": {"name": "reference_drugs__is_sensitive", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__is_sensitive", "block_contents": "Whether the drug is sensitive and requires special handling"}, "doc.tamanu_source_dbt.table__reference_drug_facilities": {"name": "table__reference_drug_facilities", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.table__reference_drug_facilities", "block_contents": "Tracks the availability status of drugs at specific facilities.\r\n\r\n- Links reference drugs to facilities with their availability status\r\n- Allows facilities to manage which drugs are available, unavailable, or have limited stock\r\n- Used for medication dispensing workflows to determine drug availability at a facility"}, "doc.tamanu_source_dbt.reference_drug_facilities__reference_drug_id": {"name": "reference_drug_facilities__reference_drug_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.reference_drug_facilities__reference_drug_id", "block_contents": "Foreign key reference to the associated drug in the reference_drugs table"}, "doc.tamanu_source_dbt.reference_drug_facilities__facility_id": {"name": "reference_drug_facilities__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.reference_drug_facilities__facility_id", "block_contents": "Foreign key reference to the facility where this drug availability applies"}, "doc.tamanu_source_dbt.reference_drug_facilities__quantity": {"name": "reference_drug_facilities__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.reference_drug_facilities__quantity", "block_contents": "The numeric quantity of the drug available at this facility. Stored as an INTEGER:\r\n- Positive integer: Number of units available (e.g., 10, 50, 100)\r\n- 0: Drug is out of stock\r\n- NULL: Quantity is not tracked or unknown (used when stock_status is 'unknown' or 'unavailable')"}, "doc.tamanu_source_dbt.reference_drug_facilities__stock_status": {"name": "reference_drug_facilities__stock_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.reference_drug_facilities__stock_status", "block_contents": "Indicates the stock availability status of the drug at this facility. Stored as a STRING with the following valid values:\r\n- 'in_stock': Drug is available (quantity > 0)\r\n- 'out_of_stock': Drug is not available but tracked (quantity = 0)\r\n- 'unavailable': Drug is not available at this facility (quantity IS NULL)\r\n- 'unknown': Stock status is unknown or not tracked (quantity IS NULL)\r\n\r\nThis column is stored separately from quantity and is enforced by database constraints to maintain consistency:\r\n- 'in_stock' requires quantity > 0\r\n- 'out_of_stock' requires quantity = 0\r\n- 'unknown' or 'unavailable' require quantity IS NULL"}, "doc.tamanu_source_dbt.table__reference_medication_templates": {"name": "table__reference_medication_templates", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.table__reference_medication_templates", "block_contents": "Stores templates for medications, allowing for pre-defined medication orders."}, "doc.tamanu_source_dbt.reference_medication_templates__reference_data_id": {"name": "reference_medication_templates__reference_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__reference_data_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) for this medication template."}, "doc.tamanu_source_dbt.reference_medication_templates__medication_id": {"name": "reference_medication_templates__medication_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__medication_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) for the specific drug in this template."}, "doc.tamanu_source_dbt.reference_medication_templates__is_variable_dose": {"name": "reference_medication_templates__is_variable_dose", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__is_variable_dose", "block_contents": "Boolean indicating if the medication is to be administered \"pro re nata\" (as needed)."}, "doc.tamanu_source_dbt.reference_medication_templates__is_prn": {"name": "reference_medication_templates__is_prn", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__is_prn", "block_contents": "Boolean indicating if the medication dose is variable."}, "doc.tamanu_source_dbt.reference_medication_templates__dose_amount": {"name": "reference_medication_templates__dose_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__dose_amount", "block_contents": "The amount of medication per dose."}, "doc.tamanu_source_dbt.reference_medication_templates__units": {"name": "reference_medication_templates__units", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__units", "block_contents": "The unit for the dose amount (e.g., mg, mL)."}, "doc.tamanu_source_dbt.reference_medication_templates__frequency": {"name": "reference_medication_templates__frequency", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__frequency", "block_contents": "How often the medication should be administered (e.g., BID, TID, QID)."}, "doc.tamanu_source_dbt.reference_medication_templates__route": {"name": "reference_medication_templates__route", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__route", "block_contents": "The route of administration for the medication (e.g., Oral, IV, IM)."}, "doc.tamanu_source_dbt.reference_medication_templates__duration_value": {"name": "reference_medication_templates__duration_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__duration_value", "block_contents": "The numeric value for the duration the medication should be taken (e.g., 7, 14)."}, "doc.tamanu_source_dbt.reference_medication_templates__duration_unit": {"name": "reference_medication_templates__duration_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__duration_unit", "block_contents": "The unit for the medication duration (e.g., days, weeks, months)."}, "doc.tamanu_source_dbt.reference_medication_templates__notes": {"name": "reference_medication_templates__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__notes", "block_contents": "Additional notes or instructions for the medication template."}, "doc.tamanu_source_dbt.reference_medication_templates__discharge_quantity": {"name": "reference_medication_templates__discharge_quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__discharge_quantity", "block_contents": "The quantity of medication to be dispensed upon patient discharge."}, "doc.tamanu_source_dbt.reference_medication_templates__is_ongoing": {"name": "reference_medication_templates__is_ongoing", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__is_ongoing", "block_contents": "A boolean indicating if the medication is ongoing"}, "doc.tamanu_source_dbt.table__referrals": {"name": "table__referrals", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.table__referrals", "block_contents": "[Referrals](https://en.wikipedia.org/wiki/Referral_(medicine)).\r\n\r\nReferrals use a confusing mix of data in the `referrals` table and\r\n[`survey_response_answers`](#!/source/source.tamanu.tamanu.survey_response_answers) identified by\r\nthe text of the question they are for. \r\n\r\nSome additional data is captured in\r\n[survey response answers](#!/source/source.tamanu.tamanu.survey_response_answers), but this is\r\nvariable and not enforced through any validation:\r\n- Where the person is being referred to can be captured by a range of questions, sometimes with a\r\n list of hard coded facility name options, or location groups, or departments.\r\n- Who the referral is \"completed by\" can be captured by a question either the name\r\n 'Referring doctor' or 'Referral completed by'.\r\n- Some referrals are the product of a previous screening survey. In some cases (e.g. Samoa) there is\r\n a SurveyLink question that captures which survey led to this referral, in others (e.g. Nauru)\r\n there is no such question so the two survey responses cannot be reliably linked."}, "doc.tamanu_source_dbt.referrals__referred_facility": {"name": "referrals__referred_facility", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__referred_facility", "block_contents": "Unused."}, "doc.tamanu_source_dbt.referrals__initiating_encounter_id": {"name": "referrals__initiating_encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__initiating_encounter_id", "block_contents": "Reference to the [initiating encounter](#!/source/source.tamanu.tamanu.encounters)."}, "doc.tamanu_source_dbt.referrals__completing_encounter_id": {"name": "referrals__completing_encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__completing_encounter_id", "block_contents": "Unused."}, "doc.tamanu_source_dbt.referrals__survey_response_id": {"name": "referrals__survey_response_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__survey_response_id", "block_contents": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) with more data."}, "doc.tamanu_source_dbt.referrals__status": {"name": "referrals__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__status", "block_contents": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`"}, "doc.tamanu_source_dbt.table__refresh_tokens": {"name": "table__refresh_tokens", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.table__refresh_tokens", "block_contents": "Refresh tokens are used by API clients to refresh their authentication quickly, within a timeout."}, "doc.tamanu_source_dbt.refresh_tokens__refresh_id": {"name": "refresh_tokens__refresh_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.refresh_tokens__refresh_id", "block_contents": "Random value given to the client to use as this refresh token."}, "doc.tamanu_source_dbt.refresh_tokens__device_id": {"name": "refresh_tokens__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.refresh_tokens__device_id", "block_contents": "Unique device ID from the client."}, "doc.tamanu_source_dbt.refresh_tokens__user_id": {"name": "refresh_tokens__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.refresh_tokens__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users) being authenticated as."}, "doc.tamanu_source_dbt.refresh_tokens__expires_at": {"name": "refresh_tokens__expires_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.refresh_tokens__expires_at", "block_contents": "When the refresh token expires."}, "doc.tamanu_source_dbt.table__report_definitions": {"name": "table__report_definitions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definitions.md", "original_file_path": "models\\sources\\report_definitions.md", "unique_id": "doc.tamanu_source_dbt.table__report_definitions", "block_contents": "A name for a report.\r\n\r\nThis is what you see when selecting a report to generate in Tamanu.\r\n\r\nThe actual data is in [versions](#!/source/source.tamanu.tamanu.report_definition_versions)."}, "doc.tamanu_source_dbt.report_definitions__name": {"name": "report_definitions__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definitions.md", "original_file_path": "models\\sources\\report_definitions.md", "unique_id": "doc.tamanu_source_dbt.report_definitions__name", "block_contents": "Human-friendly name of the report."}, "doc.tamanu_source_dbt.report_definitions__db_schema": {"name": "report_definitions__db_schema", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definitions.md", "original_file_path": "models\\sources\\report_definitions.md", "unique_id": "doc.tamanu_source_dbt.report_definitions__db_schema", "block_contents": "The name of the database schema (namespace) which is queried.\r\n\r\nDefaults to `reporting`, which are standardised and normalised views designed specifically for\r\nreporting; sometimes this is set to `public` to query the raw database directly."}, "doc.tamanu_source_dbt.table__report_definition_versions": {"name": "table__report_definition_versions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.table__report_definition_versions", "block_contents": "A report definition containing the actual executable SQL query.\r\n\r\nReport versions are immutable and changes to a report create a new version."}, "doc.tamanu_source_dbt.report_definition_versions__version_number": {"name": "report_definition_versions__version_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__version_number", "block_contents": "The version number.\r\n\r\nVersion numbers are incrementing integers i.e 1,2,3,4.\r\n\r\nThe active version is determined by the highest `status = 'published'` version number"}, "doc.tamanu_source_dbt.report_definition_versions__notes": {"name": "report_definition_versions__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__notes", "block_contents": "Free-form description or usage notes."}, "doc.tamanu_source_dbt.report_definition_versions__status": {"name": "report_definition_versions__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__status", "block_contents": "Status of this version of the report.\r\n\r\nOne of:\r\n- `draft`\r\n- `published`"}, "doc.tamanu_source_dbt.report_definition_versions__query": {"name": "report_definition_versions__query", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__query", "block_contents": "The SQL query."}, "doc.tamanu_source_dbt.report_definition_versions__query_options": {"name": "report_definition_versions__query_options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__query_options", "block_contents": "JSON config containing additional options for the query.\r\n\r\n- Form fields to allow customisation of the query when generating reports (query replacements)\r\n- Default date range e.g. last 30 days\r\n- Context for executing query e.g. this facility or all facilities (facility or central server)"}, "doc.tamanu_source_dbt.report_definition_versions__report_definition_id": {"name": "report_definition_versions__report_definition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__report_definition_id", "block_contents": "The [report definition](#!/source/source.tamanu.tamanu.report_definitions)."}, "doc.tamanu_source_dbt.report_definition_versions__user_id": {"name": "report_definition_versions__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who saved this report version."}, "doc.tamanu_source_dbt.table__report_requests": {"name": "table__report_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.table__report_requests", "block_contents": "Queued requests for reports by users.\r\n\r\nReports can be generated on-demand on the server a user is connected to, or it can be queued and\r\nexecuted at the server's leisure, and then sent attached to an email."}, "doc.tamanu_source_dbt.report_requests__report_type": {"name": "report_requests__report_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__report_type", "block_contents": "If the report is defined in code, this is the code of that report.\r\n\r\nMost reports are now created in SQL, but there are still a number of legacy reports that are\r\nhardcoded in the Tamanu source code, and this is how they're referenced."}, "doc.tamanu_source_dbt.report_requests__recipients": {"name": "report_requests__recipients", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__recipients", "block_contents": "JSON array of email addresses.\r\n\r\nSome legacy data may exist that specifies this as a comma-separated values."}, "doc.tamanu_source_dbt.report_requests__parameters": {"name": "report_requests__parameters", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__parameters", "block_contents": "JSON parameters for the report."}, "doc.tamanu_source_dbt.report_requests__status": {"name": "report_requests__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__status", "block_contents": "Processing status of the report request.\r\n\r\nOne of:\r\n- `Received`\r\n- `Processing`\r\n- `Processed`\r\n- `Error`"}, "doc.tamanu_source_dbt.report_requests__requested_by_user_id": {"name": "report_requests__requested_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__requested_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) requesting this report generation."}, "doc.tamanu_source_dbt.report_requests__error": {"name": "report_requests__error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__error", "block_contents": "If the report fails to process, the error."}, "doc.tamanu_source_dbt.report_requests__process_started_time": {"name": "report_requests__process_started_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__process_started_time", "block_contents": "When processing started."}, "doc.tamanu_source_dbt.report_requests__facility_id": {"name": "report_requests__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this report request is from."}, "doc.tamanu_source_dbt.report_requests__export_format": {"name": "report_requests__export_format", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__export_format", "block_contents": "The format the report results must be exported as.\r\n\r\nOne of:\r\n- `xlsx`\r\n- `csv`"}, "doc.tamanu_source_dbt.report_requests__report_definition_version_id": {"name": "report_requests__report_definition_version_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__report_definition_version_id", "block_contents": "The [report version](#!/source/source.tamanu.tamanu.report_definition_versions) being generated.\r\n\r\nNote that this is a version, not a report. If a report is updated after a request is queued, the\r\n\"old\" version will be executed. Additionally, new versions must be synced to facilities to be usable."}, "doc.tamanu_source_dbt.table__roles": {"name": "table__roles", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\roles.md", "original_file_path": "models\\sources\\roles.md", "unique_id": "doc.tamanu_source_dbt.table__roles", "block_contents": "These are sets of permissions that are given to users to determine what they can do in Tamanu.\r\n\r\nThe actual permissions are associated to the role in the\r\n[`permissions`](#!/source/source.tamanu.tamanu.permissions) table."}, "doc.tamanu_source_dbt.roles__name": {"name": "roles__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\roles.md", "original_file_path": "models\\sources\\roles.md", "unique_id": "doc.tamanu_source_dbt.roles__name", "block_contents": "Readable name for the role."}, "doc.tamanu_source_dbt.table__scheduled_vaccines": {"name": "table__scheduled_vaccines", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.table__scheduled_vaccines", "block_contents": "A vaccine schedule listing all vaccines expected to be given to a child as part of a country wide Expanded Program of \r\nImmunisation can be incorporated into Tamanu to show each dose and due date on the front end of the system. \r\n\r\nFirst dose of a vaccine should use `weeks_from_birth_due` whilst subsequent doses should use \r\n`weeks_from_last_vaccination_due`."}, "doc.tamanu_source_dbt.scheduled_vaccines__id": {"name": "scheduled_vaccines__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__id", "block_contents": "Tamanu identifier for vaccine schedules"}, "doc.tamanu_source_dbt.scheduled_vaccines__category": {"name": "scheduled_vaccines__category", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__category", "block_contents": "Vaccine category [Routine, Catch-up, Campaign, Other]"}, "doc.tamanu_source_dbt.scheduled_vaccines__label": {"name": "scheduled_vaccines__label", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__label", "block_contents": "Contents of the label column is what will be displayed on the front end of Tamanu \r\nunder fields labelled 'Vaccine'. This is where the vaccine name is listed. E.g. 'BCG'."}, "doc.tamanu_source_dbt.scheduled_vaccines__dose_label": {"name": "scheduled_vaccines__dose_label", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__dose_label", "block_contents": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')"}, "doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_birth_due": {"name": "scheduled_vaccines__weeks_from_birth_due", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_birth_due", "block_contents": "This column is used to tell Tamanu how many weeks from the child's date of birth a vaccine is due. This will populate \r\nthe front end within the Vaccine schedule section in the column 'Due date'. For a vaccine to appear in the Vaccine \r\nschedule a dose must have a `weeksFromBirthDue` entered into the reference data. \r\n\r\nThis field should be used only for the first dose of the vaccine. Subsequent doses should use \r\n`weeks_from_last_vaccination_due`"}, "doc.tamanu_source_dbt.scheduled_vaccines__index": {"name": "scheduled_vaccines__index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__index", "block_contents": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given."}, "doc.tamanu_source_dbt.scheduled_vaccines__vaccine_id": {"name": "scheduled_vaccines__vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__vaccine_id", "block_contents": "Use the vaccineId column to link the id column of the Reference Data sheet Drug to the vaccine schedule. Copy the exact \r\nid from the id column in the reference data sheet Drug and paste it in the vaccineId column in the Scheduled Vaccine \r\nsheet."}, "doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_last_vaccination_due": {"name": "scheduled_vaccines__weeks_from_last_vaccination_due", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_last_vaccination_due", "block_contents": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given. The order of a vaccine dose is defined at the `index` field. \r\n\r\nThis field should not be used for the first dose but for subsequent doses. First dose should use `weeks_from_birth_due`"}, "doc.tamanu_source_dbt.scheduled_vaccines__hide_from_certificate": {"name": "scheduled_vaccines__hide_from_certificate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__hide_from_certificate", "block_contents": "Vaccines can be hidden from the vaccine certificate where required\r\n\r\nTo hide a vaccine from appearing on the vaccine certificate across the deployment, use column hideFromCertificate\r\n- true = vaccine will not appear on the vaccine certificate\r\n- blank / false = vaccine will appear on the vaccine certificate"}, "doc.tamanu_source_dbt.scheduled_vaccines__sort_index": {"name": "scheduled_vaccines__sort_index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__sort_index", "block_contents": "Sort index defaults to 0"}, "doc.tamanu_source_dbt.table__SequelizeMeta": {"name": "table__SequelizeMeta", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\SequelizeMeta.md", "original_file_path": "models\\sources\\SequelizeMeta.md", "unique_id": "doc.tamanu_source_dbt.table__SequelizeMeta", "block_contents": "This table tracks which migrations have been run. It is automatically managed by Sequelize (within Tamanu's `migrate`\r\nsubcommand), should never be edited manually"}, "doc.tamanu_source_dbt.SequelizeMeta__name": {"name": "SequelizeMeta__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\SequelizeMeta.md", "original_file_path": "models\\sources\\SequelizeMeta.md", "unique_id": "doc.tamanu_source_dbt.SequelizeMeta__name", "block_contents": "Name of the migration"}, "doc.tamanu_source_dbt.table__settings": {"name": "table__settings", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.table__settings", "block_contents": "Shared and synced configuration values.\r\n\r\nAlways set from the Central server / Admin interfaces and then synced to facilities.\r\n\r\nThose can change dynamically when a server/client is up, some settings are read at point of use and\r\nso change is applied \"immediately\", some settings are read once at server start but those should be\r\nrare and eventually eliminated as there's no facility within Tamanu to restart its own servers."}, "doc.tamanu_source_dbt.settings__key": {"name": "settings__key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.settings__key", "block_contents": "Dotted JSON path."}, "doc.tamanu_source_dbt.settings__value": {"name": "settings__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.settings__value", "block_contents": "JSON value."}, "doc.tamanu_source_dbt.settings__facility_id": {"name": "settings__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.settings__facility_id", "block_contents": "The [facility](#!/source/source.tamanu.tamanu.facilities) this setting is scoped to."}, "doc.tamanu_source_dbt.settings__scope": {"name": "settings__scope", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.settings__scope", "block_contents": "Scope of the setting, which determines how it's applied.\r\n\r\nOne of:\r\n- `global`\r\n- `central`\r\n- `facility`"}, "doc.tamanu_source_dbt.table__signers": {"name": "table__signers", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.table__signers", "block_contents": "Table of signing key and certificates for EUDCC and ICAO VDS certifications.\r\n\r\nIntroduced during the COVID-19 pandemic, these are standards which can be\r\nused to produce a QR code containing vaccine information and a digital signature\r\nwhich certifies that the vaccines were administered by a competent authority.\r\n\r\nDigital signatures are issued using a key which is rotated every three months,\r\nand which is itself signed by a Certificate Authority. A country's CA is trusted\r\nby verifying authorities such as the ICAO or EU. This completes the trust chain.\r\n\r\nTamanu generates keys and Certificate Signing Requests in this table. The secret\r\nkey material never leaves the server which generates it. CSRs are signed by the\r\ncountry Health CA, which then returns a Certificate, which is loaded in Tamanu.\r\n\r\nThere are two sets of dates associated with each Signing Key:\r\n- the validity period propagates to the Digital Signatures on the QR codes; and\r\n is generally set to 10 years.\r\n- the working period defines when the Signing Key is rotated.\r\n\r\nWhen a key is rotated, the secret material may be erased to ensure the key can\r\nnever be used again; the public information is kept forever.\r\n\r\nThere is always at most one row in this table which has a NULL `certificate`\r\nfield; this is the pending CSR.\r\n\r\nThe Signing Key in use is the row which has a NON-NULL `certificate`, a validity\r\nand working period encompassing the current time, a NON-NULL `private_key`, and\r\nis the newest within that set.\r\n\r\nSee also the `certifiable_vaccines` table.\r\n\r\nThis table is present on Facility Servers, but never populated."}, "doc.tamanu_source_dbt.signers__country_code": {"name": "signers__country_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__country_code", "block_contents": "ISO country code for the Health CA."}, "doc.tamanu_source_dbt.signers__private_key": {"name": "signers__private_key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__private_key", "block_contents": "Private key data.\r\n\r\nThis is stored encrypted at rest, using the configuration key `integrations.signer.keySecret`."}, "doc.tamanu_source_dbt.signers__public_key": {"name": "signers__public_key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__public_key", "block_contents": "Public key data."}, "doc.tamanu_source_dbt.signers__request": {"name": "signers__request", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__request", "block_contents": "Certificate Signing Request."}, "doc.tamanu_source_dbt.signers__certificate": {"name": "signers__certificate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__certificate", "block_contents": "Signed Certificate (signed by the Health CA)."}, "doc.tamanu_source_dbt.signers__validity_period_start": {"name": "signers__validity_period_start", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__validity_period_start", "block_contents": "Before that date, the key cannot be used, and signatures generated by it cannot be trusted."}, "doc.tamanu_source_dbt.signers__validity_period_end": {"name": "signers__validity_period_end", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__validity_period_end", "block_contents": "After that date, the key cannot be used, and signatures generated by it cannot be trusted."}, "doc.tamanu_source_dbt.signers__signatures_issued": {"name": "signers__signatures_issued", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__signatures_issued", "block_contents": "Counter of digital signatures issued from this key.\r\n\r\nThis can be used for statistical purposes or for usage policy. For example, one\r\ncould specify that kyes should be rotated every three months or every 1000\r\nsignatures, whichever comes first."}, "doc.tamanu_source_dbt.signers__request_sent_at": {"name": "signers__request_sent_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__request_sent_at", "block_contents": "Date at which the CSR was sent to be signed by the Health CA."}, "doc.tamanu_source_dbt.signers__working_period_start": {"name": "signers__working_period_start", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__working_period_start", "block_contents": "Before that date, the key cannot be used."}, "doc.tamanu_source_dbt.signers__working_period_end": {"name": "signers__working_period_end", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__working_period_end", "block_contents": "After that date, the key cannot be used.\r\n\r\nAfter that date, the private key may also be nulled.\r\n\r\nThis is always less than or equal to `validity_period_end`."}, "doc.tamanu_source_dbt.table__socket_io_attachments": {"name": "table__socket_io_attachments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\socket_io_attachments.md", "original_file_path": "models\\sources\\socket_io_attachments.md", "unique_id": "doc.tamanu_source_dbt.table__socket_io_attachments", "block_contents": "Table used by Socket.IO to synchronise WebSocket sessions across server replicas."}, "doc.tamanu_source_dbt.socket_io_attachments__payload": {"name": "socket_io_attachments__payload", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\socket_io_attachments.md", "original_file_path": "models\\sources\\socket_io_attachments.md", "unique_id": "doc.tamanu_source_dbt.socket_io_attachments__payload", "block_contents": "Payload."}, "doc.tamanu_source_dbt.table__surveys": {"name": "table__surveys", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.table__surveys", "block_contents": "Surveys, aka custom forms that can be filled by practitioners.\r\n\r\nThese are composed of [screen components](#!/source/source.tamanu.tamanu.survey_screen_components)."}, "doc.tamanu_source_dbt.surveys__code": {"name": "surveys__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__code", "block_contents": "Machine-friendly code."}, "doc.tamanu_source_dbt.surveys__name": {"name": "surveys__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__name", "block_contents": "Human-friendly name."}, "doc.tamanu_source_dbt.surveys__program_id": {"name": "surveys__program_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__program_id", "block_contents": "The [program](#!/source/source.tamanu.tamanu.programs) grouping this survey."}, "doc.tamanu_source_dbt.surveys__survey_type": {"name": "surveys__survey_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__survey_type", "block_contents": "Type of survey.\r\n\r\nOne of:\r\n- `programs`\r\n- `referral`\r\n- `obsolete`\r\n- `vitals`"}, "doc.tamanu_source_dbt.surveys__is_sensitive": {"name": "surveys__is_sensitive", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__is_sensitive", "block_contents": "Whether the data recorded in the survey is sensitive."}, "doc.tamanu_source_dbt.surveys__notifiable": {"name": "surveys__notifiable", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__notifiable", "block_contents": "Whether filling this survey sends a notification email.\r\n\r\nThese are sent by the `SurveyCompletionNotifierProcessor` scheduled task."}, "doc.tamanu_source_dbt.surveys__notify_email_addresses": {"name": "surveys__notify_email_addresses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__notify_email_addresses", "block_contents": "If `notifiable` is true, where to send the notification."}, "doc.tamanu_source_dbt.table__survey_responses": {"name": "table__survey_responses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.table__survey_responses", "block_contents": "A response to a survey (as recorded by a practitioner).\r\n\r\nTypically surveys are filled on behalf of patients as part of an encounter.\r\n\r\nBecause there are multiple distinct kinds of dates at play here:\r\n- `created_at`, `updated_at`, `deleted_at` are system data for syncing and cannot be relied on for realtime\r\n- `start_time`, `end_time` are real datetimes automatically recorded when starting and submitting a survey response\r\n- in survey response answers, there could be a data element for targeting the date of when exactly the data is recorded in real time."}, "doc.tamanu_source_dbt.survey_responses__start_time": {"name": "survey_responses__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__start_time", "block_contents": "When the survey was started."}, "doc.tamanu_source_dbt.survey_responses__end_time": {"name": "survey_responses__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__end_time", "block_contents": "When the survey was completed."}, "doc.tamanu_source_dbt.survey_responses__result": {"name": "survey_responses__result", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__result", "block_contents": "The numeric value that is the summary of the survey response."}, "doc.tamanu_source_dbt.survey_responses__survey_id": {"name": "survey_responses__survey_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__survey_id", "block_contents": "The [survey](#!/source/source.tamanu.tamanu.surveys) being responded to."}, "doc.tamanu_source_dbt.survey_responses__encounter_id": {"name": "survey_responses__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this survey response is a part of."}, "doc.tamanu_source_dbt.survey_responses__result_text": {"name": "survey_responses__result_text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__result_text", "block_contents": "The textual value that is the summary of the survey response."}, "doc.tamanu_source_dbt.survey_responses__user_id": {"name": "survey_responses__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) recording this survey response."}, "doc.tamanu_source_dbt.survey_responses__start_time_legacy": {"name": "survey_responses__start_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__start_time_legacy", "block_contents": "[Deprecated] When the survey was started."}, "doc.tamanu_source_dbt.survey_responses__end_time_legacy": {"name": "survey_responses__end_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__end_time_legacy", "block_contents": "[Deprecated] When the survey was completed."}, "doc.tamanu_source_dbt.survey_responses__notified": {"name": "survey_responses__notified", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__notified", "block_contents": "If the [survey](#!/source/source.tamanu.tamanu.surveys) is `notifiable`, whether this response's\r\nnotification has been sent."}, "doc.tamanu_source_dbt.survey_responses__metadata": {"name": "survey_responses__metadata", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__metadata", "block_contents": "Metadata for a survey response, (eg: if a survey response is linked to another survey response)"}, "doc.tamanu_source_dbt.table__survey_response_answers": {"name": "table__survey_response_answers", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.table__survey_response_answers", "block_contents": "A single answer as part of a [survey response](#!/source/source.tamanu.tamanu.survey_responses)."}, "doc.tamanu_source_dbt.survey_response_answers__name": {"name": "survey_response_answers__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__name", "block_contents": "Name of the question."}, "doc.tamanu_source_dbt.survey_response_answers__body": {"name": "survey_response_answers__body", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__body", "block_contents": "Value of the answer."}, "doc.tamanu_source_dbt.survey_response_answers__response_id": {"name": "survey_response_answers__response_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__response_id", "block_contents": "The [survey response](#!/source/source.tamanu.tamanu.survey_responses)."}, "doc.tamanu_source_dbt.survey_response_answers__data_element_id": {"name": "survey_response_answers__data_element_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__data_element_id", "block_contents": "Reference to the [question](#!/source/source.tamanu.tamanu.program_data_elements)."}, "doc.tamanu_source_dbt.survey_response_answers__body_legacy": {"name": "survey_response_answers__body_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__body_legacy", "block_contents": "[Deprecated] Value of the answer in old format."}, "doc.tamanu_source_dbt.table__survey_screen_components": {"name": "table__survey_screen_components", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.table__survey_screen_components", "block_contents": "Describes how a survey question gets displayed.\r\n\r\nSee [program data element](#!/source/source.tamanu.tamanu.program_data_elements), which describes\r\nhow the data from the question is stored."}, "doc.tamanu_source_dbt.survey_screen_components__screen_index": {"name": "survey_screen_components__screen_index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__screen_index", "block_contents": "Screen this component should appear on.\r\n\r\nSurveys can have multiple \"screens\" or pages, this index sets where this particular question sits."}, "doc.tamanu_source_dbt.survey_screen_components__component_index": {"name": "survey_screen_components__component_index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__component_index", "block_contents": "The absolute index (order) of the component in the survey."}, "doc.tamanu_source_dbt.survey_screen_components__text": {"name": "survey_screen_components__text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__text", "block_contents": "Description or question of this component."}, "doc.tamanu_source_dbt.survey_screen_components__validation_criteria": {"name": "survey_screen_components__validation_criteria", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__validation_criteria", "block_contents": "JSON criteria that determines whether the value entered in this component is accepted."}, "doc.tamanu_source_dbt.survey_screen_components__detail": {"name": "survey_screen_components__detail", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__detail", "block_contents": "Longer description or explanatory text of this component."}, "doc.tamanu_source_dbt.survey_screen_components__config": {"name": "survey_screen_components__config", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__config", "block_contents": "JSON additional config of the component."}, "doc.tamanu_source_dbt.survey_screen_components__options": {"name": "survey_screen_components__options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__options", "block_contents": "JSON array of strings of options to be selected."}, "doc.tamanu_source_dbt.survey_screen_components__visibility_criteria": {"name": "survey_screen_components__visibility_criteria", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__visibility_criteria", "block_contents": "JSON criteria that determines when this component is visible.\r\n\r\nA criteria is a list of other components' codes and the value that will make this question show up:\r\n\r\n```json\r\n{\r\n \"otherQuestion\": \"Yes\"\r\n}\r\n```\r\n\r\nThere can also be the special criterium `{\"hidden\": true}` which always hides the question, and the\r\nspecial key `\"_conjunction\": \"or\"` which makes it so _any one_ item in the list is sufficient to\r\nshow the question, instead of the default where _all_ items must match."}, "doc.tamanu_source_dbt.survey_screen_components__calculation": {"name": "survey_screen_components__calculation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__calculation", "block_contents": "Math expression to do calculations on the entered value before it's saved.\r\n\r\nFor example `questionCode + 3`."}, "doc.tamanu_source_dbt.survey_screen_components__survey_id": {"name": "survey_screen_components__survey_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__survey_id", "block_contents": "The [survey](#!/source/source.tamanu.tamanu.surveys)."}, "doc.tamanu_source_dbt.survey_screen_components__data_element_id": {"name": "survey_screen_components__data_element_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__data_element_id", "block_contents": "Reference to the [data element](#!/source/source.tamanu.tamanu.program_data_elements) configuring\r\nhow the data from the question is stored."}, "doc.tamanu_source_dbt.table__sync_device_ticks": {"name": "table__sync_device_ticks", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_device_ticks.md", "original_file_path": "models\\sources\\sync_device_ticks.md", "unique_id": "doc.tamanu_source_dbt.table__sync_device_ticks", "block_contents": "Cache of which syncing device is at which tick.\r\n\r\nThis is used internally as part of sync."}, "doc.tamanu_source_dbt.sync_device_ticks__persisted_at_sync_tick": {"name": "sync_device_ticks__persisted_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_device_ticks.md", "original_file_path": "models\\sources\\sync_device_ticks.md", "unique_id": "doc.tamanu_source_dbt.sync_device_ticks__persisted_at_sync_tick", "block_contents": "The sync tick."}, "doc.tamanu_source_dbt.sync_device_ticks__device_id": {"name": "sync_device_ticks__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_device_ticks.md", "original_file_path": "models\\sources\\sync_device_ticks.md", "unique_id": "doc.tamanu_source_dbt.sync_device_ticks__device_id", "block_contents": "The device that's at this sync tick."}, "doc.tamanu_source_dbt.table__sync_lookup": {"name": "table__sync_lookup", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.table__sync_lookup", "block_contents": "Cache of records to use for sync.\r\n\r\nThis is used internally in the sync process."}, "doc.tamanu_source_dbt.sync_lookup__record_id": {"name": "sync_lookup__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__record_id", "block_contents": "The `id` field of the record."}, "doc.tamanu_source_dbt.sync_lookup__record_type": {"name": "sync_lookup__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__record_type", "block_contents": "The table name of the record."}, "doc.tamanu_source_dbt.sync_lookup__data": {"name": "sync_lookup__data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__data", "block_contents": "All the fields of the record."}, "doc.tamanu_source_dbt.sync_lookup__patient_id": {"name": "sync_lookup__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__patient_id", "block_contents": "If the record has a [patient](#!/source/source.tamanu.tamanu.patients) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__encounter_id": {"name": "sync_lookup__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__encounter_id", "block_contents": "If the record has an [encounter](#!/source/source.tamanu.tamanu.encounters) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__facility_id": {"name": "sync_lookup__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__facility_id", "block_contents": "If the record has a [facility](#!/source/source.tamanu.tamanu.facilitys) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__is_lab_request": {"name": "sync_lookup__is_lab_request", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__is_lab_request", "block_contents": "Whether the record is or is related to a lab request.\r\n\r\nThis is used to filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__is_deleted": {"name": "sync_lookup__is_deleted", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__is_deleted", "block_contents": "Whether the record is deleted (`deleted_at` is not null).\r\n\r\nThis is used to sort and filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__updated_at_by_field_sum": {"name": "sync_lookup__updated_at_by_field_sum", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__updated_at_by_field_sum", "block_contents": "If the record has an `updatedAtByField`, the sum of those values.\r\n\r\nThis is used to sort and filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__pushed_by_device_id": {"name": "sync_lookup__pushed_by_device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__pushed_by_device_id", "block_contents": "The unique device that pushed this record."}, "doc.tamanu_source_dbt.table__sync_lookup_ticks": {"name": "table__sync_lookup_ticks", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup_ticks.md", "original_file_path": "models\\sources\\sync_lookup_ticks.md", "unique_id": "doc.tamanu_source_dbt.table__sync_lookup_ticks", "block_contents": "Stores range of sync lookup ticks per sync."}, "doc.tamanu_source_dbt.sync_lookup_ticks__source_start_tick": {"name": "sync_lookup_ticks__source_start_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup_ticks.md", "original_file_path": "models\\sources\\sync_lookup_ticks.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup_ticks__source_start_tick", "block_contents": "Represents the previous lookup up to tick."}, "doc.tamanu_source_dbt.sync_lookup_ticks__lookup_end_tick": {"name": "sync_lookup_ticks__lookup_end_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup_ticks.md", "original_file_path": "models\\sources\\sync_lookup_ticks.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup_ticks__lookup_end_tick", "block_contents": "Represents the new sync tick at time of updating lookup-pending records."}, "doc.tamanu_source_dbt.table__sync_queued_devices": {"name": "table__sync_queued_devices", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.table__sync_queued_devices", "block_contents": "Devices waiting their turn to be synced."}, "doc.tamanu_source_dbt.sync_queued_devices__last_seen_time": {"name": "sync_queued_devices__last_seen_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__last_seen_time", "block_contents": "The last time the device has reached out to the syncing server."}, "doc.tamanu_source_dbt.sync_queued_devices__last_synced_tick": {"name": "sync_queued_devices__last_synced_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__last_synced_tick", "block_contents": "The sync tick the device is currently at."}, "doc.tamanu_source_dbt.sync_queued_devices__facility_id_legacy": {"name": "sync_queued_devices__facility_id_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__facility_id_legacy", "block_contents": "[Deprecated] Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this device is associated with."}, "doc.tamanu_source_dbt.sync_queued_devices__urgent": {"name": "sync_queued_devices__urgent", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__urgent", "block_contents": "A way for a device to bump its priority in the queue."}, "doc.tamanu_source_dbt.sync_queued_devices__facility_ids": {"name": "sync_queued_devices__facility_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__facility_ids", "block_contents": "Reference to the [facilities](#!/source/source.tamanu.tamanu.facilities) this device is associated with."}, "doc.tamanu_source_dbt.table__sync_sessions": {"name": "table__sync_sessions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.table__sync_sessions", "block_contents": "Records of each user that can login to the site"}, "doc.tamanu_source_dbt.sync_sessions__id": {"name": "sync_sessions__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__id", "block_contents": "Tamanu identifier for the sync session"}, "doc.tamanu_source_dbt.sync_sessions__start_time": {"name": "sync_sessions__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__start_time", "block_contents": "Timestamp when sync session started"}, "doc.tamanu_source_dbt.sync_sessions__last_connection_time": {"name": "sync_sessions__last_connection_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__last_connection_time", "block_contents": "Timestamp when sync session made last connection"}, "doc.tamanu_source_dbt.sync_sessions__snapshot_completed_at": {"name": "sync_sessions__snapshot_completed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__snapshot_completed_at", "block_contents": "Timestamp when sync session snapshot was completed"}, "doc.tamanu_source_dbt.sync_sessions__debug_info": {"name": "sync_sessions__debug_info", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__debug_info", "block_contents": "Debug information for the sync session"}, "doc.tamanu_source_dbt.sync_sessions__parameters": {"name": "sync_sessions__parameters", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__parameters", "block_contents": "Parameters for the sync session"}, "doc.tamanu_source_dbt.sync_sessions__completed_at": {"name": "sync_sessions__completed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__completed_at", "block_contents": "Timestamp when sync session was completed"}, "doc.tamanu_source_dbt.sync_sessions__persist_completed_at": {"name": "sync_sessions__persist_completed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__persist_completed_at", "block_contents": "Timestamp when sync session completion record is persisted"}, "doc.tamanu_source_dbt.sync_sessions__pull_since": {"name": "sync_sessions__pull_since", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__pull_since", "block_contents": "Sync tick that the sync session pulled since"}, "doc.tamanu_source_dbt.sync_sessions__pull_until": {"name": "sync_sessions__pull_until", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__pull_until", "block_contents": "Sync tick that the sync session pulled until"}, "doc.tamanu_source_dbt.sync_sessions__started_at_tick": {"name": "sync_sessions__started_at_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__started_at_tick", "block_contents": "Sync tick that the sync session started at"}, "doc.tamanu_source_dbt.sync_sessions__snapshot_started_at": {"name": "sync_sessions__snapshot_started_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__snapshot_started_at", "block_contents": "Timestamp the sync session snapshot started at"}, "doc.tamanu_source_dbt.sync_sessions__errors": {"name": "sync_sessions__errors", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__errors", "block_contents": "If a sync fails, the error(s)."}, "doc.tamanu_source_dbt.table__tasks": {"name": "table__tasks", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.table__tasks", "block_contents": "Tasks related to encounters"}, "doc.tamanu_source_dbt.tasks__encounter_id": {"name": "tasks__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this task is a part of."}, "doc.tamanu_source_dbt.tasks__name": {"name": "tasks__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__name", "block_contents": "Name of the task."}, "doc.tamanu_source_dbt.tasks__due_time": {"name": "tasks__due_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__due_time", "block_contents": "When the task is due."}, "doc.tamanu_source_dbt.tasks__end_time": {"name": "tasks__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__end_time", "block_contents": "When the repeating task is end."}, "doc.tamanu_source_dbt.tasks__requested_by_user_id": {"name": "tasks__requested_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__requested_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this task."}, "doc.tamanu_source_dbt.tasks__request_time": {"name": "tasks__request_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__request_time", "block_contents": "When the task is requested."}, "doc.tamanu_source_dbt.tasks__status": {"name": "tasks__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__status", "block_contents": "Status of the task.\r\n\r\nOne of:\r\n- `todo`\r\n- `completed`\r\n- `non_completed`"}, "doc.tamanu_source_dbt.tasks__note": {"name": "tasks__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__note", "block_contents": "Note of the task."}, "doc.tamanu_source_dbt.tasks__frequency_value": {"name": "tasks__frequency_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__frequency_value", "block_contents": "Frequency value of the task (if the task is repeating), must go with frequency unit."}, "doc.tamanu_source_dbt.tasks__frequency_unit": {"name": "tasks__frequency_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__frequency_unit", "block_contents": "Frequency unit of the task (if the task is repeating).\r\n\r\nOne of:\r\n- `minute`\r\n- `hour`\r\n- `day`"}, "doc.tamanu_source_dbt.tasks__high_priority": {"name": "tasks__high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__high_priority", "block_contents": "Boolean specify if the task is high priority."}, "doc.tamanu_source_dbt.tasks__parent_task_id": {"name": "tasks__parent_task_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__parent_task_id", "block_contents": "Reference to the original [task](#!/source/source.tamanu.tamanu.tasks) that the task is repeated from if it is a repeating task."}, "doc.tamanu_source_dbt.tasks__completed_by_user_id": {"name": "tasks__completed_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__completed_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as completed."}, "doc.tamanu_source_dbt.tasks__completed_time": {"name": "tasks__completed_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__completed_time", "block_contents": "When the task is marked as completed."}, "doc.tamanu_source_dbt.tasks__completed_note": {"name": "tasks__completed_note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__completed_note", "block_contents": "Completed note of the task."}, "doc.tamanu_source_dbt.tasks__not_completed_by_user_id": {"name": "tasks__not_completed_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__not_completed_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as not completed."}, "doc.tamanu_source_dbt.tasks__not_completed_time": {"name": "tasks__not_completed_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__not_completed_time", "block_contents": "When the task is marked as not completed."}, "doc.tamanu_source_dbt.tasks__not_completed_reason_id": {"name": "tasks__not_completed_reason_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__not_completed_reason_id", "block_contents": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is not completed."}, "doc.tamanu_source_dbt.tasks__todo_by_user_id": {"name": "tasks__todo_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__todo_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as to-do."}, "doc.tamanu_source_dbt.tasks__todo_time": {"name": "tasks__todo_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__todo_time", "block_contents": "When the task is marked as to-do."}, "doc.tamanu_source_dbt.tasks__todo_note": {"name": "tasks__todo_note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__todo_note", "block_contents": "To-do note of the task."}, "doc.tamanu_source_dbt.tasks__deleted_by_user_id": {"name": "tasks__deleted_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__deleted_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who delete this task."}, "doc.tamanu_source_dbt.tasks__deleted_time": {"name": "tasks__deleted_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__deleted_time", "block_contents": "When the task is deleted."}, "doc.tamanu_source_dbt.tasks__deleted_reason_id": {"name": "tasks__deleted_reason_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__deleted_reason_id", "block_contents": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is deleted."}, "doc.tamanu_source_dbt.tasks__deleted_reason_for_sync_id": {"name": "tasks__deleted_reason_for_sync_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__deleted_reason_for_sync_id", "block_contents": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is deleted if it is deleted by the system."}, "doc.tamanu_source_dbt.tasks__duration_value": {"name": "tasks__duration_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__duration_value", "block_contents": "Numeric value specifying the expected duration of the task, must be used in conjunction with duration_unit."}, "doc.tamanu_source_dbt.tasks__duration_unit": {"name": "tasks__duration_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__duration_unit", "block_contents": "Unit of time for the task duration.\r\n\r\nOne of:\r\n- `hours`\r\n- `days`\r\n- `occurrences`"}, "doc.tamanu_source_dbt.tasks__task_type": {"name": "tasks__task_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__task_type", "block_contents": "Type of the task.\r\n\r\nOne of:\r\n- `normal_task`\r\n- `medication_due_task`"}, "doc.tamanu_source_dbt.table__task_designations": {"name": "table__task_designations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_designations.md", "original_file_path": "models\\sources\\task_designations.md", "unique_id": "doc.tamanu_source_dbt.table__task_designations", "block_contents": "Association of designation to task."}, "doc.tamanu_source_dbt.task_designations__task_id": {"name": "task_designations__task_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_designations.md", "original_file_path": "models\\sources\\task_designations.md", "unique_id": "doc.tamanu_source_dbt.task_designations__task_id", "block_contents": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.task_designations__designation_id": {"name": "task_designations__designation_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_designations.md", "original_file_path": "models\\sources\\task_designations.md", "unique_id": "doc.tamanu_source_dbt.task_designations__designation_id", "block_contents": "The task [task](#!/source/source.tamanu.tamanu.tasks)"}, "doc.tamanu_source_dbt.table__task_templates": {"name": "table__task_templates", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.table__task_templates", "block_contents": "Template of tasks which then can be created upon"}, "doc.tamanu_source_dbt.task_templates__reference_data_id": {"name": "task_templates__reference_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.task_templates__reference_data_id", "block_contents": "The name of task template, referred to ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.task_templates__high_priority": {"name": "task_templates__high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.task_templates__high_priority", "block_contents": "Boolean specify if the task template is high priority."}, "doc.tamanu_source_dbt.task_templates__frequency_value": {"name": "task_templates__frequency_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.task_templates__frequency_value", "block_contents": "Frequency value of the task template (if the task is repeating), must go with frequency unit."}, "doc.tamanu_source_dbt.task_templates__frequency_unit": {"name": "task_templates__frequency_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.task_templates__frequency_unit", "block_contents": "Frequency unit of the task template (if the task is repeating).\r\n\r\nOne of:\r\n- `minute`\r\n- `hour`\r\n- `day`"}, "doc.tamanu_source_dbt.table__task_template_designations": {"name": "table__task_template_designations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_template_designations.md", "original_file_path": "models\\sources\\task_template_designations.md", "unique_id": "doc.tamanu_source_dbt.table__task_template_designations", "block_contents": "Association of designation to task template"}, "doc.tamanu_source_dbt.task_template_designations__task_template_id": {"name": "task_template_designations__task_template_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_template_designations.md", "original_file_path": "models\\sources\\task_template_designations.md", "unique_id": "doc.tamanu_source_dbt.task_template_designations__task_template_id", "block_contents": "The task template ([Task Template](#!/source/source.tamanu.tamanu.task_templates))."}, "doc.tamanu_source_dbt.task_template_designations__designation_id": {"name": "task_template_designations__designation_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_template_designations.md", "original_file_path": "models\\sources\\task_template_designations.md", "unique_id": "doc.tamanu_source_dbt.task_template_designations__designation_id", "block_contents": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__templates": {"name": "table__templates", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.table__templates", "block_contents": "Templates used for patient letters and clinical notes etc."}, "doc.tamanu_source_dbt.templates__name": {"name": "templates__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__name", "block_contents": "Internal name of the template (used when importing)."}, "doc.tamanu_source_dbt.templates__date_created": {"name": "templates__date_created", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__date_created", "block_contents": "When the template was created."}, "doc.tamanu_source_dbt.templates__title": {"name": "templates__title", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__title", "block_contents": "Title of the template (which will be rendered)."}, "doc.tamanu_source_dbt.templates__body": {"name": "templates__body", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__body", "block_contents": "Body of the template (which will be rendered)."}, "doc.tamanu_source_dbt.templates__created_by_id": {"name": "templates__created_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__created_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who created this template."}, "doc.tamanu_source_dbt.templates__type": {"name": "templates__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__type", "block_contents": "Type of the template (referred to in code)."}, "doc.tamanu_source_dbt.table__translated_strings": {"name": "table__translated_strings", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\translated_strings.md", "original_file_path": "models\\sources\\translated_strings.md", "unique_id": "doc.tamanu_source_dbt.table__translated_strings", "block_contents": "Localisation and translation strings.\r\n\r\nThese are used for two distinct purposes:\r\n- to translate Tamanu in languages other than English\r\n- to adjust the wording of specific items in the UI"}, "doc.tamanu_source_dbt.translated_strings__string_id": {"name": "translated_strings__string_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\translated_strings.md", "original_file_path": "models\\sources\\translated_strings.md", "unique_id": "doc.tamanu_source_dbt.translated_strings__string_id", "block_contents": "The internal reference of the item being translated."}, "doc.tamanu_source_dbt.translated_strings__language": {"name": "translated_strings__language", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\translated_strings.md", "original_file_path": "models\\sources\\translated_strings.md", "unique_id": "doc.tamanu_source_dbt.translated_strings__language", "block_contents": "The language code."}, "doc.tamanu_source_dbt.translated_strings__text": {"name": "translated_strings__text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\translated_strings.md", "original_file_path": "models\\sources\\translated_strings.md", "unique_id": "doc.tamanu_source_dbt.translated_strings__text", "block_contents": "The actual translated text."}, "doc.tamanu_source_dbt.table__triages": {"name": "table__triages", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.table__triages", "block_contents": "Triage data of patients waiting in an emergency department."}, "doc.tamanu_source_dbt.triages__arrival_time": {"name": "triages__arrival_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__arrival_time", "block_contents": "When the patient arrived."}, "doc.tamanu_source_dbt.triages__triage_time": {"name": "triages__triage_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__triage_time", "block_contents": "When the patient was triaged."}, "doc.tamanu_source_dbt.triages__closed_time": {"name": "triages__closed_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__closed_time", "block_contents": "When the patient was processed."}, "doc.tamanu_source_dbt.triages__score": {"name": "triages__score", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__score", "block_contents": "Classification done by the triage practitioner."}, "doc.tamanu_source_dbt.triages__encounter_id": {"name": "triages__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for."}, "doc.tamanu_source_dbt.triages__practitioner_id": {"name": "triages__practitioner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__practitioner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient."}, "doc.tamanu_source_dbt.triages__chief_complaint_id": {"name": "triages__chief_complaint_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__chief_complaint_id", "block_contents": "Reference to the primary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`)."}, "doc.tamanu_source_dbt.triages__secondary_complaint_id": {"name": "triages__secondary_complaint_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__secondary_complaint_id", "block_contents": "Reference to the secondary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`)."}, "doc.tamanu_source_dbt.triages__arrival_time_legacy": {"name": "triages__arrival_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__arrival_time_legacy", "block_contents": "[Deprecated] When the patient arrived."}, "doc.tamanu_source_dbt.triages__triage_time_legacy": {"name": "triages__triage_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__triage_time_legacy", "block_contents": "[Deprecated] When the patient was triaged."}, "doc.tamanu_source_dbt.triages__closed_time_legacy": {"name": "triages__closed_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__closed_time_legacy", "block_contents": "[Deprecated] When the patient was processed."}, "doc.tamanu_source_dbt.triages__arrival_mode_id": {"name": "triages__arrival_mode_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__arrival_mode_id", "block_contents": "Reference to how the patient arrived ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = arrivalMode`)."}, "doc.tamanu_source_dbt.table__upcoming_vaccinations": {"name": "table__upcoming_vaccinations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.table__upcoming_vaccinations", "block_contents": "A **view** which lists patients and next vaccine due for a given vaccine type.\r\n\r\nThe first dose of a vaccine type is based on weeks from birth due whilst subsequent doses are based on weeks from last \r\nvaccination due.\r\n\r\nAge limits in years and thresholds in days for scheduled status are configurable with the following defaults:\r\n\r\n- Age = 15\r\n- Status: Scheduled = 28\r\n- Status: Upcoming = 7\r\n- Status: Due = -7\r\n- Status: Overdue = -55\r\n- Status: Missed = -Infinity"}, "doc.tamanu_source_dbt.upcoming_vaccinations__patient_id": {"name": "upcoming_vaccinations__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id": {"name": "upcoming_vaccinations__scheduled_vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id", "block_contents": "Reference to the [scheduled vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines)."}, "doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_category": {"name": "upcoming_vaccinations__vaccine_category", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_category", "block_contents": "Vaccine category [Routine, Catch-up, Campaign, Other]"}, "doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_id": {"name": "upcoming_vaccinations__vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_id", "block_contents": "Reference to the vaccine ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`)."}, "doc.tamanu_source_dbt.upcoming_vaccinations__due_date": {"name": "upcoming_vaccinations__due_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__due_date", "block_contents": "Due date of the scheduled vaccine."}, "doc.tamanu_source_dbt.upcoming_vaccinations__days_till_due": {"name": "upcoming_vaccinations__days_till_due", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__days_till_due", "block_contents": "Number of days until the scheduled vaccine is due. Negative numbers indicates the number of days in the past the vaccine\r\nwas due."}, "doc.tamanu_source_dbt.upcoming_vaccinations__status": {"name": "upcoming_vaccinations__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__status", "block_contents": "Status of the upcoming vaccination listed ['DUE', 'OVERDUE', 'MISSED', 'SCHEDULED', 'UPCOMING']"}, "doc.tamanu_source_dbt.table__users": {"name": "table__users", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.table__users", "block_contents": "Records of each user that can login to Tamanu.\r\n\r\nThis includes machine users.\r\n\r\nThere is one special user account with an all-zero `id`, which is the global \"system\" user. This is\r\nused as a pseudo identity where the Tamanu system itself takes an action that normally is performed\r\nby a human or API user."}, "doc.tamanu_source_dbt.users__email": {"name": "users__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__email", "block_contents": "Email address for user. This is used to login and receive emails."}, "doc.tamanu_source_dbt.users__password": {"name": "users__password", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__password", "block_contents": "Hashed password for user login.\r\n\r\nThe value is encoded as a \"standard password hash\" with a `$[type]$[params]$[salt]$[hash]` general\r\nformat. This allows upgrading algorithms and parameters seamlessly. The current algorithm is bcrypt.\r\n\r\nThis may be null to prevent a user from being able to login."}, "doc.tamanu_source_dbt.users__display_name": {"name": "users__display_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__display_name", "block_contents": "The human readable display name for the user."}, "doc.tamanu_source_dbt.users__display_id": {"name": "users__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__display_id", "block_contents": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number."}, "doc.tamanu_source_dbt.users__phone_number": {"name": "users__phone_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__phone_number", "block_contents": "Phone number for the user.\r\n\r\nThis is not currently available anywhere visible."}, "doc.tamanu_source_dbt.users__role": {"name": "users__role", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__role", "block_contents": "The role of the user, which sets their permission level.\r\n\r\nThe special values `admin` and `system` indicate a superadmin and a system user respectively."}, "doc.tamanu_source_dbt.users__device_registration_quota": {"name": "users__device_registration_quota", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__device_registration_quota", "block_contents": "How many devices this user can register (when `features.deviceRegistrationQuota` is enabled).\r\n\r\nSee [`devices`](#!/source/source.tamanu.tamanu.devices) for more."}, "doc.tamanu_source_dbt.table__user_designations": {"name": "table__user_designations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_designations.md", "original_file_path": "models\\sources\\user_designations.md", "unique_id": "doc.tamanu_source_dbt.table__user_designations", "block_contents": "Association of user to designation"}, "doc.tamanu_source_dbt.user_designations__user_id": {"name": "user_designations__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_designations.md", "original_file_path": "models\\sources\\user_designations.md", "unique_id": "doc.tamanu_source_dbt.user_designations__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users)"}, "doc.tamanu_source_dbt.user_designations__designation_id": {"name": "user_designations__designation_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_designations.md", "original_file_path": "models\\sources\\user_designations.md", "unique_id": "doc.tamanu_source_dbt.user_designations__designation_id", "block_contents": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__user_facilities": {"name": "table__user_facilities", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_facilities.md", "original_file_path": "models\\sources\\user_facilities.md", "unique_id": "doc.tamanu_source_dbt.table__user_facilities", "block_contents": "Association of users to facilities.\r\n\r\nThis can be used to assign users to certain facilities, for authorisation purposes or for staff convenience."}, "doc.tamanu_source_dbt.user_facilities__facility_id": {"name": "user_facilities__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_facilities.md", "original_file_path": "models\\sources\\user_facilities.md", "unique_id": "doc.tamanu_source_dbt.user_facilities__facility_id", "block_contents": "The [facility](#!/source/source.tamanu.tamanu.facilities)."}, "doc.tamanu_source_dbt.user_facilities__user_id": {"name": "user_facilities__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_facilities.md", "original_file_path": "models\\sources\\user_facilities.md", "unique_id": "doc.tamanu_source_dbt.user_facilities__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.table__user_leaves": {"name": "table__user_leaves", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_leaves.md", "original_file_path": "models\\sources\\user_leaves.md", "unique_id": "doc.tamanu_source_dbt.table__user_leaves", "block_contents": "Records user leave requests, including leave period and scheduling/removal metadata."}, "doc.tamanu_source_dbt.user_leaves__start_date": {"name": "user_leaves__start_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_leaves.md", "original_file_path": "models\\sources\\user_leaves.md", "unique_id": "doc.tamanu_source_dbt.user_leaves__start_date", "block_contents": "Start date of the leave."}, "doc.tamanu_source_dbt.user_leaves__end_date": {"name": "user_leaves__end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_leaves.md", "original_file_path": "models\\sources\\user_leaves.md", "unique_id": "doc.tamanu_source_dbt.user_leaves__end_date", "block_contents": "End date of the leave."}, "doc.tamanu_source_dbt.user_leaves__user_id": {"name": "user_leaves__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_leaves.md", "original_file_path": "models\\sources\\user_leaves.md", "unique_id": "doc.tamanu_source_dbt.user_leaves__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested the leave."}, "doc.tamanu_source_dbt.table__user_localisation_caches": {"name": "table__user_localisation_caches", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_localisation_caches.md", "original_file_path": "models\\sources\\user_localisation_caches.md", "unique_id": "doc.tamanu_source_dbt.table__user_localisation_caches", "block_contents": "Cached localisation data.\r\n\r\nLocalisation can be pretty expensive to retrieve, so this caches it per user."}, "doc.tamanu_source_dbt.user_localisation_caches__localisation": {"name": "user_localisation_caches__localisation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_localisation_caches.md", "original_file_path": "models\\sources\\user_localisation_caches.md", "unique_id": "doc.tamanu_source_dbt.user_localisation_caches__localisation", "block_contents": "JSON data."}, "doc.tamanu_source_dbt.user_localisation_caches__user_id": {"name": "user_localisation_caches__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_localisation_caches.md", "original_file_path": "models\\sources\\user_localisation_caches.md", "unique_id": "doc.tamanu_source_dbt.user_localisation_caches__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) this cache is for."}, "doc.tamanu_source_dbt.table__user_login_attempts": {"name": "table__user_login_attempts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_login_attempts.md", "original_file_path": "models\\sources\\user_login_attempts.md", "unique_id": "doc.tamanu_source_dbt.table__user_login_attempts", "block_contents": "A table that tracks user login attempts for the lockout feature."}, "doc.tamanu_source_dbt.user_login_attempts__outcome": {"name": "user_login_attempts__outcome", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_login_attempts.md", "original_file_path": "models\\sources\\user_login_attempts.md", "unique_id": "doc.tamanu_source_dbt.user_login_attempts__outcome", "block_contents": "A string specifying the outcome of the login attempt."}, "doc.tamanu_source_dbt.user_login_attempts__device_id": {"name": "user_login_attempts__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_login_attempts.md", "original_file_path": "models\\sources\\user_login_attempts.md", "unique_id": "doc.tamanu_source_dbt.user_login_attempts__device_id", "block_contents": "The [device](#!/source/source.tamanu.tamanu.devices)."}, "doc.tamanu_source_dbt.user_login_attempts__user_id": {"name": "user_login_attempts__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_login_attempts.md", "original_file_path": "models\\sources\\user_login_attempts.md", "unique_id": "doc.tamanu_source_dbt.user_login_attempts__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.table__user_preferences": {"name": "table__user_preferences", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.table__user_preferences", "block_contents": "Per-user preferences."}, "doc.tamanu_source_dbt.user_preferences__user_id": {"name": "user_preferences__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.user_preferences__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users) these preferences are for."}, "doc.tamanu_source_dbt.user_preferences__key": {"name": "user_preferences__key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.user_preferences__key", "block_contents": "Key of the user preference"}, "doc.tamanu_source_dbt.user_preferences__value": {"name": "user_preferences__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.user_preferences__value", "block_contents": "Value of the user preference"}, "doc.tamanu_source_dbt.user_preferences__facility_id": {"name": "user_preferences__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.user_preferences__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) that this preference applies to"}, "doc.tamanu_source_dbt.table__user_recently_viewed_patients": {"name": "table__user_recently_viewed_patients", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_recently_viewed_patients.md", "original_file_path": "models\\sources\\user_recently_viewed_patients.md", "unique_id": "doc.tamanu_source_dbt.table__user_recently_viewed_patients", "block_contents": "A list of patients that a user has viewed recently.\r\n\r\nThis powers the \"quick access\" list in Tamanu to get back to patients that a user was last\r\ninteracting with."}, "doc.tamanu_source_dbt.user_recently_viewed_patients__user_id": {"name": "user_recently_viewed_patients__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_recently_viewed_patients.md", "original_file_path": "models\\sources\\user_recently_viewed_patients.md", "unique_id": "doc.tamanu_source_dbt.user_recently_viewed_patients__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.user_recently_viewed_patients__patient_id": {"name": "user_recently_viewed_patients__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_recently_viewed_patients.md", "original_file_path": "models\\sources\\user_recently_viewed_patients.md", "unique_id": "doc.tamanu_source_dbt.user_recently_viewed_patients__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) that was viewed."}, "doc.tamanu_source_dbt.table__vitals": {"name": "table__vitals", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.table__vitals", "block_contents": "[Deprecated] Patient's observed vitals. This is now done as a survey response."}, "doc.tamanu_source_dbt.vitals__id": {"name": "vitals__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__id", "block_contents": "Tamanu identifier for vitals"}, "doc.tamanu_source_dbt.vitals__temperature": {"name": "vitals__temperature", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__temperature", "block_contents": "Observed patient's body temperature"}, "doc.tamanu_source_dbt.vitals__weight": {"name": "vitals__weight", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__weight", "block_contents": "Observed patient's body weight"}, "doc.tamanu_source_dbt.vitals__height": {"name": "vitals__height", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__height", "block_contents": "Observed patient's height"}, "doc.tamanu_source_dbt.vitals__sbp": {"name": "vitals__sbp", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__sbp", "block_contents": "Observed patient's systolic blood pressure"}, "doc.tamanu_source_dbt.vitals__dbp": {"name": "vitals__dbp", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__dbp", "block_contents": "Observed patient's diastolic blood pressure"}, "doc.tamanu_source_dbt.vitals__heart_rate": {"name": "vitals__heart_rate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__heart_rate", "block_contents": "Observed patient's heart rate"}, "doc.tamanu_source_dbt.vitals__respiratory_rate": {"name": "vitals__respiratory_rate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__respiratory_rate", "block_contents": "Observed patient's respiratory rate"}, "doc.tamanu_source_dbt.vitals__spo2": {"name": "vitals__spo2", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__spo2", "block_contents": "Observed patient's SpO2 level or saturation of peripheral oxygen"}, "doc.tamanu_source_dbt.vitals__avpu": {"name": "vitals__avpu", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__avpu", "block_contents": "Observed patient's AVPU (alert, verbal, pain, unresponsive) level"}, "doc.tamanu_source_dbt.vitals__gcs": {"name": "vitals__gcs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__gcs", "block_contents": "Observed patient's Glasgow coma scale (GCS)"}, "doc.tamanu_source_dbt.vitals__hemoglobin": {"name": "vitals__hemoglobin", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__hemoglobin", "block_contents": "Observed patient's hemoglobin levels"}, "doc.tamanu_source_dbt.vitals__fasting_blood_glucose": {"name": "vitals__fasting_blood_glucose", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__fasting_blood_glucose", "block_contents": "Observed patient's fasting blood glucose level"}, "doc.tamanu_source_dbt.vitals__urine_ph": {"name": "vitals__urine_ph", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_ph", "block_contents": "Observed patient's urine pH"}, "doc.tamanu_source_dbt.vitals__encounter_id": {"name": "vitals__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this recording of vitals is a part of."}, "doc.tamanu_source_dbt.vitals__urine_leukocytes": {"name": "vitals__urine_leukocytes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_leukocytes", "block_contents": "Observed patient's urine leukocytes level"}, "doc.tamanu_source_dbt.vitals__urine_nitrites": {"name": "vitals__urine_nitrites", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_nitrites", "block_contents": "Observed patient's urine nitrites"}, "doc.tamanu_source_dbt.vitals__urobilinogen": {"name": "vitals__urobilinogen", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urobilinogen", "block_contents": "Observed patient's urobilinogen level"}, "doc.tamanu_source_dbt.vitals__urine_protein": {"name": "vitals__urine_protein", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_protein", "block_contents": "Observed patient's urine protein level"}, "doc.tamanu_source_dbt.vitals__blood_in_urine": {"name": "vitals__blood_in_urine", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__blood_in_urine", "block_contents": "Observed patient's blood in urine"}, "doc.tamanu_source_dbt.vitals__urine_specific_gravity": {"name": "vitals__urine_specific_gravity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_specific_gravity", "block_contents": "Observed patient's urine_specific_gravity"}, "doc.tamanu_source_dbt.vitals__urine_ketone": {"name": "vitals__urine_ketone", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_ketone", "block_contents": "Observed patient's urine ketone level"}, "doc.tamanu_source_dbt.vitals__urine_bilirubin": {"name": "vitals__urine_bilirubin", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_bilirubin", "block_contents": "Observed patient's urine bilirubin level"}, "doc.tamanu_source_dbt.vitals__urine_glucose": {"name": "vitals__urine_glucose", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_glucose", "block_contents": "Observed patient's urine glucose levels"}, "doc.tamanu_source_dbt.vitals__migrated_record": {"name": "vitals__migrated_record", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__migrated_record", "block_contents": "Tamanu identifier for the survey response the vitals record was migrated to"}, "doc.tamanu_source_dbt.table__vital_logs": {"name": "table__vital_logs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.table__vital_logs", "block_contents": "Change logs for vitals survey responses."}, "doc.tamanu_source_dbt.vital_logs__previous_value": {"name": "vital_logs__previous_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__previous_value", "block_contents": "Previous value before the logged change in vitals survey response."}, "doc.tamanu_source_dbt.vital_logs__new_value": {"name": "vital_logs__new_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__new_value", "block_contents": "New value after the logged change in vitals survey response."}, "doc.tamanu_source_dbt.vital_logs__reason_for_change": {"name": "vital_logs__reason_for_change", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__reason_for_change", "block_contents": "Reason for the logged change in the vitals survey response."}, "doc.tamanu_source_dbt.vital_logs__recorded_by_id": {"name": "vital_logs__recorded_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__recorded_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who made this change."}, "doc.tamanu_source_dbt.vital_logs__answer_id": {"name": "vital_logs__answer_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__answer_id", "block_contents": "The [survey answer](#!/source/source.tamanu.tamanu.survey_response_answers) being changed."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {}, "parent_map": {"model.tamanu_source_dbt.contributing_death_causes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"], "model.tamanu_source_dbt.departments": ["source.tamanu_source_dbt.tamanu.departments"], "model.tamanu_source_dbt.discharges": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.document_metadata": ["source.tamanu_source_dbt.tamanu.document_metadata"], "model.tamanu_source_dbt.encounters": ["source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.encounters_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.encounter_diagnoses": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.encounter_diagnoses_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.encounter_diets": ["source.tamanu_source_dbt.tamanu.encounter_diets", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.encounter_history": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.encounter_prescriptions": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.facilities": ["source.tamanu_source_dbt.tamanu.facilities"], "model.tamanu_source_dbt.imaging_area_external_codes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "model.tamanu_source_dbt.imaging_requests": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_requests"], "model.tamanu_source_dbt.imaging_request_areas": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_request_areas", "source.tamanu_source_dbt.tamanu.imaging_requests"], "model.tamanu_source_dbt.imaging_results": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.imaging_results"], "model.tamanu_source_dbt.invoices": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.invoices"], "model.tamanu_source_dbt.invoice_insurance_plans": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "model.tamanu_source_dbt.invoice_insurance_plan_items": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "model.tamanu_source_dbt.invoice_items": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoices"], "model.tamanu_source_dbt.invoice_price_lists": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "model.tamanu_source_dbt.invoice_price_list_items": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "model.tamanu_source_dbt.invoice_products": ["source.tamanu_source_dbt.tamanu.invoice_products"], "model.tamanu_source_dbt.lab_requests": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_requests"], "model.tamanu_source_dbt.lab_requests_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.lab_request_logs": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_request_logs", "source.tamanu_source_dbt.tamanu.lab_requests"], "model.tamanu_source_dbt.lab_request_logs_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.lab_tests": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_tests"], "model.tamanu_source_dbt.lab_test_panels": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "model.tamanu_source_dbt.lab_test_panel_lab_test_types": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "model.tamanu_source_dbt.lab_test_panel_requests": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "model.tamanu_source_dbt.lab_test_types": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "model.tamanu_source_dbt.locations": ["source.tamanu_source_dbt.tamanu.locations"], "model.tamanu_source_dbt.location_bookings": ["source.tamanu_source_dbt.tamanu.appointments"], "model.tamanu_source_dbt.location_groups": ["source.tamanu_source_dbt.tamanu.location_groups"], "model.tamanu_source_dbt.medication_dispenses": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.medication_dispenses", "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "source.tamanu_source_dbt.tamanu.pharmacy_orders"], "model.tamanu_source_dbt.notes": ["source.tamanu_source_dbt.tamanu.notes", "source.tamanu_source_dbt.tamanu.reference_data"], "model.tamanu_source_dbt.outpatient_appointments": ["source.tamanu_source_dbt.tamanu.appointment_schedules", "source.tamanu_source_dbt.tamanu.appointments"], "model.tamanu_source_dbt.outpatient_appointments_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.patients": ["source.tamanu_source_dbt.tamanu.patients"], "model.tamanu_source_dbt.patients_access_logs": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "model.tamanu_source_dbt.patients_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patients"], "model.tamanu_source_dbt.patients_merged": ["source.tamanu_source_dbt.tamanu.patients"], "model.tamanu_source_dbt.patients_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.patient_additional_data": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "model.tamanu_source_dbt.patient_additional_data_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_additional_data"], "model.tamanu_source_dbt.patient_allergies": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "model.tamanu_source_dbt.patient_birth_data": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "model.tamanu_source_dbt.patient_care_plans": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "model.tamanu_source_dbt.patient_conditions": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "model.tamanu_source_dbt.patient_death_contributing_causes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"], "model.tamanu_source_dbt.patient_death_data": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "model.tamanu_source_dbt.patient_facilities": ["source.tamanu_source_dbt.tamanu.patient_facilities"], "model.tamanu_source_dbt.patient_family_histories": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "model.tamanu_source_dbt.patient_field_values": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "model.tamanu_source_dbt.patient_program_registrations": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registrations_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registration_conditions": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "model.tamanu_source_dbt.patient_vaccinations_upcoming": ["source.tamanu_source_dbt.tamanu.upcoming_vaccinations"], "model.tamanu_source_dbt.pharmacy_orders": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.pharmacy_orders"], "model.tamanu_source_dbt.pharmacy_order_prescriptions": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "source.tamanu_source_dbt.tamanu.pharmacy_orders"], "model.tamanu_source_dbt.prescriptions": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions", "source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.prescriptions"], "model.tamanu_source_dbt.procedures": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.procedures"], "model.tamanu_source_dbt.procedures_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.programs": ["source.tamanu_source_dbt.tamanu.programs"], "model.tamanu_source_dbt.program_data_elements": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "model.tamanu_source_dbt.program_registries": ["source.tamanu_source_dbt.tamanu.program_registries"], "model.tamanu_source_dbt.program_registry_clinical_statuses": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "model.tamanu_source_dbt.program_registry_conditions": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "model.tamanu_source_dbt.program_registry_condition_categories": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "model.tamanu_source_dbt.reference_data": ["source.tamanu_source_dbt.tamanu.reference_data"], "model.tamanu_source_dbt.referrals": ["source.tamanu_source_dbt.tamanu.referrals"], "model.tamanu_source_dbt.refresh_tokens": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "model.tamanu_source_dbt.roles": ["source.tamanu_source_dbt.tamanu.roles"], "model.tamanu_source_dbt.surveys": ["source.tamanu_source_dbt.tamanu.surveys"], "model.tamanu_source_dbt.survey_responses": ["source.tamanu_source_dbt.tamanu.survey_responses"], "model.tamanu_source_dbt.survey_response_answers": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "model.tamanu_source_dbt.survey_screen_components": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "model.tamanu_source_dbt.translated_strings": ["source.tamanu_source_dbt.tamanu.translated_strings"], "model.tamanu_source_dbt.triages": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.triages"], "model.tamanu_source_dbt.users": ["source.tamanu_source_dbt.tamanu.users"], "model.tamanu_source_dbt.users_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.vaccine_administrations": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.vaccine_administrations_change_logs": ["model.tamanu_source_dbt.encounters", "source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.administered_vaccines"], "model.tamanu_source_dbt.vaccine_schedules": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "model.tamanu_source_dbt.ds__births": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__deaths": ["model.tamanu_source_dbt.contributing_death_causes", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_death_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__invoice_products": ["model.tamanu_source_dbt.invoice_insurance_plan_items", "model.tamanu_source_dbt.invoice_insurance_plans", "model.tamanu_source_dbt.invoice_price_list_items", "model.tamanu_source_dbt.invoice_price_lists", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types"], "model.tamanu_source_dbt.ds__ongoing_conditions": ["model.tamanu_source_dbt.patient_conditions", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__patients": ["model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__patients_access_logs": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_access_logs", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__patients_change_logs": ["model.tamanu_source_dbt.patient_additional_data_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_change_logs", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__patient_program_registrations": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_program_registration_conditions", "model.tamanu_source_dbt.patient_program_registrations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.program_registries", "model.tamanu_source_dbt.program_registry_clinical_statuses", "model.tamanu_source_dbt.program_registry_condition_categories", "model.tamanu_source_dbt.program_registry_conditions", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming": ["model.tamanu_source_dbt.patient_vaccinations_upcoming", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details": ["model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_merged"], "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations": ["model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.patients"], "model.tamanu_source_dbt.ds__sensitive_admissions": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_diagnoses": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_encounters_emergency": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_encounter_diets": ["model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_allergies", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__sensitive_imaging_requests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_lab_requests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_lab_tests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_location_bookings": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_medication_dispenses": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users", "source.tamanu_source_dbt.tamanu.appointment_schedules"], "model.tamanu_source_dbt.ds__sensitive_procedures": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_referrals": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.survey_responses", "model.tamanu_source_dbt.surveys", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_user_audit": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.roles", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_vaccinations": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.ds__admissions": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__diagnoses": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__encounters_emergency": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__encounter_diets": ["model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_allergies", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__encounter_prescriptions": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__imaging_requests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__lab_requests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__lab_tests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__location_bookings": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__medication_dispenses": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__outpatient_appointments": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__outpatient_appointments_audit": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users", "source.tamanu_source_dbt.tamanu.appointment_schedules"], "model.tamanu_source_dbt.ds__procedures": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__referrals": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.survey_responses", "model.tamanu_source_dbt.surveys", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__user_audit": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.roles", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__vaccinations": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.int__admission_history_department": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patients"], "model.tamanu_source_dbt.int__admission_history_location": ["model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients"], "model.tamanu_source_dbt.int__lab_requests_history": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_request_logs", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.sensitive-admissions-line-list": ["model.tamanu_source_dbt.ds__sensitive_admissions"], "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments": ["model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit"], "model.tamanu_source_dbt.sensitive-encounter-diets-line-list": ["model.tamanu_source_dbt.ds__sensitive_encounter_diets"], "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.sensitive-imaging-requests-line-list": ["model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.translated_strings"], "model.tamanu_source_dbt.sensitive-imaging-requests-summary": ["model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.translated_strings"], "model.tamanu_source_dbt.sensitive-incomplete-referrals": ["model.tamanu_source_dbt.ds__sensitive_referrals"], "model.tamanu_source_dbt.sensitive-lab-requests-line-list": ["model.tamanu_source_dbt.ds__sensitive_lab_requests"], "model.tamanu_source_dbt.sensitive-lab-tests-line-list": ["model.tamanu_source_dbt.ds__sensitive_lab_tests"], "model.tamanu_source_dbt.sensitive-location-bookings-line-list": ["model.tamanu_source_dbt.ds__sensitive_location_bookings"], "model.tamanu_source_dbt.sensitive-medication-dispensed-summary": ["model.tamanu_source_dbt.ds__sensitive_medication_dispenses"], "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list": ["model.tamanu_source_dbt.ds__sensitive_outpatient_appointments"], "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary": ["model.tamanu_source_dbt.ds__sensitive_encounters_emergency"], "model.tamanu_source_dbt.sensitive-prescription-line-list": ["model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions"], "model.tamanu_source_dbt.sensitive-procedures-line-list": ["model.tamanu_source_dbt.ds__sensitive_procedures"], "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list": ["model.tamanu_source_dbt.ds__sensitive_diagnoses"], "model.tamanu_source_dbt.sensitive-user-audit-line-list": ["model.tamanu_source_dbt.ds__sensitive_user_audit"], "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list": ["model.tamanu_source_dbt.ds__sensitive_vaccinations"], "model.tamanu_source_dbt.sensitive-vaccine-line-list": ["model.tamanu_source_dbt.ds__sensitive_vaccinations"], "model.tamanu_source_dbt.admissions-line-list": ["model.tamanu_source_dbt.ds__admissions"], "model.tamanu_source_dbt.audit-outpatient-appointments": ["model.tamanu_source_dbt.ds__outpatient_appointments_audit"], "model.tamanu_source_dbt.audit-patient-details-edit": ["model.tamanu_source_dbt.ds__patients_change_logs"], "model.tamanu_source_dbt.audit-patient-views": ["model.tamanu_source_dbt.ds__patients_access_logs"], "model.tamanu_source_dbt.deceased-patients-line-list": ["model.tamanu_source_dbt.ds__deaths"], "model.tamanu_source_dbt.encounter-diets-line-list": ["model.tamanu_source_dbt.ds__encounter_diets"], "model.tamanu_source_dbt.encounter-summary-by-end-date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.encounter-summary-by-start-date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.hospital-admissions-by-area-summary": ["model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.locations"], "model.tamanu_source_dbt.hospital-admissions-by-department-summary": ["model.tamanu_source_dbt.int__admission_history_department"], "model.tamanu_source_dbt.hospital-admissions-by-location-summary": ["model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.locations"], "model.tamanu_source_dbt.imaging-requests-line-list": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.translated_strings"], "model.tamanu_source_dbt.imaging-requests-summary": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.translated_strings"], "model.tamanu_source_dbt.incomplete-referrals": ["model.tamanu_source_dbt.ds__referrals"], "model.tamanu_source_dbt.invoice-products-summary": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.invoice_insurance_plans", "model.tamanu_source_dbt.invoice_price_lists"], "model.tamanu_source_dbt.lab-requests-line-list": ["model.tamanu_source_dbt.ds__lab_requests"], "model.tamanu_source_dbt.lab-requests-summary": ["model.tamanu_source_dbt.int__lab_requests_history"], "model.tamanu_source_dbt.lab-tests-line-list": ["model.tamanu_source_dbt.ds__lab_tests"], "model.tamanu_source_dbt.location-bookings-line-list": ["model.tamanu_source_dbt.ds__location_bookings"], "model.tamanu_source_dbt.medication-dispensed-summary": ["model.tamanu_source_dbt.ds__medication_dispenses"], "model.tamanu_source_dbt.ongoing-conditions-line-list": ["model.tamanu_source_dbt.ds__ongoing_conditions"], "model.tamanu_source_dbt.outpatient-appointments-line-list": ["model.tamanu_source_dbt.ds__outpatient_appointments"], "model.tamanu_source_dbt.patient-emergency-encounters-summary": ["model.tamanu_source_dbt.ds__encounters_emergency"], "model.tamanu_source_dbt.prescription-line-list": ["model.tamanu_source_dbt.ds__encounter_prescriptions"], "model.tamanu_source_dbt.procedures-line-list": ["model.tamanu_source_dbt.ds__procedures"], "model.tamanu_source_dbt.program-registry-line-list": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.program-registry-removed-patients-line-list": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.recent-diagnoses-line-list": ["model.tamanu_source_dbt.ds__diagnoses"], "model.tamanu_source_dbt.registered-births-line-list": ["model.tamanu_source_dbt.ds__births"], "model.tamanu_source_dbt.registered-patients-by-dob-line-list": ["model.tamanu_source_dbt.ds__patients"], "model.tamanu_source_dbt.registered-patients-daily-summary": ["model.tamanu_source_dbt.ds__patients"], "model.tamanu_source_dbt.registered-patients-line-list": ["model.tamanu_source_dbt.ds__patients"], "model.tamanu_source_dbt.upcoming-vaccinations-line-list": ["model.tamanu_source_dbt.ds__patient_vaccinations_upcoming"], "model.tamanu_source_dbt.usage-quality-metrics-patient-details": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details"], "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations"], "model.tamanu_source_dbt.user-audit-line-list": ["model.tamanu_source_dbt.ds__user_audit"], "model.tamanu_source_dbt.vaccine-audit-line-list": ["model.tamanu_source_dbt.ds__vaccinations"], "model.tamanu_source_dbt.vaccine-line-list": ["model.tamanu_source_dbt.ds__vaccinations"], "test.tamanu_source_dbt.logical__ds__admissions": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__diagnoses": ["model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__encounters_emergency": ["model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.triages"], "test.tamanu_source_dbt.logical__ds__encounter_diets": ["model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__encounter_prescriptions": ["model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__imaging_requests": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__location_bookings": ["model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__outpatient_appointments": ["model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments"], "test.tamanu_source_dbt.logical__ds__procedures": ["model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.procedures"], "test.tamanu_source_dbt.logical__ds__referrals": ["model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.referrals"], "test.tamanu_source_dbt.logical__ds__user_audit": ["model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__vaccinations": ["model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.vaccine_administrations"], "test.tamanu_source_dbt.logical__encounter_summary_by_end_date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users"], "test.tamanu_source_dbt.logical__encounter_summary_by_start_date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users"], "test.tamanu_source_dbt.assert__metric_definitions__disaggregations": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.assert__patients__village_id": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.assert__users__role": ["source.tamanu_source_dbt.tamanu.roles", "source.tamanu_source_dbt.tamanu.users"], "seed.tamanu_source_dbt.metric_definitions": [], "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc": ["model.tamanu_source_dbt.encounter_diagnoses"], "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a": ["source.tamanu_source_dbt.tamanu.certificate_notifications", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5": ["source.tamanu_source_dbt.tamanu.certificate_notifications", "source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe": ["source.tamanu_source_dbt.tamanu.certificate_notifications", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c": ["source.tamanu_source_dbt.tamanu.death_revert_logs", "source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c": ["source.tamanu_source_dbt.tamanu.death_revert_logs", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54": ["source.tamanu_source_dbt.tamanu.death_revert_logs", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812": ["source.tamanu_source_dbt.tamanu.devices", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59": ["source.tamanu_source_dbt.tamanu.discharges"], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b": ["source.tamanu_source_dbt.tamanu.discharges"], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574": ["source.tamanu_source_dbt.tamanu.discharges"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c": ["source.tamanu_source_dbt.tamanu.discharges"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b": ["source.tamanu_source_dbt.tamanu.document_metadata", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909": ["source.tamanu_source_dbt.tamanu.document_metadata", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd": ["source.tamanu_source_dbt.tamanu.attachments", "source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836": ["source.tamanu_source_dbt.tamanu.encounter_diets", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d": ["source.tamanu_source_dbt.tamanu.encounter_diets", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600": ["source.tamanu_source_dbt.tamanu.imaging_request_areas", "source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06": ["source.tamanu_source_dbt.tamanu.imaging_request_areas", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113": ["source.tamanu_source_dbt.tamanu.imaging_results", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1": ["source.tamanu_source_dbt.tamanu.invoice_discounts", "source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3": ["source.tamanu_source_dbt.tamanu.invoice_discounts", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments", "source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts", "source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments", "source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060": ["source.tamanu_source_dbt.tamanu.invoice_payments", "source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b": ["source.tamanu_source_dbt.tamanu.invoice_payments", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f": ["source.tamanu_source_dbt.tamanu.ips_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f": ["source.tamanu_source_dbt.tamanu.attachments", "source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506": ["source.tamanu_source_dbt.tamanu.lab_request_attachments", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3": ["source.tamanu_source_dbt.tamanu.lab_request_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd": ["source.tamanu_source_dbt.tamanu.lab_request_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da": ["source.tamanu_source_dbt.tamanu.lab_request_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e": ["source.tamanu_source_dbt.tamanu.lab_request_logs", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883": ["source.tamanu_source_dbt.tamanu.lab_request_logs", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f": ["source.tamanu_source_dbt.tamanu.lab_request_logs"], "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e": ["source.tamanu_source_dbt.tamanu.lab_test_types", "source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f": ["source.tamanu_source_dbt.tamanu.lab_tests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5": ["source.tamanu_source_dbt.tamanu.lab_tests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6": ["source.tamanu_source_dbt.tamanu.lab_test_panels", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types", "source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types", "source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests", "source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4": ["source.tamanu_source_dbt.tamanu.lab_test_types", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21": ["source.tamanu_source_dbt.tamanu.local_system_facts"], "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b": ["source.tamanu_source_dbt.tamanu.local_system_facts"], "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d": ["source.tamanu_source_dbt.tamanu.local_system_facts"], "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e": ["source.tamanu_source_dbt.tamanu.location_groups", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5": ["source.tamanu_source_dbt.tamanu.notes", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7": ["source.tamanu_source_dbt.tamanu.notes", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b": ["source.tamanu_source_dbt.tamanu.note_items", "source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3": ["source.tamanu_source_dbt.tamanu.note_items", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca": ["source.tamanu_source_dbt.tamanu.note_items", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac": ["source.tamanu_source_dbt.tamanu.one_time_logins", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7": ["source.tamanu_source_dbt.tamanu.patient_birth_data", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba": ["source.tamanu_source_dbt.tamanu.patient_communications", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615": ["source.tamanu_source_dbt.tamanu.patient_contacts", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27": ["source.tamanu_source_dbt.tamanu.patient_contacts", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6": ["source.tamanu_source_dbt.tamanu.patient_facilities"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4": ["source.tamanu_source_dbt.tamanu.patient_facilities"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062": ["source.tamanu_source_dbt.tamanu.patient_facilities", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92": ["source.tamanu_source_dbt.tamanu.patient_family_histories", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6": ["source.tamanu_source_dbt.tamanu.patient_family_histories", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce": ["source.tamanu_source_dbt.tamanu.patient_family_histories", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories", "source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5": ["source.tamanu_source_dbt.tamanu.patient_field_definitions", "source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59": ["source.tamanu_source_dbt.tamanu.patient_field_values", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb": ["source.tamanu_source_dbt.tamanu.patient_issues", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561": ["source.tamanu_source_dbt.tamanu.patient_vrs_data", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"], "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407": ["source.tamanu_source_dbt.tamanu.permissions", "source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d": ["source.tamanu_source_dbt.tamanu.referrals", "source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2": ["source.tamanu_source_dbt.tamanu.refresh_tokens", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2": ["source.tamanu_source_dbt.tamanu.report_definition_versions", "source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192": ["source.tamanu_source_dbt.tamanu.report_definition_versions", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4": ["source.tamanu_source_dbt.tamanu.report_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d": ["source.tamanu_source_dbt.tamanu.report_definition_versions", "source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a": ["source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463": ["source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef": ["source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f": ["source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c": ["source.tamanu_source_dbt.tamanu.SequelizeMeta"], "test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6": ["source.tamanu_source_dbt.tamanu.SequelizeMeta"], "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"], "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635": ["source.tamanu_source_dbt.tamanu.programs", "source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90": ["source.tamanu_source_dbt.tamanu.survey_responses", "source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04": ["source.tamanu_source_dbt.tamanu.survey_responses", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d": ["source.tamanu_source_dbt.tamanu.survey_response_answers", "source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b": ["source.tamanu_source_dbt.tamanu.program_data_elements", "source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"], "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"], "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"], "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c": ["source.tamanu_source_dbt.tamanu.templates", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138": ["source.tamanu_source_dbt.tamanu.triages", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"], "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines", "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"], "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a": ["source.tamanu_source_dbt.tamanu.user_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3": ["source.tamanu_source_dbt.tamanu.user_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16": ["source.tamanu_source_dbt.tamanu.user_facilities"], "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"], "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"], "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"], "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999": ["source.tamanu_source_dbt.tamanu.devices", "source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5": ["source.tamanu_source_dbt.tamanu.user_login_attempts", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26": ["source.tamanu_source_dbt.tamanu.survey_response_answers", "source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877": ["source.tamanu_source_dbt.tamanu.vital_logs"], "source.tamanu_source_dbt.logs__tamanu.accesses": [], "source.tamanu_source_dbt.logs__tamanu.changes": [], "source.tamanu_source_dbt.logs__tamanu.debug_logs": [], "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes": [], "source.tamanu_source_dbt.logs__tamanu.fhir_writes": [], "source.tamanu_source_dbt.logs__tamanu.migrations": [], "source.tamanu_source_dbt.tamanu.administered_vaccines": [], "source.tamanu_source_dbt.tamanu.appointments": [], "source.tamanu_source_dbt.tamanu.appointment_procedure_types": [], "source.tamanu_source_dbt.tamanu.appointment_schedules": [], "source.tamanu_source_dbt.tamanu.assets": [], "source.tamanu_source_dbt.tamanu.attachments": [], "source.tamanu_source_dbt.tamanu.certifiable_vaccines": [], "source.tamanu_source_dbt.tamanu.certificate_notifications": [], "source.tamanu_source_dbt.tamanu.contributing_death_causes": [], "source.tamanu_source_dbt.tamanu.death_revert_logs": [], "source.tamanu_source_dbt.tamanu.departments": [], "source.tamanu_source_dbt.tamanu.devices": [], "source.tamanu_source_dbt.tamanu.discharges": [], "source.tamanu_source_dbt.tamanu.document_metadata": [], "source.tamanu_source_dbt.tamanu.encounters": [], "source.tamanu_source_dbt.tamanu.encounter_diagnoses": [], "source.tamanu_source_dbt.tamanu.encounter_diets": [], "source.tamanu_source_dbt.tamanu.encounter_history": [], "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions": [], "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories": [], "source.tamanu_source_dbt.tamanu.encounter_prescriptions": [], "source.tamanu_source_dbt.tamanu.facilities": [], "source.tamanu_source_dbt.tamanu.imaging_area_external_codes": [], "source.tamanu_source_dbt.tamanu.imaging_requests": [], "source.tamanu_source_dbt.tamanu.imaging_request_areas": [], "source.tamanu_source_dbt.tamanu.imaging_results": [], "source.tamanu_source_dbt.tamanu.imaging_type_external_codes": [], "source.tamanu_source_dbt.tamanu.invoices": [], "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans": [], "source.tamanu_source_dbt.tamanu.invoice_discounts": [], "source.tamanu_source_dbt.tamanu.invoice_insurance_plans": [], "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items": [], "source.tamanu_source_dbt.tamanu.invoice_insurer_payments": [], "source.tamanu_source_dbt.tamanu.invoice_items": [], "source.tamanu_source_dbt.tamanu.invoice_item_discounts": [], "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances": [], "source.tamanu_source_dbt.tamanu.invoice_patient_payments": [], "source.tamanu_source_dbt.tamanu.invoice_payments": [], "source.tamanu_source_dbt.tamanu.invoice_price_lists": [], "source.tamanu_source_dbt.tamanu.invoice_price_list_items": [], "source.tamanu_source_dbt.tamanu.invoice_products": [], "source.tamanu_source_dbt.tamanu.ips_requests": [], "source.tamanu_source_dbt.tamanu.lab_requests": [], "source.tamanu_source_dbt.tamanu.lab_request_attachments": [], "source.tamanu_source_dbt.tamanu.lab_request_logs": [], "source.tamanu_source_dbt.tamanu.lab_tests": [], "source.tamanu_source_dbt.tamanu.lab_test_panels": [], "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types": [], "source.tamanu_source_dbt.tamanu.lab_test_panel_requests": [], "source.tamanu_source_dbt.tamanu.lab_test_types": [], "source.tamanu_source_dbt.tamanu.local_system_facts": [], "source.tamanu_source_dbt.tamanu.locations": [], "source.tamanu_source_dbt.tamanu.location_assignments": [], "source.tamanu_source_dbt.tamanu.location_assignment_templates": [], "source.tamanu_source_dbt.tamanu.location_groups": [], "source.tamanu_source_dbt.tamanu.medication_administration_records": [], "source.tamanu_source_dbt.tamanu.medication_administration_record_doses": [], "source.tamanu_source_dbt.tamanu.medication_dispenses": [], "source.tamanu_source_dbt.tamanu.notes": [], "source.tamanu_source_dbt.tamanu.notes_legacy": [], "source.tamanu_source_dbt.tamanu.note_items": [], "source.tamanu_source_dbt.tamanu.note_pages": [], "source.tamanu_source_dbt.tamanu.notifications": [], "source.tamanu_source_dbt.tamanu.one_time_logins": [], "source.tamanu_source_dbt.tamanu.patients": [], "source.tamanu_source_dbt.tamanu.patient_additional_data": [], "source.tamanu_source_dbt.tamanu.patient_allergies": [], "source.tamanu_source_dbt.tamanu.patient_birth_data": [], "source.tamanu_source_dbt.tamanu.patient_care_plans": [], "source.tamanu_source_dbt.tamanu.patient_communications": [], "source.tamanu_source_dbt.tamanu.patient_conditions": [], "source.tamanu_source_dbt.tamanu.patient_contacts": [], "source.tamanu_source_dbt.tamanu.patient_death_data": [], "source.tamanu_source_dbt.tamanu.patient_facilities": [], "source.tamanu_source_dbt.tamanu.patient_family_histories": [], "source.tamanu_source_dbt.tamanu.patient_field_definitions": [], "source.tamanu_source_dbt.tamanu.patient_field_definition_categories": [], "source.tamanu_source_dbt.tamanu.patient_field_values": [], "source.tamanu_source_dbt.tamanu.patient_issues": [], "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions": [], "source.tamanu_source_dbt.tamanu.patient_program_registrations": [], "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions": [], "source.tamanu_source_dbt.tamanu.patient_secondary_ids": [], "source.tamanu_source_dbt.tamanu.patient_vrs_data": [], "source.tamanu_source_dbt.tamanu.permissions": [], "source.tamanu_source_dbt.tamanu.pharmacy_orders": [], "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions": [], "source.tamanu_source_dbt.tamanu.portal_one_time_tokens": [], "source.tamanu_source_dbt.tamanu.portal_survey_assignments": [], "source.tamanu_source_dbt.tamanu.portal_users": [], "source.tamanu_source_dbt.tamanu.prescriptions": [], "source.tamanu_source_dbt.tamanu.procedures": [], "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians": [], "source.tamanu_source_dbt.tamanu.procedure_survey_responses": [], "source.tamanu_source_dbt.tamanu.procedure_type_surveys": [], "source.tamanu_source_dbt.tamanu.programs": [], "source.tamanu_source_dbt.tamanu.program_data_elements": [], "source.tamanu_source_dbt.tamanu.program_registries": [], "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses": [], "source.tamanu_source_dbt.tamanu.program_registry_conditions": [], "source.tamanu_source_dbt.tamanu.program_registry_condition_categories": [], "source.tamanu_source_dbt.tamanu.reference_data": [], "source.tamanu_source_dbt.tamanu.reference_data_relations": [], "source.tamanu_source_dbt.tamanu.reference_drugs": [], "source.tamanu_source_dbt.tamanu.reference_drug_facilities": [], "source.tamanu_source_dbt.tamanu.reference_medication_templates": [], "source.tamanu_source_dbt.tamanu.referrals": [], "source.tamanu_source_dbt.tamanu.refresh_tokens": [], "source.tamanu_source_dbt.tamanu.report_definitions": [], "source.tamanu_source_dbt.tamanu.report_definition_versions": [], "source.tamanu_source_dbt.tamanu.report_requests": [], "source.tamanu_source_dbt.tamanu.roles": [], "source.tamanu_source_dbt.tamanu.scheduled_vaccines": [], "source.tamanu_source_dbt.tamanu.SequelizeMeta": [], "source.tamanu_source_dbt.tamanu.settings": [], "source.tamanu_source_dbt.tamanu.signers": [], "source.tamanu_source_dbt.tamanu.socket_io_attachments": [], "source.tamanu_source_dbt.tamanu.surveys": [], "source.tamanu_source_dbt.tamanu.survey_responses": [], "source.tamanu_source_dbt.tamanu.survey_response_answers": [], "source.tamanu_source_dbt.tamanu.survey_screen_components": [], "source.tamanu_source_dbt.tamanu.sync_device_ticks": [], "source.tamanu_source_dbt.tamanu.sync_lookup": [], "source.tamanu_source_dbt.tamanu.sync_lookup_ticks": [], "source.tamanu_source_dbt.tamanu.sync_queued_devices": [], "source.tamanu_source_dbt.tamanu.sync_sessions": [], "source.tamanu_source_dbt.tamanu.tasks": [], "source.tamanu_source_dbt.tamanu.task_designations": [], "source.tamanu_source_dbt.tamanu.task_templates": [], "source.tamanu_source_dbt.tamanu.task_template_designations": [], "source.tamanu_source_dbt.tamanu.templates": [], "source.tamanu_source_dbt.tamanu.translated_strings": [], "source.tamanu_source_dbt.tamanu.triages": [], "source.tamanu_source_dbt.tamanu.upcoming_vaccinations": [], "source.tamanu_source_dbt.tamanu.users": [], "source.tamanu_source_dbt.tamanu.user_designations": [], "source.tamanu_source_dbt.tamanu.user_facilities": [], "source.tamanu_source_dbt.tamanu.user_leaves": [], "source.tamanu_source_dbt.tamanu.user_localisation_caches": [], "source.tamanu_source_dbt.tamanu.user_login_attempts": [], "source.tamanu_source_dbt.tamanu.user_preferences": [], "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients": [], "source.tamanu_source_dbt.tamanu.vitals": [], "source.tamanu_source_dbt.tamanu.vital_logs": [], "unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs": ["model.tamanu_source_dbt.patient_program_registrations_change_logs"], "unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs": ["model.tamanu_source_dbt.patient_program_registration_conditions_change_logs"], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation": ["model.tamanu_source_dbt.ds__admissions"], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality": ["model.tamanu_source_dbt.ds__admissions"], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only": ["model.tamanu_source_dbt.ds__admissions"], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities": ["model.tamanu_source_dbt.ds__admissions"]}, "child_map": {"model.tamanu_source_dbt.contributing_death_causes": ["model.tamanu_source_dbt.ds__deaths"], "model.tamanu_source_dbt.departments": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.discharges": ["model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.document_metadata": [], "model.tamanu_source_dbt.encounters": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "test.tamanu_source_dbt.logical__ds__admissions", "test.tamanu_source_dbt.logical__ds__diagnoses", "test.tamanu_source_dbt.logical__ds__encounter_diets", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions", "test.tamanu_source_dbt.logical__ds__imaging_requests", "test.tamanu_source_dbt.logical__ds__procedures", "test.tamanu_source_dbt.logical__ds__referrals", "test.tamanu_source_dbt.logical__ds__user_audit", "test.tamanu_source_dbt.logical__ds__vaccinations", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.encounters_metadata": [], "model.tamanu_source_dbt.encounter_diagnoses": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc", "test.tamanu_source_dbt.logical__ds__diagnoses"], "model.tamanu_source_dbt.encounter_diagnoses_metadata": [], "model.tamanu_source_dbt.encounter_diets": ["model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_diets"], "model.tamanu_source_dbt.encounter_history": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.encounter_prescriptions": ["model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions"], "model.tamanu_source_dbt.facilities": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patients_access_logs", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__admissions", "test.tamanu_source_dbt.logical__ds__diagnoses", "test.tamanu_source_dbt.logical__ds__encounter_diets", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions", "test.tamanu_source_dbt.logical__ds__imaging_requests", "test.tamanu_source_dbt.logical__ds__location_bookings", "test.tamanu_source_dbt.logical__ds__outpatient_appointments", "test.tamanu_source_dbt.logical__ds__procedures", "test.tamanu_source_dbt.logical__ds__referrals", "test.tamanu_source_dbt.logical__ds__user_audit", "test.tamanu_source_dbt.logical__ds__vaccinations", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.imaging_area_external_codes": [], "model.tamanu_source_dbt.imaging_requests": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__imaging_requests"], "model.tamanu_source_dbt.imaging_request_areas": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.imaging_results": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__sensitive_imaging_requests"], "model.tamanu_source_dbt.invoices": ["model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.invoice_insurance_plans": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.invoice-products-summary"], "model.tamanu_source_dbt.invoice_insurance_plan_items": ["model.tamanu_source_dbt.ds__invoice_products"], "model.tamanu_source_dbt.invoice_items": ["model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.invoice_price_lists": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.invoice-products-summary"], "model.tamanu_source_dbt.invoice_price_list_items": ["model.tamanu_source_dbt.ds__invoice_products"], "model.tamanu_source_dbt.invoice_products": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_requests": ["model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_requests_metadata": [], "model.tamanu_source_dbt.lab_request_logs": ["model.tamanu_source_dbt.int__lab_requests_history"], "model.tamanu_source_dbt.lab_request_logs_metadata": [], "model.tamanu_source_dbt.lab_tests": ["model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_test_panels": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_test_panel_lab_test_types": [], "model.tamanu_source_dbt.lab_test_panel_requests": ["model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_test_types": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.locations": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.hospital-admissions-by-area-summary", "model.tamanu_source_dbt.hospital-admissions-by-location-summary", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__admissions", "test.tamanu_source_dbt.logical__ds__diagnoses", "test.tamanu_source_dbt.logical__ds__encounter_diets", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions", "test.tamanu_source_dbt.logical__ds__imaging_requests", "test.tamanu_source_dbt.logical__ds__location_bookings", "test.tamanu_source_dbt.logical__ds__procedures", "test.tamanu_source_dbt.logical__ds__referrals", "test.tamanu_source_dbt.logical__ds__user_audit", "test.tamanu_source_dbt.logical__ds__vaccinations", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.location_bookings": ["model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "test.tamanu_source_dbt.logical__ds__location_bookings"], "model.tamanu_source_dbt.location_groups": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__outpatient_appointments"], "model.tamanu_source_dbt.medication_dispenses": ["model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses"], "model.tamanu_source_dbt.notes": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.outpatient_appointments": ["model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "test.tamanu_source_dbt.logical__ds__outpatient_appointments"], "model.tamanu_source_dbt.outpatient_appointments_change_logs": ["model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit"], "model.tamanu_source_dbt.patients": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__ongoing_conditions", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__patients_access_logs", "model.tamanu_source_dbt.ds__patients_change_logs", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details", "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.patients_access_logs": ["model.tamanu_source_dbt.ds__patients_access_logs"], "model.tamanu_source_dbt.patients_change_logs": ["model.tamanu_source_dbt.ds__patients_change_logs"], "model.tamanu_source_dbt.patients_merged": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details"], "model.tamanu_source_dbt.patients_metadata": [], "model.tamanu_source_dbt.patient_additional_data": ["model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.patient_additional_data_change_logs": ["model.tamanu_source_dbt.ds__patients_change_logs"], "model.tamanu_source_dbt.patient_allergies": ["model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_diets"], "model.tamanu_source_dbt.patient_birth_data": ["model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations"], "model.tamanu_source_dbt.patient_care_plans": [], "model.tamanu_source_dbt.patient_conditions": ["model.tamanu_source_dbt.ds__ongoing_conditions"], "model.tamanu_source_dbt.patient_death_contributing_causes": [], "model.tamanu_source_dbt.patient_death_data": ["model.tamanu_source_dbt.ds__deaths"], "model.tamanu_source_dbt.patient_facilities": [], "model.tamanu_source_dbt.patient_family_histories": [], "model.tamanu_source_dbt.patient_field_values": [], "model.tamanu_source_dbt.patient_program_registrations": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registrations_change_logs": ["unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs"], "model.tamanu_source_dbt.patient_program_registration_conditions": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs": ["unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs"], "model.tamanu_source_dbt.patient_vaccinations_upcoming": ["model.tamanu_source_dbt.ds__patient_vaccinations_upcoming"], "model.tamanu_source_dbt.pharmacy_orders": ["model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses"], "model.tamanu_source_dbt.pharmacy_order_prescriptions": ["model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses"], "model.tamanu_source_dbt.prescriptions": ["model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.procedures": ["model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__procedures"], "model.tamanu_source_dbt.procedures_metadata": [], "model.tamanu_source_dbt.programs": [], "model.tamanu_source_dbt.program_data_elements": [], "model.tamanu_source_dbt.program_registries": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.program_registry_clinical_statuses": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.program_registry_conditions": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.program_registry_condition_categories": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.reference_data": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__ongoing_conditions", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__patients_access_logs", "model.tamanu_source_dbt.ds__patients_change_logs", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.referrals": ["model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_referrals", "test.tamanu_source_dbt.logical__ds__referrals"], "model.tamanu_source_dbt.refresh_tokens": [], "model.tamanu_source_dbt.roles": ["model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__user_audit"], "model.tamanu_source_dbt.surveys": ["model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_referrals"], "model.tamanu_source_dbt.survey_responses": ["model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_referrals"], "model.tamanu_source_dbt.survey_response_answers": [], "model.tamanu_source_dbt.survey_screen_components": [], "model.tamanu_source_dbt.translated_strings": ["model.tamanu_source_dbt.imaging-requests-line-list", "model.tamanu_source_dbt.imaging-requests-summary", "model.tamanu_source_dbt.sensitive-imaging-requests-line-list", "model.tamanu_source_dbt.sensitive-imaging-requests-summary"], "model.tamanu_source_dbt.triages": ["model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__encounters_emergency"], "model.tamanu_source_dbt.users": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__ongoing_conditions", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__patients_access_logs", "model.tamanu_source_dbt.ds__patients_change_logs", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.users_metadata": [], "model.tamanu_source_dbt.vaccine_administrations": ["model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__vaccinations"], "model.tamanu_source_dbt.vaccine_administrations_change_logs": ["model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__vaccinations"], "model.tamanu_source_dbt.vaccine_schedules": ["model.tamanu_source_dbt.ds__patient_vaccinations_upcoming", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.ds__births": ["model.tamanu_source_dbt.registered-births-line-list"], "model.tamanu_source_dbt.ds__deaths": ["model.tamanu_source_dbt.deceased-patients-line-list"], "model.tamanu_source_dbt.ds__invoice_products": ["model.tamanu_source_dbt.invoice-products-summary"], "model.tamanu_source_dbt.ds__ongoing_conditions": ["model.tamanu_source_dbt.ongoing-conditions-line-list"], "model.tamanu_source_dbt.ds__patients": ["model.tamanu_source_dbt.registered-patients-by-dob-line-list", "model.tamanu_source_dbt.registered-patients-daily-summary", "model.tamanu_source_dbt.registered-patients-line-list"], "model.tamanu_source_dbt.ds__patients_access_logs": ["model.tamanu_source_dbt.audit-patient-views"], "model.tamanu_source_dbt.ds__patients_change_logs": ["model.tamanu_source_dbt.audit-patient-details-edit"], "model.tamanu_source_dbt.ds__patient_program_registrations": ["model.tamanu_source_dbt.program-registry-line-list", "model.tamanu_source_dbt.program-registry-removed-patients-line-list"], "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming": ["model.tamanu_source_dbt.upcoming-vaccinations-line-list"], "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details": ["model.tamanu_source_dbt.usage-quality-metrics-patient-details"], "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations": ["model.tamanu_source_dbt.usage-quality-metrics-patient-registrations"], "model.tamanu_source_dbt.ds__sensitive_admissions": ["model.tamanu_source_dbt.sensitive-admissions-line-list"], "model.tamanu_source_dbt.ds__sensitive_diagnoses": ["model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list"], "model.tamanu_source_dbt.ds__sensitive_encounters_emergency": ["model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary"], "model.tamanu_source_dbt.ds__sensitive_encounter_diets": ["model.tamanu_source_dbt.sensitive-encounter-diets-line-list"], "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions": ["model.tamanu_source_dbt.sensitive-prescription-line-list"], "model.tamanu_source_dbt.ds__sensitive_imaging_requests": ["model.tamanu_source_dbt.sensitive-imaging-requests-line-list", "model.tamanu_source_dbt.sensitive-imaging-requests-summary"], "model.tamanu_source_dbt.ds__sensitive_lab_requests": ["model.tamanu_source_dbt.sensitive-lab-requests-line-list"], "model.tamanu_source_dbt.ds__sensitive_lab_tests": ["model.tamanu_source_dbt.sensitive-lab-tests-line-list"], "model.tamanu_source_dbt.ds__sensitive_location_bookings": ["model.tamanu_source_dbt.sensitive-location-bookings-line-list"], "model.tamanu_source_dbt.ds__sensitive_medication_dispenses": ["model.tamanu_source_dbt.sensitive-medication-dispensed-summary"], "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments": ["model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list"], "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit": ["model.tamanu_source_dbt.sensitive-audit-outpatient-appointments"], "model.tamanu_source_dbt.ds__sensitive_procedures": ["model.tamanu_source_dbt.sensitive-procedures-line-list"], "model.tamanu_source_dbt.ds__sensitive_referrals": ["model.tamanu_source_dbt.sensitive-incomplete-referrals"], "model.tamanu_source_dbt.ds__sensitive_user_audit": ["model.tamanu_source_dbt.sensitive-user-audit-line-list"], "model.tamanu_source_dbt.ds__sensitive_vaccinations": ["model.tamanu_source_dbt.sensitive-vaccine-audit-line-list", "model.tamanu_source_dbt.sensitive-vaccine-line-list"], "model.tamanu_source_dbt.ds__admissions": ["model.tamanu_source_dbt.admissions-line-list", "test.tamanu_source_dbt.logical__ds__admissions", "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation", "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality", "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only", "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities"], "model.tamanu_source_dbt.ds__diagnoses": ["model.tamanu_source_dbt.recent-diagnoses-line-list", "test.tamanu_source_dbt.logical__ds__diagnoses"], "model.tamanu_source_dbt.ds__encounters_emergency": ["model.tamanu_source_dbt.patient-emergency-encounters-summary", "test.tamanu_source_dbt.logical__ds__encounters_emergency"], "model.tamanu_source_dbt.ds__encounter_diets": ["model.tamanu_source_dbt.encounter-diets-line-list", "test.tamanu_source_dbt.logical__ds__encounter_diets"], "model.tamanu_source_dbt.ds__encounter_prescriptions": ["model.tamanu_source_dbt.prescription-line-list", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions"], "model.tamanu_source_dbt.ds__imaging_requests": ["model.tamanu_source_dbt.imaging-requests-line-list", "model.tamanu_source_dbt.imaging-requests-summary", "test.tamanu_source_dbt.logical__ds__imaging_requests"], "model.tamanu_source_dbt.ds__lab_requests": ["model.tamanu_source_dbt.lab-requests-line-list"], "model.tamanu_source_dbt.ds__lab_tests": ["model.tamanu_source_dbt.lab-tests-line-list"], "model.tamanu_source_dbt.ds__location_bookings": ["model.tamanu_source_dbt.location-bookings-line-list", "test.tamanu_source_dbt.logical__ds__location_bookings"], "model.tamanu_source_dbt.ds__medication_dispenses": ["model.tamanu_source_dbt.medication-dispensed-summary"], "model.tamanu_source_dbt.ds__outpatient_appointments": ["model.tamanu_source_dbt.outpatient-appointments-line-list", "test.tamanu_source_dbt.logical__ds__outpatient_appointments"], "model.tamanu_source_dbt.ds__outpatient_appointments_audit": ["model.tamanu_source_dbt.audit-outpatient-appointments"], "model.tamanu_source_dbt.ds__procedures": ["model.tamanu_source_dbt.procedures-line-list", "test.tamanu_source_dbt.logical__ds__procedures"], "model.tamanu_source_dbt.ds__referrals": ["model.tamanu_source_dbt.incomplete-referrals", "test.tamanu_source_dbt.logical__ds__referrals"], "model.tamanu_source_dbt.ds__user_audit": ["model.tamanu_source_dbt.user-audit-line-list", "test.tamanu_source_dbt.logical__ds__user_audit"], "model.tamanu_source_dbt.ds__vaccinations": ["model.tamanu_source_dbt.vaccine-audit-line-list", "model.tamanu_source_dbt.vaccine-line-list", "test.tamanu_source_dbt.logical__ds__vaccinations"], "model.tamanu_source_dbt.int__admission_history_department": ["model.tamanu_source_dbt.hospital-admissions-by-department-summary"], "model.tamanu_source_dbt.int__admission_history_location": ["model.tamanu_source_dbt.hospital-admissions-by-area-summary", "model.tamanu_source_dbt.hospital-admissions-by-location-summary"], "model.tamanu_source_dbt.int__lab_requests_history": ["model.tamanu_source_dbt.lab-requests-summary"], "model.tamanu_source_dbt.sensitive-admissions-line-list": [], "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments": [], "model.tamanu_source_dbt.sensitive-encounter-diets-line-list": [], "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date": [], "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date": [], "model.tamanu_source_dbt.sensitive-imaging-requests-line-list": [], "model.tamanu_source_dbt.sensitive-imaging-requests-summary": [], "model.tamanu_source_dbt.sensitive-incomplete-referrals": [], "model.tamanu_source_dbt.sensitive-lab-requests-line-list": [], "model.tamanu_source_dbt.sensitive-lab-tests-line-list": [], "model.tamanu_source_dbt.sensitive-location-bookings-line-list": [], "model.tamanu_source_dbt.sensitive-medication-dispensed-summary": [], "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list": [], "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary": [], "model.tamanu_source_dbt.sensitive-prescription-line-list": [], "model.tamanu_source_dbt.sensitive-procedures-line-list": [], "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list": [], "model.tamanu_source_dbt.sensitive-user-audit-line-list": [], "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list": [], "model.tamanu_source_dbt.sensitive-vaccine-line-list": [], "model.tamanu_source_dbt.admissions-line-list": [], "model.tamanu_source_dbt.audit-outpatient-appointments": [], "model.tamanu_source_dbt.audit-patient-details-edit": [], "model.tamanu_source_dbt.audit-patient-views": [], "model.tamanu_source_dbt.deceased-patients-line-list": [], "model.tamanu_source_dbt.encounter-diets-line-list": [], "model.tamanu_source_dbt.encounter-summary-by-end-date": ["test.tamanu_source_dbt.logical__encounter_summary_by_end_date"], "model.tamanu_source_dbt.encounter-summary-by-start-date": ["test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.hospital-admissions-by-area-summary": [], "model.tamanu_source_dbt.hospital-admissions-by-department-summary": [], "model.tamanu_source_dbt.hospital-admissions-by-location-summary": [], "model.tamanu_source_dbt.imaging-requests-line-list": [], "model.tamanu_source_dbt.imaging-requests-summary": [], "model.tamanu_source_dbt.incomplete-referrals": [], "model.tamanu_source_dbt.invoice-products-summary": [], "model.tamanu_source_dbt.lab-requests-line-list": [], "model.tamanu_source_dbt.lab-requests-summary": [], "model.tamanu_source_dbt.lab-tests-line-list": [], "model.tamanu_source_dbt.location-bookings-line-list": [], "model.tamanu_source_dbt.medication-dispensed-summary": [], "model.tamanu_source_dbt.ongoing-conditions-line-list": [], "model.tamanu_source_dbt.outpatient-appointments-line-list": [], "model.tamanu_source_dbt.patient-emergency-encounters-summary": [], "model.tamanu_source_dbt.prescription-line-list": [], "model.tamanu_source_dbt.procedures-line-list": [], "model.tamanu_source_dbt.program-registry-line-list": [], "model.tamanu_source_dbt.program-registry-removed-patients-line-list": [], "model.tamanu_source_dbt.recent-diagnoses-line-list": [], "model.tamanu_source_dbt.registered-births-line-list": [], "model.tamanu_source_dbt.registered-patients-by-dob-line-list": [], "model.tamanu_source_dbt.registered-patients-daily-summary": [], "model.tamanu_source_dbt.registered-patients-line-list": [], "model.tamanu_source_dbt.upcoming-vaccinations-line-list": [], "model.tamanu_source_dbt.usage-quality-metrics-patient-details": [], "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations": [], "model.tamanu_source_dbt.user-audit-line-list": [], "model.tamanu_source_dbt.vaccine-audit-line-list": [], "model.tamanu_source_dbt.vaccine-line-list": [], "test.tamanu_source_dbt.logical__ds__admissions": [], "test.tamanu_source_dbt.logical__ds__diagnoses": [], "test.tamanu_source_dbt.logical__ds__encounters_emergency": [], "test.tamanu_source_dbt.logical__ds__encounter_diets": [], "test.tamanu_source_dbt.logical__ds__encounter_prescriptions": [], "test.tamanu_source_dbt.logical__ds__imaging_requests": [], "test.tamanu_source_dbt.logical__ds__location_bookings": [], "test.tamanu_source_dbt.logical__ds__outpatient_appointments": [], "test.tamanu_source_dbt.logical__ds__procedures": [], "test.tamanu_source_dbt.logical__ds__referrals": [], "test.tamanu_source_dbt.logical__ds__user_audit": [], "test.tamanu_source_dbt.logical__ds__vaccinations": [], "test.tamanu_source_dbt.logical__encounter_summary_by_end_date": [], "test.tamanu_source_dbt.logical__encounter_summary_by_start_date": [], "test.tamanu_source_dbt.assert__metric_definitions__disaggregations": [], "test.tamanu_source_dbt.assert__patients__village_id": [], "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due": [], "test.tamanu_source_dbt.assert__users__role": [], "seed.tamanu_source_dbt.metric_definitions": ["test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac", "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef", "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c", "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852", "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c", "test.tamanu_source_dbt.assert__metric_definitions__disaggregations", "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489", "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64", "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461", "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25", "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08", "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf", "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0", "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f", "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e", "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6", "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a", "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13"], "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc": [], "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08": [], "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13": [], "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c": [], "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf": [], "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461": [], "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac": [], "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c": [], "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6": [], "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a": [], "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0": [], "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852": [], "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b": [], "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567": [], "test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54": [], "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd": [], "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e": [], "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f": [], "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4": [], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5": [], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec": [], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0": [], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c": [], "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c": [], "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf": [], "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b": [], "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227": [], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e": [], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1": [], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e": [], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d": [], "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd": [], "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250": [], "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625": [], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a": [], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a": [], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7": [], "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5": [], "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a": [], "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a": [], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05": [], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137": [], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf": [], "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc": [], "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb": [], "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d": [], "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45": [], "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530": [], "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182": [], "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040": [], "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6": [], "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59": [], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b": [], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5": [], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4": [], "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3": [], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b": [], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459": [], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd": [], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947": [], "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab": [], "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee": [], "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b": [], "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616": [], "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d": [], "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94": [], "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21": [], "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b": [], "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d": [], "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1": [], "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574": [], "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce": [], "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2": [], "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2": [], "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204": [], "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e": [], "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5": [], "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f": [], "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3": [], "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7": [], "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0": [], "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a": [], "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c": [], "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91": [], "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2": [], "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5": [], "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205": [], "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822": [], "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0": [], "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b": [], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b": [], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3": [], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d": [], "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc": [], "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2": [], "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f": [], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d": [], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af": [], "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac": [], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08": [], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03": [], "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed": [], "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437": [], "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624": [], "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be": [], "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904": [], "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b": [], "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9": [], "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0": [], "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2": [], "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108": [], "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b": [], "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127": [], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85": [], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac": [], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39": [], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157": [], "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e": [], "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3": [], "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41": [], "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37": [], "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4": [], "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef": [], "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50": [], "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9": [], "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9": [], "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4": [], "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1": [], "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee": [], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c": [], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6": [], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb": [], "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95": [], "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921": [], "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d": [], "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3": [], "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762": [], "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267": [], "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a": [], "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463": [], "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef": [], "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f": [], "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e": [], "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c": [], "test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6": [], "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6": [], "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8": [], "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6": [], "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156": [], "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc": [], "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48": [], "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266": [], "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b": [], "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924": [], "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf": [], "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c": [], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886": [], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e": [], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb": [], "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d": [], "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273": [], "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea": [], "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6": [], "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1": [], "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998": [], "test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692": [], "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780": [], "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c": [], "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2": [], "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35": [], "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd": [], "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6": [], "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b": [], "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0": [], "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a": [], "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f": [], "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c": [], "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf": [], "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90": [], "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e": [], "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704": [], "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06": [], "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16": [], "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565": [], "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3": [], "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c": [], "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106": [], "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05": [], "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13": [], "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8": [], "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1": [], "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff": [], "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d": [], "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877": [], "source.tamanu_source_dbt.logs__tamanu.accesses": ["model.tamanu_source_dbt.patients_access_logs", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e", "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a"], "source.tamanu_source_dbt.logs__tamanu.changes": ["model.tamanu_source_dbt.encounter_diagnoses_metadata", "model.tamanu_source_dbt.encounters_metadata", "model.tamanu_source_dbt.lab_request_logs_metadata", "model.tamanu_source_dbt.lab_requests_metadata", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patient_additional_data_change_logs", "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs", "model.tamanu_source_dbt.patient_program_registrations_change_logs", "model.tamanu_source_dbt.patients_change_logs", "model.tamanu_source_dbt.patients_metadata", "model.tamanu_source_dbt.procedures_metadata", "model.tamanu_source_dbt.users_metadata", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658", "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465", "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9"], "source.tamanu_source_dbt.logs__tamanu.debug_logs": ["test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0", "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4", "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0", "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567", "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd"], "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes": ["test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b", "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985", "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0", "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629", "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0", "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43"], "source.tamanu_source_dbt.logs__tamanu.fhir_writes": ["test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883", "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8"], "source.tamanu_source_dbt.logs__tamanu.migrations": ["test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571", "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e"], "source.tamanu_source_dbt.tamanu.administered_vaccines": ["model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f", "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c", "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1", "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d", "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e", "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05"], "source.tamanu_source_dbt.tamanu.appointments": ["model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.outpatient_appointments", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733", "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5", "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60"], "source.tamanu_source_dbt.tamanu.appointment_procedure_types": ["test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c", "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c"], "source.tamanu_source_dbt.tamanu.appointment_schedules": ["model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.outpatient_appointments", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442", "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f"], "source.tamanu_source_dbt.tamanu.assets": ["test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb", "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54", "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e", "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2", "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992", "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b", "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6"], "source.tamanu_source_dbt.tamanu.attachments": ["test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e", "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e", "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1", "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f", "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227"], "source.tamanu_source_dbt.tamanu.certifiable_vaccines": ["test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb", "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0", "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f"], "source.tamanu_source_dbt.tamanu.certificate_notifications": ["test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a", "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a", "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b"], "source.tamanu_source_dbt.tamanu.contributing_death_causes": ["model.tamanu_source_dbt.contributing_death_causes", "model.tamanu_source_dbt.patient_death_contributing_causes", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a", "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a", "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa"], "source.tamanu_source_dbt.tamanu.death_revert_logs": ["test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54", "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317"], "source.tamanu_source_dbt.tamanu.departments": ["model.tamanu_source_dbt.departments", "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d", "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb", "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45", "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182", "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec", "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc"], "source.tamanu_source_dbt.tamanu.devices": ["test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee", "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906", "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4", "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040", "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6", "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2", "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812", "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999", "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158"], "source.tamanu_source_dbt.tamanu.discharges": ["model.tamanu_source_dbt.discharges", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5", "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574", "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b", "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4", "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59"], "source.tamanu_source_dbt.tamanu.document_metadata": ["model.tamanu_source_dbt.document_metadata", "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b", "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6"], "source.tamanu_source_dbt.tamanu.encounters": ["model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_request_logs", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.vaccine_administrations", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9", "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2", "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503", "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e", "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0", "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38"], "source.tamanu_source_dbt.tamanu.encounter_diagnoses": ["model.tamanu_source_dbt.encounter_diagnoses", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069", "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a", "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9"], "source.tamanu_source_dbt.tamanu.encounter_diets": ["model.tamanu_source_dbt.encounter_diets", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836", "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027"], "source.tamanu_source_dbt.tamanu.encounter_history": ["model.tamanu_source_dbt.encounter_history", "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb", "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4"], "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions": ["test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f", "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d"], "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories": ["test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2", "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a"], "source.tamanu_source_dbt.tamanu.encounter_prescriptions": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab", "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1"], "source.tamanu_source_dbt.tamanu.facilities": ["model.tamanu_source_dbt.facilities", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4", "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1", "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4", "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330", "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286", "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0", "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa", "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63", "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4"], "source.tamanu_source_dbt.tamanu.imaging_area_external_codes": ["model.tamanu_source_dbt.imaging_area_external_codes", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c", "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98", "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b"], "source.tamanu_source_dbt.tamanu.imaging_requests": ["model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_results", "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17", "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069", "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e"], "source.tamanu_source_dbt.tamanu.imaging_request_areas": ["model.tamanu_source_dbt.imaging_request_areas", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600", "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2"], "source.tamanu_source_dbt.tamanu.imaging_results": ["model.tamanu_source_dbt.imaging_results", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069", "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99"], "source.tamanu_source_dbt.tamanu.imaging_type_external_codes": ["test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff", "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd"], "source.tamanu_source_dbt.tamanu.invoices": ["model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoices", "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb", "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f", "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060", "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660", "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e"], "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans": ["test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80", "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253"], "source.tamanu_source_dbt.tamanu.invoice_discounts": ["test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1", "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6"], "source.tamanu_source_dbt.tamanu.invoice_insurance_plans": ["model.tamanu_source_dbt.invoice_insurance_plans", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d", "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9"], "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items": ["model.tamanu_source_dbt.invoice_insurance_plan_items", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2", "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d"], "source.tamanu_source_dbt.tamanu.invoice_insurer_payments": ["test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a", "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7", "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0", "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc"], "source.tamanu_source_dbt.tamanu.invoice_items": ["model.tamanu_source_dbt.invoice_items", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f", "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59"], "source.tamanu_source_dbt.tamanu.invoice_item_discounts": ["test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45", "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94"], "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances": ["test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334", "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a"], "source.tamanu_source_dbt.tamanu.invoice_patient_payments": ["test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e", "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5", "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247"], "source.tamanu_source_dbt.tamanu.invoice_payments": ["test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b", "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1"], "source.tamanu_source_dbt.tamanu.invoice_price_lists": ["model.tamanu_source_dbt.invoice_price_lists", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7", "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f"], "source.tamanu_source_dbt.tamanu.invoice_price_list_items": ["model.tamanu_source_dbt.invoice_price_list_items", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7", "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467"], "source.tamanu_source_dbt.tamanu.invoice_products": ["model.tamanu_source_dbt.invoice_products", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f", "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436"], "source.tamanu_source_dbt.tamanu.ips_requests": ["test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9", "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f", "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34"], "source.tamanu_source_dbt.tamanu.lab_requests": ["model.tamanu_source_dbt.lab_request_logs", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_tests", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30", "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7", "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd", "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa", "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f"], "source.tamanu_source_dbt.tamanu.lab_request_attachments": ["test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d", "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1"], "source.tamanu_source_dbt.tamanu.lab_request_logs": ["model.tamanu_source_dbt.lab_request_logs", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883", "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3"], "source.tamanu_source_dbt.tamanu.lab_tests": ["model.tamanu_source_dbt.lab_tests", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5", "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa", "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e", "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a"], "source.tamanu_source_dbt.tamanu.lab_test_panels": ["model.tamanu_source_dbt.lab_test_panels", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff", "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b"], "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types": ["model.tamanu_source_dbt.lab_test_panel_lab_test_types", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a"], "source.tamanu_source_dbt.tamanu.lab_test_panel_requests": ["model.tamanu_source_dbt.lab_test_panel_requests", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff", "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c"], "source.tamanu_source_dbt.tamanu.lab_test_types": ["model.tamanu_source_dbt.lab_test_types", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4", "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a", "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e", "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8"], "source.tamanu_source_dbt.tamanu.local_system_facts": ["test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b", "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d", "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21"], "source.tamanu_source_dbt.tamanu.locations": ["model.tamanu_source_dbt.locations", "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204", "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2", "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574", "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2", "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5", "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286", "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8", "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce", "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1"], "source.tamanu_source_dbt.tamanu.location_assignments": ["test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a", "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5"], "source.tamanu_source_dbt.tamanu.location_assignment_templates": ["test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6", "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606"], "source.tamanu_source_dbt.tamanu.location_groups": ["model.tamanu_source_dbt.location_groups", "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf", "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330", "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e", "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856"], "source.tamanu_source_dbt.tamanu.medication_administration_records": ["test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f", "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48"], "source.tamanu_source_dbt.tamanu.medication_administration_record_doses": ["test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69", "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead"], "source.tamanu_source_dbt.tamanu.medication_dispenses": ["model.tamanu_source_dbt.medication_dispenses", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91", "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031"], "source.tamanu_source_dbt.tamanu.notes": ["model.tamanu_source_dbt.notes", "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d", "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205", "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036", "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5", "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f", "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822", "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a", "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c", "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e", "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2", "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5", "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7", "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e", "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48"], "source.tamanu_source_dbt.tamanu.notes_legacy": ["test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0", "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd"], "source.tamanu_source_dbt.tamanu.note_items": ["test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca", "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8"], "source.tamanu_source_dbt.tamanu.note_pages": ["test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b", "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269"], "source.tamanu_source_dbt.tamanu.notifications": ["test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9", "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b"], "source.tamanu_source_dbt.tamanu.one_time_logins": ["test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03", "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d", "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08", "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af", "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac", "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f"], "source.tamanu_source_dbt.tamanu.patients": ["model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_change_logs", "model.tamanu_source_dbt.patients_merged", "test.tamanu_source_dbt.assert__patients__village_id", "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7", "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622", "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00", "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302", "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545", "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed", "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba", "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7", "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba", "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741", "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062", "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59", "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f", "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886", "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c", "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72", "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d"], "source.tamanu_source_dbt.tamanu.patient_additional_data": ["model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_additional_data_change_logs", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c", "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167", "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf", "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6"], "source.tamanu_source_dbt.tamanu.patient_allergies": ["model.tamanu_source_dbt.patient_allergies", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8", "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb"], "source.tamanu_source_dbt.tamanu.patient_birth_data": ["model.tamanu_source_dbt.patient_birth_data", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97", "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc", "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294", "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0", "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9", "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645", "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7", "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0"], "source.tamanu_source_dbt.tamanu.patient_care_plans": ["model.tamanu_source_dbt.patient_care_plans", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450", "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99"], "source.tamanu_source_dbt.tamanu.patient_communications": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278", "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba", "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2"], "source.tamanu_source_dbt.tamanu.patient_conditions": ["model.tamanu_source_dbt.patient_conditions", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb", "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86"], "source.tamanu_source_dbt.tamanu.patient_contacts": ["test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683", "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615", "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688"], "source.tamanu_source_dbt.tamanu.patient_death_data": ["model.tamanu_source_dbt.contributing_death_causes", "model.tamanu_source_dbt.patient_death_contributing_causes", "model.tamanu_source_dbt.patient_death_data", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18", "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741", "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6"], "source.tamanu_source_dbt.tamanu.patient_facilities": ["model.tamanu_source_dbt.patient_facilities", "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6", "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4", "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea", "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062"], "source.tamanu_source_dbt.tamanu.patient_family_histories": ["model.tamanu_source_dbt.patient_family_histories", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718", "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92", "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6", "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751"], "source.tamanu_source_dbt.tamanu.patient_field_definitions": ["test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5", "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5"], "source.tamanu_source_dbt.tamanu.patient_field_definition_categories": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6", "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37"], "source.tamanu_source_dbt.tamanu.patient_field_values": ["model.tamanu_source_dbt.patient_field_values", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59"], "source.tamanu_source_dbt.tamanu.patient_issues": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397", "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb", "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be"], "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae", "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6"], "source.tamanu_source_dbt.tamanu.patient_program_registrations": ["model.tamanu_source_dbt.patient_program_registration_conditions", "model.tamanu_source_dbt.patient_program_registrations", "model.tamanu_source_dbt.patient_program_registrations_change_logs", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a", "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b"], "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions": ["model.tamanu_source_dbt.patient_program_registration_conditions", "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf", "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5"], "source.tamanu_source_dbt.tamanu.patient_secondary_ids": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f", "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c"], "source.tamanu_source_dbt.tamanu.patient_vrs_data": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6", "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437", "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561", "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715"], "source.tamanu_source_dbt.tamanu.permissions": ["test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb", "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536", "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624", "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be", "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395", "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407", "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be"], "source.tamanu_source_dbt.tamanu.pharmacy_orders": ["model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e", "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16"], "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions": ["model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b", "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2"], "source.tamanu_source_dbt.tamanu.portal_one_time_tokens": ["test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b", "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf"], "source.tamanu_source_dbt.tamanu.portal_survey_assignments": ["test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85", "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba"], "source.tamanu_source_dbt.tamanu.portal_users": ["test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108", "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac", "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1"], "source.tamanu_source_dbt.tamanu.prescriptions": ["model.tamanu_source_dbt.prescriptions", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b", "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647"], "source.tamanu_source_dbt.tamanu.procedures": ["model.tamanu_source_dbt.procedures", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39", "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291"], "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians": ["test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80", "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6"], "source.tamanu_source_dbt.tamanu.procedure_survey_responses": ["test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3", "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841"], "source.tamanu_source_dbt.tamanu.procedure_type_surveys": ["test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41", "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15"], "source.tamanu_source_dbt.tamanu.programs": ["model.tamanu_source_dbt.programs", "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef", "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4", "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50", "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9", "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635", "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37"], "source.tamanu_source_dbt.tamanu.program_data_elements": ["model.tamanu_source_dbt.program_data_elements", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030", "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b", "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4"], "source.tamanu_source_dbt.tamanu.program_registries": ["model.tamanu_source_dbt.program_registries", "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395", "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa", "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413", "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a", "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852"], "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses": ["model.tamanu_source_dbt.program_registry_clinical_statuses", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805", "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e"], "source.tamanu_source_dbt.tamanu.program_registry_conditions": ["model.tamanu_source_dbt.program_registry_conditions", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf", "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7"], "source.tamanu_source_dbt.tamanu.program_registry_condition_categories": ["model.tamanu_source_dbt.program_registry_condition_categories", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e"], "source.tamanu_source_dbt.tamanu.reference_data": ["model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.reference_data", "test.tamanu_source_dbt.assert__patients__village_id", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06", "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee"], "source.tamanu_source_dbt.tamanu.reference_data_relations": ["test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b", "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e"], "source.tamanu_source_dbt.tamanu.reference_drugs": ["test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485", "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13", "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c"], "source.tamanu_source_dbt.tamanu.reference_drug_facilities": ["test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96"], "source.tamanu_source_dbt.tamanu.reference_medication_templates": ["test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4", "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51"], "source.tamanu_source_dbt.tamanu.referrals": ["model.tamanu_source_dbt.referrals", "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d", "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0"], "source.tamanu_source_dbt.tamanu.refresh_tokens": ["model.tamanu_source_dbt.refresh_tokens", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95", "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2", "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141"], "source.tamanu_source_dbt.tamanu.report_definitions": ["test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3", "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d", "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799", "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51", "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2", "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb", "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6"], "source.tamanu_source_dbt.tamanu.report_definition_versions": ["test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22", "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2", "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d", "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c"], "source.tamanu_source_dbt.tamanu.report_requests": ["test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9", "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4", "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf"], "source.tamanu_source_dbt.tamanu.roles": ["model.tamanu_source_dbt.roles", "test.tamanu_source_dbt.assert__users__role", "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463", "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef", "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f", "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407", "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a"], "source.tamanu_source_dbt.tamanu.scheduled_vaccines": ["model.tamanu_source_dbt.vaccine_schedules", "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due", "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83", "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e", "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf", "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45"], "source.tamanu_source_dbt.tamanu.SequelizeMeta": ["test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6", "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c"], "source.tamanu_source_dbt.tamanu.settings": ["test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8", "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6", "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36", "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6", "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2", "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e", "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11", "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe", "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849"], "source.tamanu_source_dbt.tamanu.signers": ["test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735", "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b", "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd", "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e", "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31", "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6", "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8", "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab"], "source.tamanu_source_dbt.tamanu.socket_io_attachments": ["test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc", "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48", "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156"], "source.tamanu_source_dbt.tamanu.surveys": ["model.tamanu_source_dbt.surveys", "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90", "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635", "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc"], "source.tamanu_source_dbt.tamanu.survey_responses": ["model.tamanu_source_dbt.survey_responses", "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6", "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14", "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914", "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d", "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04", "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3"], "source.tamanu_source_dbt.tamanu.survey_response_answers": ["model.tamanu_source_dbt.survey_response_answers", "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f", "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba", "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5", "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf", "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b", "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d", "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26", "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a"], "source.tamanu_source_dbt.tamanu.survey_screen_components": ["model.tamanu_source_dbt.survey_screen_components", "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f", "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214", "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413", "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa", "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387"], "source.tamanu_source_dbt.tamanu.sync_device_ticks": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41", "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a", "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999"], "source.tamanu_source_dbt.tamanu.sync_lookup": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886", "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43"], "source.tamanu_source_dbt.tamanu.sync_lookup_ticks": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181", "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3"], "source.tamanu_source_dbt.tamanu.sync_queued_devices": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d", "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe"], "source.tamanu_source_dbt.tamanu.sync_sessions": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c", "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3"], "source.tamanu_source_dbt.tamanu.tasks": ["test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee", "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c"], "source.tamanu_source_dbt.tamanu.task_designations": ["test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273", "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db"], "source.tamanu_source_dbt.tamanu.task_templates": ["test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea", "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea", "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e", "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44", "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6", "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f", "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8"], "source.tamanu_source_dbt.tamanu.task_template_designations": ["test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1", "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a"], "source.tamanu_source_dbt.tamanu.templates": ["test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692", "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780", "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c", "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6", "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c", "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998"], "source.tamanu_source_dbt.tamanu.translated_strings": ["model.tamanu_source_dbt.translated_strings", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2"], "source.tamanu_source_dbt.tamanu.triages": ["model.tamanu_source_dbt.triages", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44", "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6", "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd", "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b", "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f", "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0", "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138", "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35"], "source.tamanu_source_dbt.tamanu.upcoming_vaccinations": ["model.tamanu_source_dbt.patient_vaccinations_upcoming", "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c", "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf"], "source.tamanu_source_dbt.tamanu.users": ["model.tamanu_source_dbt.users", "test.tamanu_source_dbt.assert__users__role", "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704", "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde", "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e", "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504", "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c", "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a", "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f", "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90", "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636", "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3", "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54", "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b", "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca", "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5", "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7", "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7", "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39", "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2", "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04", "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c", "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138", "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5", "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055", "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0", "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196"], "source.tamanu_source_dbt.tamanu.user_designations": ["test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80", "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a"], "source.tamanu_source_dbt.tamanu.user_facilities": ["test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3", "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16", "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a"], "source.tamanu_source_dbt.tamanu.user_leaves": ["test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528", "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5"], "source.tamanu_source_dbt.tamanu.user_localisation_caches": ["test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd", "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3", "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226"], "source.tamanu_source_dbt.tamanu.user_login_attempts": ["test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106", "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999", "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5", "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808"], "source.tamanu_source_dbt.tamanu.user_preferences": ["test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13", "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af"], "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients": ["test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e", "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918", "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8", "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3", "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839", "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a"], "source.tamanu_source_dbt.tamanu.vitals": ["test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f", "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f", "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f", "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb", "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1", "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af"], "source.tamanu_source_dbt.tamanu.vital_logs": ["test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877", "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26", "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055", "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4"], "unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs": [], "unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs": [], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation": [], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality": [], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only": [], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {"unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs": {"model": "patient_program_registrations_change_logs", "given": [{"input": "source('logs__tamanu', 'changes')", "rows": [{"id": "550e8400-e29b-41d4-a716-446655440001", "logged_at": "2025-06-20 10:00:00+12:00", "updated_by_user_id": "user_001", "record_id": "reg_001", "table_name": "patient_program_registrations", "version": "2.33.0", "record_created_at": "2024-01-15 09:00:00", "record_updated_at": "2024-01-15 09:00:00", "record_data": "{\"date\": \"2024-01-15T09:00:00Z\", \"registration_status\": \"active\", \"patient_id\": \"pat_001\", \"program_registry_id\": \"prog_001\", \"clinical_status_id\": \"status_001\", \"clinician_id\": \"cli_001\", \"registering_facility_id\": \"fac_001\", \"facility_id\": \"fac_001\"}"}, {"id": "550e8400-e29b-41d4-a716-446655440002", "logged_at": "2025-06-20 14:30:00+12:00", "updated_by_user_id": "user_002", "record_id": "reg_001", "table_name": "patient_program_registrations", "version": "2.33.1", "record_created_at": "2024-01-16 13:30:00", "record_updated_at": "2024-01-16 13:30:00", "record_data": "{\"date\": \"2024-01-16T13:30:00Z\", \"registration_status\": \"inactive\", \"patient_id\": \"pat_001\", \"program_registry_id\": \"prog_001\", \"clinical_status_id\": \"status_002\", \"clinician_id\": \"cli_002\", \"registering_facility_id\": \"fac_001\", \"facility_id\": \"fac_001\", \"deactivated_clinician_id\": \"cli_003\", \"deactivated_date\": \"2024-01-16T15:00:00Z\"}"}], "format": "csv", "fixture": null}, {"input": "source('tamanu', 'patient_program_registrations')", "rows": [{"id": "reg_001", "date": "2026-01-18 10:00:00", "registration_status": "inactive", "patient_id": "pat_001", "program_registry_id": "prog_001", "clinical_status_id": "status_002", "clinician_id": "cli_002", "registering_facility_id": "fac_001", "facility_id": "fac_001", "village_id": null, "deactivated_clinician_id": "cli_003", "deactivated_date": "2024-01-16 15:00:00", "deleted_at": null}], "format": "csv", "fixture": null}], "expect": {"rows": [{"changelog_id": "550e8400-e29b-41d4-a716-446655440001", "logged_at": "2025-06-20 10:00:00+12:00", "updated_by_user_id": "user_001", "id": "reg_001", "datetime": "2024-01-15 09:00:00", "registration_status": "active", "patient_id": "pat_001", "program_registry_id": "prog_001", "clinical_status_id": "status_001", "registered_by_id": "cli_001", "registering_facility_id": "fac_001", "facility_id": "fac_001", "village_id": null, "deactivated_by_id": null, "deactivated_datetime": null}, {"changelog_id": "550e8400-e29b-41d4-a716-446655440002", "logged_at": "2025-06-20 14:30:00+12:00", "updated_by_user_id": "user_002", "id": "reg_001", "datetime": "2024-01-16 13:30:00", "registration_status": "inactive", "patient_id": "pat_001", "program_registry_id": "prog_001", "clinical_status_id": "status_002", "registered_by_id": "cli_002", "registering_facility_id": "fac_001", "facility_id": "fac_001", "village_id": null, "deactivated_by_id": "cli_003", "deactivated_datetime": "2024-01-16 15:00:00"}], "format": "csv", "fixture": null}, "name": "test_patient_program_registrations_change_logs", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registrations_change_logs.yml", "original_file_path": "models\\bases\\patient_program_registrations_change_logs.yml", "unique_id": "unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registrations_change_logs", "test_patient_program_registrations_change_logs"], "description": "Test basic functionality of patient_program_registrations_change_logs model", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_program_registrations_change_logs"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "daa003d136f6a20aac44bd33b29452bc30d21b55151e4a3256de2cdbc91cd907", "schema": "reporting", "created_at": 1782422375.1499941, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs": {"model": "patient_program_registration_conditions_change_logs", "given": [{"input": "source('logs__tamanu', 'changes')", "rows": [{"id": "550e8400-e29b-41d4-a716-446655440001", "logged_at": "2025-06-20 10:00:00", "updated_by_user_id": "user_001", "record_id": "cond_001", "table_name": "patient_program_registration_conditions", "version": "2.33.0", "record_created_at": "2024-01-15 09:00:00", "record_updated_at": "2024-01-15 09:00:00", "record_data": "{\"id\": \"cond_001\", \"date\": \"2024-01-15T09:00:00Z\", \"program_registry_condition_id\": \"prog_cond_001\", \"patient_program_registration_id\": \"reg_001\", \"program_registry_condition_category_id\": \"primary\", \"reason_for_change\": \"initial_registration\", \"clinician_id\": \"cli_001\", \"deletion_date\": null, \"deletion_clinician_id\": null}"}, {"id": "550e8400-e29b-41d4-a716-446655440002", "logged_at": "2025-06-20 14:30:00", "updated_by_user_id": "user_002", "record_id": "cond_001", "table_name": "patient_program_registration_conditions", "version": "2.33.1", "record_created_at": "2024-01-16 13:30:00", "record_updated_at": "2024-01-16 13:30:00", "record_data": "{\"id\": \"cond_001\", \"date\": \"2024-01-16T13:30:00Z\", \"program_registry_condition_id\": \"prog_cond_001\", \"patient_program_registration_id\": \"reg_001\", \"program_registry_condition_category_id\": \"secondary\", \"reason_for_change\": \"condition_category_updated\", \"clinician_id\": \"cli_002\", \"deletion_date\": \"2024-01-16T15:00:00Z\", \"deletion_clinician_id\": \"cli_003\"}"}], "format": "csv", "fixture": null}, {"input": "source('tamanu', 'patient_program_registration_conditions')", "rows": [{"id": "cond_001", "date": "2024-01-15 09:00:00", "program_registry_condition_id": "prog_cond_001", "patient_program_registration_id": "reg_001", "program_registry_condition_category_id": "primary", "reason_for_change": "initial_registration", "clinician_id": "cli_001", "deletion_date": null, "deletion_clinician_id": null, "deleted_at": null}, {"id": "cond_001", "date": "2024-01-16 13:30:00", "program_registry_condition_id": "prog_cond_001", "patient_program_registration_id": "reg_001", "program_registry_condition_category_id": "secondary", "reason_for_change": "condition_category_updated", "clinician_id": "cli_002", "deletion_date": "2024-01-16 15:00:00", "deletion_clinician_id": "cli_003", "deleted_at": null}], "format": "csv", "fixture": null}], "expect": {"rows": [{"changelog_id": "550e8400-e29b-41d4-a716-446655440002", "logged_at": "2025-06-20 14:30:00", "updated_by_user_id": "user_002", "id": "cond_001", "datetime": "2024-01-16 13:30:00", "program_registry_condition_id": "prog_cond_001", "patient_program_registration_id": "reg_001", "program_registry_condition_category_id": "secondary", "reason_for_change": "condition_category_updated", "recorded_by_id": "cli_002", "deleted_datetime": "2024-01-16 15:00:00", "deleted_by_id": "cli_003"}, {"changelog_id": "550e8400-e29b-41d4-a716-446655440001", "logged_at": "2025-06-20 10:00:00", "updated_by_user_id": "user_001", "id": "cond_001", "datetime": "2024-01-15 09:00:00", "program_registry_condition_id": "prog_cond_001", "patient_program_registration_id": "reg_001", "program_registry_condition_category_id": "primary", "reason_for_change": "initial_registration", "recorded_by_id": "cli_001", "deleted_datetime": null, "deleted_by_id": null}], "format": "csv", "fixture": null}, "name": "test_patient_program_registration_conditions_change_logs", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registration_conditions_change_logs.yml", "original_file_path": "models\\bases\\patient_program_registration_conditions_change_logs.yml", "unique_id": "unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registration_conditions_change_logs", "test_patient_program_registration_conditions_change_logs"], "description": "Test basic functionality of patient_program_registration_conditions_change_logs model", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_program_registration_conditions_change_logs"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "caca3093fd3f120852e920d714a962363b7e47f68dac517fb9eb72039ad3f979", "schema": "reporting", "created_at": 1782422375.1659558, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation": {"model": "ds__admissions", "given": [{"input": "ref('encounters')", "rows": "select 'enc_001' as id, 'pat_001' as patient_id, '2024-05-15 10:00:00'::timestamp as start_datetime, null::timestamp as end_datetime, 'loc_001' as location_id, 'bill_001' as patient_billing_type_id, 'admission' as encounter_type", "format": "sql", "fixture": null}, {"input": "ref('patients')", "rows": "select 'pat_001' as id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 'male' as sex, 'vil_001' as village_id", "format": "sql", "fixture": null}, {"input": "ref('encounter_history')", "rows": "select 'enc_001' as encounter_id, '2024-05-15 10:00:00'::timestamp as datetime, null::text[] as change_type, 'cli_001' as clinician_id, 'dept_001' as department_id, 'loc_001' as location_id, 'admission' as encounter_type", "format": "sql", "fixture": null}, {"input": "ref('users')", "rows": "select 'cli_001' as id, 'Dr. Alice Wilson' as display_name", "format": "sql", "fixture": null}, {"input": "ref('departments')", "rows": "select 'dept_001' as id, 'Emergency' as name", "format": "sql", "fixture": null}, {"input": "ref('locations')", "rows": "select 'loc_001' as id, 'Room 101' as name, 'fac_001' as facility_id, 'lg_001' as location_group_id", "format": "sql", "fixture": null}, {"input": "ref('location_groups')", "rows": "select 'lg_001' as id, 'Emergency Ward' as name", "format": "sql", "fixture": null}, {"input": "ref('facilities')", "rows": "select 'fac_001' as id, 'Central Hospital' as name, false as is_sensitive", "format": "sql", "fixture": null}, {"input": "ref('reference_data')", "rows": "select 'vil_001' as id, 'Village A' as name, null as code\nunion all\nselect 'bill_001', 'Insurance', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_diagnoses')", "rows": "select null::text as encounter_id, null::text as diagnosis_id, null::boolean as is_primary, null::text as certainty, null::timestamp as datetime\nwhere false", "format": "sql", "fixture": null}], "expect": {"rows": "select 'pat_001' as patient_id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 34 as age, 'Male' as sex, 'vil_001' as village_id, 'Village A' as village, 'bill_001' as billing_type_id, 'Insurance' as billing_type, 'cli_001' as admitting_clinician_id, 'Dr. Alice Wilson' as admitting_clinician, '2024-05-15 10:00:00'::timestamp as admission_datetime, 'active' as admission_status, null::timestamp as discharge_datetime, 'fac_001' as facility_id, 'Central Hospital' as facility, array['dept_001'] as department_ids, 'Emergency' as departments, '2024-05-15 10:00' as department_datetimes, array['lg_001'] as location_group_ids, 'Emergency Ward' as location_groups, '2024-05-15 10:00' as location_group_datetimes, array['loc_001'] as location_ids, 'Room 101' as locations, '2024-05-15 10:00' as location_datetimes, null as primary_diagnoses, null as secondary_diagnoses", "format": "sql", "fixture": null}, "name": "test_ds_admissions_age_calculation", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "unit_tests\\test_ds_admissions_age_calculation.yml", "original_file_path": "models\\unit_tests\\test_ds_admissions_age_calculation.yml", "unique_id": "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation", "fqn": ["tamanu_source_dbt", "unit_tests", "ds__admissions", "test_ds_admissions_age_calculation"], "description": "Test age calculation at admission time", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "34db723f667978a93d737512faf08a59a5c2aab9a5ce75a81bbbc31295a7a8e8", "schema": "reporting", "created_at": 1782422375.7293534, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality": {"model": "ds__admissions", "given": [{"input": "ref('encounters')", "rows": "select 'enc_001' as id, 'pat_001' as patient_id, '2024-01-15 10:00:00'::timestamp as start_datetime, null::timestamp as end_datetime, 'loc_001' as location_id, 'bill_001' as patient_billing_type_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', 'pat_002', '2024-01-16 14:30:00'::timestamp, '2024-01-20 09:00:00'::timestamp, 'loc_002', 'bill_002', 'admission'\nunion all\nselect 'enc_003', 'pat_003', '2024-01-17 08:15:00'::timestamp, null::timestamp, 'loc_001', null, 'outpatient'", "format": "sql", "fixture": null}, {"input": "ref('patients')", "rows": "select 'pat_001' as id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 'male' as sex, 'vil_001' as village_id\nunion all\nselect 'pat_002', 'P002', 'Jane', 'Smith', '1985-08-22'::date, 'female', 'vil_002'\nunion all\nselect 'pat_003', 'P003', 'Bob', 'Johnson', '1975-12-10'::date, 'male', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_history')", "rows": "select 'enc_001' as encounter_id, '2024-01-15 10:00:00'::timestamp as datetime, null::text[] as change_type, 'cli_001' as clinician_id, 'dept_001' as department_id, 'loc_001' as location_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', '2024-01-16 14:30:00'::timestamp, null::text[], 'cli_002', 'dept_002', 'loc_002', 'admission'\nunion all\nselect 'enc_002', '2024-01-18 10:00:00'::timestamp, array['department'], 'cli_002', 'dept_003', 'loc_002', 'admission'", "format": "sql", "fixture": null}, {"input": "ref('users')", "rows": "select 'cli_001' as id, 'Dr. Alice Wilson' as display_name\nunion all\nselect 'cli_002', 'Dr. Bob Martinez'", "format": "sql", "fixture": null}, {"input": "ref('departments')", "rows": "select 'dept_001' as id, 'Emergency' as name\nunion all\nselect 'dept_002', 'Internal Medicine'\nunion all\nselect 'dept_003', 'Surgery'", "format": "sql", "fixture": null}, {"input": "ref('locations')", "rows": "select 'loc_001' as id, 'Room 101' as name, 'fac_001' as facility_id, 'lg_001' as location_group_id\nunion all\nselect 'loc_002', 'Room 201', 'fac_001', 'lg_002'", "format": "sql", "fixture": null}, {"input": "ref('location_groups')", "rows": "select 'lg_001' as id, 'Emergency Ward' as name\nunion all\nselect 'lg_002', 'Medical Ward'", "format": "sql", "fixture": null}, {"input": "ref('facilities')", "rows": "select 'fac_001' as id, 'Central Hospital' as name, false as is_sensitive", "format": "sql", "fixture": null}, {"input": "ref('reference_data')", "rows": "select 'vil_001' as id, 'Village A' as name, null as code\nunion all\nselect 'vil_002', 'Village B', null\nunion all\nselect 'bill_001', 'Insurance', null\nunion all\nselect 'bill_002', 'Private Pay', null\nunion all\nselect 'diag_001', 'Hypertension', 'I10'", "format": "sql", "fixture": null}, {"input": "ref('encounter_diagnoses')", "rows": "select 'enc_001' as encounter_id, 'diag_001' as diagnosis_id, true as is_primary, 'confirmed' as certainty, '2024-01-15 11:00:00'::timestamp as datetime\nunion all\nselect 'enc_002', 'diag_001', false, 'confirmed', '2024-01-16 15:00:00'::timestamp", "format": "sql", "fixture": null}], "expect": {"rows": "select 'pat_001' as patient_id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 33 as age, 'Male' as sex, 'vil_001' as village_id, 'Village A' as village, 'bill_001' as billing_type_id, 'Insurance' as billing_type, 'cli_001' as admitting_clinician_id, 'Dr. Alice Wilson' as admitting_clinician, '2024-01-15 10:00:00'::timestamp as admission_datetime, 'active' as admission_status, null::timestamp as discharge_datetime, 'fac_001' as facility_id, 'Central Hospital' as facility, array['dept_001'] as department_ids, 'Emergency' as departments, '2024-01-15 10:00' as department_datetimes, array['lg_001'] as location_group_ids, 'Emergency Ward' as location_groups, '2024-01-15 10:00' as location_group_datetimes, array['loc_001'] as location_ids, 'Room 101' as locations, '2024-01-15 10:00' as location_datetimes, 'Hypertension (I10)' as primary_diagnoses, null as secondary_diagnoses\nunion all\nselect 'pat_002', 'P002', 'Jane', 'Smith', '1985-08-22'::date, 38, 'Female', 'vil_002', 'Village B', 'bill_002', 'Private Pay', 'cli_002', 'Dr. Bob Martinez', '2024-01-16 14:30:00'::timestamp, 'discharged', '2024-01-20 09:00:00'::timestamp, 'fac_001', 'Central Hospital', array['dept_002', 'dept_003'], 'Internal Medicine, Surgery', '2024-01-16 14:30; 2024-01-18 10:00', array['lg_002'], 'Medical Ward', '2024-01-16 14:30', array['loc_002'], 'Room 201', '2024-01-16 14:30', null, 'Hypertension (I10)'", "format": "sql", "fixture": null}, "name": "test_ds_admissions_basic_functionality", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "unit_tests\\test_ds_admissions_basic_functionality.yml", "original_file_path": "models\\unit_tests\\test_ds_admissions_basic_functionality.yml", "unique_id": "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality", "fqn": ["tamanu_source_dbt", "unit_tests", "ds__admissions", "test_ds_admissions_basic_functionality"], "description": "Test basic functionality of ds__admissions model with sample data", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "2cc99841efad0f3cd001abbaf56ba3f2919ebfe1bd434a406f31548705cbf04a", "schema": "reporting", "created_at": 1782422375.7452774, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only": {"model": "ds__admissions", "given": [{"input": "ref('encounters')", "rows": "select 'enc_001' as id, 'pat_001' as patient_id, '2024-01-15 10:00:00'::timestamp as start_datetime, null::timestamp as end_datetime, 'loc_001' as location_id, 'bill_001' as patient_billing_type_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', 'pat_002', '2024-01-16 14:30:00'::timestamp, null::timestamp, 'loc_002', 'bill_002', 'outpatient'\nunion all\nselect 'enc_003', 'pat_003', '2024-01-17 08:15:00'::timestamp, null::timestamp, 'loc_001', null, 'emergency'", "format": "sql", "fixture": null}, {"input": "ref('patients')", "rows": "select 'pat_001' as id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 'male' as sex, 'vil_001' as village_id\nunion all\nselect 'pat_002', 'P002', 'Jane', 'Smith', '1985-08-22'::date, 'female', 'vil_002'\nunion all\nselect 'pat_003', 'P003', 'Bob', 'Johnson', '1975-12-10'::date, 'male', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_history')", "rows": "select 'enc_001' as encounter_id, '2024-01-15 10:00:00'::timestamp as datetime, null::text[] as change_type, 'cli_001' as clinician_id, 'dept_001' as department_id, 'loc_001' as location_id, 'admission' as encounter_type", "format": "sql", "fixture": null}, {"input": "ref('users')", "rows": "select 'cli_001' as id, 'Dr. Alice Wilson' as display_name", "format": "sql", "fixture": null}, {"input": "ref('departments')", "rows": "select 'dept_001' as id, 'Emergency' as name", "format": "sql", "fixture": null}, {"input": "ref('locations')", "rows": "select 'loc_001' as id, 'Room 101' as name, 'fac_001' as facility_id, 'lg_001' as location_group_id\nunion all\nselect 'loc_002', 'Room 201', 'fac_001', 'lg_002'", "format": "sql", "fixture": null}, {"input": "ref('location_groups')", "rows": "select 'lg_001' as id, 'Emergency Ward' as name\nunion all\nselect 'lg_002', 'Medical Ward'", "format": "sql", "fixture": null}, {"input": "ref('facilities')", "rows": "select 'fac_001' as id, 'Central Hospital' as name, false as is_sensitive", "format": "sql", "fixture": null}, {"input": "ref('reference_data')", "rows": "select 'vil_001' as id, 'Village A' as name, null as code\nunion all\nselect 'vil_002', 'Village B', null\nunion all\nselect 'bill_001', 'Insurance', null\nunion all\nselect 'bill_002', 'Private Pay', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_diagnoses')", "rows": "select null::text as encounter_id, null::text as diagnosis_id, null::boolean as is_primary, null::text as certainty, null::timestamp as datetime\nwhere false", "format": "sql", "fixture": null}], "expect": {"rows": "select 'pat_001' as patient_id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 33 as age, 'Male' as sex, 'vil_001' as village_id, 'Village A' as village, 'bill_001' as billing_type_id, 'Insurance' as billing_type, 'cli_001' as admitting_clinician_id, 'Dr. Alice Wilson' as admitting_clinician, '2024-01-15 10:00:00'::timestamp as admission_datetime, 'active' as admission_status, null::timestamp as discharge_datetime, 'fac_001' as facility_id, 'Central Hospital' as facility, array['dept_001'] as department_ids, 'Emergency' as departments, '2024-01-15 10:00' as department_datetimes, array['lg_001'] as location_group_ids, 'Emergency Ward' as location_groups, '2024-01-15 10:00' as location_group_datetimes, array['loc_001'] as location_ids, 'Room 101' as locations, '2024-01-15 10:00' as location_datetimes, null as primary_diagnoses, null as secondary_diagnoses", "format": "sql", "fixture": null}, "name": "test_ds_admissions_filters_admission_encounters_only", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "unit_tests\\test_ds_admissions_filters_admission_encounters_only.yml", "original_file_path": "models\\unit_tests\\test_ds_admissions_filters_admission_encounters_only.yml", "unique_id": "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only", "fqn": ["tamanu_source_dbt", "unit_tests", "ds__admissions", "test_ds_admissions_filters_admission_encounters_only"], "description": "Test that only admission encounters are included", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "cf117e08238982706acdef751b6071774a0c29b4826413db40ab96f839bf436a", "schema": "reporting", "created_at": 1782422375.7452774, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities": {"model": "ds__admissions", "given": [{"input": "ref('encounters')", "rows": "select 'enc_001' as id, 'pat_001' as patient_id, '2024-05-15 10:00:00'::timestamp as start_datetime, null::timestamp as end_datetime, 'loc_001' as location_id, 'bill_001' as patient_billing_type_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', 'pat_002', '2024-05-16 14:00:00'::timestamp, null::timestamp, 'loc_002', 'bill_002', 'admission'", "format": "sql", "fixture": null}, {"input": "ref('patients')", "rows": "select 'pat_001' as id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 'male' as sex, 'vil_001' as village_id\nunion all\nselect 'pat_002', 'P002', 'Jane', 'Smith', '1985-08-22'::date, 'female', 'vil_002'", "format": "sql", "fixture": null}, {"input": "ref('encounter_history')", "rows": "select 'enc_001' as encounter_id, '2024-05-15 10:00:00'::timestamp as datetime, null::text[] as change_type, 'cli_001' as clinician_id, 'dept_001' as department_id, 'loc_001' as location_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', '2024-05-16 14:00:00'::timestamp, null::text[], 'cli_002', 'dept_002', 'loc_002', 'admission'", "format": "sql", "fixture": null}, {"input": "ref('users')", "rows": "select 'cli_001' as id, 'Dr. Alice Wilson' as display_name\nunion all\nselect 'cli_002', 'Dr. Bob Martinez'", "format": "sql", "fixture": null}, {"input": "ref('departments')", "rows": "select 'dept_001' as id, 'Emergency' as name\nunion all\nselect 'dept_002', 'Psychiatry'", "format": "sql", "fixture": null}, {"input": "ref('locations')", "rows": "select 'loc_001' as id, 'Room 101' as name, 'fac_001' as facility_id, 'lg_001' as location_group_id\nunion all\nselect 'loc_002', 'Room 201', 'fac_002', 'lg_002'", "format": "sql", "fixture": null}, {"input": "ref('location_groups')", "rows": "select 'lg_001' as id, 'Emergency Ward' as name\nunion all\nselect 'lg_002', 'Psychiatric Ward'", "format": "sql", "fixture": null}, {"input": "ref('facilities')", "rows": "select 'fac_001' as id, 'Central Hospital' as name, false as is_sensitive\nunion all\nselect 'fac_002', 'Psychiatric Hospital', true", "format": "sql", "fixture": null}, {"input": "ref('reference_data')", "rows": "select 'vil_001' as id, 'Village A' as name, null as code\nunion all\nselect 'vil_002', 'Village B', null\nunion all\nselect 'bill_001', 'Insurance', null\nunion all\nselect 'bill_002', 'Private Pay', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_diagnoses')", "rows": "select null::text as encounter_id, null::text as diagnosis_id, null::boolean as is_primary, null::text as certainty, null::timestamp as datetime\nwhere false", "format": "sql", "fixture": null}], "expect": {"rows": "select 'pat_001' as patient_id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 34 as age, 'Male' as sex, 'vil_001' as village_id, 'Village A' as village, 'bill_001' as billing_type_id, 'Insurance' as billing_type, 'cli_001' as admitting_clinician_id, 'Dr. Alice Wilson' as admitting_clinician, '2024-05-15 10:00:00'::timestamp as admission_datetime, 'active' as admission_status, null::timestamp as discharge_datetime, 'fac_001' as facility_id, 'Central Hospital' as facility, array['dept_001'] as department_ids, 'Emergency' as departments, '2024-05-15 10:00' as department_datetimes, array['lg_001'] as location_group_ids, 'Emergency Ward' as location_groups, '2024-05-15 10:00' as location_group_datetimes, array['loc_001'] as location_ids, 'Room 101' as locations, '2024-05-15 10:00' as location_datetimes, null as primary_diagnoses, null as secondary_diagnoses", "format": "sql", "fixture": null}, "name": "test_ds_admissions_sensitive_facilities", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "unit_tests\\test_ds_admissions_sensitive_facilities.yml", "original_file_path": "models\\unit_tests\\test_ds_admissions_sensitive_facilities.yml", "unique_id": "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities", "fqn": ["tamanu_source_dbt", "unit_tests", "ds__admissions", "test_ds_admissions_sensitive_facilities"], "description": "Test that admissions at sensitive facilities are excluded", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "b8b410a350cc1031aa301bf92cc85b2815aadfe40f539da8804c4791ce6daffd", "schema": "reporting", "created_at": 1782422375.7452774, "versions": null, "version": null}}, "functions": {}}, catalog: {"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.11.7", "generated_at": "2026-06-25T21:21:26.238685Z", "invocation_id": "ea2aa608-cebc-4ffd-a44c-a0ce4c2579ed", "invocation_started_at": "2026-06-25T21:21:08.231793Z", "env": {}}, "nodes": {"model.tamanu_source_dbt.admissions-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "admissions-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Admitting clinician": {"type": "character varying", "index": 9, "name": "Admitting clinician", "comment": null}, "Admission date and time": {"type": "text", "index": 10, "name": "Admission date and time", "comment": null}, "Admission status": {"type": "text", "index": 11, "name": "Admission status", "comment": null}, "Discharge date and time": {"type": "text", "index": 12, "name": "Discharge date and time", "comment": null}, "Facility": {"type": "character varying(255)", "index": 13, "name": "Facility", "comment": null}, "Department history": {"type": "text", "index": 14, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 15, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 16, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 17, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 18, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 19, "name": "Location history date and times", "comment": null}, "Primary diagnoses": {"type": "text", "index": 20, "name": "Primary diagnoses", "comment": null}, "Secondary diagnoses": {"type": "text", "index": 21, "name": "Secondary diagnoses", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.admissions-line-list"}, "model.tamanu_source_dbt.audit-outpatient-appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "audit-outpatient-appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Change number": {"type": "bigint", "index": 5, "name": "Change number", "comment": null}, "Appointment date and time": {"type": "text", "index": 6, "name": "Appointment date and time", "comment": null}, "Appointment type": {"type": "text", "index": 7, "name": "Appointment type", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 8, "name": "Clinician", "comment": null}, "Area": {"type": "character varying(255)", "index": 9, "name": "Area", "comment": null}, "Priority appointment": {"type": "text", "index": 10, "name": "Priority appointment", "comment": null}, "Repeating appointment": {"type": "text", "index": 11, "name": "Repeating appointment", "comment": null}, "Appointment created by": {"type": "character varying(255)", "index": 12, "name": "Appointment created by", "comment": null}, "Appointment modified by": {"type": "character varying(255)", "index": 13, "name": "Appointment modified by", "comment": null}, "Appointment modified date & time": {"type": "text", "index": 14, "name": "Appointment modified date & time", "comment": null}, "Appointment cancelled": {"type": "text", "index": 15, "name": "Appointment cancelled", "comment": null}, "Previous appointment date & time": {"type": "text", "index": 16, "name": "Previous appointment date & time", "comment": null}, "Previous appointment type": {"type": "text", "index": 17, "name": "Previous appointment type", "comment": null}, "Previous clinician": {"type": "character varying", "index": 18, "name": "Previous clinician", "comment": null}, "Previous area": {"type": "character varying", "index": 19, "name": "Previous area", "comment": null}, "Previous priority appointment": {"type": "text", "index": 20, "name": "Previous priority appointment", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.audit-outpatient-appointments"}, "model.tamanu_source_dbt.audit-patient-details-edit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "audit-patient-details-edit", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "text", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "text", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "text", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Edited by user": {"type": "character varying(255)", "index": 7, "name": "Edited by user", "comment": null}, "User email": {"type": "character varying(255)", "index": 8, "name": "User email", "comment": null}, "User role": {"type": "character varying(255)", "index": 9, "name": "User role", "comment": null}, "Date and time edited": {"type": "text", "index": 10, "name": "Date and time edited", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.audit-patient-details-edit"}, "model.tamanu_source_dbt.audit-patient-views": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "audit-patient-views", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "integer", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Viewed by user": {"type": "character varying(255)", "index": 8, "name": "Viewed by user", "comment": null}, "User email": {"type": "character varying(255)", "index": 9, "name": "User email", "comment": null}, "User role": {"type": "character varying(255)", "index": 10, "name": "User role", "comment": null}, "Viewed at facility": {"type": "character varying(255)", "index": 11, "name": "Viewed at facility", "comment": null}, "Date and time viewed": {"type": "text", "index": 12, "name": "Date and time viewed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.audit-patient-views"}, "model.tamanu_source_dbt.contributing_death_causes": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "contributing_death_causes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "time_after_onset": {"type": "integer", "index": 2, "name": "time_after_onset", "comment": null}, "patient_death_data_id": {"type": "character varying(255)", "index": 3, "name": "patient_death_data_id", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 4, "name": "condition_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.contributing_death_causes"}, "model.tamanu_source_dbt.deceased-patients-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "deceased-patients-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Nationality": {"type": "text", "index": 8, "name": "Nationality", "comment": null}, "Place of death": {"type": "character varying", "index": 9, "name": "Place of death", "comment": null}, "Department": {"type": "character varying(255)", "index": 10, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 11, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 12, "name": "Location", "comment": null}, "Date of death": {"type": "text", "index": 13, "name": "Date of death", "comment": null}, "Attending clinician": {"type": "character varying(255)", "index": 14, "name": "Attending clinician", "comment": null}, "Primary cause of death": {"type": "text", "index": 15, "name": "Primary cause of death", "comment": null}, "Time between onset and death": {"type": "text", "index": 16, "name": "Time between onset and death", "comment": null}, "Antecedent cause 1": {"type": "text", "index": 17, "name": "Antecedent cause 1", "comment": null}, "Antecedent cause 2": {"type": "text", "index": 18, "name": "Antecedent cause 2", "comment": null}, "Other condition 1": {"type": "text", "index": 19, "name": "Other condition 1", "comment": null}, "Other condition 2": {"type": "text", "index": 20, "name": "Other condition 2", "comment": null}, "Other condition 3": {"type": "text", "index": 21, "name": "Other condition 3", "comment": null}, "Other condition 4": {"type": "text", "index": 22, "name": "Other condition 4", "comment": null}, "Had recent surgery": {"type": "text", "index": 23, "name": "Had recent surgery", "comment": null}, "Last surgery date": {"type": "text", "index": 24, "name": "Last surgery date", "comment": null}, "Reason for surgery": {"type": "text", "index": 25, "name": "Reason for surgery", "comment": null}, "Manner of death": {"type": "character varying(255)", "index": 26, "name": "Manner of death", "comment": null}, "External cause date": {"type": "text", "index": 27, "name": "External cause date", "comment": null}, "External cause location": {"type": "character varying(255)", "index": 28, "name": "External cause location", "comment": null}, "Was pregnant": {"type": "text", "index": 29, "name": "Was pregnant", "comment": null}, "Pregnancy contributed": {"type": "character varying(255)", "index": 30, "name": "Pregnancy contributed", "comment": null}, "Was fetal or infant": {"type": "text", "index": 31, "name": "Was fetal or infant", "comment": null}, "Was stillborn": {"type": "text", "index": 32, "name": "Was stillborn", "comment": null}, "Birth weight (kg)": {"type": "integer", "index": 33, "name": "Birth weight (kg)", "comment": null}, "Completed weeks of pregnancy": {"type": "integer", "index": 34, "name": "Completed weeks of pregnancy", "comment": null}, "Age of mother": {"type": "integer", "index": 35, "name": "Age of mother", "comment": null}, "Condition in mother affecting fetus or newborn": {"type": "text", "index": 36, "name": "Condition in mother affecting fetus or newborn", "comment": null}, "Death within day of birth": {"type": "text", "index": 37, "name": "Death within day of birth", "comment": null}, "Hours survived since birth": {"type": "integer", "index": 38, "name": "Hours survived since birth", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.deceased-patients-line-list"}, "model.tamanu_source_dbt.departments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "departments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.departments"}, "model.tamanu_source_dbt.discharges": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "discharges", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "note": {"type": "text", "index": 2, "name": "note", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 3, "name": "encounter_id", "comment": null}, "discharged_by_id": {"type": "character varying(255)", "index": 4, "name": "discharged_by_id", "comment": null}, "disposition_id": {"type": "character varying(255)", "index": 5, "name": "disposition_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.discharges"}, "model.tamanu_source_dbt.document_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "document_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "type": {"type": "text", "index": 3, "name": "type", "comment": null}, "created_datetime": {"type": "timestamp without time zone", "index": 4, "name": "created_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 5, "name": "patient_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.document_metadata"}, "model.tamanu_source_dbt.ds__admissions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__admissions", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 10, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 11, "name": "billing_type", "comment": null}, "admitting_clinician_id": {"type": "character varying", "index": 12, "name": "admitting_clinician_id", "comment": null}, "admitting_clinician": {"type": "character varying", "index": 13, "name": "admitting_clinician", "comment": null}, "admission_datetime": {"type": "timestamp without time zone", "index": 14, "name": "admission_datetime", "comment": null}, "admission_status": {"type": "text", "index": 15, "name": "admission_status", "comment": null}, "discharge_datetime": {"type": "timestamp without time zone", "index": 16, "name": "discharge_datetime", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 17, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 18, "name": "facility", "comment": null}, "department_ids": {"type": "character varying[]", "index": 19, "name": "department_ids", "comment": null}, "departments": {"type": "text", "index": 20, "name": "departments", "comment": null}, "department_datetimes": {"type": "text", "index": 21, "name": "department_datetimes", "comment": null}, "location_group_ids": {"type": "character varying[]", "index": 22, "name": "location_group_ids", "comment": null}, "location_groups": {"type": "text", "index": 23, "name": "location_groups", "comment": null}, "location_group_datetimes": {"type": "text", "index": 24, "name": "location_group_datetimes", "comment": null}, "location_ids": {"type": "character varying[]", "index": 25, "name": "location_ids", "comment": null}, "locations": {"type": "text", "index": 26, "name": "locations", "comment": null}, "location_datetimes": {"type": "text", "index": 27, "name": "location_datetimes", "comment": null}, "primary_diagnoses": {"type": "text", "index": 28, "name": "primary_diagnoses", "comment": null}, "secondary_diagnoses": {"type": "text", "index": 29, "name": "secondary_diagnoses", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__admissions"}, "model.tamanu_source_dbt.ds__births": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__births", "database": "app", "comment": null, "owner": "app"}, "columns": {"registration_date": {"type": "date", "index": 1, "name": "registration_date", "comment": null}, "registered_by": {"type": "character varying", "index": 2, "name": "registered_by", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 4, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 5, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 6, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 7, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 8, "name": "sex", "comment": null}, "ethnicity": {"type": "text", "index": 9, "name": "ethnicity", "comment": null}, "nationality": {"type": "text", "index": 10, "name": "nationality", "comment": null}, "village_id": {"type": "character varying(255)", "index": 11, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 12, "name": "village", "comment": null}, "mother": {"type": "text", "index": 13, "name": "mother", "comment": null}, "father": {"type": "text", "index": 14, "name": "father", "comment": null}, "birth_time": {"type": "time without time zone", "index": 15, "name": "birth_time", "comment": null}, "gestational_age_estimate": {"type": "double precision", "index": 16, "name": "gestational_age_estimate", "comment": null}, "registered_birth_place": {"type": "character varying", "index": 17, "name": "registered_birth_place", "comment": null}, "birth_facility_id": {"type": "character varying(255)", "index": 18, "name": "birth_facility_id", "comment": null}, "birth_facility": {"type": "character varying(255)", "index": 19, "name": "birth_facility", "comment": null}, "attendant_at_birth": {"type": "character varying", "index": 20, "name": "attendant_at_birth", "comment": null}, "name_of_attendant_at_birth": {"type": "character varying(255)", "index": 21, "name": "name_of_attendant_at_birth", "comment": null}, "birth_delivery_type": {"type": "character varying", "index": 22, "name": "birth_delivery_type", "comment": null}, "birth_type": {"type": "text", "index": 23, "name": "birth_type", "comment": null}, "birth_weight": {"type": "numeric", "index": 24, "name": "birth_weight", "comment": null}, "birth_length": {"type": "numeric", "index": 25, "name": "birth_length", "comment": null}, "apgar_score_one_minute": {"type": "integer", "index": 26, "name": "apgar_score_one_minute", "comment": null}, "apgar_score_five_minutes": {"type": "integer", "index": 27, "name": "apgar_score_five_minutes", "comment": null}, "apgar_score_ten_minutes": {"type": "integer", "index": 28, "name": "apgar_score_ten_minutes", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__births"}, "model.tamanu_source_dbt.ds__deaths": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__deaths", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "nationality_id": {"type": "character varying(255)", "index": 10, "name": "nationality_id", "comment": null}, "nationality": {"type": "text", "index": 11, "name": "nationality", "comment": null}, "place_of_death": {"type": "character varying", "index": 12, "name": "place_of_death", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 13, "name": "facility_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 14, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 15, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 20, "name": "date_of_death", "comment": null}, "attending_clinician_id": {"type": "character varying(255)", "index": 21, "name": "attending_clinician_id", "comment": null}, "attending_clinician": {"type": "character varying(255)", "index": 22, "name": "attending_clinician", "comment": null}, "primary_cause_condition_id": {"type": "character varying(255)", "index": 23, "name": "primary_cause_condition_id", "comment": null}, "primary_cause_condition": {"type": "text", "index": 24, "name": "primary_cause_condition", "comment": null}, "time_between_onset_and_death": {"type": "text", "index": 25, "name": "time_between_onset_and_death", "comment": null}, "antecedent_cause_1_id": {"type": "character varying(255)", "index": 26, "name": "antecedent_cause_1_id", "comment": null}, "antecedent_cause_1": {"type": "text", "index": 27, "name": "antecedent_cause_1", "comment": null}, "antecedent_cause_2_id": {"type": "character varying(255)", "index": 28, "name": "antecedent_cause_2_id", "comment": null}, "antecedent_cause_2": {"type": "text", "index": 29, "name": "antecedent_cause_2", "comment": null}, "other_condition_1_id": {"type": "character varying(255)", "index": 30, "name": "other_condition_1_id", "comment": null}, "other_condition_1": {"type": "text", "index": 31, "name": "other_condition_1", "comment": null}, "other_condition_2_id": {"type": "character varying(255)", "index": 32, "name": "other_condition_2_id", "comment": null}, "other_condition_2": {"type": "text", "index": 33, "name": "other_condition_2", "comment": null}, "other_condition_3_id": {"type": "character varying(255)", "index": 34, "name": "other_condition_3_id", "comment": null}, "other_condition_3": {"type": "text", "index": 35, "name": "other_condition_3", "comment": null}, "other_condition_4_id": {"type": "character varying(255)", "index": 36, "name": "other_condition_4_id", "comment": null}, "other_condition_4": {"type": "text", "index": 37, "name": "other_condition_4", "comment": null}, "had_recent_surgery": {"type": "text", "index": 38, "name": "had_recent_surgery", "comment": null}, "last_surgery_date": {"type": "date", "index": 39, "name": "last_surgery_date", "comment": null}, "reason_for_surgery_id": {"type": "character varying(255)", "index": 40, "name": "reason_for_surgery_id", "comment": null}, "reason_for_surgery": {"type": "text", "index": 41, "name": "reason_for_surgery", "comment": null}, "manner_of_death": {"type": "character varying(255)", "index": 42, "name": "manner_of_death", "comment": null}, "external_cause_date": {"type": "date", "index": 43, "name": "external_cause_date", "comment": null}, "external_cause_location": {"type": "character varying(255)", "index": 44, "name": "external_cause_location", "comment": null}, "was_pregnant": {"type": "text", "index": 45, "name": "was_pregnant", "comment": null}, "pregnancy_contributed": {"type": "character varying(255)", "index": 46, "name": "pregnancy_contributed", "comment": null}, "was_fetal_or_infant": {"type": "text", "index": 47, "name": "was_fetal_or_infant", "comment": null}, "was_stillborn": {"type": "text", "index": 48, "name": "was_stillborn", "comment": null}, "birth_weight": {"type": "integer", "index": 49, "name": "birth_weight", "comment": null}, "completed_weeks_of_pregnancy": {"type": "integer", "index": 50, "name": "completed_weeks_of_pregnancy", "comment": null}, "age_of_mother": {"type": "integer", "index": 51, "name": "age_of_mother", "comment": null}, "condition_in_mother_affecting_fetus_or_newborn": {"type": "text", "index": 52, "name": "condition_in_mother_affecting_fetus_or_newborn", "comment": null}, "death_within_day_of_birth": {"type": "text", "index": 53, "name": "death_within_day_of_birth", "comment": null}, "hours_survived_since_birth": {"type": "integer", "index": 54, "name": "hours_survived_since_birth", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__deaths"}, "model.tamanu_source_dbt.ds__diagnoses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__diagnoses", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 3, "name": "diagnosis_id", "comment": null}, "diagnosis": {"type": "text", "index": 4, "name": "diagnosis", "comment": null}, "diagnosis_datetime": {"type": "timestamp without time zone", "index": 5, "name": "diagnosis_datetime", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "display_id": {"type": "character varying(255)", "index": 8, "name": "display_id", "comment": null}, "age": {"type": "double precision", "index": 9, "name": "age", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 11, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 14, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 15, "name": "clinician", "comment": null}, "department_id": {"type": "character varying(255)", "index": 16, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 17, "name": "department", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 20, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 21, "name": "facility", "comment": null}, "certainty": {"type": "text", "index": 22, "name": "certainty", "comment": null}, "is_primary": {"type": "text", "index": 23, "name": "is_primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__diagnoses"}, "model.tamanu_source_dbt.ds__encounter_diets": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__encounter_diets", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 3, "name": "display_id", "comment": null}, "patient_name": {"type": "text", "index": 4, "name": "patient_name", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 5, "name": "start_datetime", "comment": null}, "age": {"type": "text", "index": 6, "name": "age", "comment": null}, "location_id": {"type": "character varying(255)", "index": 7, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 8, "name": "location", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 9, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 10, "name": "location_group", "comment": null}, "diets": {"type": "text", "index": 11, "name": "diets", "comment": null}, "allergies": {"type": "text", "index": 12, "name": "allergies", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__encounter_diets"}, "model.tamanu_source_dbt.ds__encounter_prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__encounter_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 2, "name": "prescription_id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 3, "name": "datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 8, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 9, "name": "age", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 11, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 14, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 15, "name": "facility", "comment": null}, "is_selected_for_discharge": {"type": "boolean", "index": 16, "name": "is_selected_for_discharge", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 17, "name": "medication_id", "comment": null}, "medication_code": {"type": "character varying(255)", "index": 18, "name": "medication_code", "comment": null}, "medication": {"type": "text", "index": 19, "name": "medication", "comment": null}, "route": {"type": "character varying(255)", "index": 20, "name": "route", "comment": null}, "quantity": {"type": "integer", "index": 21, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 22, "name": "repeats", "comment": null}, "is_ongoing": {"type": "boolean", "index": 23, "name": "is_ongoing", "comment": null}, "is_prn": {"type": "boolean", "index": 24, "name": "is_prn", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 25, "name": "is_variable_dose", "comment": null}, "dose_amount": {"type": "numeric", "index": 26, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 27, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 28, "name": "frequency", "comment": null}, "is_discontinued": {"type": "boolean", "index": 29, "name": "is_discontinued", "comment": null}, "discontinued_by_id": {"type": "character varying(255)", "index": 30, "name": "discontinued_by_id", "comment": null}, "discontinuing_reason": {"type": "character varying(255)", "index": 31, "name": "discontinuing_reason", "comment": null}, "discontinued_datetime": {"type": "timestamp without time zone", "index": 32, "name": "discontinued_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__encounter_prescriptions"}, "model.tamanu_source_dbt.ds__encounters_emergency": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__encounters_emergency", "database": "app", "comment": null, "owner": "app"}, "columns": {"triage_id": {"type": "character varying(255)", "index": 1, "name": "triage_id", "comment": null}, "arrival_datetime": {"type": "timestamp without time zone", "index": 2, "name": "arrival_datetime", "comment": null}, "triage_datetime": {"type": "timestamp without time zone", "index": 3, "name": "triage_datetime", "comment": null}, "closed_datetime": {"type": "timestamp without time zone", "index": 4, "name": "closed_datetime", "comment": null}, "score": {"type": "text", "index": 5, "name": "score", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 7, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 8, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 9, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 10, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 11, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 14, "name": "encounter_id", "comment": null}, "encounter_type": {"type": "character varying(31)", "index": 15, "name": "encounter_type", "comment": null}, "arrival_mode": {"type": "text", "index": 16, "name": "arrival_mode", "comment": null}, "chief_complaint": {"type": "text", "index": 17, "name": "chief_complaint", "comment": null}, "secondary_complaint": {"type": "text", "index": 18, "name": "secondary_complaint", "comment": null}, "clinician": {"type": "character varying(255)", "index": 19, "name": "clinician", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 20, "name": "clinician_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 21, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 22, "name": "facility", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__encounters_emergency"}, "model.tamanu_source_dbt.ds__imaging_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__imaging_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "request_id": {"type": "character varying(255)", "index": 16, "name": "request_id", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 17, "name": "requested_datetime", "comment": null}, "supervising_clinician_id": {"type": "character varying(255)", "index": 18, "name": "supervising_clinician_id", "comment": null}, "supervising_clinician": {"type": "character varying(255)", "index": 19, "name": "supervising_clinician", "comment": null}, "requesting_clinician_id": {"type": "character varying(255)", "index": 20, "name": "requesting_clinician_id", "comment": null}, "requesting_clinician": {"type": "character varying(255)", "index": 21, "name": "requesting_clinician", "comment": null}, "priority": {"type": "character varying", "index": 22, "name": "priority", "comment": null}, "imaging_type": {"type": "character varying(31)", "index": 23, "name": "imaging_type", "comment": null}, "imaging_area": {"type": "text", "index": 24, "name": "imaging_area", "comment": null}, "status_id": {"type": "character varying(255)", "index": 25, "name": "status_id", "comment": null}, "status": {"type": "text", "index": 26, "name": "status", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 27, "name": "completed_datetime", "comment": null}, "reason_for_cancellation": {"type": "text", "index": 28, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__imaging_requests"}, "model.tamanu_source_dbt.ds__invoice_products": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__invoice_products", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "insurable": {"type": "boolean", "index": 3, "name": "insurable", "comment": null}, "category": {"type": "character varying(255)", "index": 4, "name": "category", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 5, "name": "source_record_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 6, "name": "visibility_status", "comment": null}, "external_code": {"type": "text", "index": 7, "name": "external_code", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__invoice_products"}, "model.tamanu_source_dbt.ds__lab_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__lab_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department": {"type": "character varying(255)", "index": 12, "name": "department", "comment": null}, "department_id": {"type": "character varying(255)", "index": 13, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 15, "name": "location", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "laboratory_id": {"type": "character varying(255)", "index": 18, "name": "laboratory_id", "comment": null}, "laboratory": {"type": "text", "index": 19, "name": "laboratory", "comment": null}, "request_id": {"type": "character varying(255)", "index": 20, "name": "request_id", "comment": null}, "status": {"type": "character varying", "index": 21, "name": "status", "comment": null}, "status_id": {"type": "character varying(255)", "index": 22, "name": "status_id", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 23, "name": "requested_datetime", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 24, "name": "requested_by_id", "comment": null}, "requested_by": {"type": "character varying(255)", "index": 25, "name": "requested_by", "comment": null}, "requesting_department_id": {"type": "character varying(255)", "index": 26, "name": "requesting_department_id", "comment": null}, "requesting_department": {"type": "character varying(255)", "index": 27, "name": "requesting_department", "comment": null}, "priority_id": {"type": "character varying(255)", "index": 28, "name": "priority_id", "comment": null}, "priority": {"type": "text", "index": 29, "name": "priority", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 30, "name": "lab_test_category_id", "comment": null}, "lab_test_category": {"type": "text", "index": 31, "name": "lab_test_category", "comment": null}, "lab_test_panel": {"type": "character varying(255)", "index": 32, "name": "lab_test_panel", "comment": null}, "tests": {"type": "text", "index": 33, "name": "tests", "comment": null}, "collected_datetime": {"type": "timestamp without time zone", "index": 34, "name": "collected_datetime", "comment": null}, "collected_by_id": {"type": "character varying(255)", "index": 35, "name": "collected_by_id", "comment": null}, "collected_by": {"type": "character varying(255)", "index": 36, "name": "collected_by", "comment": null}, "specimen_type_id": {"type": "character varying(255)", "index": 37, "name": "specimen_type_id", "comment": null}, "specimen_type": {"type": "text", "index": 38, "name": "specimen_type", "comment": null}, "site": {"type": "text", "index": 39, "name": "site", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 40, "name": "completed_datetime", "comment": null}, "reason_for_cancellation": {"type": "character varying", "index": 41, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__lab_requests"}, "model.tamanu_source_dbt.ds__lab_tests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__lab_tests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "requesting_department_id": {"type": "character varying(255)", "index": 14, "name": "requesting_department_id", "comment": null}, "requesting_department": {"type": "character varying(255)", "index": 15, "name": "requesting_department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 20, "name": "lab_request_id", "comment": null}, "status_id": {"type": "character varying(255)", "index": 21, "name": "status_id", "comment": null}, "status": {"type": "character varying", "index": 22, "name": "status", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 23, "name": "lab_test_panel_id", "comment": null}, "lab_test_panel": {"type": "character varying(255)", "index": 24, "name": "lab_test_panel", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 25, "name": "lab_test_category_id", "comment": null}, "lab_test_category": {"type": "text", "index": 26, "name": "lab_test_category", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 27, "name": "requested_datetime", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 28, "name": "requested_by_id", "comment": null}, "requested_by": {"type": "character varying(255)", "index": 29, "name": "requested_by", "comment": null}, "lab_request_published_datetime": {"type": "timestamp without time zone", "index": 30, "name": "lab_request_published_datetime", "comment": null}, "lab_test_date": {"type": "date", "index": 31, "name": "lab_test_date", "comment": null}, "result": {"type": "text", "index": 32, "name": "result", "comment": null}, "verification": {"type": "character varying(255)", "index": 33, "name": "verification", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 34, "name": "lab_test_type_id", "comment": null}, "lab_test_type": {"type": "character varying(255)", "index": 35, "name": "lab_test_type", "comment": null}, "lab_test_completed_datetime": {"type": "timestamp without time zone", "index": 36, "name": "lab_test_completed_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__lab_tests"}, "model.tamanu_source_dbt.ds__location_bookings": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__location_bookings", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 10, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 11, "name": "billing_type", "comment": null}, "booking_start_datetime": {"type": "timestamp without time zone", "index": 12, "name": "booking_start_datetime", "comment": null}, "booking_end_datetime": {"type": "timestamp without time zone", "index": 13, "name": "booking_end_datetime", "comment": null}, "booking_status": {"type": "character varying(255)", "index": 14, "name": "booking_status", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 15, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 16, "name": "clinician", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 17, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 18, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 19, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 20, "name": "location", "comment": null}, "booking_type_id": {"type": "character varying(255)", "index": 21, "name": "booking_type_id", "comment": null}, "booking_type": {"type": "text", "index": 22, "name": "booking_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__location_bookings"}, "model.tamanu_source_dbt.ds__medication_dispenses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__medication_dispenses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "quantity": {"type": "integer", "index": 2, "name": "quantity", "comment": null}, "dispensed_at": {"type": "timestamp without time zone", "index": 3, "name": "dispensed_at", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 5, "name": "facility", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 6, "name": "medication_id", "comment": null}, "medication_code": {"type": "character varying(255)", "index": 7, "name": "medication_code", "comment": null}, "medication": {"type": "text", "index": 8, "name": "medication", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__medication_dispenses"}, "model.tamanu_source_dbt.ds__ongoing_conditions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__ongoing_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village": {"type": "text", "index": 8, "name": "village", "comment": null}, "village_id": {"type": "character varying(255)", "index": 9, "name": "village_id", "comment": null}, "condition": {"type": "text", "index": 10, "name": "condition", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 11, "name": "condition_id", "comment": null}, "recorded_datetime": {"type": "timestamp without time zone", "index": 12, "name": "recorded_datetime", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 13, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 14, "name": "clinician", "comment": null}, "date_resolved": {"type": "timestamp without time zone", "index": 15, "name": "date_resolved", "comment": null}, "clinician_resolving": {"type": "character varying", "index": 16, "name": "clinician_resolving", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__ongoing_conditions"}, "model.tamanu_source_dbt.ds__outpatient_appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__outpatient_appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 8, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 9, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 10, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 11, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 12, "name": "billing_type", "comment": null}, "appointment_start_datetime": {"type": "timestamp without time zone", "index": 13, "name": "appointment_start_datetime", "comment": null}, "appointment_end_datetime": {"type": "timestamp without time zone", "index": 14, "name": "appointment_end_datetime", "comment": null}, "appointment_type_id": {"type": "character varying(255)", "index": 15, "name": "appointment_type_id", "comment": null}, "appointment_type": {"type": "text", "index": 16, "name": "appointment_type", "comment": null}, "appointment_status": {"type": "character varying(255)", "index": 17, "name": "appointment_status", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 18, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 19, "name": "clinician", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 20, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 21, "name": "location_group", "comment": null}, "priority": {"type": "text", "index": 22, "name": "priority", "comment": null}, "schedule_id": {"type": "uuid", "index": 23, "name": "schedule_id", "comment": null}, "until_date": {"type": "date", "index": 24, "name": "until_date", "comment": null}, "interval": {"type": "integer", "index": 25, "name": "interval", "comment": null}, "days_of_week": {"type": "character varying(255)[]", "index": 26, "name": "days_of_week", "comment": null}, "frequency": {"type": "character varying(255)", "index": 27, "name": "frequency", "comment": null}, "nth_weekday": {"type": "integer", "index": 28, "name": "nth_weekday", "comment": null}, "created_by_user_id": {"type": "text", "index": 29, "name": "created_by_user_id", "comment": null}, "created_by": {"type": "character varying(255)", "index": 30, "name": "created_by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__outpatient_appointments"}, "model.tamanu_source_dbt.ds__outpatient_appointments_audit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__outpatient_appointments_audit", "database": "app", "comment": null, "owner": "app"}, "columns": {"change_id": {"type": "uuid", "index": 1, "name": "change_id", "comment": null}, "appointment_id": {"type": "text", "index": 2, "name": "appointment_id", "comment": null}, "change_number": {"type": "bigint", "index": 3, "name": "change_number", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 8, "name": "date_of_birth", "comment": null}, "appointment_start_datetime": {"type": "timestamp without time zone", "index": 9, "name": "appointment_start_datetime", "comment": null}, "appointment_end_datetime": {"type": "timestamp without time zone", "index": 10, "name": "appointment_end_datetime", "comment": null}, "appointment_type": {"type": "text", "index": 11, "name": "appointment_type", "comment": null}, "appointment_type_id": {"type": "text", "index": 12, "name": "appointment_type_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 13, "name": "clinician", "comment": null}, "clinician_id": {"type": "text", "index": 14, "name": "clinician_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "location_group_id": {"type": "text", "index": 16, "name": "location_group_id", "comment": null}, "priority": {"type": "text", "index": 17, "name": "priority", "comment": null}, "schedule_id": {"type": "uuid", "index": 18, "name": "schedule_id", "comment": null}, "is_repeating": {"type": "text", "index": 19, "name": "is_repeating", "comment": null}, "created_by": {"type": "character varying(255)", "index": 20, "name": "created_by", "comment": null}, "created_by_user_id": {"type": "text", "index": 21, "name": "created_by_user_id", "comment": null}, "modified_by": {"type": "character varying(255)", "index": 22, "name": "modified_by", "comment": null}, "modified_by_user_id": {"type": "text", "index": 23, "name": "modified_by_user_id", "comment": null}, "modified_datetime": {"type": "timestamp with time zone", "index": 24, "name": "modified_datetime", "comment": null}, "is_cancelled": {"type": "text", "index": 25, "name": "is_cancelled", "comment": null}, "prev_start_datetime": {"type": "timestamp without time zone", "index": 26, "name": "prev_start_datetime", "comment": null}, "prev_end_datetime": {"type": "timestamp without time zone", "index": 27, "name": "prev_end_datetime", "comment": null}, "prev_appointment_type": {"type": "text", "index": 28, "name": "prev_appointment_type", "comment": null}, "prev_appointment_type_id": {"type": "text", "index": 29, "name": "prev_appointment_type_id", "comment": null}, "prev_clinician": {"type": "character varying", "index": 30, "name": "prev_clinician", "comment": null}, "prev_clinician_id": {"type": "text", "index": 31, "name": "prev_clinician_id", "comment": null}, "prev_location_group": {"type": "character varying", "index": 32, "name": "prev_location_group", "comment": null}, "prev_location_group_id": {"type": "text", "index": 33, "name": "prev_location_group_id", "comment": null}, "prev_priority": {"type": "text", "index": 34, "name": "prev_priority", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 35, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 36, "name": "facility", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__outpatient_appointments_audit"}, "model.tamanu_source_dbt.ds__patient_program_registrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patient_program_registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_program_registration_id": {"type": "text", "index": 1, "name": "patient_program_registration_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 3, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 4, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 5, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 6, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "registering_facility_id": {"type": "character varying(255)", "index": 10, "name": "registering_facility_id", "comment": null}, "registering_facility": {"type": "character varying(255)", "index": 11, "name": "registering_facility", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 12, "name": "registered_by_id", "comment": null}, "registered_by": {"type": "character varying(255)", "index": 13, "name": "registered_by", "comment": null}, "currently_at": {"type": "character varying", "index": 14, "name": "currently_at", "comment": null}, "currently_at_type": {"type": "text", "index": 15, "name": "currently_at_type", "comment": null}, "related_condition_ids": {"type": "character varying[]", "index": 16, "name": "related_condition_ids", "comment": null}, "related_conditions": {"type": "text", "index": 17, "name": "related_conditions", "comment": null}, "related_condition_category_ids": {"type": "text[]", "index": 18, "name": "related_condition_category_ids", "comment": null}, "related_condition_categories": {"type": "text", "index": 19, "name": "related_condition_categories", "comment": null}, "clinical_status_id": {"type": "character varying(255)", "index": 20, "name": "clinical_status_id", "comment": null}, "clinical_status": {"type": "text", "index": 21, "name": "clinical_status", "comment": null}, "registration_status": {"type": "text", "index": 22, "name": "registration_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 23, "name": "program_registry_id", "comment": null}, "subdivision_id": {"type": "character varying(255)", "index": 24, "name": "subdivision_id", "comment": null}, "subdivision": {"type": "text", "index": 25, "name": "subdivision", "comment": null}, "division_id": {"type": "character varying(255)", "index": 26, "name": "division_id", "comment": null}, "division": {"type": "text", "index": 27, "name": "division", "comment": null}, "registration_datetime": {"type": "timestamp without time zone", "index": 28, "name": "registration_datetime", "comment": null}, "deactivated_by_id": {"type": "character varying(255)", "index": 29, "name": "deactivated_by_id", "comment": null}, "deactivated_by": {"type": "character varying(255)", "index": 30, "name": "deactivated_by", "comment": null}, "deactivated_datetime": {"type": "timestamp without time zone", "index": 31, "name": "deactivated_datetime", "comment": null}, "primary_contact_number": {"type": "character varying(255)", "index": 32, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "character varying(255)", "index": 33, "name": "secondary_contact_number", "comment": null}, "emergency_contact_name": {"type": "character varying(255)", "index": 34, "name": "emergency_contact_name", "comment": null}, "emergency_contact_number": {"type": "character varying(255)", "index": 35, "name": "emergency_contact_number", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patient_program_registrations"}, "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patient_vaccinations_upcoming", "database": "app", "comment": null, "owner": "app"}, "columns": {"display_id": {"type": "character varying(255)", "index": 1, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 3, "name": "last_name", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "due_date": {"type": "date", "index": 10, "name": "due_date", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 11, "name": "vaccine_category", "comment": null}, "vaccine_schedules_id": {"type": "character varying(255)", "index": 12, "name": "vaccine_schedules_id", "comment": null}, "vaccine_name": {"type": "character varying(255)", "index": 13, "name": "vaccine_name", "comment": null}, "vaccine_schedule": {"type": "character varying(255)", "index": 14, "name": "vaccine_schedule", "comment": null}, "vaccine_status": {"type": "text", "index": 15, "name": "vaccine_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming"}, "model.tamanu_source_dbt.ds__patients": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patients", "database": "app", "comment": null, "owner": "app"}, "columns": {"registration_date": {"type": "timestamp with time zone", "index": 1, "name": "registration_date", "comment": null}, "registered_by": {"type": "character varying(255)", "index": 2, "name": "registered_by", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 4, "name": "first_name", "comment": null}, "middle_name": {"type": "character varying(255)", "index": 5, "name": "middle_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 6, "name": "last_name", "comment": null}, "cultural_name": {"type": "character varying(255)", "index": 7, "name": "cultural_name", "comment": null}, "display_id": {"type": "character varying(255)", "index": 8, "name": "display_id", "comment": null}, "sex": {"type": "text", "index": 9, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 10, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 11, "name": "village", "comment": null}, "date_of_birth": {"type": "date", "index": 12, "name": "date_of_birth", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 13, "name": "date_of_death", "comment": null}, "birth_certificate": {"type": "character varying(255)", "index": 14, "name": "birth_certificate", "comment": null}, "driving_license": {"type": "character varying(255)", "index": 15, "name": "driving_license", "comment": null}, "passport": {"type": "character varying(255)", "index": 16, "name": "passport", "comment": null}, "blood_type": {"type": "character varying(255)", "index": 17, "name": "blood_type", "comment": null}, "title": {"type": "character varying(255)", "index": 18, "name": "title", "comment": null}, "marital_status": {"type": "character varying(255)", "index": 19, "name": "marital_status", "comment": null}, "primary_contact_number": {"type": "character varying(255)", "index": 20, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "character varying(255)", "index": 21, "name": "secondary_contact_number", "comment": null}, "country_of_birth": {"type": "text", "index": 22, "name": "country_of_birth", "comment": null}, "nationality": {"type": "text", "index": 23, "name": "nationality", "comment": null}, "ethnicity": {"type": "text", "index": 24, "name": "ethnicity", "comment": null}, "occupation": {"type": "text", "index": 25, "name": "occupation", "comment": null}, "religion": {"type": "text", "index": 26, "name": "religion", "comment": null}, "patient_billing_type": {"type": "text", "index": 27, "name": "patient_billing_type", "comment": null}, "mother_id": {"type": "character varying(255)", "index": 28, "name": "mother_id", "comment": null}, "father_id": {"type": "character varying(255)", "index": 29, "name": "father_id", "comment": null}, "street_village": {"type": "character varying(255)", "index": 30, "name": "street_village", "comment": null}, "registration_type": {"type": "text", "index": 31, "name": "registration_type", "comment": null}, "age": {"type": "double precision", "index": 32, "name": "age", "comment": null}, "status": {"type": "text", "index": 33, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patients"}, "model.tamanu_source_dbt.ds__patients_access_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patients_access_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "text", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 6, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 7, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 8, "name": "village", "comment": null}, "viewed_by_user_id": {"type": "text", "index": 9, "name": "viewed_by_user_id", "comment": null}, "viewed_by_user": {"type": "character varying(255)", "index": 10, "name": "viewed_by_user", "comment": null}, "user_email": {"type": "character varying(255)", "index": 11, "name": "user_email", "comment": null}, "user_role": {"type": "character varying(255)", "index": 12, "name": "user_role", "comment": null}, "viewed_at_facility": {"type": "character varying(255)", "index": 13, "name": "viewed_at_facility", "comment": null}, "date_time_viewed": {"type": "timestamp without time zone", "index": 14, "name": "date_time_viewed", "comment": null}, "facility_id": {"type": "text", "index": 15, "name": "facility_id", "comment": null}, "is_mobile": {"type": "boolean", "index": 16, "name": "is_mobile", "comment": null}, "session_id": {"type": "text", "index": 17, "name": "session_id", "comment": null}, "device_id": {"type": "text", "index": 18, "name": "device_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patients_access_logs"}, "model.tamanu_source_dbt.ds__patients_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patients_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "text", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "text", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "text", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "text", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 6, "name": "sex", "comment": null}, "village_id": {"type": "text", "index": 7, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 8, "name": "village", "comment": null}, "edited_by_user_id": {"type": "text", "index": 9, "name": "edited_by_user_id", "comment": null}, "edited_by_user": {"type": "character varying(255)", "index": 10, "name": "edited_by_user", "comment": null}, "user_email": {"type": "character varying(255)", "index": 11, "name": "user_email", "comment": null}, "user_role": {"type": "character varying(255)", "index": 12, "name": "user_role", "comment": null}, "edited_datetime": {"type": "timestamp without time zone", "index": 13, "name": "edited_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patients_change_logs"}, "model.tamanu_source_dbt.ds__procedures": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__procedures", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "nationality": {"type": "text", "index": 8, "name": "nationality", "comment": null}, "encounter_facility_id": {"type": "character varying(255)", "index": 9, "name": "encounter_facility_id", "comment": null}, "encounter_facility": {"type": "character varying(255)", "index": 10, "name": "encounter_facility", "comment": null}, "encounter_department_id": {"type": "character varying(255)", "index": 11, "name": "encounter_department_id", "comment": null}, "encounter_department": {"type": "character varying(255)", "index": 12, "name": "encounter_department", "comment": null}, "encounter_type": {"type": "text", "index": 13, "name": "encounter_type", "comment": null}, "encounter_start_datetime": {"type": "timestamp without time zone", "index": 14, "name": "encounter_start_datetime", "comment": null}, "encounter_end_datetime": {"type": "timestamp without time zone", "index": 15, "name": "encounter_end_datetime", "comment": null}, "procedure_facility_id": {"type": "character varying(255)", "index": 16, "name": "procedure_facility_id", "comment": null}, "procedure_facility": {"type": "character varying(255)", "index": 17, "name": "procedure_facility", "comment": null}, "procedure_area_id": {"type": "character varying(255)", "index": 18, "name": "procedure_area_id", "comment": null}, "procedure_area": {"type": "character varying(255)", "index": 19, "name": "procedure_area", "comment": null}, "procedure_location_id": {"type": "character varying(255)", "index": 20, "name": "procedure_location_id", "comment": null}, "procedure_location": {"type": "character varying(255)", "index": 21, "name": "procedure_location", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 22, "name": "procedure_type_id", "comment": null}, "procedure_type": {"type": "text", "index": 23, "name": "procedure_type", "comment": null}, "procedure_date": {"type": "date", "index": 24, "name": "procedure_date", "comment": null}, "procedure_start_time": {"type": "time without time zone", "index": 25, "name": "procedure_start_time", "comment": null}, "procedure_end_time": {"type": "time without time zone", "index": 26, "name": "procedure_end_time", "comment": null}, "procedure_duration": {"type": "text", "index": 27, "name": "procedure_duration", "comment": null}, "procedure_clinician_id": {"type": "character varying(255)", "index": 28, "name": "procedure_clinician_id", "comment": null}, "procedure_clinician": {"type": "character varying(255)", "index": 29, "name": "procedure_clinician", "comment": null}, "procedure_anaesthetist_id": {"type": "character varying(255)", "index": 30, "name": "procedure_anaesthetist_id", "comment": null}, "procedure_anaesthetist": {"type": "character varying(255)", "index": 31, "name": "procedure_anaesthetist", "comment": null}, "procedure_assistant_anaesthetist_id": {"type": "character varying(255)", "index": 32, "name": "procedure_assistant_anaesthetist_id", "comment": null}, "procedure_assistant_anaesthetist": {"type": "character varying(255)", "index": 33, "name": "procedure_assistant_anaesthetist", "comment": null}, "is_completed": {"type": "text", "index": 34, "name": "is_completed", "comment": null}, "time_in": {"type": "time without time zone", "index": 35, "name": "time_in", "comment": null}, "time_out": {"type": "time without time zone", "index": 36, "name": "time_out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__procedures"}, "model.tamanu_source_dbt.ds__referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "village_id": {"type": "character varying(255)", "index": 5, "name": "village_id", "comment": null}, "diagnoses": {"type": "text", "index": 6, "name": "diagnoses", "comment": null}, "referral_type": {"type": "character varying(255)", "index": 7, "name": "referral_type", "comment": null}, "referring_doctor_id": {"type": "character varying(255)", "index": 8, "name": "referring_doctor_id", "comment": null}, "referring_doctor_name": {"type": "character varying(255)", "index": 9, "name": "referring_doctor_name", "comment": null}, "referral_datetime": {"type": "timestamp without time zone", "index": 10, "name": "referral_datetime", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "department": {"type": "character varying(255)", "index": 12, "name": "department", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__referrals"}, "model.tamanu_source_dbt.ds__sensitive_admissions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_admissions", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 10, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 11, "name": "billing_type", "comment": null}, "admitting_clinician_id": {"type": "character varying", "index": 12, "name": "admitting_clinician_id", "comment": null}, "admitting_clinician": {"type": "character varying", "index": 13, "name": "admitting_clinician", "comment": null}, "admission_datetime": {"type": "timestamp without time zone", "index": 14, "name": "admission_datetime", "comment": null}, "admission_status": {"type": "text", "index": 15, "name": "admission_status", "comment": null}, "discharge_datetime": {"type": "timestamp without time zone", "index": 16, "name": "discharge_datetime", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 17, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 18, "name": "facility", "comment": null}, "department_ids": {"type": "character varying[]", "index": 19, "name": "department_ids", "comment": null}, "departments": {"type": "text", "index": 20, "name": "departments", "comment": null}, "department_datetimes": {"type": "text", "index": 21, "name": "department_datetimes", "comment": null}, "location_group_ids": {"type": "character varying[]", "index": 22, "name": "location_group_ids", "comment": null}, "location_groups": {"type": "text", "index": 23, "name": "location_groups", "comment": null}, "location_group_datetimes": {"type": "text", "index": 24, "name": "location_group_datetimes", "comment": null}, "location_ids": {"type": "character varying[]", "index": 25, "name": "location_ids", "comment": null}, "locations": {"type": "text", "index": 26, "name": "locations", "comment": null}, "location_datetimes": {"type": "text", "index": 27, "name": "location_datetimes", "comment": null}, "primary_diagnoses": {"type": "text", "index": 28, "name": "primary_diagnoses", "comment": null}, "secondary_diagnoses": {"type": "text", "index": 29, "name": "secondary_diagnoses", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_admissions"}, "model.tamanu_source_dbt.ds__sensitive_diagnoses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_diagnoses", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 3, "name": "diagnosis_id", "comment": null}, "diagnosis": {"type": "text", "index": 4, "name": "diagnosis", "comment": null}, "diagnosis_datetime": {"type": "timestamp without time zone", "index": 5, "name": "diagnosis_datetime", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "display_id": {"type": "character varying(255)", "index": 8, "name": "display_id", "comment": null}, "age": {"type": "double precision", "index": 9, "name": "age", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 11, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 14, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 15, "name": "clinician", "comment": null}, "department_id": {"type": "character varying(255)", "index": 16, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 17, "name": "department", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 20, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 21, "name": "facility", "comment": null}, "certainty": {"type": "text", "index": 22, "name": "certainty", "comment": null}, "is_primary": {"type": "text", "index": 23, "name": "is_primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_diagnoses"}, "model.tamanu_source_dbt.ds__sensitive_encounter_diets": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_encounter_diets", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 3, "name": "display_id", "comment": null}, "patient_name": {"type": "text", "index": 4, "name": "patient_name", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 5, "name": "start_datetime", "comment": null}, "age": {"type": "text", "index": 6, "name": "age", "comment": null}, "location_id": {"type": "character varying(255)", "index": 7, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 8, "name": "location", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 9, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 10, "name": "location_group", "comment": null}, "diets": {"type": "text", "index": 11, "name": "diets", "comment": null}, "allergies": {"type": "text", "index": 12, "name": "allergies", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounter_diets"}, "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_encounter_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 2, "name": "prescription_id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 3, "name": "datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 8, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 9, "name": "age", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 11, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 14, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 15, "name": "facility", "comment": null}, "is_selected_for_discharge": {"type": "boolean", "index": 16, "name": "is_selected_for_discharge", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 17, "name": "medication_id", "comment": null}, "medication_code": {"type": "character varying(255)", "index": 18, "name": "medication_code", "comment": null}, "medication": {"type": "text", "index": 19, "name": "medication", "comment": null}, "route": {"type": "character varying(255)", "index": 20, "name": "route", "comment": null}, "quantity": {"type": "integer", "index": 21, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 22, "name": "repeats", "comment": null}, "is_ongoing": {"type": "boolean", "index": 23, "name": "is_ongoing", "comment": null}, "is_prn": {"type": "boolean", "index": 24, "name": "is_prn", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 25, "name": "is_variable_dose", "comment": null}, "dose_amount": {"type": "numeric", "index": 26, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 27, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 28, "name": "frequency", "comment": null}, "is_discontinued": {"type": "boolean", "index": 29, "name": "is_discontinued", "comment": null}, "discontinued_by_id": {"type": "character varying(255)", "index": 30, "name": "discontinued_by_id", "comment": null}, "discontinuing_reason": {"type": "character varying(255)", "index": 31, "name": "discontinuing_reason", "comment": null}, "discontinued_datetime": {"type": "timestamp without time zone", "index": 32, "name": "discontinued_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions"}, "model.tamanu_source_dbt.ds__sensitive_encounters_emergency": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_encounters_emergency", "database": "app", "comment": null, "owner": "app"}, "columns": {"triage_id": {"type": "character varying(255)", "index": 1, "name": "triage_id", "comment": null}, "arrival_datetime": {"type": "timestamp without time zone", "index": 2, "name": "arrival_datetime", "comment": null}, "triage_datetime": {"type": "timestamp without time zone", "index": 3, "name": "triage_datetime", "comment": null}, "closed_datetime": {"type": "timestamp without time zone", "index": 4, "name": "closed_datetime", "comment": null}, "score": {"type": "text", "index": 5, "name": "score", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 7, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 8, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 9, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 10, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 11, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 14, "name": "encounter_id", "comment": null}, "encounter_type": {"type": "character varying(31)", "index": 15, "name": "encounter_type", "comment": null}, "arrival_mode": {"type": "text", "index": 16, "name": "arrival_mode", "comment": null}, "chief_complaint": {"type": "text", "index": 17, "name": "chief_complaint", "comment": null}, "secondary_complaint": {"type": "text", "index": 18, "name": "secondary_complaint", "comment": null}, "clinician": {"type": "character varying(255)", "index": 19, "name": "clinician", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 20, "name": "clinician_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 21, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 22, "name": "facility", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounters_emergency"}, "model.tamanu_source_dbt.ds__sensitive_imaging_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_imaging_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "request_id": {"type": "character varying(255)", "index": 16, "name": "request_id", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 17, "name": "requested_datetime", "comment": null}, "supervising_clinician_id": {"type": "character varying(255)", "index": 18, "name": "supervising_clinician_id", "comment": null}, "supervising_clinician": {"type": "character varying(255)", "index": 19, "name": "supervising_clinician", "comment": null}, "requesting_clinician_id": {"type": "character varying(255)", "index": 20, "name": "requesting_clinician_id", "comment": null}, "requesting_clinician": {"type": "character varying(255)", "index": 21, "name": "requesting_clinician", "comment": null}, "priority": {"type": "character varying", "index": 22, "name": "priority", "comment": null}, "imaging_type": {"type": "character varying(31)", "index": 23, "name": "imaging_type", "comment": null}, "imaging_area": {"type": "text", "index": 24, "name": "imaging_area", "comment": null}, "status_id": {"type": "character varying(255)", "index": 25, "name": "status_id", "comment": null}, "status": {"type": "text", "index": 26, "name": "status", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 27, "name": "completed_datetime", "comment": null}, "reason_for_cancellation": {"type": "text", "index": 28, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_imaging_requests"}, "model.tamanu_source_dbt.ds__sensitive_lab_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_lab_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department": {"type": "character varying(255)", "index": 12, "name": "department", "comment": null}, "department_id": {"type": "character varying(255)", "index": 13, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 15, "name": "location", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "laboratory_id": {"type": "character varying(255)", "index": 18, "name": "laboratory_id", "comment": null}, "laboratory": {"type": "text", "index": 19, "name": "laboratory", "comment": null}, "request_id": {"type": "character varying(255)", "index": 20, "name": "request_id", "comment": null}, "status": {"type": "character varying", "index": 21, "name": "status", "comment": null}, "status_id": {"type": "character varying(255)", "index": 22, "name": "status_id", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 23, "name": "requested_datetime", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 24, "name": "requested_by_id", "comment": null}, "requested_by": {"type": "character varying(255)", "index": 25, "name": "requested_by", "comment": null}, "requesting_department_id": {"type": "character varying(255)", "index": 26, "name": "requesting_department_id", "comment": null}, "requesting_department": {"type": "character varying(255)", "index": 27, "name": "requesting_department", "comment": null}, "priority_id": {"type": "character varying(255)", "index": 28, "name": "priority_id", "comment": null}, "priority": {"type": "text", "index": 29, "name": "priority", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 30, "name": "lab_test_category_id", "comment": null}, "lab_test_category": {"type": "text", "index": 31, "name": "lab_test_category", "comment": null}, "lab_test_panel": {"type": "character varying(255)", "index": 32, "name": "lab_test_panel", "comment": null}, "tests": {"type": "text", "index": 33, "name": "tests", "comment": null}, "collected_datetime": {"type": "timestamp without time zone", "index": 34, "name": "collected_datetime", "comment": null}, "collected_by_id": {"type": "character varying(255)", "index": 35, "name": "collected_by_id", "comment": null}, "collected_by": {"type": "character varying(255)", "index": 36, "name": "collected_by", "comment": null}, "specimen_type_id": {"type": "character varying(255)", "index": 37, "name": "specimen_type_id", "comment": null}, "specimen_type": {"type": "text", "index": 38, "name": "specimen_type", "comment": null}, "site": {"type": "text", "index": 39, "name": "site", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 40, "name": "completed_datetime", "comment": null}, "reason_for_cancellation": {"type": "character varying", "index": 41, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_lab_requests"}, "model.tamanu_source_dbt.ds__sensitive_lab_tests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_lab_tests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "requesting_department_id": {"type": "character varying(255)", "index": 14, "name": "requesting_department_id", "comment": null}, "requesting_department": {"type": "character varying(255)", "index": 15, "name": "requesting_department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 20, "name": "lab_request_id", "comment": null}, "status_id": {"type": "character varying(255)", "index": 21, "name": "status_id", "comment": null}, "status": {"type": "character varying", "index": 22, "name": "status", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 23, "name": "lab_test_panel_id", "comment": null}, "lab_test_panel": {"type": "character varying(255)", "index": 24, "name": "lab_test_panel", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 25, "name": "lab_test_category_id", "comment": null}, "lab_test_category": {"type": "text", "index": 26, "name": "lab_test_category", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 27, "name": "requested_datetime", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 28, "name": "requested_by_id", "comment": null}, "requested_by": {"type": "character varying(255)", "index": 29, "name": "requested_by", "comment": null}, "lab_request_published_datetime": {"type": "timestamp without time zone", "index": 30, "name": "lab_request_published_datetime", "comment": null}, "lab_test_date": {"type": "date", "index": 31, "name": "lab_test_date", "comment": null}, "result": {"type": "text", "index": 32, "name": "result", "comment": null}, "verification": {"type": "character varying(255)", "index": 33, "name": "verification", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 34, "name": "lab_test_type_id", "comment": null}, "lab_test_type": {"type": "character varying(255)", "index": 35, "name": "lab_test_type", "comment": null}, "lab_test_completed_datetime": {"type": "timestamp without time zone", "index": 36, "name": "lab_test_completed_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_lab_tests"}, "model.tamanu_source_dbt.ds__sensitive_location_bookings": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_location_bookings", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 10, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 11, "name": "billing_type", "comment": null}, "booking_start_datetime": {"type": "timestamp without time zone", "index": 12, "name": "booking_start_datetime", "comment": null}, "booking_end_datetime": {"type": "timestamp without time zone", "index": 13, "name": "booking_end_datetime", "comment": null}, "booking_status": {"type": "character varying(255)", "index": 14, "name": "booking_status", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 15, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 16, "name": "clinician", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 17, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 18, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 19, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 20, "name": "location", "comment": null}, "booking_type_id": {"type": "character varying(255)", "index": 21, "name": "booking_type_id", "comment": null}, "booking_type": {"type": "text", "index": 22, "name": "booking_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_location_bookings"}, "model.tamanu_source_dbt.ds__sensitive_medication_dispenses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_medication_dispenses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "quantity": {"type": "integer", "index": 2, "name": "quantity", "comment": null}, "dispensed_at": {"type": "timestamp without time zone", "index": 3, "name": "dispensed_at", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 5, "name": "facility", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 6, "name": "medication_id", "comment": null}, "medication_code": {"type": "character varying(255)", "index": 7, "name": "medication_code", "comment": null}, "medication": {"type": "text", "index": 8, "name": "medication", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_medication_dispenses"}, "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_outpatient_appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 8, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 9, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 10, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 11, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 12, "name": "billing_type", "comment": null}, "appointment_start_datetime": {"type": "timestamp without time zone", "index": 13, "name": "appointment_start_datetime", "comment": null}, "appointment_end_datetime": {"type": "timestamp without time zone", "index": 14, "name": "appointment_end_datetime", "comment": null}, "appointment_type_id": {"type": "character varying(255)", "index": 15, "name": "appointment_type_id", "comment": null}, "appointment_type": {"type": "text", "index": 16, "name": "appointment_type", "comment": null}, "appointment_status": {"type": "character varying(255)", "index": 17, "name": "appointment_status", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 18, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 19, "name": "clinician", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 20, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 21, "name": "location_group", "comment": null}, "priority": {"type": "text", "index": 22, "name": "priority", "comment": null}, "schedule_id": {"type": "uuid", "index": 23, "name": "schedule_id", "comment": null}, "until_date": {"type": "date", "index": 24, "name": "until_date", "comment": null}, "interval": {"type": "integer", "index": 25, "name": "interval", "comment": null}, "days_of_week": {"type": "character varying(255)[]", "index": 26, "name": "days_of_week", "comment": null}, "frequency": {"type": "character varying(255)", "index": 27, "name": "frequency", "comment": null}, "nth_weekday": {"type": "integer", "index": 28, "name": "nth_weekday", "comment": null}, "created_by_user_id": {"type": "text", "index": 29, "name": "created_by_user_id", "comment": null}, "created_by": {"type": "character varying(255)", "index": 30, "name": "created_by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments"}, "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_outpatient_appointments_audit", "database": "app", "comment": null, "owner": "app"}, "columns": {"change_id": {"type": "uuid", "index": 1, "name": "change_id", "comment": null}, "appointment_id": {"type": "text", "index": 2, "name": "appointment_id", "comment": null}, "change_number": {"type": "bigint", "index": 3, "name": "change_number", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 8, "name": "date_of_birth", "comment": null}, "appointment_start_datetime": {"type": "timestamp without time zone", "index": 9, "name": "appointment_start_datetime", "comment": null}, "appointment_end_datetime": {"type": "timestamp without time zone", "index": 10, "name": "appointment_end_datetime", "comment": null}, "appointment_type": {"type": "text", "index": 11, "name": "appointment_type", "comment": null}, "appointment_type_id": {"type": "text", "index": 12, "name": "appointment_type_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 13, "name": "clinician", "comment": null}, "clinician_id": {"type": "text", "index": 14, "name": "clinician_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "location_group_id": {"type": "text", "index": 16, "name": "location_group_id", "comment": null}, "priority": {"type": "text", "index": 17, "name": "priority", "comment": null}, "schedule_id": {"type": "uuid", "index": 18, "name": "schedule_id", "comment": null}, "is_repeating": {"type": "text", "index": 19, "name": "is_repeating", "comment": null}, "created_by": {"type": "character varying(255)", "index": 20, "name": "created_by", "comment": null}, "created_by_user_id": {"type": "text", "index": 21, "name": "created_by_user_id", "comment": null}, "modified_by": {"type": "character varying(255)", "index": 22, "name": "modified_by", "comment": null}, "modified_by_user_id": {"type": "text", "index": 23, "name": "modified_by_user_id", "comment": null}, "modified_datetime": {"type": "timestamp with time zone", "index": 24, "name": "modified_datetime", "comment": null}, "is_cancelled": {"type": "text", "index": 25, "name": "is_cancelled", "comment": null}, "prev_start_datetime": {"type": "timestamp without time zone", "index": 26, "name": "prev_start_datetime", "comment": null}, "prev_end_datetime": {"type": "timestamp without time zone", "index": 27, "name": "prev_end_datetime", "comment": null}, "prev_appointment_type": {"type": "text", "index": 28, "name": "prev_appointment_type", "comment": null}, "prev_appointment_type_id": {"type": "text", "index": 29, "name": "prev_appointment_type_id", "comment": null}, "prev_clinician": {"type": "character varying", "index": 30, "name": "prev_clinician", "comment": null}, "prev_clinician_id": {"type": "text", "index": 31, "name": "prev_clinician_id", "comment": null}, "prev_location_group": {"type": "character varying", "index": 32, "name": "prev_location_group", "comment": null}, "prev_location_group_id": {"type": "text", "index": 33, "name": "prev_location_group_id", "comment": null}, "prev_priority": {"type": "text", "index": 34, "name": "prev_priority", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 35, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 36, "name": "facility", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit"}, "model.tamanu_source_dbt.ds__sensitive_procedures": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_procedures", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "nationality": {"type": "text", "index": 8, "name": "nationality", "comment": null}, "encounter_facility_id": {"type": "character varying(255)", "index": 9, "name": "encounter_facility_id", "comment": null}, "encounter_facility": {"type": "character varying(255)", "index": 10, "name": "encounter_facility", "comment": null}, "encounter_department_id": {"type": "character varying(255)", "index": 11, "name": "encounter_department_id", "comment": null}, "encounter_department": {"type": "character varying(255)", "index": 12, "name": "encounter_department", "comment": null}, "encounter_type": {"type": "text", "index": 13, "name": "encounter_type", "comment": null}, "encounter_start_datetime": {"type": "timestamp without time zone", "index": 14, "name": "encounter_start_datetime", "comment": null}, "encounter_end_datetime": {"type": "timestamp without time zone", "index": 15, "name": "encounter_end_datetime", "comment": null}, "procedure_facility_id": {"type": "character varying(255)", "index": 16, "name": "procedure_facility_id", "comment": null}, "procedure_facility": {"type": "character varying(255)", "index": 17, "name": "procedure_facility", "comment": null}, "procedure_area_id": {"type": "character varying(255)", "index": 18, "name": "procedure_area_id", "comment": null}, "procedure_area": {"type": "character varying(255)", "index": 19, "name": "procedure_area", "comment": null}, "procedure_location_id": {"type": "character varying(255)", "index": 20, "name": "procedure_location_id", "comment": null}, "procedure_location": {"type": "character varying(255)", "index": 21, "name": "procedure_location", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 22, "name": "procedure_type_id", "comment": null}, "procedure_type": {"type": "text", "index": 23, "name": "procedure_type", "comment": null}, "procedure_date": {"type": "date", "index": 24, "name": "procedure_date", "comment": null}, "procedure_start_time": {"type": "time without time zone", "index": 25, "name": "procedure_start_time", "comment": null}, "procedure_end_time": {"type": "time without time zone", "index": 26, "name": "procedure_end_time", "comment": null}, "procedure_duration": {"type": "text", "index": 27, "name": "procedure_duration", "comment": null}, "procedure_clinician_id": {"type": "character varying(255)", "index": 28, "name": "procedure_clinician_id", "comment": null}, "procedure_clinician": {"type": "character varying(255)", "index": 29, "name": "procedure_clinician", "comment": null}, "procedure_anaesthetist_id": {"type": "character varying(255)", "index": 30, "name": "procedure_anaesthetist_id", "comment": null}, "procedure_anaesthetist": {"type": "character varying(255)", "index": 31, "name": "procedure_anaesthetist", "comment": null}, "procedure_assistant_anaesthetist_id": {"type": "character varying(255)", "index": 32, "name": "procedure_assistant_anaesthetist_id", "comment": null}, "procedure_assistant_anaesthetist": {"type": "character varying(255)", "index": 33, "name": "procedure_assistant_anaesthetist", "comment": null}, "is_completed": {"type": "text", "index": 34, "name": "is_completed", "comment": null}, "time_in": {"type": "time without time zone", "index": 35, "name": "time_in", "comment": null}, "time_out": {"type": "time without time zone", "index": 36, "name": "time_out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_procedures"}, "model.tamanu_source_dbt.ds__sensitive_referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "village_id": {"type": "character varying(255)", "index": 5, "name": "village_id", "comment": null}, "diagnoses": {"type": "text", "index": 6, "name": "diagnoses", "comment": null}, "referral_type": {"type": "character varying(255)", "index": 7, "name": "referral_type", "comment": null}, "referring_doctor_id": {"type": "character varying(255)", "index": 8, "name": "referring_doctor_id", "comment": null}, "referring_doctor_name": {"type": "character varying(255)", "index": 9, "name": "referring_doctor_name", "comment": null}, "referral_datetime": {"type": "timestamp without time zone", "index": 10, "name": "referral_datetime", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "department": {"type": "character varying(255)", "index": 12, "name": "department", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_referrals"}, "model.tamanu_source_dbt.ds__sensitive_user_audit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_user_audit", "database": "app", "comment": null, "owner": "app"}, "columns": {"user_id": {"type": "character varying(255)", "index": 1, "name": "user_id", "comment": null}, "user_name": {"type": "character varying(255)", "index": 2, "name": "user_name", "comment": null}, "user_role": {"type": "character varying(255)", "index": 3, "name": "user_role", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "patient_category": {"type": "text", "index": 6, "name": "patient_category", "comment": null}, "triage_category": {"type": "text", "index": 7, "name": "triage_category", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 8, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 9, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 10, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 11, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 12, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 13, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 15, "name": "location", "comment": null}, "encounter_start_datetime": {"type": "timestamp without time zone", "index": 16, "name": "encounter_start_datetime", "comment": null}, "encounter_end_datetime": {"type": "timestamp without time zone", "index": 17, "name": "encounter_end_datetime", "comment": null}, "first_note_datetime": {"type": "timestamp without time zone", "index": 18, "name": "first_note_datetime", "comment": null}, "last_note_datetime": {"type": "timestamp without time zone", "index": 19, "name": "last_note_datetime", "comment": null}, "is_discharged": {"type": "text", "index": 20, "name": "is_discharged", "comment": null}, "non_discharge_by_clinicians": {"type": "text", "index": 21, "name": "non_discharge_by_clinicians", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_user_audit"}, "model.tamanu_source_dbt.ds__sensitive_vaccinations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_vaccinations", "database": "app", "comment": null, "owner": "app"}, "columns": {"display_id": {"type": "character varying(255)", "index": 1, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 3, "name": "last_name", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 16, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 17, "name": "location", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 18, "name": "scheduled_vaccine_id", "comment": null}, "vaccination_date": {"type": "date", "index": 19, "name": "vaccination_date", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 20, "name": "vaccine_category", "comment": null}, "vaccine_name": {"type": "character varying(255)", "index": 21, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 22, "name": "vaccine_brand", "comment": null}, "disease": {"type": "text", "index": 23, "name": "disease", "comment": null}, "vaccine_status": {"type": "text", "index": 24, "name": "vaccine_status", "comment": null}, "vaccine_schedule": {"type": "character varying(255)", "index": 25, "name": "vaccine_schedule", "comment": null}, "batch": {"type": "character varying(255)", "index": 26, "name": "batch", "comment": null}, "recorded_by": {"type": "character varying", "index": 27, "name": "recorded_by", "comment": null}, "circumstances": {"type": "text", "index": 28, "name": "circumstances", "comment": null}, "given_by": {"type": "text", "index": 29, "name": "given_by", "comment": null}, "given_elsewhere_by": {"type": "text", "index": 30, "name": "given_elsewhere_by", "comment": null}, "not_given_clinician": {"type": "text", "index": 31, "name": "not_given_clinician", "comment": null}, "not_given_reason": {"type": "text", "index": 32, "name": "not_given_reason", "comment": null}, "modified_by": {"type": "character varying", "index": 33, "name": "modified_by", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 34, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_vaccinations"}, "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__usage_quality_metrics_patient_details", "database": "app", "comment": null, "owner": "app"}, "columns": {"total_patients": {"type": "bigint", "index": 1, "name": "total_patients", "comment": null}, "total_patients_with_incomplete_name": {"type": "bigint", "index": 2, "name": "total_patients_with_incomplete_name", "comment": null}, "total_patients_with_missing_dob": {"type": "bigint", "index": 3, "name": "total_patients_with_missing_dob", "comment": null}, "total_patients_with_invalid_dob": {"type": "bigint", "index": 4, "name": "total_patients_with_invalid_dob", "comment": null}, "total_patients_with_missing_location": {"type": "bigint", "index": 5, "name": "total_patients_with_missing_location", "comment": null}, "total_patients_with_missing_contact": {"type": "bigint", "index": 6, "name": "total_patients_with_missing_contact", "comment": null}, "total_patients_merged": {"type": "bigint", "index": 7, "name": "total_patients_merged", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details"}, "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__usage_quality_metrics_patient_registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"registration_date": {"type": "timestamp with time zone", "index": 1, "name": "registration_date", "comment": null}, "total_patient_registrations": {"type": "bigint", "index": 2, "name": "total_patient_registrations", "comment": null}, "total_birth_registrations": {"type": "bigint", "index": 3, "name": "total_birth_registrations", "comment": null}, "total_incorrect_registrations_for_patient_under_6mth": {"type": "bigint", "index": 4, "name": "total_incorrect_registrations_for_patient_under_6mth", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations"}, "model.tamanu_source_dbt.ds__user_audit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__user_audit", "database": "app", "comment": null, "owner": "app"}, "columns": {"user_id": {"type": "character varying(255)", "index": 1, "name": "user_id", "comment": null}, "user_name": {"type": "character varying(255)", "index": 2, "name": "user_name", "comment": null}, "user_role": {"type": "character varying(255)", "index": 3, "name": "user_role", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "patient_category": {"type": "text", "index": 6, "name": "patient_category", "comment": null}, "triage_category": {"type": "text", "index": 7, "name": "triage_category", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 8, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 9, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 10, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 11, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 12, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 13, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 15, "name": "location", "comment": null}, "encounter_start_datetime": {"type": "timestamp without time zone", "index": 16, "name": "encounter_start_datetime", "comment": null}, "encounter_end_datetime": {"type": "timestamp without time zone", "index": 17, "name": "encounter_end_datetime", "comment": null}, "first_note_datetime": {"type": "timestamp without time zone", "index": 18, "name": "first_note_datetime", "comment": null}, "last_note_datetime": {"type": "timestamp without time zone", "index": 19, "name": "last_note_datetime", "comment": null}, "is_discharged": {"type": "text", "index": 20, "name": "is_discharged", "comment": null}, "non_discharge_by_clinicians": {"type": "text", "index": 21, "name": "non_discharge_by_clinicians", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__user_audit"}, "model.tamanu_source_dbt.ds__vaccinations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__vaccinations", "database": "app", "comment": null, "owner": "app"}, "columns": {"display_id": {"type": "character varying(255)", "index": 1, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 3, "name": "last_name", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 16, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 17, "name": "location", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 18, "name": "scheduled_vaccine_id", "comment": null}, "vaccination_date": {"type": "date", "index": 19, "name": "vaccination_date", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 20, "name": "vaccine_category", "comment": null}, "vaccine_name": {"type": "character varying(255)", "index": 21, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 22, "name": "vaccine_brand", "comment": null}, "disease": {"type": "text", "index": 23, "name": "disease", "comment": null}, "vaccine_status": {"type": "text", "index": 24, "name": "vaccine_status", "comment": null}, "vaccine_schedule": {"type": "character varying(255)", "index": 25, "name": "vaccine_schedule", "comment": null}, "batch": {"type": "character varying(255)", "index": 26, "name": "batch", "comment": null}, "recorded_by": {"type": "character varying", "index": 27, "name": "recorded_by", "comment": null}, "circumstances": {"type": "text", "index": 28, "name": "circumstances", "comment": null}, "given_by": {"type": "text", "index": 29, "name": "given_by", "comment": null}, "given_elsewhere_by": {"type": "text", "index": 30, "name": "given_elsewhere_by", "comment": null}, "not_given_clinician": {"type": "text", "index": 31, "name": "not_given_clinician", "comment": null}, "not_given_reason": {"type": "text", "index": 32, "name": "not_given_reason", "comment": null}, "modified_by": {"type": "character varying", "index": 33, "name": "modified_by", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 34, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__vaccinations"}, "model.tamanu_source_dbt.encounter-diets-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter-diets-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Encounter start date": {"type": "text", "index": 1, "name": "Encounter start date", "comment": null}, "Encounter start time": {"type": "text", "index": 2, "name": "Encounter start time", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "Patient name": {"type": "text", "index": 4, "name": "Patient name", "comment": null}, "Age": {"type": "text", "index": 5, "name": "Age", "comment": null}, "Location": {"type": "text", "index": 6, "name": "Location", "comment": null}, "Diet": {"type": "text", "index": 7, "name": "Diet", "comment": null}, "Allergies": {"type": "text", "index": 8, "name": "Allergies", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter-diets-line-list"}, "model.tamanu_source_dbt.encounter-summary-by-end-date": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter-summary-by-end-date", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 7, "name": "Ethnicity", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 9, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 10, "name": "Encounter end date and time", "comment": null}, "Length of stay (days)": {"type": "integer", "index": 11, "name": "Length of stay (days)", "comment": null}, "Facility": {"type": "character varying(255)", "index": 12, "name": "Facility", "comment": null}, "Emergency encounter type": {"type": "text", "index": 13, "name": "Emergency encounter type", "comment": null}, "Inpatient encounter type": {"type": "text", "index": 14, "name": "Inpatient encounter type", "comment": null}, "Outpatient encounter type": {"type": "text", "index": 15, "name": "Outpatient encounter type", "comment": null}, "Discharge disposition": {"type": "text", "index": 16, "name": "Discharge disposition", "comment": null}, "Triage category": {"type": "text", "index": 17, "name": "Triage category", "comment": null}, "Arrival mode": {"type": "text", "index": 18, "name": "Arrival mode", "comment": null}, "Time seen following triage/Waiting time (hh:mm:ss)": {"type": "text", "index": 19, "name": "Time seen following triage/Waiting time (hh:mm:ss)", "comment": null}, "Clinician": {"type": "text", "index": 20, "name": "Clinician", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 21, "name": "Supervising clinician", "comment": null}, "Discharging department": {"type": "character varying(255)", "index": 22, "name": "Discharging department", "comment": null}, "Discharge date and time of Discharging department": {"type": "text", "index": 23, "name": "Discharge date and time of Discharging department", "comment": null}, "Discharging area": {"type": "character varying(255)", "index": 24, "name": "Discharging area", "comment": null}, "Discharge date and time of Discharging area": {"type": "text", "index": 25, "name": "Discharge date and time of Discharging area", "comment": null}, "Discharging location": {"type": "character varying(255)", "index": 26, "name": "Discharging location", "comment": null}, "Discharge date and time of Discharging location": {"type": "text", "index": 27, "name": "Discharge date and time of Discharging location", "comment": null}, "Department history": {"type": "text", "index": 28, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 29, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 30, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 31, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 32, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 33, "name": "Location history date and times", "comment": null}, "Reason for encounter": {"type": "text", "index": 34, "name": "Reason for encounter", "comment": null}, "Diagnoses": {"type": "text", "index": 35, "name": "Diagnoses", "comment": null}, "Medications": {"type": "text", "index": 36, "name": "Medications", "comment": null}, "Vaccinations": {"type": "text", "index": 37, "name": "Vaccinations", "comment": null}, "Procedures": {"type": "text", "index": 38, "name": "Procedures", "comment": null}, "Lab requests": {"type": "text", "index": 39, "name": "Lab requests", "comment": null}, "Imaging requests": {"type": "text", "index": 40, "name": "Imaging requests", "comment": null}, "Notes": {"type": "text", "index": 41, "name": "Notes", "comment": null}, "invoiceFinalisedDateTime": {"type": "text", "index": 42, "name": "invoiceFinalisedDateTime", "comment": null}, "invoiceProductCategories": {"type": "text", "index": 43, "name": "invoiceProductCategories", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter-summary-by-end-date"}, "model.tamanu_source_dbt.encounter-summary-by-start-date": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter-summary-by-start-date", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 7, "name": "Ethnicity", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 9, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 10, "name": "Encounter end date and time", "comment": null}, "Length of stay (days)": {"type": "integer", "index": 11, "name": "Length of stay (days)", "comment": null}, "Facility": {"type": "character varying(255)", "index": 12, "name": "Facility", "comment": null}, "Emergency encounter type": {"type": "text", "index": 13, "name": "Emergency encounter type", "comment": null}, "Inpatient encounter type": {"type": "text", "index": 14, "name": "Inpatient encounter type", "comment": null}, "Outpatient encounter type": {"type": "text", "index": 15, "name": "Outpatient encounter type", "comment": null}, "Discharge disposition": {"type": "text", "index": 16, "name": "Discharge disposition", "comment": null}, "Triage category": {"type": "text", "index": 17, "name": "Triage category", "comment": null}, "Arrival mode": {"type": "text", "index": 18, "name": "Arrival mode", "comment": null}, "Time seen following triage/Waiting time (hh:mm:ss)": {"type": "text", "index": 19, "name": "Time seen following triage/Waiting time (hh:mm:ss)", "comment": null}, "Clinician": {"type": "text", "index": 20, "name": "Clinician", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 21, "name": "Supervising clinician", "comment": null}, "Discharging department": {"type": "character varying(255)", "index": 22, "name": "Discharging department", "comment": null}, "Discharge date and time of Discharging department": {"type": "text", "index": 23, "name": "Discharge date and time of Discharging department", "comment": null}, "Discharging area": {"type": "character varying(255)", "index": 24, "name": "Discharging area", "comment": null}, "Discharge date and time of Discharging area": {"type": "text", "index": 25, "name": "Discharge date and time of Discharging area", "comment": null}, "Discharging location": {"type": "character varying(255)", "index": 26, "name": "Discharging location", "comment": null}, "Discharge date and time of Discharging location": {"type": "text", "index": 27, "name": "Discharge date and time of Discharging location", "comment": null}, "Department history": {"type": "text", "index": 28, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 29, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 30, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 31, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 32, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 33, "name": "Location history date and times", "comment": null}, "Reason for encounter": {"type": "text", "index": 34, "name": "Reason for encounter", "comment": null}, "Diagnoses": {"type": "text", "index": 35, "name": "Diagnoses", "comment": null}, "Medications": {"type": "text", "index": 36, "name": "Medications", "comment": null}, "Vaccinations": {"type": "text", "index": 37, "name": "Vaccinations", "comment": null}, "Procedures": {"type": "text", "index": 38, "name": "Procedures", "comment": null}, "Lab requests": {"type": "text", "index": 39, "name": "Lab requests", "comment": null}, "Imaging requests": {"type": "text", "index": 40, "name": "Imaging requests", "comment": null}, "Notes": {"type": "text", "index": 41, "name": "Notes", "comment": null}, "invoiceFinalisedDateTime": {"type": "text", "index": 42, "name": "invoiceFinalisedDateTime", "comment": null}, "invoiceProductCategories": {"type": "text", "index": 43, "name": "invoiceProductCategories", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter-summary-by-start-date"}, "model.tamanu_source_dbt.encounter_diagnoses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_diagnoses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "is_primary": {"type": "boolean", "index": 3, "name": "is_primary", "comment": null}, "certainty": {"type": "character varying(255)", "index": 4, "name": "certainty", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 5, "name": "encounter_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 6, "name": "diagnosis_id", "comment": null}, "diagnosed_by_id": {"type": "character varying(255)", "index": 7, "name": "diagnosed_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_diagnoses"}, "model.tamanu_source_dbt.encounter_diagnoses_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_diagnoses_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_diagnoses_metadata"}, "model.tamanu_source_dbt.encounter_diets": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_diets", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "diet_id": {"type": "character varying(255)", "index": 3, "name": "diet_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_diets"}, "model.tamanu_source_dbt.encounter_history": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_history", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 3, "name": "encounter_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 4, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 5, "name": "location_id", "comment": null}, "encounter_type": {"type": "character varying(255)", "index": 6, "name": "encounter_type", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 7, "name": "clinician_id", "comment": null}, "updated_by_id": {"type": "character varying(255)", "index": 8, "name": "updated_by_id", "comment": null}, "change_type": {"type": "text[]", "index": 9, "name": "change_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_history"}, "model.tamanu_source_dbt.encounter_prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 3, "name": "prescription_id", "comment": null}, "is_selected_for_discharge": {"type": "boolean", "index": 4, "name": "is_selected_for_discharge", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_prescriptions"}, "model.tamanu_source_dbt.encounters": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounters", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 2, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 3, "name": "end_datetime", "comment": null}, "encounter_type": {"type": "character varying(31)", "index": 4, "name": "encounter_type", "comment": null}, "reason_for_encounter": {"type": "text", "index": 5, "name": "reason_for_encounter", "comment": null}, "device_id": {"type": "text", "index": 6, "name": "device_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 8, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 9, "name": "location_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 10, "name": "clinician_id", "comment": null}, "patient_billing_type_id": {"type": "character varying(255)", "index": 11, "name": "patient_billing_type_id", "comment": null}, "referral_source_id": {"type": "character varying(255)", "index": 12, "name": "referral_source_id", "comment": null}, "planned_location_id": {"type": "character varying(255)", "index": 13, "name": "planned_location_id", "comment": null}, "planned_location_start_datetime": {"type": "timestamp without time zone", "index": 14, "name": "planned_location_start_datetime", "comment": null}, "discharge_draft": {"type": "jsonb", "index": 15, "name": "discharge_draft", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounters"}, "model.tamanu_source_dbt.encounters_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounters_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounters_metadata"}, "model.tamanu_source_dbt.facilities": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "division": {"type": "character varying(255)", "index": 4, "name": "division", "comment": null}, "type": {"type": "character varying(255)", "index": 5, "name": "type", "comment": null}, "email": {"type": "character varying(255)", "index": 6, "name": "email", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 7, "name": "contact_number", "comment": null}, "city_town": {"type": "character varying(255)", "index": 8, "name": "city_town", "comment": null}, "street_address": {"type": "character varying(255)", "index": 9, "name": "street_address", "comment": null}, "catchment_id": {"type": "text", "index": 10, "name": "catchment_id", "comment": null}, "visibility_status": {"type": "text", "index": 11, "name": "visibility_status", "comment": null}, "is_sensitive": {"type": "boolean", "index": 12, "name": "is_sensitive", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.facilities"}, "model.tamanu_source_dbt.hospital-admissions-by-area-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "hospital-admissions-by-area-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Month": {"type": "text", "index": 1, "name": "Month", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Area": {"type": "character varying(255)", "index": 3, "name": "Area", "comment": null}, "Number of admissions": {"type": "bigint", "index": 4, "name": "Number of admissions", "comment": null}, "Number of discharges": {"type": "bigint", "index": 5, "name": "Number of discharges", "comment": null}, "Number of deaths": {"type": "bigint", "index": 6, "name": "Number of deaths", "comment": null}, "Number of transfers into location": {"type": "bigint", "index": 7, "name": "Number of transfers into location", "comment": null}, "Number of transfers out of location": {"type": "bigint", "index": 8, "name": "Number of transfers out of location", "comment": null}, "Average length of stay": {"type": "numeric", "index": 9, "name": "Average length of stay", "comment": null}, "Number of patient days": {"type": "numeric", "index": 10, "name": "Number of patient days", "comment": null}, "Bed occupancy (%)": {"type": "text", "index": 11, "name": "Bed occupancy (%)", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-area-summary"}, "model.tamanu_source_dbt.hospital-admissions-by-department-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "hospital-admissions-by-department-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Month": {"type": "text", "index": 1, "name": "Month", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 3, "name": "Department", "comment": null}, "Number of admissions": {"type": "bigint", "index": 4, "name": "Number of admissions", "comment": null}, "Number of discharges": {"type": "bigint", "index": 5, "name": "Number of discharges", "comment": null}, "Number of deaths": {"type": "bigint", "index": 6, "name": "Number of deaths", "comment": null}, "Number of transfers into department": {"type": "bigint", "index": 7, "name": "Number of transfers into department", "comment": null}, "Number of transfers out of department": {"type": "bigint", "index": 8, "name": "Number of transfers out of department", "comment": null}, "Average length of stay": {"type": "numeric", "index": 9, "name": "Average length of stay", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-department-summary"}, "model.tamanu_source_dbt.hospital-admissions-by-location-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "hospital-admissions-by-location-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Month": {"type": "text", "index": 1, "name": "Month", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Area": {"type": "character varying(255)", "index": 3, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 4, "name": "Location", "comment": null}, "Number of admissions": {"type": "bigint", "index": 5, "name": "Number of admissions", "comment": null}, "Number of discharges": {"type": "bigint", "index": 6, "name": "Number of discharges", "comment": null}, "Number of deaths": {"type": "bigint", "index": 7, "name": "Number of deaths", "comment": null}, "Number of transfers into location": {"type": "bigint", "index": 8, "name": "Number of transfers into location", "comment": null}, "Number of transfers out of location": {"type": "bigint", "index": 9, "name": "Number of transfers out of location", "comment": null}, "Average length of stay": {"type": "numeric", "index": 10, "name": "Average length of stay", "comment": null}, "Number of patient days": {"type": "numeric", "index": 11, "name": "Number of patient days", "comment": null}, "Bed occupancy (%)": {"type": "text", "index": 12, "name": "Bed occupancy (%)", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-location-summary"}, "model.tamanu_source_dbt.imaging-requests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging-requests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 10, "name": "Area", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 11, "name": "Request ID", "comment": null}, "Request date and time": {"type": "text", "index": 12, "name": "Request date and time", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 13, "name": "Supervising clinician", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 14, "name": "Requesting clinician", "comment": null}, "Priority": {"type": "character varying", "index": 15, "name": "Priority", "comment": null}, "Imaging type": {"type": "text", "index": 16, "name": "Imaging type", "comment": null}, "Area to be imaged": {"type": "text", "index": 17, "name": "Area to be imaged", "comment": null}, "Status": {"type": "text", "index": 18, "name": "Status", "comment": null}, "Completed date and time": {"type": "text", "index": 19, "name": "Completed date and time", "comment": null}, "Reason for cancellation": {"type": "text", "index": 20, "name": "Reason for cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging-requests-line-list"}, "model.tamanu_source_dbt.imaging-requests-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging-requests-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date": {"type": "text", "index": 1, "name": "Date", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 3, "name": "Department", "comment": null}, "Imaging type": {"type": "text", "index": 4, "name": "Imaging type", "comment": null}, "Total new requests": {"type": "bigint", "index": 5, "name": "Total new requests", "comment": null}, "Total requests with a status of pending": {"type": "bigint", "index": 6, "name": "Total requests with a status of pending", "comment": null}, "Total requests completed": {"type": "bigint", "index": 7, "name": "Total requests completed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging-requests-summary"}, "model.tamanu_source_dbt.imaging_area_external_codes": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging_area_external_codes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "area_id": {"type": "character varying(255)", "index": 2, "name": "area_id", "comment": null}, "code": {"type": "text", "index": 3, "name": "code", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging_area_external_codes"}, "model.tamanu_source_dbt.imaging_request_areas": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging_request_areas", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "imaging_request_id": {"type": "character varying", "index": 2, "name": "imaging_request_id", "comment": null}, "area_id": {"type": "character varying(255)", "index": 3, "name": "area_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging_request_areas"}, "model.tamanu_source_dbt.imaging_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 3, "name": "datetime", "comment": null}, "status": {"type": "character varying(255)", "index": 4, "name": "status", "comment": null}, "priority": {"type": "character varying(255)", "index": 5, "name": "priority", "comment": null}, "imaging_type": {"type": "character varying(31)", "index": 6, "name": "imaging_type", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 8, "name": "requested_by_id", "comment": null}, "completed_by_id": {"type": "character varying(255)", "index": 9, "name": "completed_by_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 10, "name": "location_id", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 11, "name": "location_group_id", "comment": null}, "reason_for_cancellation": {"type": "character varying(1024)", "index": 12, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging_requests"}, "model.tamanu_source_dbt.imaging_results": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging_results", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "description": {"type": "text", "index": 3, "name": "description", "comment": null}, "imaging_request_id": {"type": "character varying", "index": 4, "name": "imaging_request_id", "comment": null}, "external_code": {"type": "text", "index": 5, "name": "external_code", "comment": null}, "completed_by_id": {"type": "character varying(255)", "index": 6, "name": "completed_by_id", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging_results"}, "model.tamanu_source_dbt.incomplete-referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "incomplete-referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Diagnoses": {"type": "text", "index": 4, "name": "Diagnoses", "comment": null}, "Referral name": {"type": "character varying(255)", "index": 5, "name": "Referral name", "comment": null}, "Referring doctor": {"type": "character varying(255)", "index": 6, "name": "Referring doctor", "comment": null}, "Referral date": {"type": "text", "index": 7, "name": "Referral date", "comment": null}, "Department": {"type": "character varying(255)", "index": 8, "name": "Department", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.incomplete-referrals"}, "model.tamanu_source_dbt.invoice-products-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice-products-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"ID": {"type": "character varying(255)", "index": 1, "name": "ID", "comment": null}, "Product name": {"type": "text", "index": 2, "name": "Product name", "comment": null}, "Insurable": {"type": "boolean", "index": 3, "name": "Insurable", "comment": null}, "Category": {"type": "character varying(255)", "index": 4, "name": "Category", "comment": null}, "Category ID": {"type": "character varying(255)", "index": 5, "name": "Category ID", "comment": null}, "Visibility status": {"type": "character varying(255)", "index": 6, "name": "Visibility status", "comment": null}, "Lab external code": {"type": "text", "index": 7, "name": "Lab external code", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice-products-summary"}, "model.tamanu_source_dbt.invoice_insurance_plan_items": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_insurance_plan_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "invoice_insurance_plan_id": {"type": "text", "index": 2, "name": "invoice_insurance_plan_id", "comment": null}, "invoice_product_id": {"type": "text", "index": 3, "name": "invoice_product_id", "comment": null}, "coverage_value": {"type": "numeric", "index": 4, "name": "coverage_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_insurance_plan_items"}, "model.tamanu_source_dbt.invoice_insurance_plans": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_insurance_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "name": {"type": "character varying(255)", "index": 2, "name": "name", "comment": null}, "code": {"type": "character varying(255)", "index": 3, "name": "code", "comment": null}, "default_coverage": {"type": "numeric", "index": 4, "name": "default_coverage", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_insurance_plans"}, "model.tamanu_source_dbt.invoice_items": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_id": {"type": "uuid", "index": 2, "name": "invoice_id", "comment": null}, "date": {"type": "date", "index": 3, "name": "date", "comment": null}, "product_id": {"type": "character varying(255)", "index": 4, "name": "product_id", "comment": null}, "product_code_final": {"type": "character varying(255)", "index": 5, "name": "product_code_final", "comment": null}, "product_name_final": {"type": "character varying(255)", "index": 6, "name": "product_name_final", "comment": null}, "price_final": {"type": "numeric", "index": 7, "name": "price_final", "comment": null}, "manual_entry_price": {"type": "numeric", "index": 8, "name": "manual_entry_price", "comment": null}, "quantity": {"type": "integer", "index": 9, "name": "quantity", "comment": null}, "ordered_by_user_id": {"type": "character varying(255)", "index": 10, "name": "ordered_by_user_id", "comment": null}, "approved": {"type": "boolean", "index": 11, "name": "approved", "comment": null}, "source_record_type": {"type": "character varying(255)", "index": 12, "name": "source_record_type", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 13, "name": "source_record_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_items"}, "model.tamanu_source_dbt.invoice_price_list_items": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_price_list_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "invoice_price_list_id": {"type": "text", "index": 2, "name": "invoice_price_list_id", "comment": null}, "invoice_product_id": {"type": "text", "index": 3, "name": "invoice_product_id", "comment": null}, "price": {"type": "numeric", "index": 4, "name": "price", "comment": null}, "is_hidden": {"type": "boolean", "index": 5, "name": "is_hidden", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_price_list_items"}, "model.tamanu_source_dbt.invoice_price_lists": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_price_lists", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "name": {"type": "character varying(255)", "index": 2, "name": "name", "comment": null}, "code": {"type": "character varying(255)", "index": 3, "name": "code", "comment": null}, "visibility_status": {"type": "text", "index": 4, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_price_lists"}, "model.tamanu_source_dbt.invoice_products": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_products", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "insurable": {"type": "boolean", "index": 3, "name": "insurable", "comment": null}, "category": {"type": "character varying(255)", "index": 4, "name": "category", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 5, "name": "source_record_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 6, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_products"}, "model.tamanu_source_dbt.invoices": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoices", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 3, "name": "datetime", "comment": null}, "status": {"type": "character varying(255)", "index": 4, "name": "status", "comment": null}, "patient_payment_status": {"type": "character varying(255)", "index": 5, "name": "patient_payment_status", "comment": null}, "insurer_payment_status": {"type": "character varying(255)", "index": 6, "name": "insurer_payment_status", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoices"}, "model.tamanu_source_dbt.lab-requests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab-requests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Location": {"type": "text", "index": 10, "name": "Location", "comment": null}, "Laboratory": {"type": "text", "index": 11, "name": "Laboratory", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 12, "name": "Request ID", "comment": null}, "Status": {"type": "character varying", "index": 13, "name": "Status", "comment": null}, "Lab request date and time": {"type": "text", "index": 14, "name": "Lab request date and time", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 15, "name": "Requesting clinician", "comment": null}, "Requesting department": {"type": "character varying(255)", "index": 16, "name": "Requesting department", "comment": null}, "Priority": {"type": "text", "index": 17, "name": "Priority", "comment": null}, "Test category": {"type": "text", "index": 18, "name": "Test category", "comment": null}, "Test requested": {"type": "text", "index": 19, "name": "Test requested", "comment": null}, "Sample collection date and time": {"type": "text", "index": 20, "name": "Sample collection date and time", "comment": null}, "Sample collected by": {"type": "character varying(255)", "index": 21, "name": "Sample collected by", "comment": null}, "Specimen type": {"type": "text", "index": 22, "name": "Specimen type", "comment": null}, "Site": {"type": "text", "index": 23, "name": "Site", "comment": null}, "Completed date and time": {"type": "text", "index": 24, "name": "Completed date and time", "comment": null}, "Reason for cancellation": {"type": "character varying", "index": 25, "name": "Reason for cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab-requests-line-list"}, "model.tamanu_source_dbt.lab-requests-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab-requests-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date": {"type": "text", "index": 1, "name": "Date", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 3, "name": "Department", "comment": null}, "Test category": {"type": "text", "index": 4, "name": "Test category", "comment": null}, "Total new requests": {"type": "bigint", "index": 5, "name": "Total new requests", "comment": null}, "Total requests with a status of results pending": {"type": "bigint", "index": 6, "name": "Total requests with a status of results pending", "comment": null}, "Total requests published": {"type": "bigint", "index": 7, "name": "Total requests published", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab-requests-summary"}, "model.tamanu_source_dbt.lab-tests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab-tests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Requesting department": {"type": "character varying(255)", "index": 10, "name": "Requesting department", "comment": null}, "Location": {"type": "text", "index": 11, "name": "Location", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 12, "name": "Request ID", "comment": null}, "Status": {"type": "character varying", "index": 13, "name": "Status", "comment": null}, "Lab test panel": {"type": "character varying(255)", "index": 14, "name": "Lab test panel", "comment": null}, "Test category": {"type": "text", "index": 15, "name": "Test category", "comment": null}, "Lab request date and time": {"type": "text", "index": 16, "name": "Lab request date and time", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 17, "name": "Requesting clinician", "comment": null}, "Lab request published date and time": {"type": "text", "index": 18, "name": "Lab request published date and time", "comment": null}, "Lab test date": {"type": "text", "index": 19, "name": "Lab test date", "comment": null}, "Result": {"type": "text", "index": 20, "name": "Result", "comment": null}, "Verification": {"type": "character varying(255)", "index": 21, "name": "Verification", "comment": null}, "Lab test type": {"type": "character varying(255)", "index": 22, "name": "Lab test type", "comment": null}, "Lab test completed date and time": {"type": "text", "index": 23, "name": "Lab test completed date and time", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab-tests-line-list"}, "model.tamanu_source_dbt.lab_request_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_request_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 4, "name": "lab_request_id", "comment": null}, "status": {"type": "character varying(31)", "index": 5, "name": "status", "comment": null}, "updated_by_id": {"type": "character varying(255)", "index": 6, "name": "updated_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_request_logs"}, "model.tamanu_source_dbt.lab_request_logs_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_request_logs_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_request_logs_metadata"}, "model.tamanu_source_dbt.lab_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}, "display_id": {"type": "character varying(255)", "index": 4, "name": "display_id", "comment": null}, "is_urgent": {"type": "boolean", "index": 5, "name": "is_urgent", "comment": null}, "status": {"type": "character varying(255)", "index": 6, "name": "status", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 7, "name": "requested_datetime", "comment": null}, "lab_test_priority_id": {"type": "character varying(255)", "index": 8, "name": "lab_test_priority_id", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 9, "name": "lab_test_category_id", "comment": null}, "lab_test_panel_request_id": {"type": "uuid", "index": 10, "name": "lab_test_panel_request_id", "comment": null}, "lab_test_laboratory_id": {"type": "character varying(255)", "index": 11, "name": "lab_test_laboratory_id", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 12, "name": "requested_by_id", "comment": null}, "is_specimen_collected": {"type": "boolean", "index": 13, "name": "is_specimen_collected", "comment": null}, "specimen_type_id": {"type": "character varying(255)", "index": 14, "name": "specimen_type_id", "comment": null}, "lab_sample_site_id": {"type": "character varying(255)", "index": 15, "name": "lab_sample_site_id", "comment": null}, "collected_datetime": {"type": "timestamp without time zone", "index": 16, "name": "collected_datetime", "comment": null}, "collected_by_id": {"type": "character varying(255)", "index": 17, "name": "collected_by_id", "comment": null}, "reason_for_cancellation": {"type": "character varying(31)", "index": 18, "name": "reason_for_cancellation", "comment": null}, "published_datetime": {"type": "timestamp without time zone", "index": 19, "name": "published_datetime", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 20, "name": "encounter_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 21, "name": "department_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_requests"}, "model.tamanu_source_dbt.lab_requests_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_requests_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_requests_metadata"}, "model.tamanu_source_dbt.lab_test_panel_lab_test_types": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_test_panel_lab_test_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 2, "name": "lab_test_panel_id", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 3, "name": "lab_test_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_test_panel_lab_test_types"}, "model.tamanu_source_dbt.lab_test_panel_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_test_panel_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 2, "name": "lab_test_panel_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 3, "name": "encounter_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_test_panel_requests"}, "model.tamanu_source_dbt.lab_test_panels": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_test_panels", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "external_code": {"type": "text", "index": 3, "name": "external_code", "comment": null}, "name": {"type": "character varying(255)", "index": 4, "name": "name", "comment": null}, "category_id": {"type": "character varying(255)", "index": 5, "name": "category_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 6, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_test_panels"}, "model.tamanu_source_dbt.lab_test_types": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_test_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "external_code": {"type": "text", "index": 3, "name": "external_code", "comment": null}, "name": {"type": "character varying(255)", "index": 4, "name": "name", "comment": null}, "unit": {"type": "character varying(255)", "index": 5, "name": "unit", "comment": null}, "male_min": {"type": "double precision", "index": 6, "name": "male_min", "comment": null}, "male_max": {"type": "double precision", "index": 7, "name": "male_max", "comment": null}, "female_min": {"type": "double precision", "index": 8, "name": "female_min", "comment": null}, "female_max": {"type": "double precision", "index": 9, "name": "female_max", "comment": null}, "result_type": {"type": "character varying(255)", "index": 10, "name": "result_type", "comment": null}, "options": {"type": "text", "index": 11, "name": "options", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 12, "name": "lab_test_category_id", "comment": null}, "visibility_status": {"type": "text", "index": 13, "name": "visibility_status", "comment": null}, "is_sensitive": {"type": "boolean", "index": 14, "name": "is_sensitive", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_test_types"}, "model.tamanu_source_dbt.lab_tests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_tests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "date": {"type": "date", "index": 2, "name": "date", "comment": null}, "result": {"type": "text", "index": 3, "name": "result", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 4, "name": "lab_request_id", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 5, "name": "lab_test_type_id", "comment": null}, "lab_test_method_id": {"type": "character varying(255)", "index": 6, "name": "lab_test_method_id", "comment": null}, "laboratory_officer": {"type": "character varying(255)", "index": 7, "name": "laboratory_officer", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 8, "name": "completed_datetime", "comment": null}, "verification": {"type": "character varying(255)", "index": 9, "name": "verification", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_tests"}, "model.tamanu_source_dbt.location-bookings-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "location-bookings-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Booking start date and time": {"type": "text", "index": 9, "name": "Booking start date and time", "comment": null}, "Booking end date and time": {"type": "text", "index": 10, "name": "Booking end date and time", "comment": null}, "Booking duration": {"type": "text", "index": 11, "name": "Booking duration", "comment": null}, "Area": {"type": "character varying(255)", "index": 12, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 13, "name": "Location", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 14, "name": "Clinician", "comment": null}, "Booking type": {"type": "text", "index": 15, "name": "Booking type", "comment": null}, "Booking status": {"type": "character varying(255)", "index": 16, "name": "Booking status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.location-bookings-line-list"}, "model.tamanu_source_dbt.location_bookings": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "location_bookings", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 2, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 3, "name": "end_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 5, "name": "clinician_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 7, "name": "location_id", "comment": null}, "booking_type_id": {"type": "character varying(255)", "index": 8, "name": "booking_type_id", "comment": null}, "is_high_priority": {"type": "boolean", "index": 9, "name": "is_high_priority", "comment": null}, "status": {"type": "character varying(255)", "index": 10, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.location_bookings"}, "model.tamanu_source_dbt.location_groups": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "location_groups", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.location_groups"}, "model.tamanu_source_dbt.locations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "locations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "max_occupancy": {"type": "integer", "index": 4, "name": "max_occupancy", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 5, "name": "location_group_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 6, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.locations"}, "model.tamanu_source_dbt.medication-dispensed-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "medication-dispensed-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Medication": {"type": "text", "index": 1, "name": "Medication", "comment": null}, "Code": {"type": "character varying(255)", "index": 2, "name": "Code", "comment": null}, "Quantity": {"type": "bigint", "index": 3, "name": "Quantity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.medication-dispensed-summary"}, "model.tamanu_source_dbt.medication_dispenses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "medication_dispenses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "pharmacy_order_prescription_id": {"type": "uuid", "index": 2, "name": "pharmacy_order_prescription_id", "comment": null}, "quantity": {"type": "integer", "index": 3, "name": "quantity", "comment": null}, "dispensed_at": {"type": "timestamp without time zone", "index": 4, "name": "dispensed_at", "comment": null}, "dispensed_by_user_id": {"type": "character varying(255)", "index": 5, "name": "dispensed_by_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.medication_dispenses"}, "model.tamanu_source_dbt.notes": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "notes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "content": {"type": "text", "index": 3, "name": "content", "comment": null}, "note_type_id": {"type": "character varying(255)", "index": 4, "name": "note_type_id", "comment": null}, "note_type": {"type": "text", "index": 5, "name": "note_type", "comment": null}, "record_type": {"type": "character varying(255)", "index": 6, "name": "record_type", "comment": null}, "record_id": {"type": "character varying(255)", "index": 7, "name": "record_id", "comment": null}, "authored_by_id": {"type": "character varying(255)", "index": 8, "name": "authored_by_id", "comment": null}, "on_behalf_of_id": {"type": "character varying(255)", "index": 9, "name": "on_behalf_of_id", "comment": null}, "updated_note_id": {"type": "uuid", "index": 10, "name": "updated_note_id", "comment": null}, "visibility_status": {"type": "text", "index": 11, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.notes"}, "model.tamanu_source_dbt.ongoing-conditions-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ongoing-conditions-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Ongoing condition": {"type": "text", "index": 8, "name": "Ongoing condition", "comment": null}, "Date recorded": {"type": "text", "index": 9, "name": "Date recorded", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 10, "name": "Clinician", "comment": null}, "Date resolved": {"type": "text", "index": 11, "name": "Date resolved", "comment": null}, "Clinician confirming resolution": {"type": "character varying", "index": 12, "name": "Clinician confirming resolution", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ongoing-conditions-line-list"}, "model.tamanu_source_dbt.outpatient-appointments-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "outpatient-appointments-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Contact number": {"type": "character varying(255)", "index": 7, "name": "Contact number", "comment": null}, "Village": {"type": "text", "index": 8, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 9, "name": "Billing type", "comment": null}, "Appointment date and time": {"type": "text", "index": 10, "name": "Appointment date and time", "comment": null}, "Appointment end date and time": {"type": "text", "index": 11, "name": "Appointment end date and time", "comment": null}, "Appointment type": {"type": "text", "index": 12, "name": "Appointment type", "comment": null}, "Appointment status": {"type": "character varying(255)", "index": 13, "name": "Appointment status", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 14, "name": "Clinician", "comment": null}, "Area": {"type": "character varying(255)", "index": 15, "name": "Area", "comment": null}, "Priority appointment": {"type": "text", "index": 16, "name": "Priority appointment", "comment": null}, "Repeating appointment": {"type": "text", "index": 17, "name": "Repeating appointment", "comment": null}, "Repeating appointment end date": {"type": "text", "index": 18, "name": "Repeating appointment end date", "comment": null}, "Appointment created by": {"type": "character varying(255)", "index": 19, "name": "Appointment created by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.outpatient-appointments-line-list"}, "model.tamanu_source_dbt.outpatient_appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "outpatient_appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 2, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 3, "name": "end_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 5, "name": "clinician_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "schedule_id": {"type": "uuid", "index": 7, "name": "schedule_id", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 8, "name": "location_group_id", "comment": null}, "appointment_type_id": {"type": "character varying(255)", "index": 9, "name": "appointment_type_id", "comment": null}, "priority": {"type": "text", "index": 10, "name": "priority", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "until_date": {"type": "date", "index": 12, "name": "until_date", "comment": null}, "interval": {"type": "integer", "index": 13, "name": "interval", "comment": null}, "days_of_week": {"type": "character varying(255)[]", "index": 14, "name": "days_of_week", "comment": null}, "frequency": {"type": "character varying(255)", "index": 15, "name": "frequency", "comment": null}, "nth_weekday": {"type": "integer", "index": 16, "name": "nth_weekday", "comment": null}, "occurrence_count": {"type": "integer", "index": 17, "name": "occurrence_count", "comment": null}, "is_fully_generated": {"type": "boolean", "index": 18, "name": "is_fully_generated", "comment": null}, "generated_until_date": {"type": "date_string", "index": 19, "name": "generated_until_date", "comment": null}, "cancelled_at_date": {"type": "date_string", "index": 20, "name": "cancelled_at_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.outpatient_appointments"}, "model.tamanu_source_dbt.outpatient_appointments_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "outpatient_appointments_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"change_id": {"type": "uuid", "index": 1, "name": "change_id", "comment": null}, "appointment_id": {"type": "text", "index": 2, "name": "appointment_id", "comment": null}, "modified_datetime": {"type": "timestamp with time zone", "index": 3, "name": "modified_datetime", "comment": null}, "modified_by_user_id": {"type": "text", "index": 4, "name": "modified_by_user_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 5, "name": "created_by_user_id", "comment": null}, "patient_id": {"type": "text", "index": 6, "name": "patient_id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 7, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 8, "name": "end_datetime", "comment": null}, "clinician_id": {"type": "text", "index": 9, "name": "clinician_id", "comment": null}, "location_group_id": {"type": "text", "index": 10, "name": "location_group_id", "comment": null}, "appointment_type_id": {"type": "text", "index": 11, "name": "appointment_type_id", "comment": null}, "is_high_priority": {"type": "boolean", "index": 12, "name": "is_high_priority", "comment": null}, "status": {"type": "text", "index": 13, "name": "status", "comment": null}, "schedule_id": {"type": "uuid", "index": 14, "name": "schedule_id", "comment": null}, "prev_start_datetime": {"type": "timestamp without time zone", "index": 15, "name": "prev_start_datetime", "comment": null}, "prev_end_datetime": {"type": "timestamp without time zone", "index": 16, "name": "prev_end_datetime", "comment": null}, "prev_clinician_id": {"type": "text", "index": 17, "name": "prev_clinician_id", "comment": null}, "prev_location_group_id": {"type": "text", "index": 18, "name": "prev_location_group_id", "comment": null}, "prev_appointment_type_id": {"type": "text", "index": 19, "name": "prev_appointment_type_id", "comment": null}, "prev_is_high_priority": {"type": "boolean", "index": 20, "name": "prev_is_high_priority", "comment": null}, "prev_status": {"type": "text", "index": 21, "name": "prev_status", "comment": null}, "change_sequence": {"type": "bigint", "index": 22, "name": "change_sequence", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.outpatient_appointments_change_logs"}, "model.tamanu_source_dbt.patient-emergency-encounters-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient-emergency-encounters-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 7, "name": "Facility", "comment": null}, "Number of triage records": {"type": "bigint", "index": 8, "name": "Number of triage records", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient-emergency-encounters-summary"}, "model.tamanu_source_dbt.patient_additional_data": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_additional_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "title": {"type": "character varying(255)", "index": 2, "name": "title", "comment": null}, "marital_status": {"type": "character varying(255)", "index": 3, "name": "marital_status", "comment": null}, "primary_contact_number": {"type": "character varying(255)", "index": 4, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "character varying(255)", "index": 5, "name": "secondary_contact_number", "comment": null}, "emergency_contact_name": {"type": "character varying(255)", "index": 6, "name": "emergency_contact_name", "comment": null}, "emergency_contact_number": {"type": "character varying(255)", "index": 7, "name": "emergency_contact_number", "comment": null}, "social_media": {"type": "character varying(255)", "index": 8, "name": "social_media", "comment": null}, "ethnicity_id": {"type": "character varying(255)", "index": 9, "name": "ethnicity_id", "comment": null}, "religion_id": {"type": "character varying(255)", "index": 10, "name": "religion_id", "comment": null}, "nationality_id": {"type": "character varying(255)", "index": 11, "name": "nationality_id", "comment": null}, "secondary_village_id": {"type": "text", "index": 12, "name": "secondary_village_id", "comment": null}, "country_id": {"type": "character varying(255)", "index": 13, "name": "country_id", "comment": null}, "division_id": {"type": "character varying(255)", "index": 14, "name": "division_id", "comment": null}, "subdivision_id": {"type": "character varying(255)", "index": 15, "name": "subdivision_id", "comment": null}, "medical_area_id": {"type": "character varying(255)", "index": 16, "name": "medical_area_id", "comment": null}, "nursing_zone_id": {"type": "character varying(255)", "index": 17, "name": "nursing_zone_id", "comment": null}, "settlement_id": {"type": "character varying(255)", "index": 18, "name": "settlement_id", "comment": null}, "city_town": {"type": "character varying(255)", "index": 19, "name": "city_town", "comment": null}, "street_village": {"type": "character varying(255)", "index": 20, "name": "street_village", "comment": null}, "country_of_birth_id": {"type": "character varying(255)", "index": 21, "name": "country_of_birth_id", "comment": null}, "place_of_birth": {"type": "character varying(255)", "index": 22, "name": "place_of_birth", "comment": null}, "birth_certificate": {"type": "character varying(255)", "index": 23, "name": "birth_certificate", "comment": null}, "driving_license": {"type": "character varying(255)", "index": 24, "name": "driving_license", "comment": null}, "passport": {"type": "character varying(255)", "index": 25, "name": "passport", "comment": null}, "educational_level": {"type": "character varying(255)", "index": 26, "name": "educational_level", "comment": null}, "occupation_id": {"type": "character varying(255)", "index": 27, "name": "occupation_id", "comment": null}, "blood_type": {"type": "character varying(255)", "index": 28, "name": "blood_type", "comment": null}, "patient_billing_type_id": {"type": "character varying(255)", "index": 29, "name": "patient_billing_type_id", "comment": null}, "health_center_id": {"type": "text", "index": 30, "name": "health_center_id", "comment": null}, "insurer_id": {"type": "character varying(255)", "index": 31, "name": "insurer_id", "comment": null}, "insurer_policy_number": {"type": "character varying(255)", "index": 32, "name": "insurer_policy_number", "comment": null}, "mother_id": {"type": "character varying(255)", "index": 33, "name": "mother_id", "comment": null}, "father_id": {"type": "character varying(255)", "index": 34, "name": "father_id", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 35, "name": "registered_by_id", "comment": null}, "updated_by_field": {"type": "json", "index": 36, "name": "updated_by_field", "comment": null}, "registration_date": {"type": "date", "index": 37, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_additional_data"}, "model.tamanu_source_dbt.patient_additional_data_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_additional_data_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp without time zone", "index": 2, "name": "logged_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 3, "name": "updated_by_user_id", "comment": null}, "patient_id": {"type": "text", "index": 4, "name": "patient_id", "comment": null}, "title": {"type": "text", "index": 5, "name": "title", "comment": null}, "marital_status": {"type": "text", "index": 6, "name": "marital_status", "comment": null}, "primary_contact_number": {"type": "text", "index": 7, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "text", "index": 8, "name": "secondary_contact_number", "comment": null}, "emergency_contact_name": {"type": "text", "index": 9, "name": "emergency_contact_name", "comment": null}, "emergency_contact_number": {"type": "text", "index": 10, "name": "emergency_contact_number", "comment": null}, "social_media": {"type": "text", "index": 11, "name": "social_media", "comment": null}, "ethnicity_id": {"type": "text", "index": 12, "name": "ethnicity_id", "comment": null}, "religion_id": {"type": "text", "index": 13, "name": "religion_id", "comment": null}, "nationality_id": {"type": "text", "index": 14, "name": "nationality_id", "comment": null}, "secondary_village_id": {"type": "text", "index": 15, "name": "secondary_village_id", "comment": null}, "country_id": {"type": "text", "index": 16, "name": "country_id", "comment": null}, "division_id": {"type": "text", "index": 17, "name": "division_id", "comment": null}, "subdivision_id": {"type": "text", "index": 18, "name": "subdivision_id", "comment": null}, "medical_area_id": {"type": "text", "index": 19, "name": "medical_area_id", "comment": null}, "nursing_zone_id": {"type": "text", "index": 20, "name": "nursing_zone_id", "comment": null}, "settlement_id": {"type": "text", "index": 21, "name": "settlement_id", "comment": null}, "city_town": {"type": "text", "index": 22, "name": "city_town", "comment": null}, "street_village": {"type": "text", "index": 23, "name": "street_village", "comment": null}, "country_of_birth_id": {"type": "text", "index": 24, "name": "country_of_birth_id", "comment": null}, "place_of_birth": {"type": "text", "index": 25, "name": "place_of_birth", "comment": null}, "birth_certificate": {"type": "text", "index": 26, "name": "birth_certificate", "comment": null}, "driving_license": {"type": "text", "index": 27, "name": "driving_license", "comment": null}, "passport": {"type": "text", "index": 28, "name": "passport", "comment": null}, "educational_level": {"type": "text", "index": 29, "name": "educational_level", "comment": null}, "occupation_id": {"type": "text", "index": 30, "name": "occupation_id", "comment": null}, "blood_type": {"type": "text", "index": 31, "name": "blood_type", "comment": null}, "patient_billing_type_id": {"type": "text", "index": 32, "name": "patient_billing_type_id", "comment": null}, "health_center_id": {"type": "text", "index": 33, "name": "health_center_id", "comment": null}, "insurer_id": {"type": "text", "index": 34, "name": "insurer_id", "comment": null}, "insurer_policy_number": {"type": "text", "index": 35, "name": "insurer_policy_number", "comment": null}, "mother_id": {"type": "text", "index": 36, "name": "mother_id", "comment": null}, "father_id": {"type": "text", "index": 37, "name": "father_id", "comment": null}, "registered_by_id": {"type": "text", "index": 38, "name": "registered_by_id", "comment": null}, "updated_by_field": {"type": "jsonb", "index": 39, "name": "updated_by_field", "comment": null}, "registration_date": {"type": "date", "index": 40, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_additional_data_change_logs"}, "model.tamanu_source_dbt.patient_allergies": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_allergies", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "allergy_id": {"type": "character varying(255)", "index": 3, "name": "allergy_id", "comment": null}, "recorded_date": {"type": "date", "index": 4, "name": "recorded_date", "comment": null}, "recorded_by": {"type": "character varying(255)", "index": 5, "name": "recorded_by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_allergies"}, "model.tamanu_source_dbt.patient_birth_data": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_birth_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "birth_time": {"type": "time without time zone", "index": 2, "name": "birth_time", "comment": null}, "gestational_age_estimate": {"type": "double precision", "index": 3, "name": "gestational_age_estimate", "comment": null}, "attendant_at_birth": {"type": "character varying(255)", "index": 4, "name": "attendant_at_birth", "comment": null}, "name_of_attendant_at_birth": {"type": "character varying(255)", "index": 5, "name": "name_of_attendant_at_birth", "comment": null}, "birth_type": {"type": "character varying(255)", "index": 6, "name": "birth_type", "comment": null}, "birth_delivery_type": {"type": "character varying(255)", "index": 7, "name": "birth_delivery_type", "comment": null}, "birth_weight": {"type": "numeric", "index": 8, "name": "birth_weight", "comment": null}, "birth_length": {"type": "numeric", "index": 9, "name": "birth_length", "comment": null}, "apgar_score_one_minute": {"type": "integer", "index": 10, "name": "apgar_score_one_minute", "comment": null}, "apgar_score_five_minutes": {"type": "integer", "index": 11, "name": "apgar_score_five_minutes", "comment": null}, "apgar_score_ten_minutes": {"type": "integer", "index": 12, "name": "apgar_score_ten_minutes", "comment": null}, "registered_birth_place": {"type": "character varying(255)", "index": 13, "name": "registered_birth_place", "comment": null}, "birth_facility_id": {"type": "character varying(255)", "index": 14, "name": "birth_facility_id", "comment": null}, "registration_date": {"type": "date", "index": 15, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_birth_data"}, "model.tamanu_source_dbt.patient_care_plans": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_care_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "care_plan_datetime": {"type": "timestamp without time zone", "index": 2, "name": "care_plan_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 4, "name": "clinician_id", "comment": null}, "care_plan_id": {"type": "character varying(255)", "index": 5, "name": "care_plan_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_care_plans"}, "model.tamanu_source_dbt.patient_conditions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "recorded_datetime": {"type": "timestamp without time zone", "index": 2, "name": "recorded_datetime", "comment": null}, "note": {"type": "character varying(255)", "index": 3, "name": "note", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 4, "name": "condition_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 5, "name": "patient_id", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 6, "name": "recorded_by_id", "comment": null}, "is_resolved": {"type": "boolean", "index": 7, "name": "is_resolved", "comment": null}, "resolved_datetime": {"type": "timestamp without time zone", "index": 8, "name": "resolved_datetime", "comment": null}, "resolved_by_id": {"type": "character varying(255)", "index": 9, "name": "resolved_by_id", "comment": null}, "resolution_note": {"type": "text", "index": 10, "name": "resolution_note", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_conditions"}, "model.tamanu_source_dbt.patient_death_contributing_causes": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_death_contributing_causes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "mins_after_onset": {"type": "integer", "index": 2, "name": "mins_after_onset", "comment": null}, "patient_death_data_id": {"type": "character varying(255)", "index": 3, "name": "patient_death_data_id", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 4, "name": "condition_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_death_contributing_causes"}, "model.tamanu_source_dbt.patient_death_data": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_death_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "manner": {"type": "character varying(255)", "index": 2, "name": "manner", "comment": null}, "had_recent_surgery": {"type": "character varying(255)", "index": 3, "name": "had_recent_surgery", "comment": null}, "last_surgery_date": {"type": "date", "index": 4, "name": "last_surgery_date", "comment": null}, "last_surgery_reason_id": {"type": "character varying(255)", "index": 5, "name": "last_surgery_reason_id", "comment": null}, "external_cause_date": {"type": "date", "index": 6, "name": "external_cause_date", "comment": null}, "external_cause_location": {"type": "character varying(255)", "index": 7, "name": "external_cause_location", "comment": null}, "external_cause_notes": {"type": "text", "index": 8, "name": "external_cause_notes", "comment": null}, "was_pregnant": {"type": "character varying(255)", "index": 9, "name": "was_pregnant", "comment": null}, "pregnancy_contributed": {"type": "character varying(255)", "index": 10, "name": "pregnancy_contributed", "comment": null}, "was_fetal_or_infant": {"type": "boolean", "index": 11, "name": "was_fetal_or_infant", "comment": null}, "was_stillborn": {"type": "character varying(255)", "index": 12, "name": "was_stillborn", "comment": null}, "birth_weight": {"type": "integer", "index": 13, "name": "birth_weight", "comment": null}, "was_within_day_of_birth": {"type": "boolean", "index": 14, "name": "was_within_day_of_birth", "comment": null}, "hours_survived_since_birth": {"type": "integer", "index": 15, "name": "hours_survived_since_birth", "comment": null}, "carrier_age": {"type": "integer", "index": 16, "name": "carrier_age", "comment": null}, "carrier_pregnancy_weeks": {"type": "integer", "index": 17, "name": "carrier_pregnancy_weeks", "comment": null}, "was_outside_health_facility": {"type": "boolean", "index": 18, "name": "was_outside_health_facility", "comment": null}, "primary_cause_mins_after_onset": {"type": "integer", "index": 19, "name": "primary_cause_mins_after_onset", "comment": null}, "primary_cause_condition_id": {"type": "character varying(255)", "index": 20, "name": "primary_cause_condition_id", "comment": null}, "antecedent_cause1_mins_after_onset": {"type": "integer", "index": 21, "name": "antecedent_cause1_mins_after_onset", "comment": null}, "antecedent_cause1_condition_id": {"type": "character varying(255)", "index": 22, "name": "antecedent_cause1_condition_id", "comment": null}, "antecedent_cause2_mins_after_onset": {"type": "integer", "index": 23, "name": "antecedent_cause2_mins_after_onset", "comment": null}, "antecedent_cause2_condition_id": {"type": "character varying(255)", "index": 24, "name": "antecedent_cause2_condition_id", "comment": null}, "antecedent_cause3_mins_after_onset": {"type": "integer", "index": 25, "name": "antecedent_cause3_mins_after_onset", "comment": null}, "antecedent_cause3_condition_id": {"type": "character varying(255)", "index": 26, "name": "antecedent_cause3_condition_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 27, "name": "patient_id", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 28, "name": "recorded_by_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 29, "name": "facility_id", "comment": null}, "is_final": {"type": "boolean", "index": 30, "name": "is_final", "comment": null}, "visibility_status": {"type": "text", "index": 31, "name": "visibility_status", "comment": null}, "autopsy_requested": {"type": "character varying(255)", "index": 32, "name": "autopsy_requested", "comment": null}, "autopsy_findings_used": {"type": "character varying(255)", "index": 33, "name": "autopsy_findings_used", "comment": null}, "manner_of_death_description": {"type": "text", "index": 34, "name": "manner_of_death_description", "comment": null}, "pregnancy_moment": {"type": "character varying(255)", "index": 35, "name": "pregnancy_moment", "comment": null}, "multiple_pregnancy": {"type": "character varying(255)", "index": 36, "name": "multiple_pregnancy", "comment": null}, "mother_condition_description": {"type": "text", "index": 37, "name": "mother_condition_description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_death_data"}, "model.tamanu_source_dbt.patient_facilities": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_facilities"}, "model.tamanu_source_dbt.patient_family_histories": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_family_histories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "recorded_datetime": {"type": "timestamp without time zone", "index": 2, "name": "recorded_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 4, "name": "clinician_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 5, "name": "diagnosis_id", "comment": null}, "relationship": {"type": "character varying(255)", "index": 6, "name": "relationship", "comment": null}, "note": {"type": "character varying(255)", "index": 7, "name": "note", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_family_histories"}, "model.tamanu_source_dbt.patient_field_values": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_field_values", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "definition_id": {"type": "character varying(255)", "index": 2, "name": "definition_id", "comment": null}, "value": {"type": "text", "index": 3, "name": "value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_field_values"}, "model.tamanu_source_dbt.patient_program_registration_conditions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_program_registration_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "program_registry_condition_id": {"type": "character varying(255)", "index": 3, "name": "program_registry_condition_id", "comment": null}, "patient_program_registration_id": {"type": "text", "index": 4, "name": "patient_program_registration_id", "comment": null}, "program_registry_condition_category_id": {"type": "text", "index": 5, "name": "program_registry_condition_category_id", "comment": null}, "reason_for_change": {"type": "character varying(255)", "index": 6, "name": "reason_for_change", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 7, "name": "recorded_by_id", "comment": null}, "deleted_datetime": {"type": "timestamp without time zone", "index": 8, "name": "deleted_datetime", "comment": null}, "deleted_by_id": {"type": "character varying(255)", "index": 9, "name": "deleted_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_program_registration_conditions"}, "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_program_registration_conditions_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 2, "name": "logged_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 3, "name": "updated_by_user_id", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 5, "name": "datetime", "comment": null}, "program_registry_condition_id": {"type": "text", "index": 6, "name": "program_registry_condition_id", "comment": null}, "patient_program_registration_id": {"type": "text", "index": 7, "name": "patient_program_registration_id", "comment": null}, "program_registry_condition_category_id": {"type": "text", "index": 8, "name": "program_registry_condition_category_id", "comment": null}, "reason_for_change": {"type": "text", "index": 9, "name": "reason_for_change", "comment": null}, "recorded_by_id": {"type": "text", "index": 10, "name": "recorded_by_id", "comment": null}, "deleted_datetime": {"type": "timestamp without time zone", "index": 11, "name": "deleted_datetime", "comment": null}, "deleted_by_id": {"type": "text", "index": 12, "name": "deleted_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs"}, "model.tamanu_source_dbt.patient_program_registrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_program_registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "registration_status": {"type": "text", "index": 3, "name": "registration_status", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 5, "name": "program_registry_id", "comment": null}, "clinical_status_id": {"type": "character varying(255)", "index": 6, "name": "clinical_status_id", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 7, "name": "registered_by_id", "comment": null}, "registering_facility_id": {"type": "character varying(255)", "index": 8, "name": "registering_facility_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 9, "name": "facility_id", "comment": null}, "village_id": {"type": "character varying(255)", "index": 10, "name": "village_id", "comment": null}, "deactivated_by_id": {"type": "character varying(255)", "index": 11, "name": "deactivated_by_id", "comment": null}, "deactivated_datetime": {"type": "timestamp without time zone", "index": 12, "name": "deactivated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_program_registrations"}, "model.tamanu_source_dbt.patient_program_registrations_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_program_registrations_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 2, "name": "logged_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 3, "name": "updated_by_user_id", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 5, "name": "datetime", "comment": null}, "registration_status": {"type": "text", "index": 6, "name": "registration_status", "comment": null}, "patient_id": {"type": "text", "index": 7, "name": "patient_id", "comment": null}, "program_registry_id": {"type": "text", "index": 8, "name": "program_registry_id", "comment": null}, "clinical_status_id": {"type": "text", "index": 9, "name": "clinical_status_id", "comment": null}, "registered_by_id": {"type": "text", "index": 10, "name": "registered_by_id", "comment": null}, "registering_facility_id": {"type": "text", "index": 11, "name": "registering_facility_id", "comment": null}, "facility_id": {"type": "text", "index": 12, "name": "facility_id", "comment": null}, "village_id": {"type": "text", "index": 13, "name": "village_id", "comment": null}, "deactivated_by_id": {"type": "text", "index": 14, "name": "deactivated_by_id", "comment": null}, "deactivated_datetime": {"type": "timestamp without time zone", "index": 15, "name": "deactivated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_program_registrations_change_logs"}, "model.tamanu_source_dbt.patient_vaccinations_upcoming": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_vaccinations_upcoming", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "vaccine_schedules_id": {"type": "character varying(255)", "index": 2, "name": "vaccine_schedules_id", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 3, "name": "vaccine_category", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 4, "name": "vaccine_id", "comment": null}, "due_date": {"type": "date", "index": 5, "name": "due_date", "comment": null}, "days_till_due": {"type": "integer", "index": 6, "name": "days_till_due", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_vaccinations_upcoming"}, "model.tamanu_source_dbt.patients": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}, "display_id": {"type": "character varying(255)", "index": 4, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 5, "name": "first_name", "comment": null}, "middle_name": {"type": "character varying(255)", "index": 6, "name": "middle_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "cultural_name": {"type": "character varying(255)", "index": 8, "name": "cultural_name", "comment": null}, "email": {"type": "character varying(255)", "index": 9, "name": "email", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "date_of_birth": {"type": "date", "index": 11, "name": "date_of_birth", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 12, "name": "date_of_death", "comment": null}, "village_id": {"type": "character varying(255)", "index": 13, "name": "village_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients"}, "model.tamanu_source_dbt.patients_access_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients_access_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": null}, "patient_id": {"type": "text", "index": 3, "name": "patient_id", "comment": null}, "facility_id": {"type": "text", "index": 4, "name": "facility_id", "comment": null}, "logged_at": {"type": "timestamp without time zone", "index": 5, "name": "logged_at", "comment": null}, "session_id": {"type": "text", "index": 6, "name": "session_id", "comment": null}, "device_id": {"type": "text", "index": 7, "name": "device_id", "comment": null}, "is_mobile": {"type": "boolean", "index": 8, "name": "is_mobile", "comment": null}, "version": {"type": "text", "index": 9, "name": "version", "comment": null}, "front_end_context": {"type": "jsonb", "index": 10, "name": "front_end_context", "comment": null}, "back_end_context": {"type": "jsonb", "index": 11, "name": "back_end_context", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients_access_logs"}, "model.tamanu_source_dbt.patients_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp without time zone", "index": 2, "name": "logged_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 3, "name": "updated_by_user_id", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "display_id": {"type": "text", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "text", "index": 6, "name": "first_name", "comment": null}, "middle_name": {"type": "text", "index": 7, "name": "middle_name", "comment": null}, "last_name": {"type": "text", "index": 8, "name": "last_name", "comment": null}, "cultural_name": {"type": "text", "index": 9, "name": "cultural_name", "comment": null}, "email": {"type": "text", "index": 10, "name": "email", "comment": null}, "sex": {"type": "text", "index": 11, "name": "sex", "comment": null}, "date_of_birth": {"type": "date", "index": 12, "name": "date_of_birth", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 13, "name": "date_of_death", "comment": null}, "village_id": {"type": "text", "index": 14, "name": "village_id", "comment": null}, "registration_date": {"type": "date", "index": 15, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients_change_logs"}, "model.tamanu_source_dbt.patients_merged": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients_merged", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "middle_name": {"type": "character varying(255)", "index": 4, "name": "middle_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 5, "name": "last_name", "comment": null}, "cultural_name": {"type": "character varying(255)", "index": 6, "name": "cultural_name", "comment": null}, "email": {"type": "character varying(255)", "index": 7, "name": "email", "comment": null}, "sex": {"type": "text", "index": 8, "name": "sex", "comment": null}, "date_of_birth": {"type": "date", "index": 9, "name": "date_of_birth", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 10, "name": "date_of_death", "comment": null}, "village_id": {"type": "character varying(255)", "index": 11, "name": "village_id", "comment": null}, "registration_date": {"type": "date", "index": 12, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients_merged"}, "model.tamanu_source_dbt.patients_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients_metadata"}, "model.tamanu_source_dbt.pharmacy_order_prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "pharmacy_order_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "pharmacy_order_id": {"type": "uuid", "index": 2, "name": "pharmacy_order_id", "comment": null}, "prescription_id": {"type": "text", "index": 3, "name": "prescription_id", "comment": null}, "ongoing_prescription_id": {"type": "text", "index": 4, "name": "ongoing_prescription_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "quantity": {"type": "integer", "index": 6, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 7, "name": "repeats", "comment": null}, "is_completed": {"type": "boolean", "index": 8, "name": "is_completed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.pharmacy_order_prescriptions"}, "model.tamanu_source_dbt.pharmacy_orders": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "pharmacy_orders", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "text", "index": 2, "name": "encounter_id", "comment": null}, "ordering_clinician_id": {"type": "text", "index": 3, "name": "ordering_clinician_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "is_discharge_prescription": {"type": "boolean", "index": 5, "name": "is_discharge_prescription", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 6, "name": "datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.pharmacy_orders"}, "model.tamanu_source_dbt.prescription-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "prescription-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Prescription date": {"type": "text", "index": 1, "name": "Prescription date", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 2, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 4, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 5, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 8, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 9, "name": "Facility", "comment": null}, "Prescription selected for discharge": {"type": "boolean", "index": 10, "name": "Prescription selected for discharge", "comment": null}, "Code": {"type": "character varying(255)", "index": 11, "name": "Code", "comment": null}, "Medication": {"type": "text", "index": 12, "name": "Medication", "comment": null}, "Route": {"type": "character varying(255)", "index": 13, "name": "Route", "comment": null}, "Quantity": {"type": "integer", "index": 14, "name": "Quantity", "comment": null}, "Repeats": {"type": "integer", "index": 15, "name": "Repeats", "comment": null}, "Is ongoing": {"type": "boolean", "index": 16, "name": "Is ongoing", "comment": null}, "Is PRN": {"type": "boolean", "index": 17, "name": "Is PRN", "comment": null}, "Is variable dose": {"type": "boolean", "index": 18, "name": "Is variable dose", "comment": null}, "Dose amount": {"type": "numeric", "index": 19, "name": "Dose amount", "comment": null}, "Units": {"type": "character varying(255)", "index": 20, "name": "Units", "comment": null}, "Frequency": {"type": "character varying(255)", "index": 21, "name": "Frequency", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.prescription-line-list"}, "model.tamanu_source_dbt.prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 3, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 4, "name": "end_datetime", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 5, "name": "medication_id", "comment": null}, "prescriber_id": {"type": "character varying(255)", "index": 6, "name": "prescriber_id", "comment": null}, "indication": {"type": "character varying(255)", "index": 7, "name": "indication", "comment": null}, "route": {"type": "character varying(255)", "index": 8, "name": "route", "comment": null}, "quantity": {"type": "integer", "index": 9, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 10, "name": "repeats", "comment": null}, "is_ongoing": {"type": "boolean", "index": 11, "name": "is_ongoing", "comment": null}, "is_prn": {"type": "boolean", "index": 12, "name": "is_prn", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 13, "name": "is_variable_dose", "comment": null}, "dose_amount": {"type": "numeric", "index": 14, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 15, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 16, "name": "frequency", "comment": null}, "duration_value": {"type": "numeric", "index": 17, "name": "duration_value", "comment": null}, "duration_unit": {"type": "character varying(255)", "index": 18, "name": "duration_unit", "comment": null}, "is_phone_order": {"type": "boolean", "index": 19, "name": "is_phone_order", "comment": null}, "ideal_times": {"type": "character varying(255)[]", "index": 20, "name": "ideal_times", "comment": null}, "is_discontinued": {"type": "boolean", "index": 21, "name": "is_discontinued", "comment": null}, "discontinued_by_id": {"type": "character varying(255)", "index": 22, "name": "discontinued_by_id", "comment": null}, "discontinuing_reason": {"type": "character varying(255)", "index": 23, "name": "discontinuing_reason", "comment": null}, "discontinued_datetime": {"type": "timestamp without time zone", "index": 24, "name": "discontinued_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.prescriptions"}, "model.tamanu_source_dbt.procedures": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "procedures", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "date": {"type": "date", "index": 2, "name": "date", "comment": null}, "start_time": {"type": "time without time zone", "index": 3, "name": "start_time", "comment": null}, "end_time": {"type": "time without time zone", "index": 4, "name": "end_time", "comment": null}, "is_completed": {"type": "boolean", "index": 5, "name": "is_completed", "comment": null}, "note": {"type": "text", "index": 6, "name": "note", "comment": null}, "completed_note": {"type": "text", "index": 7, "name": "completed_note", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 8, "name": "encounter_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 9, "name": "location_id", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 10, "name": "procedure_type_id", "comment": null}, "anaesthetic_id": {"type": "character varying(255)", "index": 11, "name": "anaesthetic_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 12, "name": "clinician_id", "comment": null}, "anaesthetist_id": {"type": "character varying(255)", "index": 13, "name": "anaesthetist_id", "comment": null}, "assistant_anaesthetist_id": {"type": "character varying(255)", "index": 14, "name": "assistant_anaesthetist_id", "comment": null}, "time_in": {"type": "time without time zone", "index": 15, "name": "time_in", "comment": null}, "time_out": {"type": "time without time zone", "index": 16, "name": "time_out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.procedures"}, "model.tamanu_source_dbt.procedures-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "procedures-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Nationality": {"type": "text", "index": 7, "name": "Nationality", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Type": {"type": "text", "index": 10, "name": "Type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 11, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 12, "name": "Encounter end date and time", "comment": null}, "Procedure facility": {"type": "character varying(255)", "index": 13, "name": "Procedure facility", "comment": null}, "Procedure area": {"type": "character varying(255)", "index": 14, "name": "Procedure area", "comment": null}, "Procedure location": {"type": "character varying(255)", "index": 15, "name": "Procedure location", "comment": null}, "Procedure": {"type": "text", "index": 16, "name": "Procedure", "comment": null}, "Procedure date": {"type": "text", "index": 17, "name": "Procedure date", "comment": null}, "Procedure start (date and time)": {"type": "text", "index": 18, "name": "Procedure start (date and time)", "comment": null}, "Procedure end (date and time)": {"type": "text", "index": 19, "name": "Procedure end (date and time)", "comment": null}, "Procedure duration": {"type": "text", "index": 20, "name": "Procedure duration", "comment": null}, "Procedure clinician": {"type": "character varying(255)", "index": 21, "name": "Procedure clinician", "comment": null}, "Procedure anaesthetist": {"type": "character varying(255)", "index": 22, "name": "Procedure anaesthetist", "comment": null}, "Procedure assistant anesthetist": {"type": "character varying(255)", "index": 23, "name": "Procedure assistant anesthetist", "comment": null}, "Procedure marked as completed": {"type": "text", "index": 24, "name": "Procedure marked as completed", "comment": null}, "Procedure time in": {"type": "time without time zone", "index": 25, "name": "Procedure time in", "comment": null}, "Procedure time out": {"type": "time without time zone", "index": 26, "name": "Procedure time out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.procedures-line-list"}, "model.tamanu_source_dbt.procedures_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "procedures_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.procedures_metadata"}, "model.tamanu_source_dbt.program-registry-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program-registry-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Registering facility": {"type": "character varying(255)", "index": 7, "name": "Registering facility", "comment": null}, "Sub-division": {"type": "text", "index": 8, "name": "Sub-division", "comment": null}, "Division": {"type": "text", "index": 9, "name": "Division", "comment": null}, "Registered by": {"type": "character varying(255)", "index": 10, "name": "Registered by", "comment": null}, "Currently at": {"type": "character varying", "index": 11, "name": "Currently at", "comment": null}, "Related conditions": {"type": "text", "index": 12, "name": "Related conditions", "comment": null}, "Related condition categories": {"type": "text", "index": 13, "name": "Related condition categories", "comment": null}, "Status": {"type": "text", "index": 14, "name": "Status", "comment": null}, "Date of registration": {"type": "text", "index": 15, "name": "Date of registration", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program-registry-line-list"}, "model.tamanu_source_dbt.program-registry-removed-patients-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program-registry-removed-patients-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Registering facility": {"type": "character varying(255)", "index": 7, "name": "Registering facility", "comment": null}, "Registered by": {"type": "character varying(255)", "index": 8, "name": "Registered by", "comment": null}, "Currently at": {"type": "character varying", "index": 9, "name": "Currently at", "comment": null}, "Related conditions": {"type": "text", "index": 10, "name": "Related conditions", "comment": null}, "Related condition categories": {"type": "text", "index": 11, "name": "Related condition categories", "comment": null}, "Status": {"type": "text", "index": 12, "name": "Status", "comment": null}, "Date of registration": {"type": "text", "index": 13, "name": "Date of registration", "comment": null}, "Date of deactivation": {"type": "text", "index": 14, "name": "Date of deactivation", "comment": null}, "Deactivated by": {"type": "character varying(255)", "index": 15, "name": "Deactivated by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program-registry-removed-patients-line-list"}, "model.tamanu_source_dbt.program_data_elements": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_data_elements", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "type": {"type": "character varying(31)", "index": 4, "name": "type", "comment": null}, "indicator": {"type": "character varying(255)", "index": 5, "name": "indicator", "comment": null}, "default_text": {"type": "character varying(255)", "index": 6, "name": "default_text", "comment": null}, "default_options": {"type": "text", "index": 7, "name": "default_options", "comment": null}, "visualisation_config": {"type": "text", "index": 8, "name": "visualisation_config", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_data_elements"}, "model.tamanu_source_dbt.program_registries": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_registries", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "text", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "currently_at_type": {"type": "text", "index": 4, "name": "currently_at_type", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}, "program_id": {"type": "character varying(255)", "index": 6, "name": "program_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_registries"}, "model.tamanu_source_dbt.program_registry_clinical_statuses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_registry_clinical_statuses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "text", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "color": {"type": "text", "index": 4, "name": "color", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 6, "name": "program_registry_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_registry_clinical_statuses"}, "model.tamanu_source_dbt.program_registry_condition_categories": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_registry_condition_categories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "code": {"type": "text", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 4, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 5, "name": "program_registry_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_registry_condition_categories"}, "model.tamanu_source_dbt.program_registry_conditions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_registry_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "text", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 4, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 5, "name": "program_registry_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_registry_conditions"}, "model.tamanu_source_dbt.programs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "programs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.programs"}, "model.tamanu_source_dbt.recent-diagnoses-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "recent-diagnoses-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date & time": {"type": "text", "index": 1, "name": "Date & time", "comment": null}, "Diagnoses": {"type": "text", "index": 2, "name": "Diagnoses", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 4, "name": "Last name", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 5, "name": "Patient ID", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Primary contact number": {"type": "character varying(255)", "index": 8, "name": "Primary contact number", "comment": null}, "Village": {"type": "text", "index": 9, "name": "Village", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 10, "name": "Clinician", "comment": null}, "Department": {"type": "character varying(255)", "index": 11, "name": "Department", "comment": null}, "Certainty": {"type": "text", "index": 12, "name": "Certainty", "comment": null}, "Is primary": {"type": "text", "index": 13, "name": "Is primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.recent-diagnoses-line-list"}, "model.tamanu_source_dbt.reference_data": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "reference_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "type": {"type": "character varying(255)", "index": 4, "name": "type", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.reference_data"}, "model.tamanu_source_dbt.referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "status": {"type": "character varying(255)", "index": 2, "name": "status", "comment": null}, "referred_facility": {"type": "character varying(255)", "index": 3, "name": "referred_facility", "comment": null}, "initiating_encounter_id": {"type": "character varying(255)", "index": 4, "name": "initiating_encounter_id", "comment": null}, "survey_response_id": {"type": "character varying(255)", "index": 5, "name": "survey_response_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.referrals"}, "model.tamanu_source_dbt.refresh_tokens": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "refresh_tokens", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "device_id": {"type": "text", "index": 2, "name": "device_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 3, "name": "user_id", "comment": null}, "expires_at": {"type": "timestamp with time zone", "index": 4, "name": "expires_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.refresh_tokens"}, "model.tamanu_source_dbt.registered-births-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "registered-births-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "text", "index": 1, "name": "Registration date", "comment": null}, "Registered by": {"type": "character varying", "index": 2, "name": "Registered by", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 4, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 5, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 6, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 8, "name": "Ethnicity", "comment": null}, "Nationality": {"type": "text", "index": 9, "name": "Nationality", "comment": null}, "Village": {"type": "text", "index": 10, "name": "Village", "comment": null}, "Mother": {"type": "text", "index": 11, "name": "Mother", "comment": null}, "Father": {"type": "text", "index": 12, "name": "Father", "comment": null}, "Time of birth": {"type": "text", "index": 13, "name": "Time of birth", "comment": null}, "Gestational age (weeks)": {"type": "double precision", "index": 14, "name": "Gestational age (weeks)", "comment": null}, "Place of birth": {"type": "character varying", "index": 15, "name": "Place of birth", "comment": null}, "Name of health facility (if selected)": {"type": "character varying(255)", "index": 16, "name": "Name of health facility (if selected)", "comment": null}, "Attendant at birth": {"type": "character varying", "index": 17, "name": "Attendant at birth", "comment": null}, "Name of attendant": {"type": "character varying(255)", "index": 18, "name": "Name of attendant", "comment": null}, "Delivery type": {"type": "character varying", "index": 19, "name": "Delivery type", "comment": null}, "Single/Plural birth": {"type": "text", "index": 20, "name": "Single/Plural birth", "comment": null}, "Birth weight (kg)": {"type": "numeric", "index": 21, "name": "Birth weight (kg)", "comment": null}, "Birth length (cm)": {"type": "numeric", "index": 22, "name": "Birth length (cm)", "comment": null}, "Apgar score at 1 min": {"type": "integer", "index": 23, "name": "Apgar score at 1 min", "comment": null}, "Apgar score at 5 min": {"type": "integer", "index": 24, "name": "Apgar score at 5 min", "comment": null}, "Apgar score at 10 min": {"type": "integer", "index": 25, "name": "Apgar score at 10 min", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.registered-births-line-list"}, "model.tamanu_source_dbt.registered-patients-by-dob-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "registered-patients-by-dob-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "text", "index": 1, "name": "Registration date", "comment": null}, "Registered by": {"type": "character varying(255)", "index": 2, "name": "Registered by", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Middle name": {"type": "character varying(255)", "index": 4, "name": "Middle name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 5, "name": "Last name", "comment": null}, "Cultural name": {"type": "character varying(255)", "index": 6, "name": "Cultural name", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 7, "name": "Patient ID", "comment": null}, "Sex": {"type": "text", "index": 8, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 9, "name": "Village", "comment": null}, "Date of birth": {"type": "text", "index": 10, "name": "Date of birth", "comment": null}, "Registration type": {"type": "text", "index": 11, "name": "Registration type", "comment": null}, "Birth certificate": {"type": "character varying(255)", "index": 12, "name": "Birth certificate", "comment": null}, "Driving license": {"type": "character varying(255)", "index": 13, "name": "Driving license", "comment": null}, "Passport": {"type": "character varying(255)", "index": 14, "name": "Passport", "comment": null}, "Blood type": {"type": "character varying(255)", "index": 15, "name": "Blood type", "comment": null}, "Title": {"type": "character varying(255)", "index": 16, "name": "Title", "comment": null}, "Marital status": {"type": "character varying(255)", "index": 17, "name": "Marital status", "comment": null}, "Primary contact number": {"type": "character varying(255)", "index": 18, "name": "Primary contact number", "comment": null}, "Secondary contact number": {"type": "character varying(255)", "index": 19, "name": "Secondary contact number", "comment": null}, "Country of birth": {"type": "text", "index": 20, "name": "Country of birth", "comment": null}, "Nationality": {"type": "text", "index": 21, "name": "Nationality", "comment": null}, "Ethnicity": {"type": "text", "index": 22, "name": "Ethnicity", "comment": null}, "Occupation": {"type": "text", "index": 23, "name": "Occupation", "comment": null}, "Religion": {"type": "text", "index": 24, "name": "Religion", "comment": null}, "Billing type": {"type": "text", "index": 25, "name": "Billing type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.registered-patients-by-dob-line-list"}, "model.tamanu_source_dbt.registered-patients-daily-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "registered-patients-daily-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "text", "index": 1, "name": "Registration date", "comment": null}, "Total patients (male)": {"type": "bigint", "index": 2, "name": "Total patients (male)", "comment": null}, "Total patients (female)": {"type": "bigint", "index": 3, "name": "Total patients (female)", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.registered-patients-daily-summary"}, "model.tamanu_source_dbt.registered-patients-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "registered-patients-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "text", "index": 1, "name": "Registration date", "comment": null}, "Registered by": {"type": "character varying(255)", "index": 2, "name": "Registered by", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Middle name": {"type": "character varying(255)", "index": 4, "name": "Middle name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 5, "name": "Last name", "comment": null}, "Cultural name": {"type": "character varying(255)", "index": 6, "name": "Cultural name", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 7, "name": "Patient ID", "comment": null}, "Sex": {"type": "text", "index": 8, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 9, "name": "Village", "comment": null}, "Date of birth": {"type": "text", "index": 10, "name": "Date of birth", "comment": null}, "Birth certificate": {"type": "character varying(255)", "index": 11, "name": "Birth certificate", "comment": null}, "Driving license": {"type": "character varying(255)", "index": 12, "name": "Driving license", "comment": null}, "Passport": {"type": "character varying(255)", "index": 13, "name": "Passport", "comment": null}, "Blood type": {"type": "character varying(255)", "index": 14, "name": "Blood type", "comment": null}, "Title": {"type": "character varying(255)", "index": 15, "name": "Title", "comment": null}, "Marital status": {"type": "character varying(255)", "index": 16, "name": "Marital status", "comment": null}, "Primary contact number": {"type": "character varying(255)", "index": 17, "name": "Primary contact number", "comment": null}, "Secondary contact number": {"type": "character varying(255)", "index": 18, "name": "Secondary contact number", "comment": null}, "Country of birth": {"type": "text", "index": 19, "name": "Country of birth", "comment": null}, "Nationality": {"type": "text", "index": 20, "name": "Nationality", "comment": null}, "Ethnicity": {"type": "text", "index": 21, "name": "Ethnicity", "comment": null}, "Occupation": {"type": "text", "index": 22, "name": "Occupation", "comment": null}, "Religion": {"type": "text", "index": 23, "name": "Religion", "comment": null}, "Billing type": {"type": "text", "index": 24, "name": "Billing type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.registered-patients-line-list"}, "model.tamanu_source_dbt.roles": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "roles", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "character varying(255)", "index": 2, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.roles"}, "model.tamanu_source_dbt.sensitive-admissions-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-admissions-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Admitting clinician": {"type": "character varying", "index": 9, "name": "Admitting clinician", "comment": null}, "Admission date and time": {"type": "text", "index": 10, "name": "Admission date and time", "comment": null}, "Admission status": {"type": "text", "index": 11, "name": "Admission status", "comment": null}, "Discharge date and time": {"type": "text", "index": 12, "name": "Discharge date and time", "comment": null}, "Facility": {"type": "character varying(255)", "index": 13, "name": "Facility", "comment": null}, "Department history": {"type": "text", "index": 14, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 15, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 16, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 17, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 18, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 19, "name": "Location history date and times", "comment": null}, "Primary diagnoses": {"type": "text", "index": 20, "name": "Primary diagnoses", "comment": null}, "Secondary diagnoses": {"type": "text", "index": 21, "name": "Secondary diagnoses", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-admissions-line-list"}, "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-audit-outpatient-appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Change number": {"type": "bigint", "index": 5, "name": "Change number", "comment": null}, "Appointment date and time": {"type": "text", "index": 6, "name": "Appointment date and time", "comment": null}, "Appointment type": {"type": "text", "index": 7, "name": "Appointment type", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 8, "name": "Clinician", "comment": null}, "Area": {"type": "character varying(255)", "index": 9, "name": "Area", "comment": null}, "Priority appointment": {"type": "text", "index": 10, "name": "Priority appointment", "comment": null}, "Repeating appointment": {"type": "text", "index": 11, "name": "Repeating appointment", "comment": null}, "Appointment created by": {"type": "character varying(255)", "index": 12, "name": "Appointment created by", "comment": null}, "Appointment modified by": {"type": "character varying(255)", "index": 13, "name": "Appointment modified by", "comment": null}, "Appointment modified date & time": {"type": "text", "index": 14, "name": "Appointment modified date & time", "comment": null}, "Appointment cancelled": {"type": "text", "index": 15, "name": "Appointment cancelled", "comment": null}, "Previous appointment date & time": {"type": "text", "index": 16, "name": "Previous appointment date & time", "comment": null}, "Previous appointment type": {"type": "text", "index": 17, "name": "Previous appointment type", "comment": null}, "Previous clinician": {"type": "character varying", "index": 18, "name": "Previous clinician", "comment": null}, "Previous area": {"type": "character varying", "index": 19, "name": "Previous area", "comment": null}, "Previous priority appointment": {"type": "text", "index": 20, "name": "Previous priority appointment", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments"}, "model.tamanu_source_dbt.sensitive-encounter-diets-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-encounter-diets-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Encounter start date": {"type": "text", "index": 1, "name": "Encounter start date", "comment": null}, "Encounter start time": {"type": "text", "index": 2, "name": "Encounter start time", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "Patient name": {"type": "text", "index": 4, "name": "Patient name", "comment": null}, "Age": {"type": "text", "index": 5, "name": "Age", "comment": null}, "Location": {"type": "text", "index": 6, "name": "Location", "comment": null}, "Diet": {"type": "text", "index": 7, "name": "Diet", "comment": null}, "Allergies": {"type": "text", "index": 8, "name": "Allergies", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-encounter-diets-line-list"}, "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-encounter-summary-by-end-date", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 7, "name": "Ethnicity", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 9, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 10, "name": "Encounter end date and time", "comment": null}, "Length of stay (days)": {"type": "integer", "index": 11, "name": "Length of stay (days)", "comment": null}, "Facility": {"type": "character varying(255)", "index": 12, "name": "Facility", "comment": null}, "Emergency encounter type": {"type": "text", "index": 13, "name": "Emergency encounter type", "comment": null}, "Inpatient encounter type": {"type": "text", "index": 14, "name": "Inpatient encounter type", "comment": null}, "Outpatient encounter type": {"type": "text", "index": 15, "name": "Outpatient encounter type", "comment": null}, "Discharge disposition": {"type": "text", "index": 16, "name": "Discharge disposition", "comment": null}, "Triage category": {"type": "text", "index": 17, "name": "Triage category", "comment": null}, "Arrival mode": {"type": "text", "index": 18, "name": "Arrival mode", "comment": null}, "Time seen following triage/Waiting time (hh:mm:ss)": {"type": "text", "index": 19, "name": "Time seen following triage/Waiting time (hh:mm:ss)", "comment": null}, "Clinician": {"type": "text", "index": 20, "name": "Clinician", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 21, "name": "Supervising clinician", "comment": null}, "Discharging department": {"type": "character varying(255)", "index": 22, "name": "Discharging department", "comment": null}, "Discharge date and time of Discharging department": {"type": "text", "index": 23, "name": "Discharge date and time of Discharging department", "comment": null}, "Discharging area": {"type": "character varying(255)", "index": 24, "name": "Discharging area", "comment": null}, "Discharge date and time of Discharging area": {"type": "text", "index": 25, "name": "Discharge date and time of Discharging area", "comment": null}, "Discharging location": {"type": "character varying(255)", "index": 26, "name": "Discharging location", "comment": null}, "Discharge date and time of Discharging location": {"type": "text", "index": 27, "name": "Discharge date and time of Discharging location", "comment": null}, "Department history": {"type": "text", "index": 28, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 29, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 30, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 31, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 32, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 33, "name": "Location history date and times", "comment": null}, "Reason for encounter": {"type": "text", "index": 34, "name": "Reason for encounter", "comment": null}, "Diagnoses": {"type": "text", "index": 35, "name": "Diagnoses", "comment": null}, "Medications": {"type": "text", "index": 36, "name": "Medications", "comment": null}, "Vaccinations": {"type": "text", "index": 37, "name": "Vaccinations", "comment": null}, "Procedures": {"type": "text", "index": 38, "name": "Procedures", "comment": null}, "Lab requests": {"type": "text", "index": 39, "name": "Lab requests", "comment": null}, "Imaging requests": {"type": "text", "index": 40, "name": "Imaging requests", "comment": null}, "Notes": {"type": "text", "index": 41, "name": "Notes", "comment": null}, "invoiceFinalisedDateTime": {"type": "text", "index": 42, "name": "invoiceFinalisedDateTime", "comment": null}, "invoiceProductCategories": {"type": "text", "index": 43, "name": "invoiceProductCategories", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date"}, "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-encounter-summary-by-start-date", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 7, "name": "Ethnicity", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 9, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 10, "name": "Encounter end date and time", "comment": null}, "Length of stay (days)": {"type": "integer", "index": 11, "name": "Length of stay (days)", "comment": null}, "Facility": {"type": "character varying(255)", "index": 12, "name": "Facility", "comment": null}, "Emergency encounter type": {"type": "text", "index": 13, "name": "Emergency encounter type", "comment": null}, "Inpatient encounter type": {"type": "text", "index": 14, "name": "Inpatient encounter type", "comment": null}, "Outpatient encounter type": {"type": "text", "index": 15, "name": "Outpatient encounter type", "comment": null}, "Discharge disposition": {"type": "text", "index": 16, "name": "Discharge disposition", "comment": null}, "Triage category": {"type": "text", "index": 17, "name": "Triage category", "comment": null}, "Arrival mode": {"type": "text", "index": 18, "name": "Arrival mode", "comment": null}, "Time seen following triage/Waiting time (hh:mm:ss)": {"type": "text", "index": 19, "name": "Time seen following triage/Waiting time (hh:mm:ss)", "comment": null}, "Clinician": {"type": "text", "index": 20, "name": "Clinician", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 21, "name": "Supervising clinician", "comment": null}, "Discharging department": {"type": "character varying(255)", "index": 22, "name": "Discharging department", "comment": null}, "Discharge date and time of Discharging department": {"type": "text", "index": 23, "name": "Discharge date and time of Discharging department", "comment": null}, "Discharging area": {"type": "character varying(255)", "index": 24, "name": "Discharging area", "comment": null}, "Discharge date and time of Discharging area": {"type": "text", "index": 25, "name": "Discharge date and time of Discharging area", "comment": null}, "Discharging location": {"type": "character varying(255)", "index": 26, "name": "Discharging location", "comment": null}, "Discharge date and time of Discharging location": {"type": "text", "index": 27, "name": "Discharge date and time of Discharging location", "comment": null}, "Department history": {"type": "text", "index": 28, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 29, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 30, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 31, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 32, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 33, "name": "Location history date and times", "comment": null}, "Reason for encounter": {"type": "text", "index": 34, "name": "Reason for encounter", "comment": null}, "Diagnoses": {"type": "text", "index": 35, "name": "Diagnoses", "comment": null}, "Medications": {"type": "text", "index": 36, "name": "Medications", "comment": null}, "Vaccinations": {"type": "text", "index": 37, "name": "Vaccinations", "comment": null}, "Procedures": {"type": "text", "index": 38, "name": "Procedures", "comment": null}, "Lab requests": {"type": "text", "index": 39, "name": "Lab requests", "comment": null}, "Imaging requests": {"type": "text", "index": 40, "name": "Imaging requests", "comment": null}, "Notes": {"type": "text", "index": 41, "name": "Notes", "comment": null}, "invoiceFinalisedDateTime": {"type": "text", "index": 42, "name": "invoiceFinalisedDateTime", "comment": null}, "invoiceProductCategories": {"type": "text", "index": 43, "name": "invoiceProductCategories", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"}, "model.tamanu_source_dbt.sensitive-imaging-requests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-imaging-requests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 10, "name": "Area", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 11, "name": "Request ID", "comment": null}, "Request date and time": {"type": "text", "index": 12, "name": "Request date and time", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 13, "name": "Supervising clinician", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 14, "name": "Requesting clinician", "comment": null}, "Priority": {"type": "character varying", "index": 15, "name": "Priority", "comment": null}, "Imaging type": {"type": "text", "index": 16, "name": "Imaging type", "comment": null}, "Area to be imaged": {"type": "text", "index": 17, "name": "Area to be imaged", "comment": null}, "Status": {"type": "text", "index": 18, "name": "Status", "comment": null}, "Completed date and time": {"type": "text", "index": 19, "name": "Completed date and time", "comment": null}, "Reason for cancellation": {"type": "text", "index": 20, "name": "Reason for cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-imaging-requests-line-list"}, "model.tamanu_source_dbt.sensitive-imaging-requests-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-imaging-requests-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date": {"type": "text", "index": 1, "name": "Date", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 3, "name": "Department", "comment": null}, "Imaging type": {"type": "text", "index": 4, "name": "Imaging type", "comment": null}, "Total new requests": {"type": "bigint", "index": 5, "name": "Total new requests", "comment": null}, "Total requests with a status of pending": {"type": "bigint", "index": 6, "name": "Total requests with a status of pending", "comment": null}, "Total requests completed": {"type": "bigint", "index": 7, "name": "Total requests completed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-imaging-requests-summary"}, "model.tamanu_source_dbt.sensitive-incomplete-referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-incomplete-referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Diagnoses": {"type": "text", "index": 4, "name": "Diagnoses", "comment": null}, "Referral name": {"type": "character varying(255)", "index": 5, "name": "Referral name", "comment": null}, "Referring doctor": {"type": "character varying(255)", "index": 6, "name": "Referring doctor", "comment": null}, "Referral date": {"type": "text", "index": 7, "name": "Referral date", "comment": null}, "Department": {"type": "character varying(255)", "index": 8, "name": "Department", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-incomplete-referrals"}, "model.tamanu_source_dbt.sensitive-lab-requests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-lab-requests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Location": {"type": "text", "index": 10, "name": "Location", "comment": null}, "Laboratory": {"type": "text", "index": 11, "name": "Laboratory", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 12, "name": "Request ID", "comment": null}, "Status": {"type": "character varying", "index": 13, "name": "Status", "comment": null}, "Lab request date and time": {"type": "text", "index": 14, "name": "Lab request date and time", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 15, "name": "Requesting clinician", "comment": null}, "Requesting department": {"type": "character varying(255)", "index": 16, "name": "Requesting department", "comment": null}, "Priority": {"type": "text", "index": 17, "name": "Priority", "comment": null}, "Test category": {"type": "text", "index": 18, "name": "Test category", "comment": null}, "Test requested": {"type": "text", "index": 19, "name": "Test requested", "comment": null}, "Sample collection date and time": {"type": "text", "index": 20, "name": "Sample collection date and time", "comment": null}, "Sample collected by": {"type": "character varying(255)", "index": 21, "name": "Sample collected by", "comment": null}, "Specimen type": {"type": "text", "index": 22, "name": "Specimen type", "comment": null}, "Site": {"type": "text", "index": 23, "name": "Site", "comment": null}, "Completed date and time": {"type": "text", "index": 24, "name": "Completed date and time", "comment": null}, "Reason for cancellation": {"type": "character varying", "index": 25, "name": "Reason for cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-lab-requests-line-list"}, "model.tamanu_source_dbt.sensitive-lab-tests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-lab-tests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Requesting department": {"type": "character varying(255)", "index": 10, "name": "Requesting department", "comment": null}, "Location": {"type": "text", "index": 11, "name": "Location", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 12, "name": "Request ID", "comment": null}, "Status": {"type": "character varying", "index": 13, "name": "Status", "comment": null}, "Lab test panel": {"type": "character varying(255)", "index": 14, "name": "Lab test panel", "comment": null}, "Test category": {"type": "text", "index": 15, "name": "Test category", "comment": null}, "Lab request date and time": {"type": "text", "index": 16, "name": "Lab request date and time", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 17, "name": "Requesting clinician", "comment": null}, "Lab request published date and time": {"type": "text", "index": 18, "name": "Lab request published date and time", "comment": null}, "Lab test date": {"type": "text", "index": 19, "name": "Lab test date", "comment": null}, "Result": {"type": "text", "index": 20, "name": "Result", "comment": null}, "Verification": {"type": "character varying(255)", "index": 21, "name": "Verification", "comment": null}, "Lab test type": {"type": "character varying(255)", "index": 22, "name": "Lab test type", "comment": null}, "Lab test completed date and time": {"type": "text", "index": 23, "name": "Lab test completed date and time", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-lab-tests-line-list"}, "model.tamanu_source_dbt.sensitive-location-bookings-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-location-bookings-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Booking start date and time": {"type": "text", "index": 9, "name": "Booking start date and time", "comment": null}, "Booking end date and time": {"type": "text", "index": 10, "name": "Booking end date and time", "comment": null}, "Booking duration": {"type": "text", "index": 11, "name": "Booking duration", "comment": null}, "Area": {"type": "character varying(255)", "index": 12, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 13, "name": "Location", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 14, "name": "Clinician", "comment": null}, "Booking type": {"type": "text", "index": 15, "name": "Booking type", "comment": null}, "Booking status": {"type": "character varying(255)", "index": 16, "name": "Booking status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-location-bookings-line-list"}, "model.tamanu_source_dbt.sensitive-medication-dispensed-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-medication-dispensed-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Medication": {"type": "text", "index": 1, "name": "Medication", "comment": null}, "Code": {"type": "character varying(255)", "index": 2, "name": "Code", "comment": null}, "Quantity": {"type": "bigint", "index": 3, "name": "Quantity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-medication-dispensed-summary"}, "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-outpatient-appointments-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Contact number": {"type": "character varying(255)", "index": 7, "name": "Contact number", "comment": null}, "Village": {"type": "text", "index": 8, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 9, "name": "Billing type", "comment": null}, "Appointment date and time": {"type": "text", "index": 10, "name": "Appointment date and time", "comment": null}, "Appointment end date and time": {"type": "text", "index": 11, "name": "Appointment end date and time", "comment": null}, "Appointment type": {"type": "text", "index": 12, "name": "Appointment type", "comment": null}, "Appointment status": {"type": "character varying(255)", "index": 13, "name": "Appointment status", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 14, "name": "Clinician", "comment": null}, "Area": {"type": "character varying(255)", "index": 15, "name": "Area", "comment": null}, "Priority appointment": {"type": "text", "index": 16, "name": "Priority appointment", "comment": null}, "Repeating appointment": {"type": "text", "index": 17, "name": "Repeating appointment", "comment": null}, "Repeating appointment end date": {"type": "text", "index": 18, "name": "Repeating appointment end date", "comment": null}, "Appointment created by": {"type": "character varying(255)", "index": 19, "name": "Appointment created by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list"}, "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-patient-emergency-encounters-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 7, "name": "Facility", "comment": null}, "Number of triage records": {"type": "bigint", "index": 8, "name": "Number of triage records", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary"}, "model.tamanu_source_dbt.sensitive-prescription-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-prescription-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Prescription date": {"type": "text", "index": 1, "name": "Prescription date", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 2, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 4, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 5, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 8, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 9, "name": "Facility", "comment": null}, "Prescription selected for discharge": {"type": "boolean", "index": 10, "name": "Prescription selected for discharge", "comment": null}, "Code": {"type": "character varying(255)", "index": 11, "name": "Code", "comment": null}, "Medication": {"type": "text", "index": 12, "name": "Medication", "comment": null}, "Route": {"type": "character varying(255)", "index": 13, "name": "Route", "comment": null}, "Quantity": {"type": "integer", "index": 14, "name": "Quantity", "comment": null}, "Repeats": {"type": "integer", "index": 15, "name": "Repeats", "comment": null}, "Is ongoing": {"type": "boolean", "index": 16, "name": "Is ongoing", "comment": null}, "Is PRN": {"type": "boolean", "index": 17, "name": "Is PRN", "comment": null}, "Is variable dose": {"type": "boolean", "index": 18, "name": "Is variable dose", "comment": null}, "Dose amount": {"type": "numeric", "index": 19, "name": "Dose amount", "comment": null}, "Units": {"type": "character varying(255)", "index": 20, "name": "Units", "comment": null}, "Frequency": {"type": "character varying(255)", "index": 21, "name": "Frequency", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-prescription-line-list"}, "model.tamanu_source_dbt.sensitive-procedures-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-procedures-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Nationality": {"type": "text", "index": 7, "name": "Nationality", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Type": {"type": "text", "index": 10, "name": "Type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 11, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 12, "name": "Encounter end date and time", "comment": null}, "Procedure facility": {"type": "character varying(255)", "index": 13, "name": "Procedure facility", "comment": null}, "Procedure area": {"type": "character varying(255)", "index": 14, "name": "Procedure area", "comment": null}, "Procedure location": {"type": "character varying(255)", "index": 15, "name": "Procedure location", "comment": null}, "Procedure": {"type": "text", "index": 16, "name": "Procedure", "comment": null}, "Procedure date": {"type": "text", "index": 17, "name": "Procedure date", "comment": null}, "Procedure start (date and time)": {"type": "text", "index": 18, "name": "Procedure start (date and time)", "comment": null}, "Procedure end (date and time)": {"type": "text", "index": 19, "name": "Procedure end (date and time)", "comment": null}, "Procedure duration": {"type": "text", "index": 20, "name": "Procedure duration", "comment": null}, "Procedure clinician": {"type": "character varying(255)", "index": 21, "name": "Procedure clinician", "comment": null}, "Procedure anaesthetist": {"type": "character varying(255)", "index": 22, "name": "Procedure anaesthetist", "comment": null}, "Procedure assistant anesthetist": {"type": "character varying(255)", "index": 23, "name": "Procedure assistant anesthetist", "comment": null}, "Procedure marked as completed": {"type": "text", "index": 24, "name": "Procedure marked as completed", "comment": null}, "Procedure time in": {"type": "time without time zone", "index": 25, "name": "Procedure time in", "comment": null}, "Procedure time out": {"type": "time without time zone", "index": 26, "name": "Procedure time out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-procedures-line-list"}, "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-recent-diagnoses-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date & time": {"type": "text", "index": 1, "name": "Date & time", "comment": null}, "Diagnoses": {"type": "text", "index": 2, "name": "Diagnoses", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 4, "name": "Last name", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 5, "name": "Patient ID", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Primary contact number": {"type": "character varying(255)", "index": 8, "name": "Primary contact number", "comment": null}, "Village": {"type": "text", "index": 9, "name": "Village", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 10, "name": "Clinician", "comment": null}, "Department": {"type": "character varying(255)", "index": 11, "name": "Department", "comment": null}, "Certainty": {"type": "text", "index": 12, "name": "Certainty", "comment": null}, "Is primary": {"type": "text", "index": 13, "name": "Is primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list"}, "model.tamanu_source_dbt.sensitive-user-audit-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-user-audit-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"User name": {"type": "character varying(255)", "index": 1, "name": "User name", "comment": null}, "User role": {"type": "character varying(255)", "index": 2, "name": "User role", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "Patient category": {"type": "text", "index": 4, "name": "Patient category", "comment": null}, "Triage category": {"type": "text", "index": 5, "name": "Triage category", "comment": null}, "Facility": {"type": "character varying(255)", "index": 6, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 7, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 8, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 9, "name": "Location", "comment": null}, "Encounter start date and time": {"type": "text", "index": 10, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 11, "name": "Encounter end date and time", "comment": null}, "Notes start date and time": {"type": "text", "index": 12, "name": "Notes start date and time", "comment": null}, "Notes end date and time": {"type": "text", "index": 13, "name": "Notes end date and time", "comment": null}, "Discharges (has the patient been discharged)": {"type": "text", "index": 14, "name": "Discharges (has the patient been discharged)", "comment": null}, "Non-discharge by clinicians": {"type": "text", "index": 15, "name": "Non-discharge by clinicians", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-user-audit-line-list"}, "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-vaccine-audit-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Vaccination date": {"type": "text", "index": 8, "name": "Vaccination date", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 9, "name": "Vaccine name", "comment": null}, "If category of Other, Vaccine brand": {"type": "text", "index": 10, "name": "If category of Other, Vaccine brand", "comment": null}, "If category of Other, Disease": {"type": "text", "index": 11, "name": "If category of Other, Disease", "comment": null}, "Vaccine status": {"type": "text", "index": 12, "name": "Vaccine status", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 13, "name": "Schedule", "comment": null}, "Given by": {"type": "text", "index": 14, "name": "Given by", "comment": null}, "Recorded by": {"type": "character varying", "index": 15, "name": "Recorded by", "comment": null}, "Record modified by": {"type": "character varying", "index": 16, "name": "Record modified by", "comment": null}, "Record modification date": {"type": "text", "index": 17, "name": "Record modification date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list"}, "model.tamanu_source_dbt.sensitive-vaccine-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-vaccine-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 10, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 11, "name": "Location", "comment": null}, "Vaccination date": {"type": "text", "index": 12, "name": "Vaccination date", "comment": null}, "Vaccine category": {"type": "character varying(255)", "index": 13, "name": "Vaccine category", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 14, "name": "Vaccine name", "comment": null}, "If category of Other, Vaccine brand": {"type": "text", "index": 15, "name": "If category of Other, Vaccine brand", "comment": null}, "If category of Other, Disease": {"type": "text", "index": 16, "name": "If category of Other, Disease", "comment": null}, "Vaccine status": {"type": "text", "index": 17, "name": "Vaccine status", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 18, "name": "Schedule", "comment": null}, "Batch": {"type": "character varying(255)", "index": 19, "name": "Batch", "comment": null}, "Given by": {"type": "text", "index": 20, "name": "Given by", "comment": null}, "Recorded by": {"type": "character varying", "index": 21, "name": "Recorded by", "comment": null}, "If given elsewhere, Circumstances": {"type": "text", "index": 22, "name": "If given elsewhere, Circumstances", "comment": null}, "If given elsewhere, Country": {"type": "text", "index": 23, "name": "If given elsewhere, Country", "comment": null}, "If not given, Supervising clinician": {"type": "text", "index": 24, "name": "If not given, Supervising clinician", "comment": null}, "If not given, Reason not given": {"type": "text", "index": 25, "name": "If not given, Reason not given", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-vaccine-line-list"}, "model.tamanu_source_dbt.survey_response_answers": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "survey_response_answers", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "character varying(255)", "index": 2, "name": "name", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "response_id": {"type": "character varying(255)", "index": 4, "name": "response_id", "comment": null}, "data_element_id": {"type": "character varying(255)", "index": 5, "name": "data_element_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.survey_response_answers"}, "model.tamanu_source_dbt.survey_responses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "survey_responses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 2, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 3, "name": "end_datetime", "comment": null}, "result_text": {"type": "text", "index": 4, "name": "result_text", "comment": null}, "is_notified": {"type": "boolean", "index": 5, "name": "is_notified", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 6, "name": "survey_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "submitted_by_id": {"type": "character varying(255)", "index": 8, "name": "submitted_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.survey_responses"}, "model.tamanu_source_dbt.survey_screen_components": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "survey_screen_components", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "screen_index": {"type": "integer", "index": 2, "name": "screen_index", "comment": null}, "component_index": {"type": "integer", "index": 3, "name": "component_index", "comment": null}, "text": {"type": "character varying(255)", "index": 4, "name": "text", "comment": null}, "visibility_criteria": {"type": "character varying(255)", "index": 5, "name": "visibility_criteria", "comment": null}, "validation_criteria": {"type": "text", "index": 6, "name": "validation_criteria", "comment": null}, "detail": {"type": "character varying(255)", "index": 7, "name": "detail", "comment": null}, "config": {"type": "character varying(255)", "index": 8, "name": "config", "comment": null}, "options": {"type": "character varying(255)", "index": 9, "name": "options", "comment": null}, "calculation": {"type": "character varying(255)", "index": 10, "name": "calculation", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 11, "name": "survey_id", "comment": null}, "data_element_id": {"type": "character varying(255)", "index": 12, "name": "data_element_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 13, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.survey_screen_components"}, "model.tamanu_source_dbt.surveys": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "surveys", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "survey_type": {"type": "character varying(255)", "index": 4, "name": "survey_type", "comment": null}, "is_sensitive": {"type": "boolean", "index": 5, "name": "is_sensitive", "comment": null}, "is_notifiable": {"type": "boolean", "index": 6, "name": "is_notifiable", "comment": null}, "notify_email_addresses": {"type": "character varying(255)[]", "index": 7, "name": "notify_email_addresses", "comment": null}, "program_id": {"type": "character varying(255)", "index": 8, "name": "program_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 9, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.surveys"}, "model.tamanu_source_dbt.translated_strings": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "translated_strings", "database": "app", "comment": null, "owner": "app"}, "columns": {"string_id": {"type": "text", "index": 1, "name": "string_id", "comment": null}, "language": {"type": "text", "index": 2, "name": "language", "comment": null}, "text": {"type": "text", "index": 3, "name": "text", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.translated_strings"}, "model.tamanu_source_dbt.triages": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "triages", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "arrival_datetime": {"type": "timestamp without time zone", "index": 2, "name": "arrival_datetime", "comment": null}, "triage_datetime": {"type": "timestamp without time zone", "index": 3, "name": "triage_datetime", "comment": null}, "closed_datetime": {"type": "timestamp without time zone", "index": 4, "name": "closed_datetime", "comment": null}, "arrival_mode_id": {"type": "character varying(255)", "index": 5, "name": "arrival_mode_id", "comment": null}, "score": {"type": "text", "index": 6, "name": "score", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 8, "name": "clinician_id", "comment": null}, "chief_complaint_id": {"type": "character varying(255)", "index": 9, "name": "chief_complaint_id", "comment": null}, "secondary_complaint_id": {"type": "character varying(255)", "index": 10, "name": "secondary_complaint_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.triages"}, "model.tamanu_source_dbt.upcoming-vaccinations-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "upcoming-vaccinations-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Village": {"type": "text", "index": 5, "name": "Village", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Vaccination due date": {"type": "text", "index": 8, "name": "Vaccination due date", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 9, "name": "Vaccine name", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 10, "name": "Schedule", "comment": null}, "Vaccine status": {"type": "text", "index": 11, "name": "Vaccine status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.upcoming-vaccinations-line-list"}, "model.tamanu_source_dbt.usage-quality-metrics-patient-details": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "usage-quality-metrics-patient-details", "database": "app", "comment": null, "owner": "app"}, "columns": {"Total patients": {"type": "bigint", "index": 1, "name": "Total patients", "comment": null}, "Total patients with incomplete name": {"type": "bigint", "index": 2, "name": "Total patients with incomplete name", "comment": null}, "Total patients with missing date of birth": {"type": "bigint", "index": 3, "name": "Total patients with missing date of birth", "comment": null}, "Total patients with invalid date of birth": {"type": "bigint", "index": 4, "name": "Total patients with invalid date of birth", "comment": null}, "Total patients with missing location": {"type": "bigint", "index": 5, "name": "Total patients with missing location", "comment": null}, "Total patients with missing contact": {"type": "bigint", "index": 6, "name": "Total patients with missing contact", "comment": null}, "Total patients merged": {"type": "bigint", "index": 7, "name": "Total patients merged", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.usage-quality-metrics-patient-details"}, "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "usage-quality-metrics-patient-registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "timestamp with time zone", "index": 1, "name": "Registration date", "comment": null}, "Total patient registrations": {"type": "bigint", "index": 2, "name": "Total patient registrations", "comment": null}, "Total birth registrations": {"type": "bigint", "index": 3, "name": "Total birth registrations", "comment": null}, "Total incorrect registrations for aged under 6 months": {"type": "bigint", "index": 4, "name": "Total incorrect registrations for aged under 6 months", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations"}, "model.tamanu_source_dbt.user-audit-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "user-audit-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"User name": {"type": "character varying(255)", "index": 1, "name": "User name", "comment": null}, "User role": {"type": "character varying(255)", "index": 2, "name": "User role", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "Patient category": {"type": "text", "index": 4, "name": "Patient category", "comment": null}, "Triage category": {"type": "text", "index": 5, "name": "Triage category", "comment": null}, "Facility": {"type": "character varying(255)", "index": 6, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 7, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 8, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 9, "name": "Location", "comment": null}, "Encounter start date and time": {"type": "text", "index": 10, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 11, "name": "Encounter end date and time", "comment": null}, "Notes start date and time": {"type": "text", "index": 12, "name": "Notes start date and time", "comment": null}, "Notes end date and time": {"type": "text", "index": 13, "name": "Notes end date and time", "comment": null}, "Discharges (has the patient been discharged)": {"type": "text", "index": 14, "name": "Discharges (has the patient been discharged)", "comment": null}, "Non-discharge by clinicians": {"type": "text", "index": 15, "name": "Non-discharge by clinicians", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.user-audit-line-list"}, "model.tamanu_source_dbt.users": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "users", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "display_name": {"type": "character varying(255)", "index": 3, "name": "display_name", "comment": null}, "email": {"type": "character varying(255)", "index": 4, "name": "email", "comment": null}, "phone_number": {"type": "character varying(255)", "index": 5, "name": "phone_number", "comment": null}, "role": {"type": "character varying(255)", "index": 6, "name": "role", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 7, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.users"}, "model.tamanu_source_dbt.users_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "users_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.users_metadata"}, "model.tamanu_source_dbt.vaccine-audit-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine-audit-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Vaccination date": {"type": "text", "index": 8, "name": "Vaccination date", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 9, "name": "Vaccine name", "comment": null}, "If category of Other, Vaccine brand": {"type": "text", "index": 10, "name": "If category of Other, Vaccine brand", "comment": null}, "If category of Other, Disease": {"type": "text", "index": 11, "name": "If category of Other, Disease", "comment": null}, "Vaccine status": {"type": "text", "index": 12, "name": "Vaccine status", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 13, "name": "Schedule", "comment": null}, "Given by": {"type": "text", "index": 14, "name": "Given by", "comment": null}, "Recorded by": {"type": "character varying", "index": 15, "name": "Recorded by", "comment": null}, "Record modified by": {"type": "character varying", "index": 16, "name": "Record modified by", "comment": null}, "Record modification date": {"type": "text", "index": 17, "name": "Record modification date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine-audit-line-list"}, "model.tamanu_source_dbt.vaccine-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 10, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 11, "name": "Location", "comment": null}, "Vaccination date": {"type": "text", "index": 12, "name": "Vaccination date", "comment": null}, "Vaccine category": {"type": "character varying(255)", "index": 13, "name": "Vaccine category", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 14, "name": "Vaccine name", "comment": null}, "If category of Other, Vaccine brand": {"type": "text", "index": 15, "name": "If category of Other, Vaccine brand", "comment": null}, "If category of Other, Disease": {"type": "text", "index": 16, "name": "If category of Other, Disease", "comment": null}, "Vaccine status": {"type": "text", "index": 17, "name": "Vaccine status", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 18, "name": "Schedule", "comment": null}, "Batch": {"type": "character varying(255)", "index": 19, "name": "Batch", "comment": null}, "Given by": {"type": "text", "index": 20, "name": "Given by", "comment": null}, "Recorded by": {"type": "character varying", "index": 21, "name": "Recorded by", "comment": null}, "If given elsewhere, Circumstances": {"type": "text", "index": 22, "name": "If given elsewhere, Circumstances", "comment": null}, "If given elsewhere, Country": {"type": "text", "index": 23, "name": "If given elsewhere, Country", "comment": null}, "If not given, Supervising clinician": {"type": "text", "index": 24, "name": "If not given, Supervising clinician", "comment": null}, "If not given, Reason not given": {"type": "text", "index": 25, "name": "If not given, Reason not given", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine-line-list"}, "model.tamanu_source_dbt.vaccine_administrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine_administrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 3, "name": "encounter_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 4, "name": "location_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 5, "name": "department_id", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 6, "name": "scheduled_vaccine_id", "comment": null}, "status": {"type": "character varying(255)", "index": 7, "name": "status", "comment": null}, "reason": {"type": "character varying(255)", "index": 8, "name": "reason", "comment": null}, "not_given_reason_id": {"type": "character varying(255)", "index": 9, "name": "not_given_reason_id", "comment": null}, "batch": {"type": "character varying(255)", "index": 10, "name": "batch", "comment": null}, "vaccine_name": {"type": "text", "index": 11, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 12, "name": "vaccine_brand", "comment": null}, "disease": {"type": "text", "index": 13, "name": "disease", "comment": null}, "is_consented": {"type": "boolean", "index": 14, "name": "is_consented", "comment": null}, "consent_given_by": {"type": "text", "index": 15, "name": "consent_given_by", "comment": null}, "injection_site": {"type": "character varying(255)", "index": 16, "name": "injection_site", "comment": null}, "given_by": {"type": "text", "index": 17, "name": "given_by", "comment": null}, "is_given_elsewhere": {"type": "boolean", "index": 18, "name": "is_given_elsewhere", "comment": null}, "circumstance_ids": {"type": "character varying(255)[]", "index": 19, "name": "circumstance_ids", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 20, "name": "recorded_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine_administrations"}, "model.tamanu_source_dbt.vaccine_administrations_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine_administrations_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp without time zone", "index": 2, "name": "logged_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 5, "name": "updated_by_user_id", "comment": null}, "id": {"type": "text", "index": 6, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 7, "name": "datetime", "comment": null}, "batch": {"type": "text", "index": 8, "name": "batch", "comment": null}, "is_consented": {"type": "boolean", "index": 9, "name": "is_consented", "comment": null}, "disease": {"type": "text", "index": 10, "name": "disease", "comment": null}, "given_by": {"type": "text", "index": 11, "name": "given_by", "comment": null}, "is_given_elsewhere": {"type": "boolean", "index": 12, "name": "is_given_elsewhere", "comment": null}, "circumstance_ids": {"type": "text", "index": 13, "name": "circumstance_ids", "comment": null}, "recorded_by_id": {"type": "text", "index": 14, "name": "recorded_by_id", "comment": null}, "encounter_id": {"type": "text", "index": 15, "name": "encounter_id", "comment": null}, "location_id": {"type": "text", "index": 16, "name": "location_id", "comment": null}, "department_id": {"type": "text", "index": 17, "name": "department_id", "comment": null}, "vaccine_name": {"type": "text", "index": 18, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 19, "name": "vaccine_brand", "comment": null}, "injection_site": {"type": "text", "index": 20, "name": "injection_site", "comment": null}, "consent_given_by": {"type": "text", "index": 21, "name": "consent_given_by", "comment": null}, "scheduled_vaccine_id": {"type": "text", "index": 22, "name": "scheduled_vaccine_id", "comment": null}, "status": {"type": "text", "index": 23, "name": "status", "comment": null}, "reason": {"type": "text", "index": 24, "name": "reason", "comment": null}, "not_given_reason_id": {"type": "text", "index": 25, "name": "not_given_reason_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine_administrations_change_logs"}, "model.tamanu_source_dbt.vaccine_schedules": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine_schedules", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "category": {"type": "character varying(255)", "index": 2, "name": "category", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 3, "name": "vaccine_id", "comment": null}, "label": {"type": "character varying(255)", "index": 4, "name": "label", "comment": null}, "dose_label": {"type": "character varying(255)", "index": 5, "name": "dose_label", "comment": null}, "index": {"type": "integer", "index": 6, "name": "index", "comment": null}, "weeks_from_birth_due": {"type": "integer", "index": 7, "name": "weeks_from_birth_due", "comment": null}, "weeks_from_last_vaccination_due": {"type": "integer", "index": 8, "name": "weeks_from_last_vaccination_due", "comment": null}, "sort_index": {"type": "integer", "index": 9, "name": "sort_index", "comment": null}, "visibility_status": {"type": "text", "index": 10, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine_schedules"}}, "sources": {"source.tamanu_source_dbt.logs__tamanu.accesses": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "accesses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "record_id": {"type": "text", "index": 6, "name": "record_id", "comment": null}, "record_type": {"type": "text", "index": 7, "name": "record_type", "comment": null}, "facility_id": {"type": "text", "index": 8, "name": "facility_id", "comment": null}, "session_id": {"type": "text", "index": 9, "name": "session_id", "comment": null}, "device_id": {"type": "text", "index": 10, "name": "device_id", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 11, "name": "logged_at", "comment": null}, "front_end_context": {"type": "jsonb", "index": 12, "name": "front_end_context", "comment": null}, "back_end_context": {"type": "jsonb", "index": 13, "name": "back_end_context", "comment": null}, "is_mobile": {"type": "boolean", "index": 14, "name": "is_mobile", "comment": null}, "version": {"type": "text", "index": 15, "name": "version", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.accesses"}, "source.tamanu_source_dbt.logs__tamanu.changes": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "changes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "table_oid": {"type": "integer", "index": 2, "name": "table_oid", "comment": null}, "table_schema": {"type": "text", "index": 3, "name": "table_schema", "comment": null}, "table_name": {"type": "text", "index": 4, "name": "table_name", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 5, "name": "logged_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 9, "name": "updated_by_user_id", "comment": null}, "device_id": {"type": "text", "index": 10, "name": "device_id", "comment": null}, "version": {"type": "text", "index": 11, "name": "version", "comment": null}, "record_id": {"type": "text", "index": 12, "name": "record_id", "comment": null}, "record_created_at": {"type": "timestamp with time zone", "index": 14, "name": "record_created_at", "comment": null}, "record_updated_at": {"type": "timestamp with time zone", "index": 15, "name": "record_updated_at", "comment": null}, "record_deleted_at": {"type": "timestamp with time zone", "index": 16, "name": "record_deleted_at", "comment": null}, "record_data": {"type": "jsonb", "index": 18, "name": "record_data", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 19, "name": "updated_at_sync_tick", "comment": null}, "reason": {"type": "text", "index": 20, "name": "reason", "comment": null}, "migration_context": {"type": "text", "index": 21, "name": "migration_context", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.changes"}, "source.tamanu_source_dbt.logs__tamanu.debug_logs": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "debug_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "type": {"type": "character varying(255)", "index": 2, "name": "type", "comment": null}, "info": {"type": "json", "index": 3, "name": "info", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.debug_logs"}, "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "dhis2_pushes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "report_id": {"type": "text", "index": 5, "name": "report_id", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "message": {"type": "text", "index": 7, "name": "message", "comment": null}, "imported": {"type": "integer", "index": 8, "name": "imported", "comment": null}, "updated": {"type": "integer", "index": 9, "name": "updated", "comment": null}, "ignored": {"type": "integer", "index": 10, "name": "ignored", "comment": null}, "deleted": {"type": "integer", "index": 11, "name": "deleted", "comment": null}, "conflicts": {"type": "json", "index": 12, "name": "conflicts", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"}, "source.tamanu_source_dbt.logs__tamanu.fhir_writes": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "fhir_writes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "verb": {"type": "text", "index": 3, "name": "verb", "comment": null}, "url": {"type": "text", "index": 4, "name": "url", "comment": null}, "body": {"type": "jsonb", "index": 5, "name": "body", "comment": null}, "headers": {"type": "jsonb", "index": 6, "name": "headers", "comment": null}, "user_id": {"type": "character varying(255)", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.fhir_writes"}, "source.tamanu_source_dbt.logs__tamanu.migrations": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "migrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 2, "name": "logged_at", "comment": null}, "record_sync_tick": {"type": "bigint", "index": 3, "name": "record_sync_tick", "comment": null}, "device_id": {"type": "text", "index": 4, "name": "device_id", "comment": null}, "version": {"type": "text", "index": 5, "name": "version", "comment": null}, "direction": {"type": "text", "index": 6, "name": "direction", "comment": null}, "migrations": {"type": "jsonb", "index": 7, "name": "migrations", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.migrations"}, "source.tamanu_source_dbt.tamanu.SequelizeMeta": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "SequelizeMeta", "database": "app", "comment": null, "owner": "app"}, "columns": {"name": {"type": "character varying(255)", "index": 1, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.SequelizeMeta"}, "source.tamanu_source_dbt.tamanu.administered_vaccines": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "administered_vaccines", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "batch": {"type": "character varying(255)", "index": 5, "name": "batch", "comment": null}, "status": {"type": "character varying(255)", "index": 6, "name": "status", "comment": null}, "reason": {"type": "character varying(255)", "index": 7, "name": "reason", "comment": null}, "date": {"type": "date_time_string", "index": 9, "name": "date", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 10, "name": "scheduled_vaccine_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 11, "name": "encounter_id", "comment": null}, "injection_site": {"type": "character varying(255)", "index": 12, "name": "injection_site", "comment": null}, "consent": {"type": "boolean", "index": 13, "name": "consent", "comment": null}, "recorder_id": {"type": "character varying(255)", "index": 15, "name": "recorder_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 16, "name": "location_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 17, "name": "department_id", "comment": null}, "given_by": {"type": "text", "index": 18, "name": "given_by", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 23, "name": "date_legacy", "comment": null}, "not_given_reason_id": {"type": "character varying(255)", "index": 24, "name": "not_given_reason_id", "comment": null}, "given_elsewhere": {"type": "boolean", "index": 25, "name": "given_elsewhere", "comment": null}, "vaccine_name": {"type": "text", "index": 26, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 27, "name": "vaccine_brand", "comment": null}, "disease": {"type": "text", "index": 28, "name": "disease", "comment": null}, "circumstance_ids": {"type": "character varying(255)[]", "index": 29, "name": "circumstance_ids", "comment": null}, "consent_given_by": {"type": "text", "index": 30, "name": "consent_given_by", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 31, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.administered_vaccines"}, "source.tamanu_source_dbt.tamanu.appointment_procedure_types": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "appointment_procedure_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "appointment_id": {"type": "character varying(255)", "index": 2, "name": "appointment_id", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 3, "name": "procedure_type_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.appointment_procedure_types"}, "source.tamanu_source_dbt.tamanu.appointment_schedules": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "appointment_schedules", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "until_date": {"type": "date_string", "index": 2, "name": "until_date", "comment": null}, "interval": {"type": "integer", "index": 3, "name": "interval", "comment": null}, "frequency": {"type": "character varying(255)", "index": 4, "name": "frequency", "comment": null}, "days_of_week": {"type": "character varying(255)[]", "index": 5, "name": "days_of_week", "comment": null}, "nth_weekday": {"type": "integer", "index": 6, "name": "nth_weekday", "comment": null}, "occurrence_count": {"type": "integer", "index": 7, "name": "occurrence_count", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "is_fully_generated": {"type": "boolean", "index": 11, "name": "is_fully_generated", "comment": null}, "generated_until_date": {"type": "date_string", "index": 12, "name": "generated_until_date", "comment": null}, "cancelled_at_date": {"type": "date_string", "index": 13, "name": "cancelled_at_date", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.appointment_schedules"}, "source.tamanu_source_dbt.tamanu.appointments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "start_time": {"type": "date_time_string", "index": 5, "name": "start_time", "comment": null}, "end_time": {"type": "date_time_string", "index": 6, "name": "end_time", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 8, "name": "clinician_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 9, "name": "location_id", "comment": null}, "type_legacy": {"type": "character varying(255)", "index": 10, "name": "type_legacy", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "start_time_legacy": {"type": "timestamp with time zone", "index": 12, "name": "start_time_legacy", "comment": null}, "end_time_legacy": {"type": "timestamp with time zone", "index": 13, "name": "end_time_legacy", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "booking_type_id": {"type": "character varying(255)", "index": 15, "name": "booking_type_id", "comment": null}, "appointment_type_id": {"type": "character varying(255)", "index": 16, "name": "appointment_type_id", "comment": null}, "is_high_priority": {"type": "boolean", "index": 17, "name": "is_high_priority", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 18, "name": "encounter_id", "comment": null}, "schedule_id": {"type": "uuid", "index": 19, "name": "schedule_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 20, "name": "updated_at_sync_tick", "comment": null}, "additional_clinician_id": {"type": "character varying(255)", "index": 21, "name": "additional_clinician_id", "comment": null}, "link_encounter_id": {"type": "character varying(255)", "index": 22, "name": "link_encounter_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.appointments"}, "source.tamanu_source_dbt.tamanu.assets": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "assets", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 5, "name": "name", "comment": null}, "type": {"type": "character varying(255)", "index": 6, "name": "type", "comment": null}, "data": {"type": "bytea", "index": 7, "name": "data", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 9, "name": "facility_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.assets"}, "source.tamanu_source_dbt.tamanu.attachments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "attachments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "type": {"type": "text", "index": 2, "name": "type", "comment": null}, "size": {"type": "integer", "index": 3, "name": "size", "comment": null}, "data": {"type": "bytea", "index": 4, "name": "data", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.attachments"}, "source.tamanu_source_dbt.tamanu.certifiable_vaccines": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "certifiable_vaccines", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 5, "name": "vaccine_id", "comment": null}, "manufacturer_id": {"type": "character varying(255)", "index": 6, "name": "manufacturer_id", "comment": null}, "icd11_drug_code": {"type": "character varying(255)", "index": 7, "name": "icd11_drug_code", "comment": null}, "icd11_disease_code": {"type": "character varying(255)", "index": 8, "name": "icd11_disease_code", "comment": null}, "vaccine_code": {"type": "character varying(255)", "index": 9, "name": "vaccine_code", "comment": null}, "target_code": {"type": "character varying(255)", "index": 10, "name": "target_code", "comment": null}, "eu_product_code": {"type": "character varying(255)", "index": 11, "name": "eu_product_code", "comment": null}, "maximum_dosage": {"type": "integer", "index": 12, "name": "maximum_dosage", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.certifiable_vaccines"}, "source.tamanu_source_dbt.tamanu.certificate_notifications": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "certificate_notifications", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "type": {"type": "character varying(255)", "index": 5, "name": "type", "comment": null}, "require_signing": {"type": "boolean", "index": 6, "name": "require_signing", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "forward_address": {"type": "character varying(255)", "index": 8, "name": "forward_address", "comment": null}, "lab_test_id": {"type": "character varying(255)", "index": 13, "name": "lab_test_id", "comment": null}, "status": {"type": "character varying(255)", "index": 14, "name": "status", "comment": null}, "error": {"type": "text", "index": 15, "name": "error", "comment": null}, "created_by": {"type": "character varying(255)", "index": 16, "name": "created_by", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 17, "name": "lab_request_id", "comment": null}, "printed_date": {"type": "date_string", "index": 18, "name": "printed_date", "comment": null}, "facility_name": {"type": "character varying(255)", "index": 19, "name": "facility_name", "comment": null}, "language": {"type": "character varying(255)", "index": 20, "name": "language", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 21, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.certificate_notifications"}, "source.tamanu_source_dbt.tamanu.contributing_death_causes": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "contributing_death_causes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "time_after_onset": {"type": "integer", "index": 2, "name": "time_after_onset", "comment": null}, "patient_death_data_id": {"type": "character varying(255)", "index": 3, "name": "patient_death_data_id", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 4, "name": "condition_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 10, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 11, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.contributing_death_causes"}, "source.tamanu_source_dbt.tamanu.death_revert_logs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "death_revert_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "revert_time": {"type": "date_time_string", "index": 5, "name": "revert_time", "comment": null}, "death_data_id": {"type": "character varying(255)", "index": 6, "name": "death_data_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "reverted_by_id": {"type": "character varying(255)", "index": 8, "name": "reverted_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.death_revert_logs"}, "source.tamanu_source_dbt.tamanu.departments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "departments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 7, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 8, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.departments"}, "source.tamanu_source_dbt.tamanu.devices": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "devices", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "last_seen_at": {"type": "timestamp with time zone", "index": 5, "name": "last_seen_at", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 6, "name": "registered_by_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "scopes": {"type": "jsonb", "index": 8, "name": "scopes", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.devices"}, "source.tamanu_source_dbt.tamanu.discharges": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "discharges", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "text", "index": 5, "name": "note", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "discharger_id": {"type": "character varying(255)", "index": 7, "name": "discharger_id", "comment": null}, "disposition_id": {"type": "character varying(255)", "index": 8, "name": "disposition_id", "comment": null}, "facility_name": {"type": "character varying(255)", "index": 9, "name": "facility_name", "comment": null}, "facility_address": {"type": "character varying(255)", "index": 10, "name": "facility_address", "comment": null}, "facility_town": {"type": "character varying(255)", "index": 11, "name": "facility_town", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.discharges"}, "source.tamanu_source_dbt.tamanu.document_metadata": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "document_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "type": {"type": "text", "index": 3, "name": "type", "comment": null}, "document_created_at": {"type": "date_time_string", "index": 4, "name": "document_created_at", "comment": null}, "document_uploaded_at": {"type": "date_time_string", "index": 5, "name": "document_uploaded_at", "comment": null}, "document_owner": {"type": "text", "index": 6, "name": "document_owner", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 8, "name": "encounter_id", "comment": null}, "attachment_id": {"type": "character varying(255)", "index": 9, "name": "attachment_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 14, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 15, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 16, "name": "deleted_at", "comment": null}, "department_id": {"type": "character varying(255)", "index": 17, "name": "department_id", "comment": null}, "note": {"type": "character varying(255)", "index": 18, "name": "note", "comment": null}, "document_created_at_legacy": {"type": "timestamp with time zone", "index": 19, "name": "document_created_at_legacy", "comment": null}, "document_uploaded_at_legacy": {"type": "timestamp with time zone", "index": 20, "name": "document_uploaded_at_legacy", "comment": null}, "source": {"type": "character varying(255)", "index": 21, "name": "source", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 22, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.document_metadata"}, "source.tamanu_source_dbt.tamanu.encounter_diagnoses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_diagnoses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "certainty": {"type": "character varying(255)", "index": 5, "name": "certainty", "comment": null}, "is_primary": {"type": "boolean", "index": 6, "name": "is_primary", "comment": null}, "date": {"type": "date_time_string", "index": 7, "name": "date", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 8, "name": "encounter_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 9, "name": "diagnosis_id", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 10, "name": "date_legacy", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 11, "name": "clinician_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_diagnoses"}, "source.tamanu_source_dbt.tamanu.encounter_diets": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_diets", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "diet_id": {"type": "character varying(255)", "index": 3, "name": "diet_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_diets"}, "source.tamanu_source_dbt.tamanu.encounter_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_history", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 7, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 8, "name": "location_id", "comment": null}, "examiner_id": {"type": "character varying(255)", "index": 9, "name": "examiner_id", "comment": null}, "encounter_type": {"type": "character varying(255)", "index": 10, "name": "encounter_type", "comment": null}, "actor_id": {"type": "character varying(255)", "index": 11, "name": "actor_id", "comment": null}, "change_type": {"type": "text[]", "index": 12, "name": "change_type", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_history"}, "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_pause_prescription_histories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "encounter_prescription_id": {"type": "uuid", "index": 2, "name": "encounter_prescription_id", "comment": null}, "action": {"type": "character varying(255)", "index": 3, "name": "action", "comment": null}, "action_date": {"type": "date_time_string", "index": 4, "name": "action_date", "comment": null}, "action_user_id": {"type": "character varying(255)", "index": 5, "name": "action_user_id", "comment": null}, "notes": {"type": "text", "index": 6, "name": "notes", "comment": null}, "pause_duration": {"type": "numeric", "index": 7, "name": "pause_duration", "comment": null}, "pause_time_unit": {"type": "character varying(255)", "index": 8, "name": "pause_time_unit", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 10, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 11, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"}, "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_pause_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "encounter_prescription_id": {"type": "uuid", "index": 2, "name": "encounter_prescription_id", "comment": null}, "pause_duration": {"type": "numeric", "index": 3, "name": "pause_duration", "comment": null}, "pause_time_unit": {"type": "character varying(255)", "index": 4, "name": "pause_time_unit", "comment": null}, "pause_start_date": {"type": "date_time_string", "index": 5, "name": "pause_start_date", "comment": null}, "pause_end_date": {"type": "date_time_string", "index": 6, "name": "pause_end_date", "comment": null}, "notes": {"type": "text", "index": 7, "name": "notes", "comment": null}, "pausing_clinician_id": {"type": "character varying(255)", "index": 8, "name": "pausing_clinician_id", "comment": null}, "created_by": {"type": "character varying(255)", "index": 9, "name": "created_by", "comment": null}, "updated_by": {"type": "character varying(255)", "index": 10, "name": "updated_by", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 11, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 12, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 13, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"}, "source.tamanu_source_dbt.tamanu.encounter_prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 3, "name": "prescription_id", "comment": null}, "is_selected_for_discharge": {"type": "boolean", "index": 4, "name": "is_selected_for_discharge", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_prescriptions"}, "source.tamanu_source_dbt.tamanu.encounters": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounters", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "encounter_type": {"type": "character varying(31)", "index": 5, "name": "encounter_type", "comment": null}, "start_date": {"type": "date_time_string", "index": 6, "name": "start_date", "comment": null}, "end_date": {"type": "date_time_string", "index": 7, "name": "end_date", "comment": null}, "reason_for_encounter": {"type": "text", "index": 8, "name": "reason_for_encounter", "comment": null}, "device_id": {"type": "text", "index": 9, "name": "device_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 11, "name": "patient_id", "comment": null}, "examiner_id": {"type": "character varying(255)", "index": 12, "name": "examiner_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 13, "name": "location_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 14, "name": "department_id", "comment": null}, "patient_billing_type_id": {"type": "character varying(255)", "index": 19, "name": "patient_billing_type_id", "comment": null}, "start_date_legacy": {"type": "timestamp with time zone", "index": 20, "name": "start_date_legacy", "comment": null}, "end_date_legacy": {"type": "timestamp with time zone", "index": 21, "name": "end_date_legacy", "comment": null}, "referral_source_id": {"type": "character varying(255)", "index": 22, "name": "referral_source_id", "comment": null}, "planned_location_id": {"type": "character varying(255)", "index": 23, "name": "planned_location_id", "comment": null}, "planned_location_start_time": {"type": "date_time_string", "index": 24, "name": "planned_location_start_time", "comment": null}, "discharge_draft": {"type": "jsonb", "index": 26, "name": "discharge_draft", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 27, "name": "updated_at_sync_tick", "comment": null}, "estimated_end_date": {"type": "date_string", "index": 28, "name": "estimated_end_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounters"}, "source.tamanu_source_dbt.tamanu.facilities": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "division": {"type": "character varying(255)", "index": 7, "name": "division", "comment": null}, "type": {"type": "character varying(255)", "index": 8, "name": "type", "comment": null}, "email": {"type": "character varying(255)", "index": 9, "name": "email", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 10, "name": "contact_number", "comment": null}, "city_town": {"type": "character varying(255)", "index": 11, "name": "city_town", "comment": null}, "street_address": {"type": "character varying(255)", "index": 12, "name": "street_address", "comment": null}, "visibility_status": {"type": "text", "index": 13, "name": "visibility_status", "comment": null}, "catchment_id": {"type": "text", "index": 14, "name": "catchment_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 15, "name": "updated_at_sync_tick", "comment": null}, "is_sensitive": {"type": "boolean", "index": 16, "name": "is_sensitive", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.facilities"}, "source.tamanu_source_dbt.tamanu.imaging_area_external_codes": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_area_external_codes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "visibility_status": {"type": "text", "index": 6, "name": "visibility_status", "comment": null}, "area_id": {"type": "character varying(255)", "index": 7, "name": "area_id", "comment": null}, "code": {"type": "text", "index": 8, "name": "code", "comment": null}, "description": {"type": "text", "index": 9, "name": "description", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_area_external_codes"}, "source.tamanu_source_dbt.tamanu.imaging_request_areas": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_request_areas", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "imaging_request_id": {"type": "character varying", "index": 5, "name": "imaging_request_id", "comment": null}, "area_id": {"type": "character varying(255)", "index": 6, "name": "area_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_request_areas"}, "source.tamanu_source_dbt.tamanu.imaging_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "status": {"type": "character varying(255)", "index": 5, "name": "status", "comment": null}, "requested_date": {"type": "date_time_string", "index": 6, "name": "requested_date", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 8, "name": "requested_by_id", "comment": null}, "legacy_results": {"type": "text", "index": 12, "name": "legacy_results", "comment": null}, "completed_by_id": {"type": "character varying(255)", "index": 13, "name": "completed_by_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "imaging_type": {"type": "character varying(31)", "index": 15, "name": "imaging_type", "comment": null}, "requested_date_legacy": {"type": "timestamp with time zone", "index": 16, "name": "requested_date_legacy", "comment": null}, "priority": {"type": "character varying(255)", "index": 17, "name": "priority", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 18, "name": "location_group_id", "comment": null}, "reason_for_cancellation": {"type": "character varying(1024)", "index": 19, "name": "reason_for_cancellation", "comment": null}, "display_id": {"type": "character varying(255)", "index": 20, "name": "display_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 21, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_requests"}, "source.tamanu_source_dbt.tamanu.imaging_results": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_results", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "visibility_status": {"type": "text", "index": 6, "name": "visibility_status", "comment": null}, "imaging_request_id": {"type": "character varying", "index": 7, "name": "imaging_request_id", "comment": null}, "completed_by_id": {"type": "character varying(255)", "index": 8, "name": "completed_by_id", "comment": null}, "description": {"type": "text", "index": 9, "name": "description", "comment": null}, "external_code": {"type": "text", "index": 10, "name": "external_code", "comment": null}, "completed_at": {"type": "date_time_string", "index": 11, "name": "completed_at", "comment": null}, "result_image_url": {"type": "text", "index": 12, "name": "result_image_url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_results"}, "source.tamanu_source_dbt.tamanu.imaging_type_external_codes": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_type_external_codes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}, "imaging_type_code": {"type": "text", "index": 6, "name": "imaging_type_code", "comment": null}, "code": {"type": "text", "index": 7, "name": "code", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_type_external_codes"}, "source.tamanu_source_dbt.tamanu.invoice_discounts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_discounts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_id": {"type": "uuid", "index": 2, "name": "invoice_id", "comment": null}, "percentage": {"type": "numeric", "index": 3, "name": "percentage", "comment": null}, "reason": {"type": "character varying(255)", "index": 4, "name": "reason", "comment": null}, "is_manual": {"type": "boolean", "index": 5, "name": "is_manual", "comment": null}, "applied_by_user_id": {"type": "character varying(255)", "index": 6, "name": "applied_by_user_id", "comment": null}, "applied_time": {"type": "date_time_string", "index": 7, "name": "applied_time", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_discounts"}, "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_insurance_plan_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "invoice_insurance_plan_id": {"type": "text", "index": 6, "name": "invoice_insurance_plan_id", "comment": null}, "invoice_product_id": {"type": "text", "index": 7, "name": "invoice_product_id", "comment": null}, "coverage_value": {"type": "numeric", "index": 8, "name": "coverage_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"}, "source.tamanu_source_dbt.tamanu.invoice_insurance_plans": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_insurance_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "code": {"type": "character varying(255)", "index": 6, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 7, "name": "name", "comment": null}, "default_coverage": {"type": "numeric", "index": 8, "name": "default_coverage", "comment": null}, "visibility_status": {"type": "text", "index": 9, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurance_plans"}, "source.tamanu_source_dbt.tamanu.invoice_insurer_payments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_insurer_payments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_payment_id": {"type": "uuid", "index": 2, "name": "invoice_payment_id", "comment": null}, "insurer_id": {"type": "character varying(255)", "index": 3, "name": "insurer_id", "comment": null}, "status": {"type": "character varying(255)", "index": 4, "name": "status", "comment": null}, "reason": {"type": "character varying(255)", "index": 5, "name": "reason", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurer_payments"}, "source.tamanu_source_dbt.tamanu.invoice_item_discounts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_item_discounts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_item_id": {"type": "uuid", "index": 2, "name": "invoice_item_id", "comment": null}, "amount": {"type": "numeric", "index": 3, "name": "amount", "comment": null}, "reason": {"type": "character varying(255)", "index": 4, "name": "reason", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "type": {"type": "character varying(255)", "index": 8, "name": "type", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_item_discounts"}, "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_item_finalised_insurances", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "invoice_item_id": {"type": "uuid", "index": 6, "name": "invoice_item_id", "comment": null}, "coverage_value_final": {"type": "numeric", "index": 7, "name": "coverage_value_final", "comment": null}, "invoice_insurance_plan_id": {"type": "character varying(255)", "index": 8, "name": "invoice_insurance_plan_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"}, "source.tamanu_source_dbt.tamanu.invoice_items": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_id": {"type": "uuid", "index": 2, "name": "invoice_id", "comment": null}, "order_date": {"type": "date_string", "index": 3, "name": "order_date", "comment": null}, "product_id": {"type": "character varying(255)", "index": 4, "name": "product_id", "comment": null}, "quantity": {"type": "integer", "index": 5, "name": "quantity", "comment": null}, "product_name_final": {"type": "character varying(255)", "index": 6, "name": "product_name_final", "comment": null}, "manual_entry_price": {"type": "numeric", "index": 7, "name": "manual_entry_price", "comment": null}, "ordered_by_user_id": {"type": "character varying(255)", "index": 8, "name": "ordered_by_user_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 10, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 11, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 12, "name": "deleted_at", "comment": null}, "product_code_final": {"type": "character varying(255)", "index": 13, "name": "product_code_final", "comment": null}, "note": {"type": "character varying(255)", "index": 14, "name": "note", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}, "source_record_type": {"type": "character varying(255)", "index": 17, "name": "source_record_type", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 18, "name": "source_record_id", "comment": null}, "price_final": {"type": "numeric", "index": 19, "name": "price_final", "comment": null}, "approved": {"type": "boolean", "index": 20, "name": "approved", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_items"}, "source.tamanu_source_dbt.tamanu.invoice_patient_payments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_patient_payments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_payment_id": {"type": "uuid", "index": 2, "name": "invoice_payment_id", "comment": null}, "method_id": {"type": "character varying(255)", "index": 3, "name": "method_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "cheque_number": {"type": "character varying(255)", "index": 7, "name": "cheque_number", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_patient_payments"}, "source.tamanu_source_dbt.tamanu.invoice_payments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_payments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_id": {"type": "uuid", "index": 2, "name": "invoice_id", "comment": null}, "date": {"type": "date_string", "index": 3, "name": "date", "comment": null}, "receipt_number": {"type": "character varying(255)", "index": 4, "name": "receipt_number", "comment": null}, "amount": {"type": "numeric", "index": 5, "name": "amount", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_by_user_id": {"type": "character varying(255)", "index": 9, "name": "updated_by_user_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_payments"}, "source.tamanu_source_dbt.tamanu.invoice_price_list_items": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_price_list_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "invoice_price_list_id": {"type": "text", "index": 6, "name": "invoice_price_list_id", "comment": null}, "invoice_product_id": {"type": "text", "index": 7, "name": "invoice_product_id", "comment": null}, "price": {"type": "numeric", "index": 8, "name": "price", "comment": null}, "is_hidden": {"type": "boolean", "index": 10, "name": "is_hidden", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_price_list_items"}, "source.tamanu_source_dbt.tamanu.invoice_price_lists": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_price_lists", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "code": {"type": "character varying(255)", "index": 6, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 7, "name": "name", "comment": null}, "rules": {"type": "jsonb", "index": 8, "name": "rules", "comment": null}, "visibility_status": {"type": "text", "index": 9, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_price_lists"}, "source.tamanu_source_dbt.tamanu.invoice_products": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_products", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 8, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}, "category": {"type": "character varying(255)", "index": 10, "name": "category", "comment": null}, "source_record_type": {"type": "character varying(255)", "index": 11, "name": "source_record_type", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 12, "name": "source_record_id", "comment": null}, "insurable": {"type": "boolean", "index": 13, "name": "insurable", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_products"}, "source.tamanu_source_dbt.tamanu.invoices": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoices", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "date": {"type": "date_time_string", "index": 3, "name": "date", "comment": null}, "status": {"type": "character varying(255)", "index": 4, "name": "status", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "patient_payment_status": {"type": "character varying(255)", "index": 11, "name": "patient_payment_status", "comment": null}, "insurer_payment_status": {"type": "character varying(255)", "index": 12, "name": "insurer_payment_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoices"}, "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoices_invoice_insurance_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "invoice_id": {"type": "uuid", "index": 6, "name": "invoice_id", "comment": null}, "invoice_insurance_plan_id": {"type": "character varying(255)", "index": 7, "name": "invoice_insurance_plan_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"}, "source.tamanu_source_dbt.tamanu.ips_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "ips_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 5, "name": "patient_id", "comment": null}, "created_by": {"type": "character varying(255)", "index": 6, "name": "created_by", "comment": null}, "status": {"type": "character varying(255)", "index": 7, "name": "status", "comment": null}, "email": {"type": "character varying(255)", "index": 8, "name": "email", "comment": null}, "error": {"type": "text", "index": 9, "name": "error", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.ips_requests"}, "source.tamanu_source_dbt.tamanu.lab_request_attachments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_request_attachments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "attachment_id": {"type": "character varying(255)", "index": 5, "name": "attachment_id", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 6, "name": "lab_request_id", "comment": null}, "title": {"type": "character varying(255)", "index": 7, "name": "title", "comment": null}, "replaced_by_id": {"type": "character varying(255)", "index": 8, "name": "replaced_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_request_attachments"}, "source.tamanu_source_dbt.tamanu.lab_request_logs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_request_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "status": {"type": "character varying(31)", "index": 5, "name": "status", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 6, "name": "lab_request_id", "comment": null}, "updated_by_id": {"type": "character varying(255)", "index": 7, "name": "updated_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_request_logs"}, "source.tamanu_source_dbt.tamanu.lab_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "sample_time": {"type": "date_time_string", "index": 5, "name": "sample_time", "comment": null}, "requested_date": {"type": "date_time_string", "index": 6, "name": "requested_date", "comment": null}, "urgent": {"type": "boolean", "index": 7, "name": "urgent", "comment": null}, "specimen_attached": {"type": "boolean", "index": 8, "name": "specimen_attached", "comment": null}, "status": {"type": "character varying(255)", "index": 9, "name": "status", "comment": null}, "senaite_id": {"type": "character varying(255)", "index": 10, "name": "senaite_id", "comment": null}, "sample_id": {"type": "character varying(255)", "index": 11, "name": "sample_id", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 12, "name": "requested_by_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 13, "name": "encounter_id", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 14, "name": "lab_test_category_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 16, "name": "display_id", "comment": null}, "lab_test_priority_id": {"type": "character varying(255)", "index": 18, "name": "lab_test_priority_id", "comment": null}, "lab_test_laboratory_id": {"type": "character varying(255)", "index": 19, "name": "lab_test_laboratory_id", "comment": null}, "sample_time_legacy": {"type": "timestamp with time zone", "index": 20, "name": "sample_time_legacy", "comment": null}, "requested_date_legacy": {"type": "timestamp with time zone", "index": 21, "name": "requested_date_legacy", "comment": null}, "reason_for_cancellation": {"type": "character varying(31)", "index": 22, "name": "reason_for_cancellation", "comment": null}, "department_id": {"type": "character varying(255)", "index": 23, "name": "department_id", "comment": null}, "lab_test_panel_request_id": {"type": "uuid", "index": 24, "name": "lab_test_panel_request_id", "comment": null}, "lab_sample_site_id": {"type": "character varying(255)", "index": 25, "name": "lab_sample_site_id", "comment": null}, "published_date": {"type": "date_time_string", "index": 26, "name": "published_date", "comment": null}, "specimen_type_id": {"type": "character varying(255)", "index": 27, "name": "specimen_type_id", "comment": null}, "collected_by_id": {"type": "character varying(255)", "index": 28, "name": "collected_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 29, "name": "updated_at_sync_tick", "comment": null}, "results_interpretation": {"type": "text", "index": 30, "name": "results_interpretation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_requests"}, "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_test_panel_lab_test_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 5, "name": "lab_test_panel_id", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 6, "name": "lab_test_type_id", "comment": null}, "id": {"type": "text", "index": 7, "name": "id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}, "order": {"type": "integer", "index": 9, "name": "order", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"}, "source.tamanu_source_dbt.tamanu.lab_test_panel_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_test_panel_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 5, "name": "lab_test_panel_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"}, "source.tamanu_source_dbt.tamanu.lab_test_panels": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_test_panels", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 5, "name": "name", "comment": null}, "code": {"type": "character varying(255)", "index": 6, "name": "code", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 7, "name": "visibility_status", "comment": null}, "external_code": {"type": "text", "index": 8, "name": "external_code", "comment": null}, "category_id": {"type": "character varying(255)", "index": 9, "name": "category_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panels"}, "source.tamanu_source_dbt.tamanu.lab_test_types": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_test_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "unit": {"type": "character varying(255)", "index": 7, "name": "unit", "comment": null}, "male_min": {"type": "double precision", "index": 8, "name": "male_min", "comment": null}, "male_max": {"type": "double precision", "index": 9, "name": "male_max", "comment": null}, "female_min": {"type": "double precision", "index": 10, "name": "female_min", "comment": null}, "female_max": {"type": "double precision", "index": 11, "name": "female_max", "comment": null}, "range_text": {"type": "character varying(255)", "index": 12, "name": "range_text", "comment": null}, "result_type": {"type": "character varying(255)", "index": 13, "name": "result_type", "comment": null}, "options": {"type": "text", "index": 14, "name": "options", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 15, "name": "lab_test_category_id", "comment": null}, "visibility_status": {"type": "text", "index": 16, "name": "visibility_status", "comment": null}, "external_code": {"type": "text", "index": 17, "name": "external_code", "comment": null}, "is_sensitive": {"type": "boolean", "index": 18, "name": "is_sensitive", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 19, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_types"}, "source.tamanu_source_dbt.tamanu.lab_tests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_tests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_string", "index": 5, "name": "date", "comment": null}, "result": {"type": "text", "index": 7, "name": "result", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 8, "name": "lab_request_id", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 9, "name": "lab_test_type_id", "comment": null}, "category_id": {"type": "character varying(255)", "index": 10, "name": "category_id", "comment": null}, "lab_test_method_id": {"type": "character varying(255)", "index": 11, "name": "lab_test_method_id", "comment": null}, "laboratory_officer": {"type": "character varying(255)", "index": 12, "name": "laboratory_officer", "comment": null}, "completed_date": {"type": "date_time_string", "index": 13, "name": "completed_date", "comment": null}, "verification": {"type": "character varying(255)", "index": 14, "name": "verification", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 15, "name": "date_legacy", "comment": null}, "completed_date_legacy": {"type": "timestamp with time zone", "index": 16, "name": "completed_date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_tests"}, "source.tamanu_source_dbt.tamanu.local_system_facts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "local_system_facts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "key": {"type": "character varying(255)", "index": 5, "name": "key", "comment": null}, "value": {"type": "text", "index": 6, "name": "value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.local_system_facts"}, "source.tamanu_source_dbt.tamanu.location_assignment_templates": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "location_assignment_templates", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 2, "name": "user_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 3, "name": "location_id", "comment": null}, "date": {"type": "date_string", "index": 4, "name": "date", "comment": null}, "start_time": {"type": "time without time zone", "index": 5, "name": "start_time", "comment": null}, "end_time": {"type": "time without time zone", "index": 6, "name": "end_time", "comment": null}, "repeat_end_date": {"type": "date_string", "index": 7, "name": "repeat_end_date", "comment": null}, "repeat_frequency": {"type": "smallint", "index": 8, "name": "repeat_frequency", "comment": null}, "repeat_unit": {"type": "character varying(255)", "index": 9, "name": "repeat_unit", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 10, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 11, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 12, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.location_assignment_templates"}, "source.tamanu_source_dbt.tamanu.location_assignments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "location_assignments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 2, "name": "user_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 3, "name": "location_id", "comment": null}, "date": {"type": "date_string", "index": 4, "name": "date", "comment": null}, "start_time": {"type": "time without time zone", "index": 5, "name": "start_time", "comment": null}, "end_time": {"type": "time without time zone", "index": 6, "name": "end_time", "comment": null}, "template_id": {"type": "uuid", "index": 7, "name": "template_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.location_assignments"}, "source.tamanu_source_dbt.tamanu.location_groups": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "location_groups", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "code": {"type": "character varying(255)", "index": 7, "name": "code", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 8, "name": "facility_id", "comment": null}, "is_bookable": {"type": "character varying(255)", "index": 13, "name": "is_bookable", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.location_groups"}, "source.tamanu_source_dbt.tamanu.locations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "locations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 7, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 11, "name": "visibility_status", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 12, "name": "location_group_id", "comment": null}, "max_occupancy": {"type": "integer", "index": 13, "name": "max_occupancy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.locations"}, "source.tamanu_source_dbt.tamanu.medication_administration_record_doses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "medication_administration_record_doses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "dose_amount": {"type": "numeric", "index": 2, "name": "dose_amount", "comment": null}, "given_time": {"type": "date_time_string", "index": 3, "name": "given_time", "comment": null}, "given_by_user_id": {"type": "character varying(255)", "index": 4, "name": "given_by_user_id", "comment": null}, "recorded_by_user_id": {"type": "character varying(255)", "index": 5, "name": "recorded_by_user_id", "comment": null}, "mar_id": {"type": "character varying(255)", "index": 6, "name": "mar_id", "comment": null}, "dose_index": {"type": "integer", "index": 7, "name": "dose_index", "comment": null}, "is_removed": {"type": "boolean", "index": 8, "name": "is_removed", "comment": null}, "reason_for_removal": {"type": "character varying(255)", "index": 9, "name": "reason_for_removal", "comment": null}, "reason_for_change": {"type": "character varying(255)", "index": 10, "name": "reason_for_change", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 11, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 12, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 13, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.medication_administration_record_doses"}, "source.tamanu_source_dbt.tamanu.medication_administration_records": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "medication_administration_records", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "status": {"type": "character varying(255)", "index": 2, "name": "status", "comment": null}, "due_at": {"type": "date_time_string", "index": 3, "name": "due_at", "comment": null}, "recorded_at": {"type": "date_time_string", "index": 4, "name": "recorded_at", "comment": null}, "recorded_by_user_id": {"type": "character varying(255)", "index": 5, "name": "recorded_by_user_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 6, "name": "prescription_id", "comment": null}, "is_auto_generated": {"type": "boolean", "index": 7, "name": "is_auto_generated", "comment": null}, "changing_status_reason": {"type": "text", "index": 8, "name": "changing_status_reason", "comment": null}, "changing_not_given_info_reason": {"type": "character varying(255)", "index": 9, "name": "changing_not_given_info_reason", "comment": null}, "reason_not_given_id": {"type": "character varying(255)", "index": 10, "name": "reason_not_given_id", "comment": null}, "is_error": {"type": "boolean", "index": 11, "name": "is_error", "comment": null}, "error_notes": {"type": "text", "index": 12, "name": "error_notes", "comment": null}, "is_edited": {"type": "boolean", "index": 13, "name": "is_edited", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 14, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 15, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 16, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.medication_administration_records"}, "source.tamanu_source_dbt.tamanu.medication_dispenses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "medication_dispenses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "pharmacy_order_prescription_id": {"type": "uuid", "index": 2, "name": "pharmacy_order_prescription_id", "comment": null}, "quantity": {"type": "integer", "index": 3, "name": "quantity", "comment": null}, "instructions": {"type": "text", "index": 4, "name": "instructions", "comment": null}, "dispensed_by_user_id": {"type": "character varying(255)", "index": 5, "name": "dispensed_by_user_id", "comment": null}, "dispensed_at": {"type": "date_time_string", "index": 6, "name": "dispensed_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 7, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 8, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 9, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.medication_dispenses"}, "source.tamanu_source_dbt.tamanu.note_items": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "note_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note_page_id": {"type": "uuid", "index": 5, "name": "note_page_id", "comment": null}, "revised_by_id": {"type": "character varying(255)", "index": 6, "name": "revised_by_id", "comment": null}, "author_id": {"type": "character varying(255)", "index": 7, "name": "author_id", "comment": null}, "on_behalf_of_id": {"type": "character varying(255)", "index": 8, "name": "on_behalf_of_id", "comment": null}, "content": {"type": "text", "index": 9, "name": "content", "comment": null}, "date": {"type": "date_time_string", "index": 10, "name": "date", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 11, "name": "date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.note_items"}, "source.tamanu_source_dbt.tamanu.note_pages": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "note_pages", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note_type": {"type": "character varying(255)", "index": 5, "name": "note_type", "comment": null}, "record_id": {"type": "character varying(255)", "index": 6, "name": "record_id", "comment": null}, "record_type": {"type": "character varying(255)", "index": 7, "name": "record_type", "comment": null}, "date": {"type": "date_time_string", "index": 8, "name": "date", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 9, "name": "date_legacy", "comment": null}, "visibility_status": {"type": "text", "index": 10, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.note_pages"}, "source.tamanu_source_dbt.tamanu.notes": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "notes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "record_id": {"type": "character varying(255)", "index": 6, "name": "record_id", "comment": null}, "record_type": {"type": "character varying(255)", "index": 7, "name": "record_type", "comment": null}, "date": {"type": "date_time_string", "index": 8, "name": "date", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 9, "name": "date_legacy", "comment": null}, "visibility_status": {"type": "text", "index": 10, "name": "visibility_status", "comment": null}, "author_id": {"type": "character varying(255)", "index": 11, "name": "author_id", "comment": null}, "on_behalf_of_id": {"type": "character varying(255)", "index": 12, "name": "on_behalf_of_id", "comment": null}, "content": {"type": "text", "index": 14, "name": "content", "comment": null}, "revised_by_id": {"type": "uuid", "index": 15, "name": "revised_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}, "note_type_id": {"type": "character varying(255)", "index": 17, "name": "note_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.notes"}, "source.tamanu_source_dbt.tamanu.notes_legacy": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "notes_legacy", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "record_id": {"type": "character varying(255)", "index": 5, "name": "record_id", "comment": null}, "record_type": {"type": "character varying(255)", "index": 6, "name": "record_type", "comment": null}, "date": {"type": "timestamp with time zone", "index": 7, "name": "date", "comment": null}, "note_type": {"type": "character varying(255)", "index": 8, "name": "note_type", "comment": null}, "content": {"type": "text", "index": 9, "name": "content", "comment": null}, "author_id": {"type": "character varying(255)", "index": 10, "name": "author_id", "comment": null}, "on_behalf_of_id": {"type": "character varying(255)", "index": 11, "name": "on_behalf_of_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.notes_legacy"}, "source.tamanu_source_dbt.tamanu.notifications": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "notifications", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "type": {"type": "character varying(255)", "index": 2, "name": "type", "comment": null}, "status": {"type": "character varying(255)", "index": 3, "name": "status", "comment": null}, "user_id": {"type": "character varying(255)", "index": 4, "name": "user_id", "comment": null}, "created_time": {"type": "date_time_string", "index": 5, "name": "created_time", "comment": null}, "metadata": {"type": "jsonb", "index": 6, "name": "metadata", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 7, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 8, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 9, "name": "deleted_at", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 10, "name": "patient_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.notifications"}, "source.tamanu_source_dbt.tamanu.one_time_logins": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "one_time_logins", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 2, "name": "user_id", "comment": null}, "token": {"type": "character varying(255)", "index": 3, "name": "token", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "expires_at": {"type": "timestamp with time zone", "index": 7, "name": "expires_at", "comment": null}, "used_at": {"type": "timestamp with time zone", "index": 8, "name": "used_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.one_time_logins"}, "source.tamanu_source_dbt.tamanu.patient_additional_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_additional_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "place_of_birth": {"type": "character varying(255)", "index": 5, "name": "place_of_birth", "comment": null}, "primary_contact_number": {"type": "character varying(255)", "index": 6, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "character varying(255)", "index": 7, "name": "secondary_contact_number", "comment": null}, "marital_status": {"type": "character varying(255)", "index": 8, "name": "marital_status", "comment": null}, "city_town": {"type": "character varying(255)", "index": 9, "name": "city_town", "comment": null}, "street_village": {"type": "character varying(255)", "index": 10, "name": "street_village", "comment": null}, "educational_level": {"type": "character varying(255)", "index": 11, "name": "educational_level", "comment": null}, "social_media": {"type": "character varying(255)", "index": 12, "name": "social_media", "comment": null}, "blood_type": {"type": "character varying(255)", "index": 13, "name": "blood_type", "comment": null}, "title": {"type": "character varying(255)", "index": 14, "name": "title", "comment": null}, "ethnicity_id": {"type": "character varying(255)", "index": 15, "name": "ethnicity_id", "comment": null}, "nationality_id": {"type": "character varying(255)", "index": 16, "name": "nationality_id", "comment": null}, "country_id": {"type": "character varying(255)", "index": 17, "name": "country_id", "comment": null}, "division_id": {"type": "character varying(255)", "index": 18, "name": "division_id", "comment": null}, "subdivision_id": {"type": "character varying(255)", "index": 19, "name": "subdivision_id", "comment": null}, "medical_area_id": {"type": "character varying(255)", "index": 20, "name": "medical_area_id", "comment": null}, "nursing_zone_id": {"type": "character varying(255)", "index": 21, "name": "nursing_zone_id", "comment": null}, "settlement_id": {"type": "character varying(255)", "index": 22, "name": "settlement_id", "comment": null}, "occupation_id": {"type": "character varying(255)", "index": 23, "name": "occupation_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 24, "name": "patient_id", "comment": null}, "birth_certificate": {"type": "character varying(255)", "index": 28, "name": "birth_certificate", "comment": null}, "driving_license": {"type": "character varying(255)", "index": 29, "name": "driving_license", "comment": null}, "passport": {"type": "character varying(255)", "index": 30, "name": "passport", "comment": null}, "religion_id": {"type": "character varying(255)", "index": 31, "name": "religion_id", "comment": null}, "patient_billing_type_id": {"type": "character varying(255)", "index": 32, "name": "patient_billing_type_id", "comment": null}, "country_of_birth_id": {"type": "character varying(255)", "index": 33, "name": "country_of_birth_id", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 34, "name": "registered_by_id", "comment": null}, "emergency_contact_name": {"type": "character varying(255)", "index": 36, "name": "emergency_contact_name", "comment": null}, "emergency_contact_number": {"type": "character varying(255)", "index": 37, "name": "emergency_contact_number", "comment": null}, "mother_id": {"type": "character varying(255)", "index": 39, "name": "mother_id", "comment": null}, "father_id": {"type": "character varying(255)", "index": 40, "name": "father_id", "comment": null}, "id": {"type": "text", "index": 41, "name": "id", "comment": null}, "updated_at_by_field": {"type": "json", "index": 42, "name": "updated_at_by_field", "comment": null}, "health_center_id": {"type": "text", "index": 43, "name": "health_center_id", "comment": null}, "insurer_id": {"type": "character varying(255)", "index": 44, "name": "insurer_id", "comment": null}, "insurer_policy_number": {"type": "character varying(255)", "index": 45, "name": "insurer_policy_number", "comment": null}, "secondary_village_id": {"type": "text", "index": 46, "name": "secondary_village_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 47, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_additional_data"}, "source.tamanu_source_dbt.tamanu.patient_allergies": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_allergies", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "character varying(255)", "index": 5, "name": "note", "comment": null}, "recorded_date": {"type": "date_time_string", "index": 6, "name": "recorded_date", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "practitioner_id": {"type": "character varying(255)", "index": 8, "name": "practitioner_id", "comment": null}, "allergy_id": {"type": "character varying(255)", "index": 9, "name": "allergy_id", "comment": null}, "recorded_date_legacy": {"type": "timestamp with time zone", "index": 14, "name": "recorded_date_legacy", "comment": null}, "reaction_id": {"type": "character varying(255)", "index": 15, "name": "reaction_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_allergies"}, "source.tamanu_source_dbt.tamanu.patient_birth_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_birth_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 5, "name": "patient_id", "comment": null}, "birth_weight": {"type": "numeric", "index": 6, "name": "birth_weight", "comment": null}, "birth_length": {"type": "numeric", "index": 7, "name": "birth_length", "comment": null}, "birth_delivery_type": {"type": "character varying(255)", "index": 8, "name": "birth_delivery_type", "comment": null}, "gestational_age_estimate": {"type": "double precision", "index": 9, "name": "gestational_age_estimate", "comment": null}, "apgar_score_one_minute": {"type": "integer", "index": 10, "name": "apgar_score_one_minute", "comment": null}, "apgar_score_five_minutes": {"type": "integer", "index": 11, "name": "apgar_score_five_minutes", "comment": null}, "apgar_score_ten_minutes": {"type": "integer", "index": 12, "name": "apgar_score_ten_minutes", "comment": null}, "time_of_birth": {"type": "date_time_string", "index": 13, "name": "time_of_birth", "comment": null}, "birth_type": {"type": "character varying(255)", "index": 15, "name": "birth_type", "comment": null}, "attendant_at_birth": {"type": "character varying(255)", "index": 16, "name": "attendant_at_birth", "comment": null}, "name_of_attendant_at_birth": {"type": "character varying(255)", "index": 17, "name": "name_of_attendant_at_birth", "comment": null}, "birth_facility_id": {"type": "character varying(255)", "index": 18, "name": "birth_facility_id", "comment": null}, "registered_birth_place": {"type": "character varying(255)", "index": 19, "name": "registered_birth_place", "comment": null}, "time_of_birth_legacy": {"type": "character varying(255)", "index": 24, "name": "time_of_birth_legacy", "comment": null}, "id": {"type": "text", "index": 25, "name": "id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 26, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_birth_data"}, "source.tamanu_source_dbt.tamanu.patient_care_plans": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_care_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "examiner_id": {"type": "character varying(255)", "index": 7, "name": "examiner_id", "comment": null}, "care_plan_id": {"type": "character varying(255)", "index": 8, "name": "care_plan_id", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 13, "name": "date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_care_plans"}, "source.tamanu_source_dbt.tamanu.patient_communications": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_communications", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "type": {"type": "text", "index": 5, "name": "type", "comment": null}, "channel": {"type": "text", "index": 6, "name": "channel", "comment": null}, "subject": {"type": "text", "index": 7, "name": "subject", "comment": null}, "content": {"type": "text", "index": 8, "name": "content", "comment": null}, "status": {"type": "enum_patient_communications_status", "index": 9, "name": "status", "comment": null}, "error": {"type": "text", "index": 10, "name": "error", "comment": null}, "retry_count": {"type": "integer", "index": 11, "name": "retry_count", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 12, "name": "patient_id", "comment": null}, "destination": {"type": "character varying(255)", "index": 13, "name": "destination", "comment": null}, "attachment": {"type": "character varying(255)", "index": 14, "name": "attachment", "comment": null}, "hash": {"type": "integer", "index": 15, "name": "hash", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_communications"}, "source.tamanu_source_dbt.tamanu.patient_conditions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "character varying(255)", "index": 5, "name": "note", "comment": null}, "recorded_date": {"type": "date_time_string", "index": 6, "name": "recorded_date", "comment": null}, "resolved": {"type": "boolean", "index": 7, "name": "resolved", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 8, "name": "patient_id", "comment": null}, "examiner_id": {"type": "character varying(255)", "index": 9, "name": "examiner_id", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 10, "name": "condition_id", "comment": null}, "recorded_date_legacy": {"type": "timestamp with time zone", "index": 15, "name": "recorded_date_legacy", "comment": null}, "resolution_date": {"type": "date_time_string", "index": 16, "name": "resolution_date", "comment": null}, "resolution_practitioner_id": {"type": "character varying(255)", "index": 17, "name": "resolution_practitioner_id", "comment": null}, "resolution_note": {"type": "text", "index": 18, "name": "resolution_note", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 19, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_conditions"}, "source.tamanu_source_dbt.tamanu.patient_contacts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_contacts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "method": {"type": "text", "index": 6, "name": "method", "comment": null}, "connection_details": {"type": "jsonb", "index": 7, "name": "connection_details", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 9, "name": "patient_id", "comment": null}, "relationship_id": {"type": "character varying(255)", "index": 10, "name": "relationship_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_contacts"}, "source.tamanu_source_dbt.tamanu.patient_death_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_death_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 3, "name": "clinician_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "manner": {"type": "character varying(255)", "index": 5, "name": "manner", "comment": null}, "recent_surgery": {"type": "character varying(255)", "index": 6, "name": "recent_surgery", "comment": null}, "last_surgery_date": {"type": "date_string", "index": 7, "name": "last_surgery_date", "comment": null}, "last_surgery_reason_id": {"type": "character varying(255)", "index": 8, "name": "last_surgery_reason_id", "comment": null}, "external_cause_date": {"type": "date_string", "index": 9, "name": "external_cause_date", "comment": null}, "external_cause_location": {"type": "character varying(255)", "index": 10, "name": "external_cause_location", "comment": null}, "external_cause_notes": {"type": "text", "index": 11, "name": "external_cause_notes", "comment": null}, "was_pregnant": {"type": "character varying(255)", "index": 12, "name": "was_pregnant", "comment": null}, "pregnancy_contributed": {"type": "character varying(255)", "index": 13, "name": "pregnancy_contributed", "comment": null}, "fetal_or_infant": {"type": "boolean", "index": 14, "name": "fetal_or_infant", "comment": null}, "stillborn": {"type": "character varying(255)", "index": 15, "name": "stillborn", "comment": null}, "birth_weight": {"type": "integer", "index": 16, "name": "birth_weight", "comment": null}, "within_day_of_birth": {"type": "boolean", "index": 17, "name": "within_day_of_birth", "comment": null}, "hours_survived_since_birth": {"type": "integer", "index": 18, "name": "hours_survived_since_birth", "comment": null}, "carrier_age": {"type": "integer", "index": 19, "name": "carrier_age", "comment": null}, "carrier_pregnancy_weeks": {"type": "integer", "index": 20, "name": "carrier_pregnancy_weeks", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 26, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 27, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 28, "name": "deleted_at", "comment": null}, "outside_health_facility": {"type": "boolean", "index": 32, "name": "outside_health_facility", "comment": null}, "primary_cause_time_after_onset": {"type": "integer", "index": 33, "name": "primary_cause_time_after_onset", "comment": null}, "primary_cause_condition_id": {"type": "character varying(255)", "index": 34, "name": "primary_cause_condition_id", "comment": null}, "antecedent_cause1_time_after_onset": {"type": "integer", "index": 35, "name": "antecedent_cause1_time_after_onset", "comment": null}, "antecedent_cause1_condition_id": {"type": "character varying(255)", "index": 36, "name": "antecedent_cause1_condition_id", "comment": null}, "antecedent_cause2_time_after_onset": {"type": "integer", "index": 37, "name": "antecedent_cause2_time_after_onset", "comment": null}, "antecedent_cause2_condition_id": {"type": "character varying(255)", "index": 38, "name": "antecedent_cause2_condition_id", "comment": null}, "external_cause_date_legacy": {"type": "timestamp with time zone", "index": 39, "name": "external_cause_date_legacy", "comment": null}, "last_surgery_date_legacy": {"type": "timestamp with time zone", "index": 40, "name": "last_surgery_date_legacy", "comment": null}, "is_final": {"type": "boolean", "index": 41, "name": "is_final", "comment": null}, "visibility_status": {"type": "text", "index": 42, "name": "visibility_status", "comment": null}, "antecedent_cause3_time_after_onset": {"type": "integer", "index": 43, "name": "antecedent_cause3_time_after_onset", "comment": null}, "antecedent_cause3_condition_id": {"type": "character varying(255)", "index": 44, "name": "antecedent_cause3_condition_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 45, "name": "updated_at_sync_tick", "comment": null}, "autopsy_requested": {"type": "character varying(255)", "index": 46, "name": "autopsy_requested", "comment": null}, "autopsy_findings_used": {"type": "character varying(255)", "index": 47, "name": "autopsy_findings_used", "comment": null}, "manner_of_death_description": {"type": "text", "index": 48, "name": "manner_of_death_description", "comment": null}, "pregnancy_moment": {"type": "character varying(255)", "index": 49, "name": "pregnancy_moment", "comment": null}, "multiple_pregnancy": {"type": "character varying(255)", "index": 50, "name": "multiple_pregnancy", "comment": null}, "mother_condition_description": {"type": "text", "index": 51, "name": "mother_condition_description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_death_data"}, "source.tamanu_source_dbt.tamanu.patient_facilities": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 5, "name": "facility_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_facilities"}, "source.tamanu_source_dbt.tamanu.patient_family_histories": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_family_histories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "character varying(255)", "index": 5, "name": "note", "comment": null}, "recorded_date": {"type": "date_time_string", "index": 6, "name": "recorded_date", "comment": null}, "relationship": {"type": "character varying(255)", "index": 7, "name": "relationship", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 8, "name": "patient_id", "comment": null}, "practitioner_id": {"type": "character varying(255)", "index": 9, "name": "practitioner_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 10, "name": "diagnosis_id", "comment": null}, "recorded_date_legacy": {"type": "timestamp with time zone", "index": 15, "name": "recorded_date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_family_histories"}, "source.tamanu_source_dbt.tamanu.patient_field_definition_categories": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_field_definition_categories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 9, "name": "name", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_definition_categories"}, "source.tamanu_source_dbt.tamanu.patient_field_definitions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_field_definitions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 9, "name": "name", "comment": null}, "field_type": {"type": "character varying(255)", "index": 10, "name": "field_type", "comment": null}, "options": {"type": "character varying(255)[]", "index": 11, "name": "options", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 12, "name": "visibility_status", "comment": null}, "category_id": {"type": "character varying(255)", "index": 13, "name": "category_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_definitions"}, "source.tamanu_source_dbt.tamanu.patient_field_values": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_field_values", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "value": {"type": "text", "index": 9, "name": "value", "comment": null}, "definition_id": {"type": "character varying(255)", "index": 10, "name": "definition_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 11, "name": "patient_id", "comment": null}, "id": {"type": "text", "index": 12, "name": "id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_values"}, "source.tamanu_source_dbt.tamanu.patient_issues": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_issues", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "character varying(255)", "index": 5, "name": "note", "comment": null}, "recorded_date": {"type": "date_time_string", "index": 6, "name": "recorded_date", "comment": null}, "type": {"type": "enum_patient_issues_type", "index": 7, "name": "type", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 8, "name": "patient_id", "comment": null}, "recorded_date_legacy": {"type": "timestamp with time zone", "index": 13, "name": "recorded_date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_issues"}, "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_ongoing_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 3, "name": "prescription_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"}, "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_program_registration_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "deletion_date": {"type": "date_time_string", "index": 7, "name": "deletion_date", "comment": null}, "program_registry_condition_id": {"type": "character varying(255)", "index": 10, "name": "program_registry_condition_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 11, "name": "clinician_id", "comment": null}, "deletion_clinician_id": {"type": "character varying(255)", "index": 12, "name": "deletion_clinician_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}, "reason_for_change": {"type": "character varying(255)", "index": 15, "name": "reason_for_change", "comment": null}, "patient_program_registration_id": {"type": "text", "index": 17, "name": "patient_program_registration_id", "comment": null}, "program_registry_condition_category_id": {"type": "text", "index": 18, "name": "program_registry_condition_category_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"}, "source.tamanu_source_dbt.tamanu.patient_program_registrations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_program_registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "registration_status": {"type": "text", "index": 6, "name": "registration_status", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 8, "name": "program_registry_id", "comment": null}, "clinical_status_id": {"type": "character varying(255)", "index": 9, "name": "clinical_status_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 10, "name": "clinician_id", "comment": null}, "registering_facility_id": {"type": "character varying(255)", "index": 11, "name": "registering_facility_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 12, "name": "facility_id", "comment": null}, "village_id": {"type": "character varying(255)", "index": 13, "name": "village_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 15, "name": "updated_at_sync_tick", "comment": null}, "deactivated_clinician_id": {"type": "character varying(255)", "index": 16, "name": "deactivated_clinician_id", "comment": null}, "deactivated_date": {"type": "character varying(255)", "index": 17, "name": "deactivated_date", "comment": null}, "id": {"type": "text", "index": 18, "name": "id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_program_registrations"}, "source.tamanu_source_dbt.tamanu.patient_secondary_ids": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_secondary_ids", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "value": {"type": "character varying(255)", "index": 9, "name": "value", "comment": null}, "visibility_status": {"type": "text", "index": 10, "name": "visibility_status", "comment": null}, "type_id": {"type": "character varying(255)", "index": 11, "name": "type_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 12, "name": "patient_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_secondary_ids"}, "source.tamanu_source_dbt.tamanu.patient_vrs_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_vrs_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "id_type": {"type": "character varying(255)", "index": 5, "name": "id_type", "comment": null}, "identifier": {"type": "character varying(255)", "index": 6, "name": "identifier", "comment": null}, "unmatched_village_name": {"type": "character varying(255)", "index": 7, "name": "unmatched_village_name", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 8, "name": "patient_id", "comment": null}, "is_deleted_by_remote": {"type": "boolean", "index": 9, "name": "is_deleted_by_remote", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_vrs_data"}, "source.tamanu_source_dbt.tamanu.patients": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patients", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "middle_name": {"type": "character varying(255)", "index": 7, "name": "middle_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 8, "name": "last_name", "comment": null}, "cultural_name": {"type": "character varying(255)", "index": 9, "name": "cultural_name", "comment": null}, "email": {"type": "character varying(255)", "index": 10, "name": "email", "comment": null}, "date_of_birth": {"type": "date_string", "index": 11, "name": "date_of_birth", "comment": null}, "sex": {"type": "enum_patients_sex", "index": 12, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 14, "name": "village_id", "comment": null}, "additional_details": {"type": "text", "index": 24, "name": "additional_details", "comment": null}, "date_of_death": {"type": "date_time_string", "index": 31, "name": "date_of_death", "comment": null}, "merged_into_id": {"type": "character varying(255)", "index": 32, "name": "merged_into_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 33, "name": "visibility_status", "comment": null}, "date_of_birth_legacy": {"type": "timestamp with time zone", "index": 34, "name": "date_of_birth_legacy", "comment": null}, "date_of_death_legacy": {"type": "timestamp with time zone", "index": 35, "name": "date_of_death_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 36, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patients"}, "source.tamanu_source_dbt.tamanu.permissions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "permissions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "role_id": {"type": "character varying(255)", "index": 5, "name": "role_id", "comment": null}, "noun": {"type": "character varying(255)", "index": 6, "name": "noun", "comment": null}, "verb": {"type": "character varying(255)", "index": 7, "name": "verb", "comment": null}, "object_id": {"type": "character varying(255)", "index": 8, "name": "object_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.permissions"}, "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "pharmacy_order_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "pharmacy_order_id": {"type": "uuid", "index": 2, "name": "pharmacy_order_id", "comment": null}, "prescription_id": {"type": "text", "index": 3, "name": "prescription_id", "comment": null}, "quantity": {"type": "integer", "index": 4, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 5, "name": "repeats", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}, "display_id": {"type": "character varying(255)", "index": 10, "name": "display_id", "comment": null}, "is_completed": {"type": "boolean", "index": 11, "name": "is_completed", "comment": null}, "ongoing_prescription_id": {"type": "text", "index": 12, "name": "ongoing_prescription_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"}, "source.tamanu_source_dbt.tamanu.pharmacy_orders": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "pharmacy_orders", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "ordering_clinician_id": {"type": "text", "index": 2, "name": "ordering_clinician_id", "comment": null}, "encounter_id": {"type": "text", "index": 3, "name": "encounter_id", "comment": null}, "comments": {"type": "text", "index": 4, "name": "comments", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}, "is_discharge_prescription": {"type": "boolean", "index": 9, "name": "is_discharge_prescription", "comment": null}, "date": {"type": "date_time_string", "index": 10, "name": "date", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 11, "name": "facility_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.pharmacy_orders"}, "source.tamanu_source_dbt.tamanu.portal_one_time_tokens": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "portal_one_time_tokens", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "portal_user_id": {"type": "text", "index": 5, "name": "portal_user_id", "comment": null}, "type": {"type": "character varying(255)", "index": 6, "name": "type", "comment": null}, "token": {"type": "character varying(255)", "index": 7, "name": "token", "comment": null}, "expires_at": {"type": "date_time_string", "index": 8, "name": "expires_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.portal_one_time_tokens"}, "source.tamanu_source_dbt.tamanu.portal_survey_assignments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "portal_survey_assignments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "patient_id": {"type": "text", "index": 5, "name": "patient_id", "comment": null}, "survey_id": {"type": "text", "index": 6, "name": "survey_id", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}, "assigned_at": {"type": "date_time_string", "index": 8, "name": "assigned_at", "comment": null}, "assigned_by_id": {"type": "text", "index": 9, "name": "assigned_by_id", "comment": null}, "survey_response_id": {"type": "text", "index": 10, "name": "survey_response_id", "comment": null}, "facility_id": {"type": "text", "index": 11, "name": "facility_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.portal_survey_assignments"}, "source.tamanu_source_dbt.tamanu.portal_users": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "portal_users", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "patient_id": {"type": "text", "index": 5, "name": "patient_id", "comment": null}, "email": {"type": "text", "index": 6, "name": "email", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}, "status": {"type": "text", "index": 8, "name": "status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.portal_users"}, "source.tamanu_source_dbt.tamanu.prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "end_date": {"type": "date_time_string", "index": 6, "name": "end_date", "comment": null}, "notes": {"type": "character varying(255)", "index": 8, "name": "notes", "comment": null}, "indication": {"type": "character varying(255)", "index": 9, "name": "indication", "comment": null}, "route": {"type": "character varying(255)", "index": 10, "name": "route", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 16, "name": "medication_id", "comment": null}, "prescriber_id": {"type": "character varying(255)", "index": 17, "name": "prescriber_id", "comment": null}, "quantity": {"type": "integer", "index": 18, "name": "quantity", "comment": null}, "discontinued": {"type": "boolean", "index": 19, "name": "discontinued", "comment": null}, "discontinuing_clinician_id": {"type": "character varying(255)", "index": 20, "name": "discontinuing_clinician_id", "comment": null}, "discontinuing_reason": {"type": "character varying(255)", "index": 21, "name": "discontinuing_reason", "comment": null}, "repeats": {"type": "integer", "index": 22, "name": "repeats", "comment": null}, "discontinued_date": {"type": "character varying(255)", "index": 24, "name": "discontinued_date", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 25, "name": "date_legacy", "comment": null}, "end_date_legacy": {"type": "timestamp with time zone", "index": 26, "name": "end_date_legacy", "comment": null}, "is_ongoing": {"type": "boolean", "index": 27, "name": "is_ongoing", "comment": null}, "is_prn": {"type": "boolean", "index": 28, "name": "is_prn", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 29, "name": "is_variable_dose", "comment": null}, "dose_amount": {"type": "numeric", "index": 30, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 31, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 32, "name": "frequency", "comment": null}, "start_date": {"type": "date_time_string", "index": 33, "name": "start_date", "comment": null}, "duration_value": {"type": "numeric", "index": 34, "name": "duration_value", "comment": null}, "duration_unit": {"type": "character varying(255)", "index": 35, "name": "duration_unit", "comment": null}, "is_phone_order": {"type": "boolean", "index": 36, "name": "is_phone_order", "comment": null}, "ideal_times": {"type": "character varying(255)[]", "index": 37, "name": "ideal_times", "comment": null}, "pharmacy_notes": {"type": "character varying(255)", "index": 38, "name": "pharmacy_notes", "comment": null}, "display_pharmacy_notes_in_mar": {"type": "boolean", "index": 39, "name": "display_pharmacy_notes_in_mar", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 40, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.prescriptions"}, "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "procedure_assistant_clinicians", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "procedure_id": {"type": "character varying(255)", "index": 2, "name": "procedure_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 3, "name": "user_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"}, "source.tamanu_source_dbt.tamanu.procedure_survey_responses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "procedure_survey_responses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "procedure_id": {"type": "character varying(255)", "index": 2, "name": "procedure_id", "comment": null}, "survey_response_id": {"type": "character varying(255)", "index": 3, "name": "survey_response_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.procedure_survey_responses"}, "source.tamanu_source_dbt.tamanu.procedure_type_surveys": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "procedure_type_surveys", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 2, "name": "procedure_type_id", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 3, "name": "survey_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.procedure_type_surveys"}, "source.tamanu_source_dbt.tamanu.procedures": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "procedures", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "completed": {"type": "boolean", "index": 5, "name": "completed", "comment": null}, "date": {"type": "date_time_string", "index": 6, "name": "date", "comment": null}, "end_time": {"type": "date_time_string", "index": 7, "name": "end_time", "comment": null}, "note": {"type": "text", "index": 8, "name": "note", "comment": null}, "completed_note": {"type": "text", "index": 9, "name": "completed_note", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 10, "name": "encounter_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 11, "name": "location_id", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 12, "name": "procedure_type_id", "comment": null}, "anaesthetic_id": {"type": "character varying(255)", "index": 13, "name": "anaesthetic_id", "comment": null}, "physician_id": {"type": "character varying(255)", "index": 14, "name": "physician_id", "comment": null}, "anaesthetist_id": {"type": "character varying(255)", "index": 16, "name": "anaesthetist_id", "comment": null}, "start_time": {"type": "date_time_string", "index": 17, "name": "start_time", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 18, "name": "date_legacy", "comment": null}, "start_time_legacy": {"type": "character varying(255)", "index": 19, "name": "start_time_legacy", "comment": null}, "end_time_legacy": {"type": "timestamp with time zone", "index": 20, "name": "end_time_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 21, "name": "updated_at_sync_tick", "comment": null}, "department_id": {"type": "character varying(255)", "index": 22, "name": "department_id", "comment": null}, "assistant_anaesthetist_id": {"type": "character varying(255)", "index": 23, "name": "assistant_anaesthetist_id", "comment": null}, "time_in": {"type": "date_time_string", "index": 24, "name": "time_in", "comment": null}, "time_out": {"type": "date_time_string", "index": 25, "name": "time_out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.procedures"}, "source.tamanu_source_dbt.tamanu.program_data_elements": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_data_elements", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "indicator": {"type": "character varying(255)", "index": 7, "name": "indicator", "comment": null}, "default_text": {"type": "character varying(255)", "index": 8, "name": "default_text", "comment": null}, "default_options": {"type": "text", "index": 9, "name": "default_options", "comment": null}, "type": {"type": "character varying(31)", "index": 10, "name": "type", "comment": null}, "visualisation_config": {"type": "text", "index": 11, "name": "visualisation_config", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_data_elements"}, "source.tamanu_source_dbt.tamanu.program_registries": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_registries", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "text", "index": 5, "name": "code", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "currently_at_type": {"type": "text", "index": 7, "name": "currently_at_type", "comment": null}, "visibility_status": {"type": "text", "index": 8, "name": "visibility_status", "comment": null}, "program_id": {"type": "character varying(255)", "index": 9, "name": "program_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_registries"}, "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_registry_clinical_statuses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "text", "index": 5, "name": "code", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "color": {"type": "text", "index": 7, "name": "color", "comment": null}, "visibility_status": {"type": "text", "index": 8, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 9, "name": "program_registry_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"}, "source.tamanu_source_dbt.tamanu.program_registry_condition_categories": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_registry_condition_categories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "text", "index": 5, "name": "code", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 8, "name": "program_registry_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_condition_categories"}, "source.tamanu_source_dbt.tamanu.program_registry_conditions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_registry_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "text", "index": 5, "name": "code", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 8, "name": "program_registry_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_conditions"}, "source.tamanu_source_dbt.tamanu.programs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "programs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.programs"}, "source.tamanu_source_dbt.tamanu.reference_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "type": {"type": "character varying(255)", "index": 6, "name": "type", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 8, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}, "system_required": {"type": "boolean", "index": 10, "name": "system_required", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_data"}, "source.tamanu_source_dbt.tamanu.reference_data_relations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_data_relations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "reference_data_id": {"type": "text", "index": 5, "name": "reference_data_id", "comment": null}, "reference_data_parent_id": {"type": "text", "index": 6, "name": "reference_data_parent_id", "comment": null}, "type": {"type": "character varying(255)", "index": 7, "name": "type", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_data_relations"}, "source.tamanu_source_dbt.tamanu.reference_drug_facilities": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_drug_facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "reference_drug_id": {"type": "uuid", "index": 2, "name": "reference_drug_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 3, "name": "facility_id", "comment": null}, "quantity": {"type": "integer", "index": 4, "name": "quantity", "comment": null}, "stock_status": {"type": "character varying(255)", "index": 5, "name": "stock_status", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_drug_facilities"}, "source.tamanu_source_dbt.tamanu.reference_drugs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_drugs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "reference_data_id": {"type": "character varying(255)", "index": 2, "name": "reference_data_id", "comment": null}, "route": {"type": "character varying(255)", "index": 3, "name": "route", "comment": null}, "units": {"type": "character varying(255)", "index": 4, "name": "units", "comment": null}, "notes": {"type": "character varying(255)", "index": 5, "name": "notes", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}, "is_sensitive": {"type": "boolean", "index": 10, "name": "is_sensitive", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_drugs"}, "source.tamanu_source_dbt.tamanu.reference_medication_templates": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_medication_templates", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "reference_data_id": {"type": "character varying(255)", "index": 2, "name": "reference_data_id", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 3, "name": "medication_id", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 4, "name": "is_variable_dose", "comment": null}, "is_prn": {"type": "boolean", "index": 5, "name": "is_prn", "comment": null}, "dose_amount": {"type": "numeric", "index": 6, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 7, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 8, "name": "frequency", "comment": null}, "route": {"type": "character varying(255)", "index": 9, "name": "route", "comment": null}, "duration_value": {"type": "numeric", "index": 10, "name": "duration_value", "comment": null}, "duration_unit": {"type": "character varying(255)", "index": 11, "name": "duration_unit", "comment": null}, "notes": {"type": "text", "index": 12, "name": "notes", "comment": null}, "discharge_quantity": {"type": "integer", "index": 13, "name": "discharge_quantity", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 14, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 15, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 16, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}, "is_ongoing": {"type": "boolean", "index": 18, "name": "is_ongoing", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_medication_templates"}, "source.tamanu_source_dbt.tamanu.referrals": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "referred_facility": {"type": "character varying(255)", "index": 15, "name": "referred_facility", "comment": null}, "initiating_encounter_id": {"type": "character varying(255)", "index": 16, "name": "initiating_encounter_id", "comment": null}, "completing_encounter_id": {"type": "character varying(255)", "index": 17, "name": "completing_encounter_id", "comment": null}, "survey_response_id": {"type": "character varying(255)", "index": 18, "name": "survey_response_id", "comment": null}, "status": {"type": "character varying(255)", "index": 19, "name": "status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 20, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.referrals"}, "source.tamanu_source_dbt.tamanu.refresh_tokens": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "refresh_tokens", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "refresh_id": {"type": "text", "index": 2, "name": "refresh_id", "comment": null}, "device_id": {"type": "text", "index": 3, "name": "device_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 4, "name": "user_id", "comment": null}, "expires_at": {"type": "timestamp with time zone", "index": 5, "name": "expires_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 7, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 8, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.refresh_tokens"}, "source.tamanu_source_dbt.tamanu.report_definition_versions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "report_definition_versions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "version_number": {"type": "integer", "index": 9, "name": "version_number", "comment": null}, "notes": {"type": "text", "index": 10, "name": "notes", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "query": {"type": "text", "index": 12, "name": "query", "comment": null}, "query_options": {"type": "json", "index": 13, "name": "query_options", "comment": null}, "report_definition_id": {"type": "character varying(255)", "index": 14, "name": "report_definition_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 15, "name": "user_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.report_definition_versions"}, "source.tamanu_source_dbt.tamanu.report_definitions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "report_definitions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 9, "name": "name", "comment": null}, "db_schema": {"type": "character varying(255)", "index": 10, "name": "db_schema", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.report_definitions"}, "source.tamanu_source_dbt.tamanu.report_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "report_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "report_type": {"type": "character varying(255)", "index": 5, "name": "report_type", "comment": null}, "recipients": {"type": "text", "index": 6, "name": "recipients", "comment": null}, "parameters": {"type": "text", "index": 7, "name": "parameters", "comment": null}, "status": {"type": "character varying(31)", "index": 8, "name": "status", "comment": null}, "requested_by_user_id": {"type": "character varying(255)", "index": 9, "name": "requested_by_user_id", "comment": null}, "error": {"type": "text", "index": 13, "name": "error", "comment": null}, "process_started_time": {"type": "timestamp with time zone", "index": 14, "name": "process_started_time", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 16, "name": "facility_id", "comment": null}, "export_format": {"type": "character varying(255)", "index": 17, "name": "export_format", "comment": null}, "report_definition_version_id": {"type": "character varying(255)", "index": 18, "name": "report_definition_version_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 19, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.report_requests"}, "source.tamanu_source_dbt.tamanu.roles": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "roles", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 5, "name": "name", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 6, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.roles"}, "source.tamanu_source_dbt.tamanu.scheduled_vaccines": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "scheduled_vaccines", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "category": {"type": "character varying(255)", "index": 5, "name": "category", "comment": null}, "label": {"type": "character varying(255)", "index": 6, "name": "label", "comment": null}, "dose_label": {"type": "character varying(255)", "index": 7, "name": "dose_label", "comment": null}, "weeks_from_birth_due": {"type": "integer", "index": 8, "name": "weeks_from_birth_due", "comment": null}, "index": {"type": "integer", "index": 9, "name": "index", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 10, "name": "vaccine_id", "comment": null}, "weeks_from_last_vaccination_due": {"type": "integer", "index": 11, "name": "weeks_from_last_vaccination_due", "comment": null}, "visibility_status": {"type": "text", "index": 12, "name": "visibility_status", "comment": null}, "hide_from_certificate": {"type": "boolean", "index": 13, "name": "hide_from_certificate", "comment": null}, "sort_index": {"type": "integer", "index": 14, "name": "sort_index", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 15, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.scheduled_vaccines"}, "source.tamanu_source_dbt.tamanu.settings": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "settings", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "key": {"type": "text", "index": 5, "name": "key", "comment": null}, "value": {"type": "jsonb", "index": 6, "name": "value", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 7, "name": "facility_id", "comment": null}, "scope": {"type": "text", "index": 8, "name": "scope", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.settings"}, "source.tamanu_source_dbt.tamanu.signers": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "signers", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "country_code": {"type": "character varying(255)", "index": 5, "name": "country_code", "comment": null}, "private_key": {"type": "bytea", "index": 6, "name": "private_key", "comment": null}, "public_key": {"type": "bytea", "index": 7, "name": "public_key", "comment": null}, "request": {"type": "text", "index": 8, "name": "request", "comment": null}, "certificate": {"type": "text", "index": 9, "name": "certificate", "comment": null}, "validity_period_start": {"type": "timestamp with time zone", "index": 10, "name": "validity_period_start", "comment": null}, "validity_period_end": {"type": "timestamp with time zone", "index": 11, "name": "validity_period_end", "comment": null}, "signatures_issued": {"type": "integer", "index": 12, "name": "signatures_issued", "comment": null}, "request_sent_at": {"type": "timestamp with time zone", "index": 13, "name": "request_sent_at", "comment": null}, "working_period_start": {"type": "timestamp with time zone", "index": 14, "name": "working_period_start", "comment": null}, "working_period_end": {"type": "timestamp with time zone", "index": 15, "name": "working_period_end", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.signers"}, "source.tamanu_source_dbt.tamanu.socket_io_attachments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "socket_io_attachments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "payload": {"type": "bytea", "index": 3, "name": "payload", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 4, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.socket_io_attachments"}, "source.tamanu_source_dbt.tamanu.survey_response_answers": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "survey_response_answers", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 5, "name": "name", "comment": null}, "body": {"type": "text", "index": 6, "name": "body", "comment": null}, "response_id": {"type": "character varying(255)", "index": 7, "name": "response_id", "comment": null}, "data_element_id": {"type": "character varying(255)", "index": 8, "name": "data_element_id", "comment": null}, "body_legacy": {"type": "text", "index": 9, "name": "body_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.survey_response_answers"}, "source.tamanu_source_dbt.tamanu.survey_responses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "survey_responses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "start_time": {"type": "date_time_string", "index": 5, "name": "start_time", "comment": null}, "end_time": {"type": "date_time_string", "index": 6, "name": "end_time", "comment": null}, "result": {"type": "double precision", "index": 7, "name": "result", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 8, "name": "survey_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 9, "name": "encounter_id", "comment": null}, "result_text": {"type": "text", "index": 10, "name": "result_text", "comment": null}, "user_id": {"type": "character varying(255)", "index": 11, "name": "user_id", "comment": null}, "start_time_legacy": {"type": "timestamp with time zone", "index": 12, "name": "start_time_legacy", "comment": null}, "end_time_legacy": {"type": "timestamp with time zone", "index": 13, "name": "end_time_legacy", "comment": null}, "notified": {"type": "boolean", "index": 14, "name": "notified", "comment": null}, "metadata": {"type": "jsonb", "index": 15, "name": "metadata", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.survey_responses"}, "source.tamanu_source_dbt.tamanu.survey_screen_components": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "survey_screen_components", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "screen_index": {"type": "integer", "index": 5, "name": "screen_index", "comment": null}, "component_index": {"type": "integer", "index": 6, "name": "component_index", "comment": null}, "text": {"type": "character varying(255)", "index": 7, "name": "text", "comment": null}, "visibility_criteria": {"type": "character varying(255)", "index": 8, "name": "visibility_criteria", "comment": null}, "validation_criteria": {"type": "text", "index": 9, "name": "validation_criteria", "comment": null}, "detail": {"type": "character varying(255)", "index": 10, "name": "detail", "comment": null}, "config": {"type": "character varying(255)", "index": 11, "name": "config", "comment": null}, "options": {"type": "character varying(255)", "index": 12, "name": "options", "comment": null}, "calculation": {"type": "character varying(255)", "index": 13, "name": "calculation", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 14, "name": "survey_id", "comment": null}, "data_element_id": {"type": "character varying(255)", "index": 15, "name": "data_element_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 16, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.survey_screen_components"}, "source.tamanu_source_dbt.tamanu.surveys": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "surveys", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "program_id": {"type": "character varying(255)", "index": 7, "name": "program_id", "comment": null}, "survey_type": {"type": "character varying(255)", "index": 8, "name": "survey_type", "comment": null}, "is_sensitive": {"type": "boolean", "index": 9, "name": "is_sensitive", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 10, "name": "visibility_status", "comment": null}, "notifiable": {"type": "boolean", "index": 11, "name": "notifiable", "comment": null}, "notify_email_addresses": {"type": "character varying(255)[]", "index": 12, "name": "notify_email_addresses", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.surveys"}, "source.tamanu_source_dbt.tamanu.sync_device_ticks": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_device_ticks", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "persisted_at_sync_tick": {"type": "bigint", "index": 2, "name": "persisted_at_sync_tick", "comment": null}, "device_id": {"type": "text", "index": 3, "name": "device_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_device_ticks"}, "source.tamanu_source_dbt.tamanu.sync_lookup": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_lookup", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "record_id": {"type": "character varying(255)", "index": 2, "name": "record_id", "comment": null}, "record_type": {"type": "character varying(255)", "index": 3, "name": "record_type", "comment": null}, "data": {"type": "json", "index": 4, "name": "data", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 8, "name": "facility_id", "comment": null}, "is_lab_request": {"type": "boolean", "index": 9, "name": "is_lab_request", "comment": null}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": null}, "updated_at_by_field_sum": {"type": "bigint", "index": 11, "name": "updated_at_by_field_sum", "comment": null}, "pushed_by_device_id": {"type": "text", "index": 12, "name": "pushed_by_device_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_lookup"}, "source.tamanu_source_dbt.tamanu.sync_lookup_ticks": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_lookup_ticks", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "source_start_tick": {"type": "bigint", "index": 2, "name": "source_start_tick", "comment": null}, "lookup_end_tick": {"type": "bigint", "index": 3, "name": "lookup_end_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_lookup_ticks"}, "source.tamanu_source_dbt.tamanu.sync_queued_devices": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_queued_devices", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "last_seen_time": {"type": "timestamp with time zone", "index": 2, "name": "last_seen_time", "comment": null}, "facility_id_legacy": {"type": "text", "index": 3, "name": "facility_id_legacy", "comment": null}, "last_synced_tick": {"type": "bigint", "index": 4, "name": "last_synced_tick", "comment": null}, "urgent": {"type": "boolean", "index": 5, "name": "urgent", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "facility_ids": {"type": "jsonb", "index": 9, "name": "facility_ids", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_queued_devices"}, "source.tamanu_source_dbt.tamanu.sync_sessions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_sessions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "start_time": {"type": "timestamp with time zone", "index": 5, "name": "start_time", "comment": null}, "last_connection_time": {"type": "timestamp with time zone", "index": 6, "name": "last_connection_time", "comment": null}, "snapshot_completed_at": {"type": "timestamp with time zone", "index": 7, "name": "snapshot_completed_at", "comment": null}, "debug_info": {"type": "json", "index": 9, "name": "debug_info", "comment": null}, "completed_at": {"type": "timestamp with time zone", "index": 10, "name": "completed_at", "comment": null}, "persist_completed_at": {"type": "timestamp with time zone", "index": 11, "name": "persist_completed_at", "comment": null}, "pull_since": {"type": "bigint", "index": 12, "name": "pull_since", "comment": null}, "pull_until": {"type": "bigint", "index": 13, "name": "pull_until", "comment": null}, "started_at_tick": {"type": "bigint", "index": 14, "name": "started_at_tick", "comment": null}, "snapshot_started_at": {"type": "timestamp with time zone", "index": 15, "name": "snapshot_started_at", "comment": null}, "errors": {"type": "text[]", "index": 16, "name": "errors", "comment": null}, "parameters": {"type": "jsonb", "index": 17, "name": "parameters", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_sessions"}, "source.tamanu_source_dbt.tamanu.task_designations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "task_designations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "task_id": {"type": "uuid", "index": 2, "name": "task_id", "comment": null}, "designation_id": {"type": "character varying(255)", "index": 3, "name": "designation_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.task_designations"}, "source.tamanu_source_dbt.tamanu.task_template_designations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "task_template_designations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "task_template_id": {"type": "uuid", "index": 2, "name": "task_template_id", "comment": null}, "designation_id": {"type": "character varying(255)", "index": 3, "name": "designation_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.task_template_designations"}, "source.tamanu_source_dbt.tamanu.task_templates": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "task_templates", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "reference_data_id": {"type": "character varying(255)", "index": 2, "name": "reference_data_id", "comment": null}, "high_priority": {"type": "boolean", "index": 3, "name": "high_priority", "comment": null}, "frequency_value": {"type": "numeric", "index": 4, "name": "frequency_value", "comment": null}, "frequency_unit": {"type": "character varying(255)", "index": 5, "name": "frequency_unit", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.task_templates"}, "source.tamanu_source_dbt.tamanu.tasks": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "tasks", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "due_time": {"type": "date_time_string", "index": 4, "name": "due_time", "comment": null}, "end_time": {"type": "date_time_string", "index": 5, "name": "end_time", "comment": null}, "requested_by_user_id": {"type": "character varying(255)", "index": 6, "name": "requested_by_user_id", "comment": null}, "request_time": {"type": "date_time_string", "index": 7, "name": "request_time", "comment": null}, "status": {"type": "character varying(255)", "index": 8, "name": "status", "comment": null}, "note": {"type": "text", "index": 9, "name": "note", "comment": null}, "frequency_value": {"type": "numeric", "index": 10, "name": "frequency_value", "comment": null}, "frequency_unit": {"type": "character varying(255)", "index": 11, "name": "frequency_unit", "comment": null}, "high_priority": {"type": "boolean", "index": 12, "name": "high_priority", "comment": null}, "parent_task_id": {"type": "uuid", "index": 13, "name": "parent_task_id", "comment": null}, "completed_by_user_id": {"type": "character varying(255)", "index": 14, "name": "completed_by_user_id", "comment": null}, "completed_time": {"type": "date_time_string", "index": 15, "name": "completed_time", "comment": null}, "completed_note": {"type": "text", "index": 16, "name": "completed_note", "comment": null}, "not_completed_by_user_id": {"type": "character varying(255)", "index": 17, "name": "not_completed_by_user_id", "comment": null}, "not_completed_time": {"type": "date_time_string", "index": 18, "name": "not_completed_time", "comment": null}, "not_completed_reason_id": {"type": "text", "index": 19, "name": "not_completed_reason_id", "comment": null}, "todo_by_user_id": {"type": "character varying(255)", "index": 20, "name": "todo_by_user_id", "comment": null}, "todo_time": {"type": "date_time_string", "index": 21, "name": "todo_time", "comment": null}, "todo_note": {"type": "text", "index": 22, "name": "todo_note", "comment": null}, "deleted_by_user_id": {"type": "character varying(255)", "index": 23, "name": "deleted_by_user_id", "comment": null}, "deleted_time": {"type": "date_time_string", "index": 24, "name": "deleted_time", "comment": null}, "deleted_reason_id": {"type": "character varying(255)", "index": 25, "name": "deleted_reason_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 26, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 27, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 28, "name": "deleted_at", "comment": null}, "deleted_reason_for_sync_id": {"type": "character varying(255)", "index": 29, "name": "deleted_reason_for_sync_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 30, "name": "updated_at_sync_tick", "comment": null}, "duration_value": {"type": "numeric", "index": 31, "name": "duration_value", "comment": null}, "duration_unit": {"type": "character varying(255)", "index": 32, "name": "duration_unit", "comment": null}, "task_type": {"type": "character varying(255)", "index": 33, "name": "task_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.tasks"}, "source.tamanu_source_dbt.tamanu.templates": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "templates", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 2, "name": "deleted_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 3, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 4, "name": "updated_at", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "date_created": {"type": "date_string", "index": 6, "name": "date_created", "comment": null}, "title": {"type": "text", "index": 7, "name": "title", "comment": null}, "body": {"type": "text", "index": 8, "name": "body", "comment": null}, "visibility_status": {"type": "text", "index": 9, "name": "visibility_status", "comment": null}, "created_by_id": {"type": "character varying(255)", "index": 10, "name": "created_by_id", "comment": null}, "type": {"type": "text", "index": 11, "name": "type", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.templates"}, "source.tamanu_source_dbt.tamanu.translated_strings": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "translated_strings", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "string_id": {"type": "text", "index": 2, "name": "string_id", "comment": null}, "language": {"type": "text", "index": 3, "name": "language", "comment": null}, "text": {"type": "text", "index": 4, "name": "text", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.translated_strings"}, "source.tamanu_source_dbt.tamanu.triages": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "triages", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "arrival_time": {"type": "date_time_string", "index": 5, "name": "arrival_time", "comment": null}, "triage_time": {"type": "date_time_string", "index": 6, "name": "triage_time", "comment": null}, "closed_time": {"type": "date_time_string", "index": 7, "name": "closed_time", "comment": null}, "score": {"type": "text", "index": 8, "name": "score", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 9, "name": "encounter_id", "comment": null}, "practitioner_id": {"type": "character varying(255)", "index": 10, "name": "practitioner_id", "comment": null}, "chief_complaint_id": {"type": "character varying(255)", "index": 11, "name": "chief_complaint_id", "comment": null}, "secondary_complaint_id": {"type": "character varying(255)", "index": 12, "name": "secondary_complaint_id", "comment": null}, "arrival_time_legacy": {"type": "timestamp with time zone", "index": 13, "name": "arrival_time_legacy", "comment": null}, "triage_time_legacy": {"type": "timestamp with time zone", "index": 14, "name": "triage_time_legacy", "comment": null}, "closed_time_legacy": {"type": "timestamp with time zone", "index": 15, "name": "closed_time_legacy", "comment": null}, "arrival_mode_id": {"type": "character varying(255)", "index": 16, "name": "arrival_mode_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.triages"}, "source.tamanu_source_dbt.tamanu.upcoming_vaccinations": {"metadata": {"type": "VIEW", "schema": "public", "name": "upcoming_vaccinations", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 2, "name": "scheduled_vaccine_id", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 3, "name": "vaccine_category", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 4, "name": "vaccine_id", "comment": null}, "due_date": {"type": "date", "index": 5, "name": "due_date", "comment": null}, "days_till_due": {"type": "integer", "index": 6, "name": "days_till_due", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"}, "source.tamanu_source_dbt.tamanu.user_designations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_designations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 2, "name": "user_id", "comment": null}, "designation_id": {"type": "character varying(255)", "index": 3, "name": "designation_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_designations"}, "source.tamanu_source_dbt.tamanu.user_facilities": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 5, "name": "facility_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 6, "name": "user_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_facilities"}, "source.tamanu_source_dbt.tamanu.user_leaves": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_leaves", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "start_date": {"type": "date_string", "index": 2, "name": "start_date", "comment": null}, "end_date": {"type": "date_string", "index": 3, "name": "end_date", "comment": null}, "user_id": {"type": "character varying(255)", "index": 4, "name": "user_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 10, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 11, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_leaves"}, "source.tamanu_source_dbt.tamanu.user_localisation_caches": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_localisation_caches", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "localisation": {"type": "text", "index": 2, "name": "localisation", "comment": null}, "user_id": {"type": "character varying(255)", "index": 3, "name": "user_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_localisation_caches"}, "source.tamanu_source_dbt.tamanu.user_login_attempts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_login_attempts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "outcome": {"type": "text", "index": 5, "name": "outcome", "comment": null}, "user_id": {"type": "character varying(255)", "index": 6, "name": "user_id", "comment": null}, "device_id": {"type": "text", "index": 7, "name": "device_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_login_attempts"}, "source.tamanu_source_dbt.tamanu.user_preferences": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_preferences", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "user_id": {"type": "character varying(255)", "index": 5, "name": "user_id", "comment": null}, "key": {"type": "character varying(255)", "index": 8, "name": "key", "comment": null}, "value": {"type": "jsonb", "index": 9, "name": "value", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 11, "name": "facility_id", "comment": null}, "id": {"type": "text", "index": 12, "name": "id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_preferences"}, "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_recently_viewed_patients", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "user_id": {"type": "character varying(255)", "index": 5, "name": "user_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"}, "source.tamanu_source_dbt.tamanu.users": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "users", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "email": {"type": "character varying(255)", "index": 5, "name": "email", "comment": null}, "password": {"type": "character varying(255)", "index": 6, "name": "password", "comment": null}, "display_name": {"type": "character varying(255)", "index": 7, "name": "display_name", "comment": null}, "role": {"type": "character varying(255)", "index": 8, "name": "role", "comment": null}, "display_id": {"type": "character varying(255)", "index": 9, "name": "display_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 10, "name": "visibility_status", "comment": null}, "phone_number": {"type": "character varying(255)", "index": 11, "name": "phone_number", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}, "device_registration_quota": {"type": "integer", "index": 13, "name": "device_registration_quota", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.users"}, "source.tamanu_source_dbt.tamanu.vital_logs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "vital_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "previous_value": {"type": "text", "index": 6, "name": "previous_value", "comment": null}, "new_value": {"type": "text", "index": 7, "name": "new_value", "comment": null}, "reason_for_change": {"type": "text", "index": 8, "name": "reason_for_change", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 9, "name": "recorded_by_id", "comment": null}, "answer_id": {"type": "character varying(255)", "index": 10, "name": "answer_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.vital_logs"}, "source.tamanu_source_dbt.tamanu.vitals": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "vitals", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date_recorded": {"type": "date_time_string", "index": 5, "name": "date_recorded", "comment": null}, "temperature": {"type": "double precision", "index": 6, "name": "temperature", "comment": null}, "weight": {"type": "double precision", "index": 7, "name": "weight", "comment": null}, "height": {"type": "double precision", "index": 8, "name": "height", "comment": null}, "sbp": {"type": "double precision", "index": 9, "name": "sbp", "comment": null}, "dbp": {"type": "double precision", "index": 10, "name": "dbp", "comment": null}, "heart_rate": {"type": "double precision", "index": 11, "name": "heart_rate", "comment": null}, "respiratory_rate": {"type": "double precision", "index": 12, "name": "respiratory_rate", "comment": null}, "spo2": {"type": "double precision", "index": 13, "name": "spo2", "comment": null}, "avpu": {"type": "enum_vitals_avpu", "index": 14, "name": "avpu", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 15, "name": "encounter_id", "comment": null}, "gcs": {"type": "double precision", "index": 16, "name": "gcs", "comment": null}, "hemoglobin": {"type": "double precision", "index": 17, "name": "hemoglobin", "comment": null}, "fasting_blood_glucose": {"type": "double precision", "index": 18, "name": "fasting_blood_glucose", "comment": null}, "urine_ph": {"type": "double precision", "index": 19, "name": "urine_ph", "comment": null}, "urine_leukocytes": {"type": "character varying(255)", "index": 20, "name": "urine_leukocytes", "comment": null}, "urine_nitrites": {"type": "character varying(255)", "index": 21, "name": "urine_nitrites", "comment": null}, "urobilinogen": {"type": "double precision", "index": 22, "name": "urobilinogen", "comment": null}, "urine_protein": {"type": "character varying(255)", "index": 23, "name": "urine_protein", "comment": null}, "blood_in_urine": {"type": "character varying(255)", "index": 24, "name": "blood_in_urine", "comment": null}, "urine_specific_gravity": {"type": "double precision", "index": 25, "name": "urine_specific_gravity", "comment": null}, "urine_ketone": {"type": "character varying(255)", "index": 26, "name": "urine_ketone", "comment": null}, "urine_bilirubin": {"type": "character varying(255)", "index": 27, "name": "urine_bilirubin", "comment": null}, "urine_glucose": {"type": "double precision", "index": 28, "name": "urine_glucose", "comment": null}, "date_recorded_legacy": {"type": "timestamp with time zone", "index": 29, "name": "date_recorded_legacy", "comment": null}, "migrated_record": {"type": "character varying(255)", "index": 30, "name": "migrated_record", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 31, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.vitals"}}, "errors": null} }, r = { project: {}, tree: { project: [], database: [], sources: [] }, files: { manifest: {}, catalog: {} }, loaded: e.defer() }; function i(e, t) { return u.each(t.sources, (function (e, n) { t.nodes[n] = e })), u.each(e.nodes, (function (e, n) { var r = t.nodes[n]; if (r) { var i, o, a, s = u.keys(r.columns), l = e.columns, c = (i = s, o = l, a = {}, u.each(o, (function (e, t) { var n = u.find(i, (function (e) { return e.toLowerCase() == t.toLowerCase() })); n ? a[n] = e : a[t] = e })), a); e.columns = c } })), l(t, e) } function o(e, r) { return e in n && "object" == typeof n[e] ? { label: e, data: n[e] } : t({ method: "GET", url: r }).then((function (t) { return { label: e, data: t.data } }), (function (t) { console.error(t), alert("dbt Docs was unable to load the " + e + " file at path: \n " + r + "\n\nError: " + t.statusText + " (" + t.status + ")\n\nThe dbt Docs site may not work as expected if this file cannot be found.Please try again, and contact support if this error persists.") })) } return r.find_by_id = function (e, t) { r.ready((function () { if (e) { var n = r.node(e); t(n) } })) }, r.node = function (e) { return u.find(r.project.nodes, { unique_id: e }) }, r.loadProject = function () { var t = "?cb=" + (new Date).getTime(), n = [o("manifest", "manifest.json" + t), o("catalog", "catalog.json" + t)]; e.all(n).then((function (e) { u.each(e, (function (e) { e ? r.files[e.label] = e.data : console.error("FILE FAILED TO LOAD!") })), u.each(r.files.manifest.nodes, (function (e) { "model" == e.resource_type && null != e.version ? e.label = e.name + "_v" + e.version : e.label = e.name })), u.each(r.files.manifest.sources, (function (e) { e.label = e.source_name + "." + e.name, r.files.manifest.nodes[e.unique_id] = e })), u.each(r.files.manifest.exposures, (function (e) { e.label || (e.label = e.name), r.files.manifest.nodes[e.unique_id] = e })), u.each(r.files.manifest.metrics, (function (e) { r.files.manifest.nodes[e.unique_id] = e })), u.each(r.files.manifest.semantic_models, (function (e) { r.files.manifest.nodes[e.unique_id] = e, e.label = e.name })), u.each(r.files.manifest.saved_queries, (function (e) { r.files.manifest.nodes[e.unique_id] = e, e.label = e.name })), u.each(r.files.manifest.unit_tests, (function (e) { r.files.manifest.nodes[e.unique_id] = e, e.label = e.name })); var t = r.files.manifest.metadata.adapter_type, n = function (e, t) { var n = e || [], r = {}; u.each(n, (function (e) { r[e.package_name] || (r[e.package_name] = {}), r[e.package_name][e.name] = e })); e = []; return u.each(r, (function (n, r) { if ("dbt" != r && r != "dbt_" + t) { var i = function (e, t) { var n = {}; u.each(e, (function (e) { e.macro_sql.match(/{{\s*adapter_macro\([^)]+\)\s+}}/) && (e.impls = { "Adapter Macro": e.macro_sql }, e.is_adapter_macro = !0, n[e.name] = e) })); var r = ["postgres", "redshift", "bigquery", "snowflake", "spark", "presto", "default"], i = u.values(n), o = u.filter(e, (function (e) { var t = e.name.split("__"), i = t.shift(), o = t.join("__"); return !(r.indexOf(i) >= 0 && n[o]) || (n[o].impls[i] = e.macro_sql, e.is_adapter_macro_impl = !0, !1) })); return i.concat(o) }(n); e = e.concat(i) } })), u.keyBy(e, "unique_id") }(r.files.manifest.macros, t); r.files.manifest.macros = n; var o = i(r.files.manifest, r.files.catalog), a = o.nodes, s = u.keyBy(a, "name"), l = u.filter(o.nodes, { resource_type: "test" }); u.each(l, (function (e) { if (e.hasOwnProperty("test_metadata")) { var t, n = { test_name: t = e.test_metadata.namespace ? e.test_metadata.namespace + "." + e.test_metadata.name : e.test_metadata.name }; if ("not_null" == e.test_metadata.name) n.short = "N", n.label = "Not Null"; else if ("unique" == e.test_metadata.name) n.short = "U", n.label = "Unique"; else if ("relationships" == e.test_metadata.name) { var r = e.refs[0], i = s[r]; i && e.test_metadata.kwargs.field && (n.fk_field = e.test_metadata.kwargs.field, n.fk_model = i), n.short = "F", n.label = "Foreign Key" } else if ("accepted_values" == e.test_metadata.name) { if (Array.isArray(e.test_metadata.kwargs.values)) var a = e.test_metadata.kwargs.values.join(", "); else a = JSON.stringify(e.test_metadata.kwargs.values); n.short = "A", n.label = "Accepted Values: " + a } else { var l = u.omit(e.test_metadata.kwargs, "column_name"); n.short = "+", n.label = t + "(" + JSON.stringify(l) + ")" } var c = e.depends_on.nodes, p = e.column_name || e.test_metadata.kwargs.column_name || e.test_metadata.kwargs.arg; if (c.length && p) { if ("relationships" == e.test_metadata.name) var f = c[c.length - 1]; else f = c[0]; var h = o.nodes[f], g = d(o.metadata), m = u.find(h.columns, (function (e, t) { let n = p; return p.startsWith(g) && p.endsWith(g) && (n = p.substring(1, p.length - 1)), t.toLowerCase() == n.toLowerCase() })); m && (m.tests = m.tests || [], m.tests.push(n)) } } })), r.project = o; var c = u.filter(r.project.macros, (function (e) { return !e.is_adapter_macro_impl })), p = u.filter(r.project.nodes, (function (e) { return u.includes(["model", "source", "seed", "snapshot", "analysis", "exposure", "metric", "semantic_model", "saved_query"], e.resource_type) })); r.project.searchable = u.filter(p.concat(c), (function (e) { return !e.docs || e.docs.show })), r.loaded.resolve() })) }, r.ready = function (e) { r.loaded.promise.then((function () { e(r.project) })) }, r.search = function (e) { if (0 == e.length) return u.map(r.project.searchable, (function (e) { return { model: e, matches: [] } })); var t = []; return u.each(r.project.searchable, (function (n) { var r = function (e, t) { var n = [], r = { name: "string", description: "string", raw_code: "string", columns: "object", column_description: "n/a", tags: "array", arguments: "array", label: "string" }; let i = u.words(e.toLowerCase()); for (var o in r) if ("column_description" === o) for (var a in t.columns) null != t.columns[a].description && i.every(e => -1 != t.columns[a].description.toLowerCase().indexOf(e)) && n.push({ key: o, value: e }); else { if (!t[o]) continue; if ("string" === r[o] && i.every(e => -1 != t[o].toLowerCase().indexOf(e))) n.push({ key: o, value: e }); else if ("object" === r[o]) for (var a in t[o]) null != t[o][a].name && i.every(e => -1 != t[o][a].name.toLowerCase().indexOf(e)) && n.push({ key: o, value: e }); else if ("array" === r[o]) for (var s of t[o]) i.every(e => -1 != JSON.stringify(s).toLowerCase().indexOf(e)) && n.push({ key: o, value: e }) } return n }(e, n); r.length && t.push({ model: n, matches: r }) })), t }, r.getModelTree = function (e, t) { r.loaded.promise.then((function () { var n = u.values(r.project.macros), i = u.filter(r.project.nodes, (function (e) { if ("test" == e.resource_type && !e.hasOwnProperty("test_metadata")) return !0; return u.includes(["snapshot", "source", "seed", "model", "analysis", "exposure", "metric", "semantic_model", "saved_query"], e.resource_type) })); r.tree.database = function (e, t) { var n = {}, r = u.filter(e, (function (e) { return !!u.get(e, ["docs", "show"], !0) && (-1 != u.indexOf(["source", "snapshot", "seed"], e.resource_type) || ("model" == e.resource_type ? "ephemeral" != e.config.materialized : void 0)) })), i = u.sortBy(r, (function (e) { return e.database + "." + e.schema + "." + (e.identifier || e.alias || e.name) })), o = u.groupBy(i, "database"); return u.each(o, (function (e, r) { var i = { type: "database", name: r, active: !1, items: [] }; n[r] = i; var o = u.groupBy(e, "schema"); u.each(o, (function (e, n) { n = { type: "schema", name: n, active: !1, items: [] }; i.items.push(n), u.each(e, (function (e) { var r = e.unique_id == t; r && (i.active = !0, n.active = !0), n.items.push({ type: "table", name: e.identifier || e.alias || e.name, node: e, active: r, unique_id: e.unique_id, node_type: "model" }) })) })) })), n }(i, e), r.tree.groups = function (e, t) { var n = {}; u.each(e, (function (e) { const r = u.get(e, ["docs", "show"], !0); if (!(e.resource_type in ["source", "exposure", "seed", "macro"]) && r && "private" !== e.access) { if ("model" == e.resource_type && null != e.version) var i = e.name + "_v" + e.version; else i = e.name; var o = "protected" === e.access ? i + " (protected)" : i, a = e.group, s = e.unique_id == t; n[a] ? s && (n[a].active = !0) : n[a] = { type: "group", name: a, active: s, items: [] }, n[a].items.push({ type: "file", name: o, node: e, active: s, unique_id: e.unique_id, node_type: "model" }) } })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { e.items = u.sortBy(e.items, "name") })), n }(i, e), r.tree.project = function (e, t, n) { var r = {}; e = e || [], t = t || []; return u.each(e.concat(t), (function (e) { var t = u.get(e, ["docs", "show"], !0); if ("source" != e.resource_type && "exposure" != e.resource_type && "metric" != e.resource_type && "semantic_model" != e.resource_type && "saved_query" != e.resource_type && t) { if (-1 != e.original_file_path.indexOf("\\")) var i = e.original_file_path.split("\\"); else i = e.original_file_path.split("/"); var o = [e.package_name].concat(i), a = e.unique_id == n, s = u.initial(o); if ("macro" == e.resource_type) var l = e.name; else l = u.last(o); if ("model" == e.resource_type && null != e.version) var c = e.name + "_v" + e.version; else c = e.name; var d = r; u.each(s, (function (e) { d[e] ? a && (d[e].active = !0) : d[e] = { type: "folder", name: e, active: a, items: {} }, d = d[e].items })), d[l] = { type: "file", name: c, node: e, active: a, unique_id: e.unique_id, node_type: e.resource_type } } })), function e(t) { var n = [], r = u.values(t); return u.each(r, (function (t) { if (t.items) { var r = e(t.items), i = u.sortBy(r, "name"); t.items = i } n.push(t) })), n }(r) }(i, n, e); var o = u.values(r.project.sources); r.tree.sources = function (e, t) { var n = {}; u.each(e, (function (e) { var r = e.source_name, i = e.name, o = e.unique_id == t; n[r] ? o && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: o, items: [] }, n[r].items.push({ type: "file", name: i, node: e, active: o, unique_id: e.unique_id, node_type: "source" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { e.items = u.sortBy(e.items, "name") })), n }(o, e); var a = u.values(r.project.exposures); r.tree.exposures = function (e, t) { var n = {}; u.each(e, (function (e) { e.name; var r = e.type || "Uncategorized"; r = function (e) { var t = { ml: "ML" }; return t.hasOwnProperty(e) ? t[e] : e.charAt(0).toUpperCase() + e.slice(1) }(r); var i = e.unique_id == t; n[r] ? i && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: i, items: [] }, n[r].items.push({ type: "file", name: e.label, node: e, active: i, unique_id: e.unique_id, node_type: "exposure" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { e.items = u.sortBy(e.items, "name") })), n }(a, e); var s = u.values(r.project.metrics); r.tree.metrics = function (e, t) { var n = {}; u.each(e, (function (e) { e.name; var r = e.package_name, i = e.unique_id == t; n[r] ? i && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: i, items: [] }, n[r].items.push({ type: "file", name: e.label, node: e, active: i, unique_id: e.unique_id, node_type: "metric" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { n.items = u.sortBy(n.items, "name") })), n }(s, e); var l = u.values(r.project.semantic_models); r.tree.semantic_models = function (e, t) { var n = {}; u.each(e, (function (e) { e.name; var r = e.package_name, i = e.unique_id == t; n[r] ? i && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: i, items: [] }, n[r].items.push({ type: "file", name: e.name, node: e, active: i, unique_id: e.unique_id, node_type: "semantic_model" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { n.items = u.sortBy(n.items, "name") })), n }(l, e); var c = u.values(r.project.saved_queries); r.tree.saved_queries = function (e, t) { var n = {}; u.each(e, (function (e) { e.name; var r = e.package_name, i = e.unique_id == t; n[r] ? i && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: i, items: [] }, n[r].items.push({ type: "file", name: e.name, node: e, active: i, unique_id: e.unique_id, node_type: "saved_query" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { n.items = u.sortBy(n.items, "name") })), n }(c, e), t(r.tree) })) }, r.updateSelectedInTree = function (e, t) { var n = !1; return u.each(t, (function (t) { if (t.node && t.node.unique_id == e) t.active = !0, n = !0; else if (t.node && t.node.unique_id != e) t.active = !1; else { r.updateSelectedInTree(e, t.items) && (t.active = !0, n = !0) } })), n }, r.updateSelected = function (e) { return r.updateSelectedInTree(e, r.tree.project), r.updateSelectedInTree(e, r.tree.database), r.updateSelectedInTree(e, r.tree.groups), r.updateSelectedInTree(e, r.tree.sources), r.updateSelectedInTree(e, r.tree.exposures), r.updateSelectedInTree(e, r.tree.metrics), r.updateSelectedInTree(e, r.tree.semantic_models), r.updateSelectedInTree(e, r.tree.saved_queries), r.tree }, r.caseColumn = function (e) { return "snowflake" == r.project.metadata.adapter_type && e.toUpperCase() == e ? e.toLowerCase() : e }, r.init = function () { r.loadProject() }, r }]) }, function (e, t, n) { const r = n(8); n(209), n(230), n(445), n(459), n(460), n(480), n(481), n(482), r.module("dbt").run(["$rootScope", "$state", "$stateParams", function (e, t, n) { e.$state = t, e.$stateParams = n }]) }, function (e, t) { + }, function (e, t, n) { const r = n(21); function i(e) { return !r.isNull(e) && !r.isUndefined(e) } function o(e, t, n, a) { a || (a = 1); var s = e.predecessors(t); if (!s || 0 == n) return []; var l = s.concat(s.reduce((function (t, r) { return a >= n && i(n) ? t : t.concat(o(e, r, n, a + 1)) }), [])); return r.uniq(l) } function a(e, t, n, o) { o || (o = 1); var s = e.successors(t); if (!s || 0 == n) return []; var l = s.concat(s.reduce((function (t, r) { return o >= n && i(n) ? t : t.concat(a(e, r, n, o + 1)) }), [])); return r.uniq(l) } e.exports = { selectAt: function (e, t) { var n = [t], i = r.union([t], a(e, t)); return r.each(i, (function (t) { var i = o(e, t); n = r.union(n, i, [t]) })), n }, ancestorNodes: o, descendentNodes: a } }, function (e, t) { var n = { utf8: { stringToBytes: function (e) { return n.bin.stringToBytes(unescape(encodeURIComponent(e))) }, bytesToString: function (e) { return decodeURIComponent(escape(n.bin.bytesToString(e))) } }, bin: { stringToBytes: function (e) { for (var t = [], n = 0; n < e.length; n++)t.push(255 & e.charCodeAt(n)); return t }, bytesToString: function (e) { for (var t = [], n = 0; n < e.length; n++)t.push(String.fromCharCode(e[n])); return t.join("") } } }; e.exports = n }, function (e, t) { var n = "/docs/source.html"; window.angular.module("ng").run(["$templateCache", function (e) { e.put(n, '\n\n
\n \n
\n
\n
\n
\n \n
\n\n
\n
\n
\n
Description
\n
\n
\n
\n
This {{ model.resource_type }} is not currently documented
\n
\n
\n
\n
\n
\n
\n
\n
Columns
\n \n
\n
\n\n
\n
\n
\n
Referenced By
\n \n
\n
\n\n
\n
\n
\n \n
\n
\n
\n
\n
\n') }]), e.exports = n }, function (e, t, n) { "use strict"; n.r(t); var r = function (e) { return function (e) { return !!e && "object" == typeof e }(e) && !function (e) { var t = Object.prototype.toString.call(e); return "[object RegExp]" === t || "[object Date]" === t || function (e) { return e.$$typeof === i }(e) }(e) }; var i = "function" == typeof Symbol && Symbol.for ? Symbol.for("react.element") : 60103; function o(e, t) { return !1 !== t.clone && t.isMergeableObject(e) ? s((n = e, Array.isArray(n) ? [] : {}), e, t) : e; var n } function a(e, t, n) { return e.concat(t).map((function (e) { return o(e, n) })) } function s(e, t, n) { (n = n || {}).arrayMerge = n.arrayMerge || a, n.isMergeableObject = n.isMergeableObject || r; var i = Array.isArray(t); return i === Array.isArray(e) ? i ? n.arrayMerge(e, t, n) : function (e, t, n) { var r = {}; return n.isMergeableObject(e) && Object.keys(e).forEach((function (t) { r[t] = o(e[t], n) })), Object.keys(t).forEach((function (i) { n.isMergeableObject(t[i]) && e[i] ? r[i] = s(e[i], t[i], n) : r[i] = o(t[i], n) })), r }(e, t, n) : o(t, n) } s.all = function (e, t) { if (!Array.isArray(e)) throw new Error("first argument should be an array"); return e.reduce((function (e, n) { return s(e, n, t) }), {}) }; var l = s; const c = n(8), u = (n(33), n(202)), { getQuoteChar: d } = n(430); c.module("dbt").factory("project", ["$q", "$http", function (e, t) { var n = { manifest: {"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.11.7", "generated_at": "2026-06-25T21:42:35.579365Z", "invocation_id": "41675ac2-8bd9-453e-900a-687bcbdb9f0e", "invocation_started_at": "2026-06-25T21:40:48.218677+00:00", "env": {}, "project_name": "tamanu_source_dbt", "project_id": "afabe8e537d3a72acd73fa225fed65f4", "user_id": "0cfa0468-841e-40ad-bec7-2b0f9299552d", "send_anonymous_usage_stats": true, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-06-25T21:40:48.218677+00:00"}, "nodes": {"model.tamanu_source_dbt.contributing_death_causes": {"database": "app", "schema": "reporting", "name": "contributing_death_causes", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\contributing_death_causes.sql", "original_file_path": "models\\bases\\contributing_death_causes.sql", "unique_id": "model.tamanu_source_dbt.contributing_death_causes", "fqn": ["tamanu_source_dbt", "bases", "contributing_death_causes"], "alias": "contributing_death_causes", "checksum": {"name": "sha256", "checksum": "11325bae4baf7bc1e117143d6216b6e10d654c77c4363fac83908f3c56dbb200"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Contributing causes recorded with the patient's death data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in contributing_death_causes.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "time_after_onset": {"name": "time_after_onset", "description": "Time between onset of recorded cause and death in minutes.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__time_after_onset"]}, "patient_death_data_id": {"name": "patient_death_data_id", "description": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id"]}, "condition_id": {"name": "condition_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\contributing_death_causes.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423651.9315236, "relation_name": "\"app\".\"reporting\".\"contributing_death_causes\"", "raw_code": "select\r\n cdc.id,\r\n cdc.time_after_onset,\r\n cdc.patient_death_data_id,\r\n cdc.condition_id\r\nfrom {{ source('tamanu', 'contributing_death_causes') }} cdc\r\njoin {{ source('tamanu', 'patient_death_data') }} pdd on pdd.id = cdc.patient_death_data_id\r\nwhere cdc.deleted_at is null\r\n and pdd.deleted_at is null\r\n and pdd.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__contributing_death_causes"], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\contributing_death_causes.sql", "compiled": true, "compiled_code": "select\n cdc.id,\n cdc.time_after_onset,\n cdc.patient_death_data_id,\n cdc.condition_id\nfrom \"app\".\"public\".\"contributing_death_causes\" cdc\njoin \"app\".\"public\".\"patient_death_data\" pdd on pdd.id = cdc.patient_death_data_id\nwhere cdc.deleted_at is null\n and pdd.deleted_at is null\n and pdd.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.departments": {"database": "app", "schema": "reporting", "name": "departments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\departments.sql", "original_file_path": "models\\bases\\departments.sql", "unique_id": "model.tamanu_source_dbt.departments", "fqn": ["tamanu_source_dbt", "bases", "departments"], "alias": "departments", "checksum": {"name": "sha256", "checksum": "ae8e50577c2f66f3fa2645696b1f638ad9c24bb10d201e0860bad7c1d2a67742"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Basic department info with a reference to parent facility.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in departments.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code for department.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__code"]}, "name": {"name": "name", "description": "Full readable name for department.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__name"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this department is in.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in departments.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\departments.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423651.9345202, "relation_name": "\"app\".\"reporting\".\"departments\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n facility_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'departments') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__departments"], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\departments.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n facility_id,\n visibility_status\nfrom \"app\".\"public\".\"departments\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.discharges": {"database": "app", "schema": "reporting", "name": "discharges", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\discharges.sql", "original_file_path": "models\\bases\\discharges.sql", "unique_id": "model.tamanu_source_dbt.discharges", "fqn": ["tamanu_source_dbt", "bases", "discharges"], "alias": "discharges", "checksum": {"name": "sha256", "checksum": "1a9d9bd0295380f6b5f8db6f64af64d34ea064c872a40d521547d40b068c06f2"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Information about a discharge.\r\n\r\nA discharge is the end of the lifecycle for an encounter.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in discharges.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "note": {"name": "note", "description": "Free-form notes about the discharge.\r\n\r\nMay include treatment plan and follow-ups, written by the discharging clinician.\r\n\r\nSince v2.0, also see the [`notes`](#!/source/source.tamanu.tamanu.notes) table for encounter and discharge notes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__note"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this discharge is for.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__encounter_id"]}, "discharged_by_id": {"name": "discharged_by_id", "description": "The [discharging clinician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__discharger_id"]}, "disposition_id": {"name": "disposition_id", "description": "The discharge disposition or classification of the discharge ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__disposition_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\discharges.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423651.936528, "relation_name": "\"app\".\"reporting\".\"discharges\"", "raw_code": "select distinct on (d.encounter_id)\r\n d.id,\r\n d.note,\r\n d.encounter_id,\r\n d.discharger_id as discharged_by_id,\r\n d.disposition_id\r\nfrom {{ source('tamanu', 'discharges') }} d\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = d.encounter_id\r\nwhere d.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'\r\norder by d.encounter_id asc, d.created_at asc", "doc_blocks": ["doc.tamanu_source_dbt.table__discharges"], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\discharges.sql", "compiled": true, "compiled_code": "select distinct on (d.encounter_id)\n d.id,\n d.note,\n d.encounter_id,\n d.discharger_id as discharged_by_id,\n d.disposition_id\nfrom \"app\".\"public\".\"discharges\" d\njoin \"app\".\"public\".\"encounters\" e on e.id = d.encounter_id\nwhere d.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\norder by d.encounter_id asc, d.created_at asc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.document_metadata": {"database": "app", "schema": "reporting", "name": "document_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\document_metadata.sql", "original_file_path": "models\\bases\\document_metadata.sql", "unique_id": "model.tamanu_source_dbt.document_metadata", "fqn": ["tamanu_source_dbt", "bases", "document_metadata"], "alias": "document_metadata", "checksum": {"name": "sha256", "checksum": "1ea352c3939360a25e45c8f69d35b72537215d6f1b826ad94e6d6ddc95bdb622"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Information about an uploaded document or file, typically attached to an encounter or directly to a patient.\r\n\r\nThe actual file data is stored in [`attachments`](#!/source/source.tamanu.tamanu.attachments).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in document_metadata.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Free-form name of the document.\r\n\r\nOften this is the filename.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__name"]}, "type": {"name": "type", "description": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__type"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in document_metadata.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) the document was uploaded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__patient_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) the document was uploaded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__encounter_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\document_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423651.9385219, "relation_name": "\"app\".\"reporting\".\"document_metadata\"", "raw_code": "select\r\n id,\r\n name,\r\n type,\r\n created_at::timestamp as created_datetime,\r\n patient_id,\r\n encounter_id\r\nfrom {{ source('tamanu', 'document_metadata') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__document_metadata"], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\document_metadata.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n type,\n created_at::timestamp as created_datetime,\n patient_id,\n encounter_id\nfrom \"app\".\"public\".\"document_metadata\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounters": {"database": "app", "schema": "reporting", "name": "encounters", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounters.sql", "original_file_path": "models\\bases\\encounters.sql", "unique_id": "model.tamanu_source_dbt.encounters", "fqn": ["tamanu_source_dbt", "bases", "encounters"], "alias": "encounters", "checksum": {"name": "sha256", "checksum": "0d4589a4b35a42a013bb90ec2fc327d031e7db11e3e7efc795f9e11455981ebe"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Tracks the basic information of the patient encounters within Tamanu from start to finish", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounters.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_datetime": {"name": "start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "end_datetime": {"name": "end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "reason_for_encounter": {"name": "reason_for_encounter", "description": "Free-form information about the encounter.\r\n\r\nCan include info like type of survey submitted, emergency diagnosis, etc.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__reason_for_encounter"]}, "device_id": {"name": "device_id", "description": "Unique identifier for the device that created the encounter.\r\n\r\nDevice IDs are proper to each device and not globally recorded in e.g. a `devices` table.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__device_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__department_id"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "The billing type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_billing_type_id"]}, "referral_source_id": {"name": "referral_source_id", "description": "The referral source ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__referral_source_id"]}, "planned_location_id": {"name": "planned_location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) that the encounter will transfer to at the\r\n`planned_location_start_time`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__planned_location_id"]}, "planned_location_start_datetime": {"name": "planned_location_start_datetime", "description": "The time that the encounter will transfer to the planned location.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__planned_location_start_time"]}, "discharge_draft": {"name": "discharge_draft", "description": "Draft data of the encounter", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__discharge_draft"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounters.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423651.94056, "relation_name": "\"app\".\"reporting\".\"encounters\"", "raw_code": "select\r\n id,\r\n start_date::timestamp as start_datetime,\r\n case\r\n when end_date < start_date then start_date::timestamp\r\n else end_date::timestamp\r\n end as end_datetime,\r\n encounter_type,\r\n reason_for_encounter,\r\n device_id,\r\n patient_id,\r\n department_id,\r\n location_id,\r\n examiner_id as clinician_id,\r\n patient_billing_type_id,\r\n referral_source_id,\r\n planned_location_id,\r\n planned_location_start_time::timestamp as planned_location_start_datetime,\r\n discharge_draft\r\nfrom {{ source('tamanu', 'encounters') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounters"], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounters.sql", "compiled": true, "compiled_code": "select\n id,\n start_date::timestamp as start_datetime,\n case\n when end_date < start_date then start_date::timestamp\n else end_date::timestamp\n end as end_datetime,\n encounter_type,\n reason_for_encounter,\n device_id,\n patient_id,\n department_id,\n location_id,\n examiner_id as clinician_id,\n patient_billing_type_id,\n referral_source_id,\n planned_location_id,\n planned_location_start_time::timestamp as planned_location_start_datetime,\n discharge_draft\nfrom \"app\".\"public\".\"encounters\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounters_metadata": {"database": "app", "schema": "reporting", "name": "encounters_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounters_metadata.sql", "original_file_path": "models\\bases\\encounters_metadata.sql", "unique_id": "model.tamanu_source_dbt.encounters_metadata", "fqn": ["tamanu_source_dbt", "bases", "encounters_metadata"], "alias": "encounters_metadata", "checksum": {"name": "sha256", "checksum": "4f9c9d9eca76532a34e498da28520658b87994e9c517530f53bb2dabee8df666"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for encounters.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounters.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the encounters table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the encounters table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounters_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423651.94056, "relation_name": "\"app\".\"reporting\".\"encounters_metadata\"", "raw_code": "{{ get_metadata_from_changes('encounters') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounters_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'encounters'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_diagnoses": {"database": "app", "schema": "reporting", "name": "encounter_diagnoses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_diagnoses.sql", "original_file_path": "models\\bases\\encounter_diagnoses.sql", "unique_id": "model.tamanu_source_dbt.encounter_diagnoses", "fqn": ["tamanu_source_dbt", "bases", "encounter_diagnoses"], "alias": "encounter_diagnoses", "checksum": {"name": "sha256", "checksum": "51f0a5563d98f14a5b0cb5a9f120ee41fb9223312a8255fad207cb75b18d4b22"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Records diagnoses made during an encounter", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diagnoses.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in encounter_diagnoses.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "is_primary": {"name": "is_primary", "description": "A boolean indicating if this is a primary diagnosis", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__is_primary"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__encounter_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id"]}, "certainty": {"name": "certainty", "description": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__certainty"]}, "diagnosed_by_id": {"name": "diagnosed_by_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that diagnosis.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__clinician_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_diagnoses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423651.94056, "relation_name": "\"app\".\"reporting\".\"encounter_diagnoses\"", "raw_code": "select\r\n ed.id,\r\n ed.date::timestamp as datetime,\r\n ed.is_primary,\r\n ed.certainty,\r\n ed.encounter_id,\r\n ed.diagnosis_id,\r\n ed.clinician_id as diagnosed_by_id\r\nfrom {{ source('tamanu', 'encounter_diagnoses') }} ed\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ed.encounter_id\r\nwhere ed.deleted_at is null\r\n and ed.certainty not in ('disproven', 'error')\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_diagnoses"], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_diagnoses.sql", "compiled": true, "compiled_code": "select\n ed.id,\n ed.date::timestamp as datetime,\n ed.is_primary,\n ed.certainty,\n ed.encounter_id,\n ed.diagnosis_id,\n ed.clinician_id as diagnosed_by_id\nfrom \"app\".\"public\".\"encounter_diagnoses\" ed\njoin \"app\".\"public\".\"encounters\" e on e.id = ed.encounter_id\nwhere ed.deleted_at is null\n and ed.certainty not in ('disproven', 'error')\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_diagnoses_metadata": {"database": "app", "schema": "reporting", "name": "encounter_diagnoses_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_diagnoses_metadata.sql", "original_file_path": "models\\bases\\encounter_diagnoses_metadata.sql", "unique_id": "model.tamanu_source_dbt.encounter_diagnoses_metadata", "fqn": ["tamanu_source_dbt", "bases", "encounter_diagnoses_metadata"], "alias": "encounter_diagnoses_metadata", "checksum": {"name": "sha256", "checksum": "211e1c8dfa21e1e7b43d3dc49b935775d785d127efa43de2719e56e7d3d236fc"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for encounter_diagnoses.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diagnoses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the encounter_diagnoses table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the encounter_diagnoses table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_diagnoses_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0024652, "relation_name": "\"app\".\"reporting\".\"encounter_diagnoses_metadata\"", "raw_code": "{{ get_metadata_from_changes('encounter_diagnoses') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_diagnoses_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'encounter_diagnoses'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_diets": {"database": "app", "schema": "reporting", "name": "encounter_diets", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_diets.sql", "original_file_path": "models\\bases\\encounter_diets.sql", "unique_id": "model.tamanu_source_dbt.encounter_diets", "fqn": ["tamanu_source_dbt", "bases", "encounter_diets"], "alias": "encounter_diets", "checksum": {"name": "sha256", "checksum": "63ef437f501dd6ae8046bfc50300e6abbbec1555ba3dbd3bdddb33575c296544"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "A diet associated with an encounter.\r\n\r\nA patient can be placed on a diet for various medical purposes.\r\nDiets are specified in reference data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diets.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diet is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diets__encounter_id"]}, "diet_id": {"name": "diet_id", "description": "The diet ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diet`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diets__diet_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_diets.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782423652.0024652, "relation_name": "\"app\".\"reporting\".\"encounter_diets\"", "raw_code": "select\r\n ed.id,\r\n ed.encounter_id,\r\n ed.diet_id\r\nfrom {{ source('tamanu', 'encounter_diets') }} ed\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ed.encounter_id\r\nwhere ed.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_diets"], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_diets.sql", "compiled": true, "compiled_code": "select\n ed.id,\n ed.encounter_id,\n ed.diet_id\nfrom \"app\".\"public\".\"encounter_diets\" ed\njoin \"app\".\"public\".\"encounters\" e on e.id = ed.encounter_id\nwhere ed.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_history": {"database": "app", "schema": "reporting", "name": "encounter_history", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_history.sql", "original_file_path": "models\\bases\\encounter_history.sql", "unique_id": "model.tamanu_source_dbt.encounter_history", "fqn": ["tamanu_source_dbt", "bases", "encounter_history"], "alias": "encounter_history", "checksum": {"name": "sha256", "checksum": "36ee248d22dccdb96122cde573cea6d4a709ed563ae0195e9eac41c080a9c774"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Records changes to an encounter's basic details.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_history.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "date": {"name": "date", "description": "Local date for the record in encounter_history.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the original [encounter](#!/source/source.tamanu.tamanu.encounters) this history is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__encounter_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the encounter was in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__department_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the encounter was in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__location_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users) for the encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__examiner_id"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__encounter_type"]}, "updated_by_id": {"name": "updated_by_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) made the change.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__actor_id"]}, "change_type": {"name": "change_type", "description": "The field which was changed.\r\n\r\nOne of:\r\n- `encounter_type`\r\n- `location`\r\n- `department`\r\n- `examiner`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__change_type"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_history.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0024652, "relation_name": "\"app\".\"reporting\".\"encounter_history\"", "raw_code": "select\r\n eh.id,\r\n eh.date::timestamp as datetime,\r\n eh.encounter_id,\r\n eh.department_id,\r\n eh.location_id,\r\n eh.encounter_type,\r\n eh.examiner_id as clinician_id,\r\n eh.actor_id as updated_by_id,\r\n eh.change_type::text[]\r\nfrom {{ source('tamanu', 'encounter_history') }} eh\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = eh.encounter_id\r\nwhere eh.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_history"], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_history.sql", "compiled": true, "compiled_code": "select\n eh.id,\n eh.date::timestamp as datetime,\n eh.encounter_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n eh.examiner_id as clinician_id,\n eh.actor_id as updated_by_id,\n eh.change_type::text[]\nfrom \"app\".\"public\".\"encounter_history\" eh\njoin \"app\".\"public\".\"encounters\" e on e.id = eh.encounter_id\nwhere eh.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter_prescriptions": {"database": "app", "schema": "reporting", "name": "encounter_prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\encounter_prescriptions.sql", "original_file_path": "models\\bases\\encounter_prescriptions.sql", "unique_id": "model.tamanu_source_dbt.encounter_prescriptions", "fqn": ["tamanu_source_dbt", "bases", "encounter_prescriptions"], "alias": "encounter_prescriptions", "checksum": {"name": "sha256", "checksum": "17f18c83b92fbb8fb44e8a4ab29fd2d64a4eb9817fde51639fa7695729eb7d4b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Association of encounter to prescription", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__encounter_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__prescription_id"]}, "is_selected_for_discharge": {"name": "is_selected_for_discharge", "description": "Whether the prescription is for when the patient is discharged.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\encounter_prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.0024652, "relation_name": "\"app\".\"reporting\".\"encounter_prescriptions\"", "raw_code": "select\r\n ep.id,\r\n ep.encounter_id,\r\n ep.prescription_id,\r\n ep.is_selected_for_discharge\r\nfrom {{ source('tamanu', 'encounter_prescriptions') }} ep\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ep.encounter_id\r\nwhere ep.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_prescriptions"], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_prescriptions.sql", "compiled": true, "compiled_code": "select\n ep.id,\n ep.encounter_id,\n ep.prescription_id,\n ep.is_selected_for_discharge\nfrom \"app\".\"public\".\"encounter_prescriptions\" ep\njoin \"app\".\"public\".\"encounters\" e on e.id = ep.encounter_id\nwhere ep.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.facilities": {"database": "app", "schema": "reporting", "name": "facilities", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\facilities.sql", "original_file_path": "models\\bases\\facilities.sql", "unique_id": "model.tamanu_source_dbt.facilities", "fqn": ["tamanu_source_dbt", "bases", "facilities"], "alias": "facilities", "checksum": {"name": "sha256", "checksum": "91ccec8ab878468aae2857bd87623c82d5173f7b3579d3307c0d3a19d3676608"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table of facilities.\r\n\r\nFacilities may be either or both of:\r\n\r\n- Any healthcare facility, like hospitals, clinics, mobile vaccination vans, laboratories, etc\r\n- A Tamanu Facility deployment.\r\n\r\nWhen syncing, patient and related records are scoped to a facility, according to the\r\n[`patient_facilities`](#!/source/source.tamanu.tamanu.patient_facilities) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in facilities.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code (identifier) for the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__code"]}, "name": {"name": "name", "description": "Full readable name.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}, "division": {"name": "division", "description": "Administrative division this facility lives in.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__division"]}, "type": {"name": "type", "description": "Type of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__type"]}, "email": {"name": "email", "description": "Administrative email address of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__email"]}, "contact_number": {"name": "contact_number", "description": "Administrative contact number of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__contact_number"]}, "city_town": {"name": "city_town", "description": "City or town of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__city_town"]}, "street_address": {"name": "street_address", "description": "Street address of the facility.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__street_address"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in facilities.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "catchment_id": {"name": "catchment_id", "description": "Catchment area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__catchment_id"]}, "is_sensitive": {"name": "is_sensitive", "description": "If set to `true`, encounters created on this facility will only be viewable when logged into this facility", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__is_sensitive"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\facilities.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0024652, "relation_name": "\"app\".\"reporting\".\"facilities\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n division,\r\n type,\r\n email,\r\n contact_number,\r\n city_town,\r\n street_address,\r\n catchment_id,\r\n visibility_status,\r\n is_sensitive\r\nfrom {{ source('tamanu', 'facilities') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__facilities"], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\facilities.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n division,\n type,\n email,\n contact_number,\n city_town,\n street_address,\n catchment_id,\n visibility_status,\n is_sensitive\nfrom \"app\".\"public\".\"facilities\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging_area_external_codes": {"database": "app", "schema": "reporting", "name": "imaging_area_external_codes", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\imaging_area_external_codes.sql", "original_file_path": "models\\bases\\imaging_area_external_codes.sql", "unique_id": "model.tamanu_source_dbt.imaging_area_external_codes", "fqn": ["tamanu_source_dbt", "bases", "imaging_area_external_codes"], "alias": "imaging_area_external_codes", "checksum": {"name": "sha256", "checksum": "a460bc0a0959ae44a5adfcad856aea5e5894190609c185926970aa977ce53c6e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "External codes for imaging areas (such as for [PACS](https://en.wikipedia.org/wiki/Picture_archiving_and_communication_system)).\r\n\r\nImaging areas are stored in [Reference Data](#!/source/source.tamanu.tamanu.reference_data), this\r\ntable adds additional (external) codes.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_area_external_codes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "area_id": {"name": "area_id", "description": "Reference to the imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__area_id"]}, "code": {"name": "code", "description": "External code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__code"]}, "description": {"name": "description", "description": "Human-friendly description for the area/code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__description"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_area_external_codes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\imaging_area_external_codes.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0024652, "relation_name": "\"app\".\"reporting\".\"imaging_area_external_codes\"", "raw_code": "select\r\n id,\r\n area_id,\r\n code,\r\n description,\r\n visibility_status\r\nfrom {{ source('tamanu', 'imaging_area_external_codes') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_area_external_codes"], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\imaging_area_external_codes.sql", "compiled": true, "compiled_code": "select\n id,\n area_id,\n code,\n description,\n visibility_status\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging_requests": {"database": "app", "schema": "reporting", "name": "imaging_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\imaging_requests.sql", "original_file_path": "models\\bases\\imaging_requests.sql", "unique_id": "model.tamanu_source_dbt.imaging_requests", "fqn": ["tamanu_source_dbt", "bases", "imaging_requests"], "alias": "imaging_requests", "checksum": {"name": "sha256", "checksum": "1baf61cd5cc899aad620f5cb7cc3f52ee33b8203572ec1f82143df2a3b0c796a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Imaging requests are the entrypoint of imaging workflows in Tamanu.\r\n\r\nEach row is a request for radiology to perform one or more imagings on a patient.\r\n\r\nImagings can have one or more [request areas](#!/source/source.tamanu.tamanu.imaging_request_areas)\r\nattached, and when completed will have [results](#!/source/source.tamanu.tamanu.imaging_results).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_requests.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__display_id"]}, "datetime": {"name": "datetime", "description": "When the imaging was requested.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "priority": {"name": "priority", "description": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__priority"]}, "imaging_type": {"name": "imaging_type", "description": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__imaging_type"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this imaging request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__encounter_id"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "completed_by_id": {"name": "completed_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__completed_by_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) for this imaging request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__location_id"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [location group](#!/source/source.tamanu.tamanu.location_groups) for this imaging request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__location_group_id"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113).", "meta": {}, "data_type": "character varying(1024)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\imaging_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0183337, "relation_name": "\"app\".\"reporting\".\"imaging_requests\"", "raw_code": "select\r\n ir.id,\r\n ir.display_id,\r\n ir.requested_date::timestamp as datetime,\r\n ir.status,\r\n ir.priority,\r\n ir.imaging_type,\r\n ir.encounter_id,\r\n ir.requested_by_id,\r\n ir.completed_by_id,\r\n ir.location_id,\r\n ir.location_group_id,\r\n ir.reason_for_cancellation\r\nfrom {{ source('tamanu', 'imaging_requests') }} ir\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ir.encounter_id\r\nwhere ir.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_requests"], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\imaging_requests.sql", "compiled": true, "compiled_code": "select\n ir.id,\n ir.display_id,\n ir.requested_date::timestamp as datetime,\n ir.status,\n ir.priority,\n ir.imaging_type,\n ir.encounter_id,\n ir.requested_by_id,\n ir.completed_by_id,\n ir.location_id,\n ir.location_group_id,\n ir.reason_for_cancellation\nfrom \"app\".\"public\".\"imaging_requests\" ir\njoin \"app\".\"public\".\"encounters\" e on e.id = ir.encounter_id\nwhere ir.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging_request_areas": {"database": "app", "schema": "reporting", "name": "imaging_request_areas", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\imaging_request_areas.sql", "original_file_path": "models\\bases\\imaging_request_areas.sql", "unique_id": "model.tamanu_source_dbt.imaging_request_areas", "fqn": ["tamanu_source_dbt", "bases", "imaging_request_areas"], "alias": "imaging_request_areas", "checksum": {"name": "sha256", "checksum": "2c5556ab7a27755c39c8a5559fe8b3b6d221234b3c080cb194351ee18cff5ef3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Areas to be imaged as part of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_request_areas.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "imaging_request_id": {"name": "imaging_request_id", "description": "The [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_request_areas__imaging_request_id"]}, "area_id": {"name": "area_id", "description": "The imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_request_areas__area_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\imaging_request_areas.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0183337, "relation_name": "\"app\".\"reporting\".\"imaging_request_areas\"", "raw_code": "select\r\n ira.id,\r\n ira.imaging_request_id,\r\n ira.area_id\r\nfrom {{ source('tamanu', 'imaging_request_areas') }} ira\r\njoin {{ source('tamanu', 'imaging_requests') }} ir on ir.id = ira.imaging_request_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ir.encounter_id\r\nwhere ira.deleted_at is null\r\n and ir.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_request_areas"], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"], ["tamanu", "imaging_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas", "source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\imaging_request_areas.sql", "compiled": true, "compiled_code": "select\n ira.id,\n ira.imaging_request_id,\n ira.area_id\nfrom \"app\".\"public\".\"imaging_request_areas\" ira\njoin \"app\".\"public\".\"imaging_requests\" ir on ir.id = ira.imaging_request_id\njoin \"app\".\"public\".\"encounters\" e on e.id = ir.encounter_id\nwhere ira.deleted_at is null\n and ir.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging_results": {"database": "app", "schema": "reporting", "name": "imaging_results", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\imaging_results.sql", "original_file_path": "models\\bases\\imaging_results.sql", "unique_id": "model.tamanu_source_dbt.imaging_results", "fqn": ["tamanu_source_dbt", "bases", "imaging_results"], "alias": "imaging_results", "checksum": {"name": "sha256", "checksum": "6e8c44894b7b7032763b6f466ad97cd9b0d2fc4c757a5a89f4ec9b80f77af31c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Result of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).\r\n\r\nIn practice, there is usually one or two results per request:\r\n- one containing a reference to a PACS image, when imaging integrations are enabled;\r\n- one containing notes from a doctor who analysed the image.\r\n\r\nHowever there is no limit; for example there may be multiple notes from multiple doctors.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_results.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "When this result was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_at"]}, "description": {"name": "description", "description": "Free-form description / notes about this imaging.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__description"]}, "imaging_request_id": {"name": "imaging_request_id", "description": "Reference to the [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__imaging_request_id"]}, "external_code": {"name": "external_code", "description": "External code for this result, used with PACS integration (generally via FHIR).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__external_code"]}, "completed_by_id": {"name": "completed_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_by_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_results.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\imaging_results.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0183337, "relation_name": "\"app\".\"reporting\".\"imaging_results\"", "raw_code": "select\r\n ires.id,\r\n ires.completed_at::timestamp as datetime,\r\n ires.description,\r\n ires.imaging_request_id,\r\n ires.external_code,\r\n ires.completed_by_id,\r\n ires.visibility_status\r\nfrom {{ source('tamanu', 'imaging_results') }} ires\r\njoin {{ source('tamanu', 'imaging_requests') }} ireq on ireq.id = ires.imaging_request_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ireq.encounter_id\r\nwhere ires.deleted_at is null\r\n and ireq.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_results"], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"], ["tamanu", "imaging_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results", "source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\imaging_results.sql", "compiled": true, "compiled_code": "select\n ires.id,\n ires.completed_at::timestamp as datetime,\n ires.description,\n ires.imaging_request_id,\n ires.external_code,\n ires.completed_by_id,\n ires.visibility_status\nfrom \"app\".\"public\".\"imaging_results\" ires\njoin \"app\".\"public\".\"imaging_requests\" ireq on ireq.id = ires.imaging_request_id\njoin \"app\".\"public\".\"encounters\" e on e.id = ireq.encounter_id\nwhere ires.deleted_at is null\n and ireq.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoices": {"database": "app", "schema": "reporting", "name": "invoices", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoices.sql", "original_file_path": "models\\bases\\invoices.sql", "unique_id": "model.tamanu_source_dbt.invoices", "fqn": ["tamanu_source_dbt", "bases", "invoices"], "alias": "invoices", "checksum": {"name": "sha256", "checksum": "b1cb3a63ad84b76ff9d85008d24d24b522e78521d1a2656079ff2f876f10cb0e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "Invoices related to encounters.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoices.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__display_id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in invoices.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "status": {"name": "status", "description": "Status of the invoice.\r\n\r\nOne of:\r\n- `cancelled`\r\n- `in_progress`\r\n- `finalised`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__status"]}, "patient_payment_status": {"name": "patient_payment_status", "description": "Payment status (patient portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__patient_payment_status"]}, "insurer_payment_status": {"name": "insurer_payment_status", "description": "Payment status (insurer portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__insurer_payment_status"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this invoice is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__encounter_id"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoices.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"]}, "created_at": 1782423652.0183337, "relation_name": "\"app\".\"reporting\".\"invoices\"", "raw_code": "select\r\n i.id,\r\n i.display_id,\r\n i.date::timestamp as datetime,\r\n i.status,\r\n i.patient_payment_status,\r\n i.insurer_payment_status,\r\n i.encounter_id\r\nfrom {{ source('tamanu', 'invoices') }} i\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = i.encounter_id\r\nwhere\r\n i.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__invoices"], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoices.sql", "compiled": true, "compiled_code": "select\n i.id,\n i.display_id,\n i.date::timestamp as datetime,\n i.status,\n i.patient_payment_status,\n i.insurer_payment_status,\n i.encounter_id\nfrom \"app\".\"public\".\"invoices\" i\njoin \"app\".\"public\".\"encounters\" e on e.id = i.encounter_id\nwhere\n i.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_insurance_plans": {"database": "app", "schema": "reporting", "name": "invoice_insurance_plans", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_insurance_plans.sql", "original_file_path": "models\\bases\\invoice_insurance_plans.sql", "unique_id": "model.tamanu_source_dbt.invoice_insurance_plans", "fqn": ["tamanu_source_dbt", "bases", "invoice_insurance_plans"], "alias": "invoice_insurance_plans", "checksum": {"name": "sha256", "checksum": "471b4285a38c7e8b0727f811637ae413954ace0d051689b2962c6c59ef0398fb"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table for insurance contracts used for invoicing.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurance_plans.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Human-readable name of the insurance contract.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__name"]}, "code": {"name": "code", "description": "Unique identifier code for the insurance contract.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__code"]}, "default_coverage": {"name": "default_coverage", "description": "The default coverage (in percentage) of the insurance contract.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__default_coverage"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_insurance_plans.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_insurance_plans.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0183337, "relation_name": "\"app\".\"reporting\".\"invoice_insurance_plans\"", "raw_code": "select\r\n id,\r\n name,\r\n code,\r\n default_coverage,\r\n visibility_status\r\nfrom {{ source('tamanu', 'invoice_insurance_plans') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurance_plans"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_insurance_plans.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n code,\n default_coverage,\n visibility_status\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_insurance_plan_items": {"database": "app", "schema": "reporting", "name": "invoice_insurance_plan_items", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_insurance_plan_items.sql", "original_file_path": "models\\bases\\invoice_insurance_plan_items.sql", "unique_id": "model.tamanu_source_dbt.invoice_insurance_plan_items", "fqn": ["tamanu_source_dbt", "bases", "invoice_insurance_plan_items"], "alias": "invoice_insurance_plan_items", "checksum": {"name": "sha256", "checksum": "89623349f45d0519cefee8e92ca7e187f8c5692d818a607945ff34957ea7d895"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table for insurance contract items used for invoicing.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurance_plan_items.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_insurance_plan_id": {"name": "invoice_insurance_plan_id", "description": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_insurance_plan_id"]}, "invoice_product_id": {"name": "invoice_product_id", "description": "Reference to the [invoice product](#!/source/source.tamanu.tamanu.invoice_products).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_product_id"]}, "coverage_value": {"name": "coverage_value", "description": "The amount of coverage (in percentage) of the insurance contract item.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__coverage_value"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_insurance_plan_items.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0183337, "relation_name": "\"app\".\"reporting\".\"invoice_insurance_plan_items\"", "raw_code": "select\r\n id,\r\n invoice_insurance_plan_id,\r\n invoice_product_id,\r\n coverage_value\r\nfrom {{ source('tamanu', 'invoice_insurance_plan_items') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurance_plan_items"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_insurance_plan_items.sql", "compiled": true, "compiled_code": "select\n id,\n invoice_insurance_plan_id,\n invoice_product_id,\n coverage_value\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_items": {"database": "app", "schema": "reporting", "name": "invoice_items", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_items.sql", "original_file_path": "models\\bases\\invoice_items.sql", "unique_id": "model.tamanu_source_dbt.invoice_items", "fqn": ["tamanu_source_dbt", "bases", "invoice_items"], "alias": "invoice_items", "checksum": {"name": "sha256", "checksum": "0c0c4c4544b00c55711e87a79ca52c01dfb6b39d9b4a32e316f3f3b360c50bf1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "Items (products) on invoices.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_items.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_id": {"name": "invoice_id", "description": "The [invoice](#!/source/source.tamanu.tamanu.invoices).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__invoice_id"]}, "date": {"name": "date", "description": "When the item was ordered.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__order_date"]}, "product_id": {"name": "product_id", "description": "The [product](#!/source/source.tamanu.tamanu.invoice_products).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_id"]}, "product_code_final": {"name": "product_code_final", "description": "The final product code used on the invoice. Saved from the product code field when the invoice is finalised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_code_final"]}, "product_name_final": {"name": "product_name_final", "description": "The final product name used on the invoice. Saved from the product name field when the invoice is finalised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_name_final"]}, "price_final": {"name": "price_final", "description": "The final price per unit for this item on the invoice. This is determined by the manual_entry_price if provided, otherwise from the product's price when the invoice is finalised.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__price_final"]}, "manual_entry_price": {"name": "manual_entry_price", "description": "Manually entered price override for this item, if specified. When set, this takes precedence over the product's standard price.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__manual_entry_price"]}, "quantity": {"name": "quantity", "description": "Quantity ordered.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__quantity"]}, "ordered_by_user_id": {"name": "ordered_by_user_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) ordered the item.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__ordered_by_user_id"]}, "approved": {"name": "approved", "description": "A boolean field that enables clinicians to track the approval status of individual invoice line items", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__approved"]}, "source_record_type": {"name": "source_record_type", "description": "The underlying model that the source record belongs to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__source_record_type"]}, "source_record_id": {"name": "source_record_id", "description": "Foreign key relation for record type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__source_record_id"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_items.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"]}, "created_at": 1782423652.0183337, "relation_name": "\"app\".\"reporting\".\"invoice_items\"", "raw_code": "select\r\n ii.id,\r\n ii.invoice_id,\r\n ii.order_date::date as date,\r\n ii.product_id,\r\n ii.product_code_final,\r\n ii.product_name_final,\r\n ii.price_final,\r\n ii.manual_entry_price,\r\n ii.quantity,\r\n ii.ordered_by_user_id,\r\n ii.approved,\r\n ii.source_record_type,\r\n ii.source_record_id\r\nfrom {{ source('tamanu', 'invoice_items') }} ii\r\njoin {{ source('tamanu', 'invoices') }} i on i.id = ii.invoice_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = i.encounter_id\r\nwhere\r\n ii.deleted_at is null\r\n and i.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_items"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"], ["tamanu", "invoices"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_items.sql", "compiled": true, "compiled_code": "select\n ii.id,\n ii.invoice_id,\n ii.order_date::date as date,\n ii.product_id,\n ii.product_code_final,\n ii.product_name_final,\n ii.price_final,\n ii.manual_entry_price,\n ii.quantity,\n ii.ordered_by_user_id,\n ii.approved,\n ii.source_record_type,\n ii.source_record_id\nfrom \"app\".\"public\".\"invoice_items\" ii\njoin \"app\".\"public\".\"invoices\" i on i.id = ii.invoice_id\njoin \"app\".\"public\".\"encounters\" e on e.id = i.encounter_id\nwhere\n ii.deleted_at is null\n and i.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_price_lists": {"database": "app", "schema": "reporting", "name": "invoice_price_lists", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_price_lists.sql", "original_file_path": "models\\bases\\invoice_price_lists.sql", "unique_id": "model.tamanu_source_dbt.invoice_price_lists", "fqn": ["tamanu_source_dbt", "bases", "invoice_price_lists"], "alias": "invoice_price_lists", "checksum": {"name": "sha256", "checksum": "806804413307e4430316c551eff8ed208bd415c97cfee5e7220e3b166c2ed3c2"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Contains price list definitions used for invoice line item pricing. Each price list represents a set of pricing rules that can be applied to different types of invoices, patients, or services.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_price_lists.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Human-readable name of the price list, displayed in user interfaces and reports.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__name"]}, "code": {"name": "code", "description": "Unique identifier code for the price list. Used for referencing the price list in business logic and integrations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__code"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_price_lists.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_price_lists.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0183337, "relation_name": "\"app\".\"reporting\".\"invoice_price_lists\"", "raw_code": "select\r\n id,\r\n name,\r\n code,\r\n visibility_status\r\nfrom {{ source('tamanu', 'invoice_price_lists') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_price_lists"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_price_lists.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n code,\n visibility_status\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_price_list_items": {"database": "app", "schema": "reporting", "name": "invoice_price_list_items", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_price_list_items.sql", "original_file_path": "models\\bases\\invoice_price_list_items.sql", "unique_id": "model.tamanu_source_dbt.invoice_price_list_items", "fqn": ["tamanu_source_dbt", "bases", "invoice_price_list_items"], "alias": "invoice_price_list_items", "checksum": {"name": "sha256", "checksum": "772933fb0a3ffc10c160b46e1562eb4256962b5108d307284d717fbcba544556"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Contains individual pricing entries for specific products within a price list. Each record defines the price or pricing configuration for a particular product in the context of a specific price list.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_price_list_items.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_price_list_id": {"name": "invoice_price_list_id", "description": "Foreign key reference to the invoice_price_lists table. Links this pricing item to its parent price list.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__invoice_price_list_id"]}, "invoice_product_id": {"name": "invoice_product_id", "description": "Foreign key reference to the invoice products/services that can be priced. Identifies which product or service this pricing item applies to.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__invoice_product_id"]}, "price": {"name": "price", "description": "The price amount for this product in the context of this price list. Stored as a numeric value representing the cost in the system's base currency.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__price"]}, "is_hidden": {"name": "is_hidden", "description": "Determines whether the related invoice product should be hidden from searches on the frontend and also whether it should be automatically added to the invoice.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__is_hidden"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_price_list_items.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0183337, "relation_name": "\"app\".\"reporting\".\"invoice_price_list_items\"", "raw_code": "select\r\n id,\r\n invoice_price_list_id,\r\n invoice_product_id,\r\n price,\r\n is_hidden\r\nfrom {{ source('tamanu', 'invoice_price_list_items') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_price_list_items"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_price_list_items.sql", "compiled": true, "compiled_code": "select\n id,\n invoice_price_list_id,\n invoice_product_id,\n price,\n is_hidden\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice_products": {"database": "app", "schema": "reporting", "name": "invoice_products", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\invoice_products.sql", "original_file_path": "models\\bases\\invoice_products.sql", "unique_id": "model.tamanu_source_dbt.invoice_products", "fqn": ["tamanu_source_dbt", "bases", "invoice_products"], "alias": "invoice_products", "checksum": {"name": "sha256", "checksum": "1f70a2324c613ea8aee18c21ee4dc7e657a806b1d87bb5b4ee7241c37bbb4b4c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Products which can be invoiced.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Name of the product.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__name"]}, "insurable": {"name": "insurable", "description": "Whether or not discounts can be applied to a product", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__insurable"]}, "category": {"name": "category", "description": "The category of the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__category"]}, "source_record_id": {"name": "source_record_id", "description": "The id of the source record for the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__source_record_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\invoice_products.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.034271, "relation_name": "\"app\".\"reporting\".\"invoice_products\"", "raw_code": "select\r\n id,\r\n name,\r\n insurable,\r\n category,\r\n source_record_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'invoice_products') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_products"], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\invoice_products.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n insurable,\n category,\n source_record_id,\n visibility_status\nfrom \"app\".\"public\".\"invoice_products\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_requests": {"database": "app", "schema": "reporting", "name": "lab_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_requests.sql", "original_file_path": "models\\bases\\lab_requests.sql", "unique_id": "model.tamanu_source_dbt.lab_requests", "fqn": ["tamanu_source_dbt", "bases", "lab_requests"], "alias": "lab_requests", "checksum": {"name": "sha256", "checksum": "a98a305e47f4b8c01079b1607e995a92d973c9b7af5594fd446ef27286f420c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Lab requests are the entrypoint of laboratory workflows in Tamanu.\r\n\r\nEach row is a request for a laboratory to perform a group of tests on a sample taken from a patient.\r\n\r\nIt will be updated over the course of the workflow to various statuses, starting with\r\n`reception_pending` (lab has not received the request yet), up to `published` (lab has completed the\r\ntests and has attached verified results).\r\n\r\nSee also: `lab_request_attachments`, `lab_request_logs`, `lab_results`, `lab_tests`,\r\n`lab_test_panels`, and related tables to those.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "is_urgent": {"name": "is_urgent", "description": "Deprecated.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__urgent"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "lab_test_priority_id": {"name": "lab_test_priority_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_priority_id"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ncategory of this request's test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_category_id"]}, "lab_test_panel_request_id": {"name": "lab_test_panel_request_id", "description": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id"]}, "lab_test_laboratory_id": {"name": "lab_test_laboratory_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "is_specimen_collected": {"name": "is_specimen_collected", "description": "Whether a specimen is attached.\r\n\r\nThis implies `specimen_type_id`.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_attached"]}, "specimen_type_id": {"name": "specimen_type_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_type_id"]}, "lab_sample_site_id": {"name": "lab_sample_site_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing where\r\non the patient the sample was taken.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_sample_site_id"]}, "collected_datetime": {"name": "collected_datetime", "description": "When the sample was collected.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time"]}, "collected_by_id": {"name": "collected_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__collected_by_id"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__reason_for_cancellation"]}, "published_date": {"name": "published_date", "description": "When this lab request's results were published.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__published_date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) the request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__encounter_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) the request comes from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__department_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.034271, "relation_name": "\"app\".\"reporting\".\"lab_requests\"", "raw_code": "select\r\n lr.id,\r\n lr.created_at as created_datetime,\r\n lr.updated_at as updated_datetime,\r\n lr.display_id,\r\n lr.urgent as is_urgent,\r\n lr.status,\r\n lr.requested_date::timestamp as requested_datetime,\r\n lr.lab_test_priority_id,\r\n lr.lab_test_category_id,\r\n lr.lab_test_panel_request_id,\r\n lr.lab_test_laboratory_id,\r\n lr.requested_by_id,\r\n lr.specimen_attached as is_specimen_collected,\r\n lr.specimen_type_id,\r\n lr.lab_sample_site_id,\r\n lr.sample_time::timestamp as collected_datetime,\r\n lr.collected_by_id,\r\n lr.reason_for_cancellation,\r\n lr.published_date::timestamp as published_datetime,\r\n lr.encounter_id,\r\n lr.department_id\r\nfrom {{ source('tamanu', 'lab_requests') }} lr\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = lr.encounter_id\r\nwhere lr.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_requests"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_requests.sql", "compiled": true, "compiled_code": "select\n lr.id,\n lr.created_at as created_datetime,\n lr.updated_at as updated_datetime,\n lr.display_id,\n lr.urgent as is_urgent,\n lr.status,\n lr.requested_date::timestamp as requested_datetime,\n lr.lab_test_priority_id,\n lr.lab_test_category_id,\n lr.lab_test_panel_request_id,\n lr.lab_test_laboratory_id,\n lr.requested_by_id,\n lr.specimen_attached as is_specimen_collected,\n lr.specimen_type_id,\n lr.lab_sample_site_id,\n lr.sample_time::timestamp as collected_datetime,\n lr.collected_by_id,\n lr.reason_for_cancellation,\n lr.published_date::timestamp as published_datetime,\n lr.encounter_id,\n lr.department_id\nfrom \"app\".\"public\".\"lab_requests\" lr\njoin \"app\".\"public\".\"encounters\" e on e.id = lr.encounter_id\nwhere lr.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_requests_metadata": {"database": "app", "schema": "reporting", "name": "lab_requests_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_requests_metadata.sql", "original_file_path": "models\\bases\\lab_requests_metadata.sql", "unique_id": "model.tamanu_source_dbt.lab_requests_metadata", "fqn": ["tamanu_source_dbt", "bases", "lab_requests_metadata"], "alias": "lab_requests_metadata", "checksum": {"name": "sha256", "checksum": "299131a3063577bad16e1d88c579b3ae57b60fd52a1c3a9272997343763dccbe"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for lab_requests.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the lab_requests table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the lab_requests table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_requests_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0404773, "relation_name": "\"app\".\"reporting\".\"lab_requests_metadata\"", "raw_code": "{{ get_metadata_from_changes('lab_requests') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_requests_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'lab_requests'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_request_logs": {"database": "app", "schema": "reporting", "name": "lab_request_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_request_logs.sql", "original_file_path": "models\\bases\\lab_request_logs.sql", "unique_id": "model.tamanu_source_dbt.lab_request_logs", "fqn": ["tamanu_source_dbt", "bases", "lab_request_logs"], "alias": "lab_request_logs", "checksum": {"name": "sha256", "checksum": "8e834e648ae8c388a8ea11dc368808362cff0776183dc21089c29abf8566e87d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "This is a log of who changed the status of a lab request when.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_request_logs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "lab_request_id": {"name": "lab_request_id", "description": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__lab_request_id"]}, "status": {"name": "status", "description": "The status the lab request was updated to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__status"]}, "updated_by_id": {"name": "updated_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this lab request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__updated_by_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_request_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0404773, "relation_name": "\"app\".\"reporting\".\"lab_request_logs\"", "raw_code": "select\r\n lrl.id,\r\n lrl.created_at as created_datetime,\r\n lrl.updated_at as updated_datetime,\r\n lrl.lab_request_id,\r\n lrl.status,\r\n lrl.updated_by_id\r\nfrom {{ source('tamanu', 'lab_request_logs') }} lrl\r\njoin {{ source('tamanu', 'lab_requests') }} lr on lr.id = lrl.lab_request_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = lr.encounter_id\r\nwhere lrl.deleted_at is null\r\n and lr.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_request_logs"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"], ["tamanu", "lab_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs", "source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_request_logs.sql", "compiled": true, "compiled_code": "select\n lrl.id,\n lrl.created_at as created_datetime,\n lrl.updated_at as updated_datetime,\n lrl.lab_request_id,\n lrl.status,\n lrl.updated_by_id\nfrom \"app\".\"public\".\"lab_request_logs\" lrl\njoin \"app\".\"public\".\"lab_requests\" lr on lr.id = lrl.lab_request_id\njoin \"app\".\"public\".\"encounters\" e on e.id = lr.encounter_id\nwhere lrl.deleted_at is null\n and lr.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_request_logs_metadata": {"database": "app", "schema": "reporting", "name": "lab_request_logs_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_request_logs_metadata.sql", "original_file_path": "models\\bases\\lab_request_logs_metadata.sql", "unique_id": "model.tamanu_source_dbt.lab_request_logs_metadata", "fqn": ["tamanu_source_dbt", "bases", "lab_request_logs_metadata"], "alias": "lab_request_logs_metadata", "checksum": {"name": "sha256", "checksum": "44d75727704955a1f90411bf88f01b52b70b9128f4a9a18ba3dd281e502024b6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for lab_request_logs.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_request_logs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the lab_request_logs table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the lab_request_logs table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_request_logs_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0404773, "relation_name": "\"app\".\"reporting\".\"lab_request_logs_metadata\"", "raw_code": "{{ get_metadata_from_changes('lab_request_logs') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_request_logs_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'lab_request_logs'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_tests": {"database": "app", "schema": "reporting", "name": "lab_tests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_tests.sql", "original_file_path": "models\\bases\\lab_tests.sql", "unique_id": "model.tamanu_source_dbt.lab_tests", "fqn": ["tamanu_source_dbt", "bases", "lab_tests"], "alias": "lab_tests", "checksum": {"name": "sha256", "checksum": "c44e58bdaf17b6177062d662e9e3c9bca35743e05fb6705449f676d3d5d19fa7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A single test as part of a [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_tests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "date": {"name": "date", "description": "Local date for the record in lab_tests.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "result": {"name": "result", "description": "The result of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__result"]}, "lab_request_id": {"name": "lab_request_id", "description": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this test is part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_request_id"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_type_id"]}, "lab_test_method_id": {"name": "lab_test_method_id", "description": "Reference to the method ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_method_id"]}, "laboratory_officer": {"name": "laboratory_officer", "description": "Name of the lab officer performing the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__laboratory_officer"]}, "completed_datetime": {"name": "completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}, "verification": {"name": "verification", "description": "Free-form field for a verification indication.\r\n\r\nMay be a verifying or supervising officer's name, a department, lab notes...", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__verification"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_tests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0404773, "relation_name": "\"app\".\"reporting\".\"lab_tests\"", "raw_code": "select\r\n lt.id,\r\n lt.date::date as date,\r\n lt.result,\r\n lt.lab_request_id,\r\n lt.lab_test_type_id,\r\n lt.lab_test_method_id,\r\n lt.laboratory_officer,\r\n lt.completed_date::timestamp as completed_datetime,\r\n lt.verification\r\nfrom {{ source('tamanu', 'lab_tests') }} lt\r\njoin {{ source('tamanu', 'lab_requests') }} lr on lr.id = lt.lab_request_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = lr.encounter_id\r\nwhere lt.deleted_at is null\r\n and lr.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_tests"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"], ["tamanu", "lab_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests", "source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_tests.sql", "compiled": true, "compiled_code": "select\n lt.id,\n lt.date::date as date,\n lt.result,\n lt.lab_request_id,\n lt.lab_test_type_id,\n lt.lab_test_method_id,\n lt.laboratory_officer,\n lt.completed_date::timestamp as completed_datetime,\n lt.verification\nfrom \"app\".\"public\".\"lab_tests\" lt\njoin \"app\".\"public\".\"lab_requests\" lr on lr.id = lt.lab_request_id\njoin \"app\".\"public\".\"encounters\" e on e.id = lr.encounter_id\nwhere lt.deleted_at is null\n and lr.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_test_panels": {"database": "app", "schema": "reporting", "name": "lab_test_panels", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_test_panels.sql", "original_file_path": "models\\bases\\lab_test_panels.sql", "unique_id": "model.tamanu_source_dbt.lab_test_panels", "fqn": ["tamanu_source_dbt", "bases", "lab_test_panels"], "alias": "lab_test_panels", "checksum": {"name": "sha256", "checksum": "d05a87d54e418862912b5dcb00209e1ac17eb65e9228ebbf3abb127b0acad9f5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "A panel is a collection of lab test types, usually standardised.\r\n\r\nFor example the BMP (basic metabolic panel) is a panel of 8 blood tests. Instead of ordering all 8\r\ntests individually, a clinician can order the panel all at once. This may also used to more\r\nefficiently use samples.\r\n\r\nThis table defines the available test panels, and\r\n[`lab_test_panel_lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_panel_lab_test_types)\r\ncontains the actual test types that are part of each panel. See\r\n[`lab_test_panel_requests`](#!/source/source.tamanu.tamanu.lab_test_panel_requests) for requesting\r\npanels specifically, and [`lab_test_requests`](#!/source/source.tamanu.tamanu.lab_test_requests) for\r\nrequesting lab tests in general.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panels.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Internal Tamanu code of the panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__code"]}, "external_code": {"name": "external_code", "description": "External code, such as for interfacing with LIMS.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__external_code"]}, "name": {"name": "name", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__category_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_panels.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_test_panels.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0404773, "relation_name": "\"app\".\"reporting\".\"lab_test_panels\"", "raw_code": "select\r\n id,\r\n code,\r\n external_code,\r\n name,\r\n category_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'lab_test_panels') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panels"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_test_panels.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n external_code,\n name,\n category_id,\n visibility_status\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_test_panel_lab_test_types": {"database": "app", "schema": "reporting", "name": "lab_test_panel_lab_test_types", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_test_panel_lab_test_types.sql", "original_file_path": "models\\bases\\lab_test_panel_lab_test_types.sql", "unique_id": "model.tamanu_source_dbt.lab_test_panel_lab_test_types", "fqn": ["tamanu_source_dbt", "bases", "lab_test_panel_lab_test_types"], "alias": "lab_test_panel_lab_test_types", "checksum": {"name": "sha256", "checksum": "2dc5c7e79409a963f17f5cf9fae60074b4da1bc6de21b06bbea1649505c31dce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "The lab tests contained in a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about lab test\r\npanels, and [`lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_types) for the test types.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panel_lab_test_types.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_panel_id"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [test type](#!/source/source.tamanu.tamanu.lab_test_types).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_type_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_test_panel_lab_test_types.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0500216, "relation_name": "\"app\".\"reporting\".\"lab_test_panel_lab_test_types\"", "raw_code": "select\r\n id,\r\n lab_test_panel_id,\r\n lab_test_type_id\r\nfrom {{ source('tamanu', 'lab_test_panel_lab_test_types') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panel_lab_test_types"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_test_panel_lab_test_types.sql", "compiled": true, "compiled_code": "select\n id,\n lab_test_panel_id,\n lab_test_type_id\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_test_panel_requests": {"database": "app", "schema": "reporting", "name": "lab_test_panel_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_test_panel_requests.sql", "original_file_path": "models\\bases\\lab_test_panel_requests.sql", "unique_id": "model.tamanu_source_dbt.lab_test_panel_requests", "fqn": ["tamanu_source_dbt", "bases", "lab_test_panel_requests"], "alias": "lab_test_panel_requests", "checksum": {"name": "sha256", "checksum": "48b25f3f48462937dcf060fb80d9ef1346ec14d6c360d40fd2256141e46118fc"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A request for a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about those.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panel_requests.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_requests__lab_test_panel_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this lab test panel request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_requests__encounter_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_test_panel_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0500216, "relation_name": "\"app\".\"reporting\".\"lab_test_panel_requests\"", "raw_code": "select\r\n ltpr.id,\r\n ltpr.lab_test_panel_id,\r\n ltpr.encounter_id\r\nfrom {{ source('tamanu', 'lab_test_panel_requests') }} ltpr\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = ltpr.encounter_id\r\nwhere ltpr.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panel_requests"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_test_panel_requests.sql", "compiled": true, "compiled_code": "select\n ltpr.id,\n ltpr.lab_test_panel_id,\n ltpr.encounter_id\nfrom \"app\".\"public\".\"lab_test_panel_requests\" ltpr\njoin \"app\".\"public\".\"encounters\" e on e.id = ltpr.encounter_id\nwhere ltpr.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab_test_types": {"database": "app", "schema": "reporting", "name": "lab_test_types", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\lab_test_types.sql", "original_file_path": "models\\bases\\lab_test_types.sql", "unique_id": "model.tamanu_source_dbt.lab_test_types", "fqn": ["tamanu_source_dbt", "bases", "lab_test_types"], "alias": "lab_test_types", "checksum": {"name": "sha256", "checksum": "9c715ddbbe8ca0cb7d25aa63b401c2e87001a762e773c1cb1dc29baab423268b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "A kind of test that's possible to request.\r\n\r\nThis includes information about the test itself, and also parameters around result formatting, like\r\ndata type, expected ranges, etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_types.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Internal Tamanu code of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__code"]}, "external_code": {"name": "external_code", "description": "External code for the test (such as for LIMS).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__external_code"]}, "name": {"name": "name", "description": "Human-friendly name of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__name"]}, "unit": {"name": "unit", "description": "Unit the test result is measured in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__unit"]}, "male_min": {"name": "male_min", "description": "Minimum typical range for males.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__male_min"]}, "male_max": {"name": "male_max", "description": "Maximum typical range for males.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__male_max"]}, "female_min": {"name": "female_min", "description": "Minimum typical range for females.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__female_min"]}, "female_max": {"name": "female_max", "description": "Maximum typical range for females.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__female_max"]}, "range_text": {"name": "range_text", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__range_text"]}, "result_type": {"name": "result_type", "description": "Input type of result.\r\n\r\nOne of:\r\n- `FreeText`\r\n- `Number`\r\n- `Select`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__result_type"]}, "options": {"name": "options", "description": "Comma-separated list of options. Unused.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__options"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__lab_test_category_id"]}, "is_sensitive": {"name": "is_sensitive", "description": "Used to indicate if the lab test type is sensitive and should be hidden accordingly.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__is_sensitive"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_types.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\lab_test_types.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0500216, "relation_name": "\"app\".\"reporting\".\"lab_test_types\"", "raw_code": "select\r\n id,\r\n code,\r\n external_code,\r\n name,\r\n unit,\r\n male_min,\r\n male_max,\r\n female_min,\r\n female_max,\r\n range_text\r\n as result_type,\r\n options,\r\n lab_test_category_id,\r\n visibility_status,\r\n is_sensitive\r\nfrom {{ source('tamanu', 'lab_test_types') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_types"], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\lab_test_types.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n external_code,\n name,\n unit,\n male_min,\n male_max,\n female_min,\n female_max,\n range_text\n as result_type,\n options,\n lab_test_category_id,\n visibility_status,\n is_sensitive\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.locations": {"database": "app", "schema": "reporting", "name": "locations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\locations.sql", "original_file_path": "models\\bases\\locations.sql", "unique_id": "model.tamanu_source_dbt.locations", "fqn": ["tamanu_source_dbt", "bases", "locations"], "alias": "locations", "checksum": {"name": "sha256", "checksum": "fbc90b982910ef98f65130092a6066ca40d00bb7f690732e1ab7c792337162d5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Information on the hospital locations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in locations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code for location", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__code"]}, "name": {"name": "name", "description": "Full readable name for location", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__name"]}, "max_occupancy": {"name": "max_occupancy", "description": "The maximum number of patients that can be in this location", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__max_occupancy"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in locations.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\locations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0500216, "relation_name": "\"app\".\"reporting\".\"locations\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n max_occupancy,\r\n location_group_id,\r\n facility_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'locations') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__locations"], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\locations.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n max_occupancy,\n location_group_id,\n facility_id,\n visibility_status\nfrom \"app\".\"public\".\"locations\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.location_bookings": {"database": "app", "schema": "reporting", "name": "location_bookings", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\location_bookings.sql", "original_file_path": "models\\bases\\location_bookings.sql", "unique_id": "model.tamanu_source_dbt.location_bookings", "fqn": ["tamanu_source_dbt", "bases", "location_bookings"], "alias": "location_bookings", "checksum": {"name": "sha256", "checksum": "246c7546b456b6c751c1d3135c51513658b7d5d472208ea2d9cf689cc0e5b80f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table of appointments. (location bookings)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_datetime": {"name": "start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "end_datetime": {"name": "end_datetime", "description": "When the appointment ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) linked to this appointment", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__encounter_id"]}, "location_id": {"name": "location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_id"]}, "booking_type_id": {"name": "booking_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "is_high_priority": {"name": "is_high_priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "status": {"name": "status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\location_bookings.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0500216, "relation_name": "\"app\".\"reporting\".\"location_bookings\"", "raw_code": "select\r\n id,\r\n start_time::timestamp as start_datetime,\r\n end_time::timestamp as end_datetime,\r\n patient_id,\r\n clinician_id,\r\n encounter_id,\r\n location_id,\r\n booking_type_id,\r\n is_high_priority,\r\n status\r\nfrom {{ source('tamanu', 'appointments') }}\r\nwhere booking_type_id notnull\r\n and deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__appointments"], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\location_bookings.sql", "compiled": true, "compiled_code": "select\n id,\n start_time::timestamp as start_datetime,\n end_time::timestamp as end_datetime,\n patient_id,\n clinician_id,\n encounter_id,\n location_id,\n booking_type_id,\n is_high_priority,\n status\nfrom \"app\".\"public\".\"appointments\"\nwhere booking_type_id notnull\n and deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.location_groups": {"database": "app", "schema": "reporting", "name": "location_groups", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\location_groups.sql", "original_file_path": "models\\bases\\location_groups.sql", "unique_id": "model.tamanu_source_dbt.location_groups", "fqn": ["tamanu_source_dbt", "bases", "location_groups"], "alias": "location_groups", "checksum": {"name": "sha256", "checksum": "d9776bf31c16b8a797c55ee1727345e6c5802ff83c5e0dee42e47275264dbf0a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "A group of locations managed as a single unit (e.g. a ward in hospital)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in location_groups.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code for location group", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__code"]}, "name": {"name": "name", "description": "Full readable name for location group", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location group is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in location_groups.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\location_groups.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.0500216, "relation_name": "\"app\".\"reporting\".\"location_groups\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n facility_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'location_groups') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__location_groups"], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\location_groups.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n facility_id,\n visibility_status\nfrom \"app\".\"public\".\"location_groups\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.medication_dispenses": {"database": "app", "schema": "reporting", "name": "medication_dispenses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\medication_dispenses.sql", "original_file_path": "models\\bases\\medication_dispenses.sql", "unique_id": "model.tamanu_source_dbt.medication_dispenses", "fqn": ["tamanu_source_dbt", "bases", "medication_dispenses"], "alias": "medication_dispenses", "checksum": {"name": "sha256", "checksum": "7c5c23990be3b0d982f48cc21905ba9eff142264e7863b0faa886bf4416100f8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "reference"], "description": "Records of medication dispensing events, tracking when medications from pharmacy orders are physically dispensed to patients. Each record represents a single dispensing event for a specific prescription within a pharmacy order.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_dispenses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "pharmacy_order_prescription_id": {"name": "pharmacy_order_prescription_id", "description": "Reference to the [pharmacy_order_prescription](#!/source/source.tamanu.tamanu.pharmacy_order_prescriptions) that this dispense record fulfills. Links this dispensing event to the specific medication order being filled.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__pharmacy_order_prescription_id"]}, "quantity": {"name": "quantity", "description": "The quantity of medication units dispensed to the patient in each dispensing.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__quantity"]}, "dispensed_at": {"name": "dispensed_at", "description": "The timestamp indicating when the medication was physically dispensed to the patient.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_at"]}, "dispensed_by_user_id": {"name": "dispensed_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) (typically a pharmacist or pharmacy staff member) who dispensed the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_by_user_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\medication_dispenses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0500216, "relation_name": "\"app\".\"reporting\".\"medication_dispenses\"", "raw_code": "select\r\n md.id,\r\n md.pharmacy_order_prescription_id,\r\n md.quantity,\r\n md.dispensed_at::timestamp as dispensed_at,\r\n md.dispensed_by_user_id\r\nfrom {{ source('tamanu', 'medication_dispenses') }} md\r\njoin {{ source('tamanu', 'pharmacy_order_prescriptions') }} pop\r\n on pop.id = md.pharmacy_order_prescription_id\r\njoin {{ source('tamanu', 'pharmacy_orders') }} po on po.id = pop.pharmacy_order_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = po.encounter_id\r\nwhere md.deleted_at is null\r\n and pop.deleted_at is null\r\n and po.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__medication_dispenses"], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"], ["tamanu", "pharmacy_order_prescriptions"], ["tamanu", "pharmacy_orders"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses", "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "source.tamanu_source_dbt.tamanu.pharmacy_orders", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\medication_dispenses.sql", "compiled": true, "compiled_code": "select\n md.id,\n md.pharmacy_order_prescription_id,\n md.quantity,\n md.dispensed_at::timestamp as dispensed_at,\n md.dispensed_by_user_id\nfrom \"app\".\"public\".\"medication_dispenses\" md\njoin \"app\".\"public\".\"pharmacy_order_prescriptions\" pop\n on pop.id = md.pharmacy_order_prescription_id\njoin \"app\".\"public\".\"pharmacy_orders\" po on po.id = pop.pharmacy_order_id\njoin \"app\".\"public\".\"encounters\" e on e.id = po.encounter_id\nwhere md.deleted_at is null\n and pop.deleted_at is null\n and po.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.notes": {"database": "app", "schema": "reporting", "name": "notes", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\notes.sql", "original_file_path": "models\\bases\\notes.sql", "unique_id": "model.tamanu_source_dbt.notes", "fqn": ["tamanu_source_dbt", "bases", "notes"], "alias": "notes", "checksum": {"name": "sha256", "checksum": "51522179b1f122b8dba098b0dbab7a782ec2fc298b52fa629d5176489223d957"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Notes recorded by clinicians or system generated.\r\n\r\nAlso see the deprecated [`note_items`](#!/source/source.tamanu.tamanu.note_items),\r\n[`note_pages`](#!/source/source.tamanu.tamanu.note_pages), and the even older\r\n[`notes_legacy`](#!/source/source.tamanu.tamanu.notes_legacy).\r\n\r\nThis is the current version (3) of the notes system.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in notes.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in notes.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "content": {"name": "content", "description": "The content of the note recorded.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__content"]}, "note_type_id": {"name": "note_type_id", "description": "Reference to the note type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = noteType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__note_type_id"]}, "record_type": {"name": "record_type", "description": "Polymorphic relationship to the record to which the note is attached (type).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__record_type"]}, "record_id": {"name": "record_id", "description": "Polymorphic relationship to the record to which the note is attached (id).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__record_id"]}, "authored_by_id": {"name": "authored_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__author_id"]}, "on_behalf_of_id": {"name": "on_behalf_of_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note, if it wasn't the user who published it.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__on_behalf_of_id"]}, "updated_note_id": {"name": "updated_note_id", "description": "Reference to the [note](#!/source/source.tamanu.tamanu.notes) that is being revised.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__revised_by_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in notes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\notes.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0500216, "relation_name": "\"app\".\"reporting\".\"notes\"", "raw_code": "-- May include notes for the test patient.\r\nselect\r\n n.id,\r\n n.date::timestamp as datetime,\r\n n.content,\r\n n.note_type_id,\r\n rd.name as note_type,\r\n n.record_type,\r\n n.record_id,\r\n n.author_id as authored_by_id,\r\n n.on_behalf_of_id,\r\n n.revised_by_id as updated_note_id,\r\n n.visibility_status\r\nfrom {{ source('tamanu', 'notes') }} n\r\njoin {{ source('tamanu', 'reference_data') }} rd\r\n on rd.id = n.note_type_id\r\nwhere n.deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__notes"], "language": "sql", "refs": [], "sources": [["tamanu", "notes"], ["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.notes", "source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\notes.sql", "compiled": true, "compiled_code": "-- May include notes for the test patient.\nselect\n n.id,\n n.date::timestamp as datetime,\n n.content,\n n.note_type_id,\n rd.name as note_type,\n n.record_type,\n n.record_id,\n n.author_id as authored_by_id,\n n.on_behalf_of_id,\n n.revised_by_id as updated_note_id,\n n.visibility_status\nfrom \"app\".\"public\".\"notes\" n\njoin \"app\".\"public\".\"reference_data\" rd\n on rd.id = n.note_type_id\nwhere n.deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.outpatient_appointments": {"database": "app", "schema": "reporting", "name": "outpatient_appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments.sql", "original_file_path": "models\\bases\\outpatient_appointments.sql", "unique_id": "model.tamanu_source_dbt.outpatient_appointments", "fqn": ["tamanu_source_dbt", "bases", "outpatient_appointments"], "alias": "outpatient_appointments", "checksum": {"name": "sha256", "checksum": "c1d2ccc04049ba949fb642490b97e353dcc407f32a1a8c205ddc4e7a0732c192"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table of appointments. (outpatient appointment)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_datetime": {"name": "start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "end_datetime": {"name": "end_datetime", "description": "When the appointment ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "status": {"name": "status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__appointment_type_id"]}, "is_high_priority": {"name": "is_high_priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) linked to this appointment", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__encounter_id"]}, "schedule_id": {"name": "schedule_id", "description": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__schedule_id"]}, "until_date": {"name": "until_date", "description": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__until_date"]}, "interval": {"name": "interval", "description": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\"", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__interval"]}, "frequency": {"name": "frequency", "description": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__frequency"]}, "days_of_week": {"name": "days_of_week", "description": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__days_of_week"]}, "nth_weekday": {"name": "nth_weekday", "description": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__nth_weekday"]}, "occurrence_count": {"name": "occurrence_count", "description": "When this value is set, the recurrence ends after generating the specified number of occurrences\r\nAt least one of `occurrence_count` or `until_date` must be set.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__occurrence_count"]}, "is_fully_generated": {"name": "is_fully_generated", "description": "Whether or not all repeating appointments have been created for a schedule", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__is_fully_generated"]}, "generated_until_date": {"name": "generated_until_date", "description": "The date of the most recent appointment in a schedule, this is set after generation of the repeated appointment and then updated if it is necessary to generate further appointments.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__generated_until_date"]}, "cancelled_at_date": {"name": "cancelled_at_date", "description": "The date from which appointments in a schedule have been cancelled, this is set when cancelling 'this and all future appointments'.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__cancelled_at_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\outpatient_appointments.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0661294, "relation_name": "\"app\".\"reporting\".\"outpatient_appointments\"", "raw_code": "select\r\n a.id,\r\n a.start_time::timestamp as start_datetime,\r\n a.end_time::timestamp as end_datetime,\r\n a.patient_id,\r\n a.clinician_id,\r\n a.encounter_id,\r\n a.schedule_id,\r\n a.location_group_id,\r\n a.appointment_type_id,\r\n case\r\n when a.is_high_priority then 'Yes' else 'No'\r\n end as priority,\r\n a.status,\r\n s.until_date::date as until_date,\r\n s.interval,\r\n s.days_of_week,\r\n s.frequency,\r\n s.nth_weekday,\r\n s.occurrence_count,\r\n s.is_fully_generated,\r\n s.generated_until_date,\r\n s.cancelled_at_date\r\nfrom {{ source('tamanu', 'appointments') }} a\r\nleft join {{ source('tamanu', 'appointment_schedules') }} s on s.id = a.schedule_id\r\nwhere a.deleted_at is null\r\n and a.patient_id != '{{ var(\"test_patient\") }}'\r\n and a.appointment_type_id notnull", "doc_blocks": ["doc.tamanu_source_dbt.table__appointments"], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"], ["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\outpatient_appointments.sql", "compiled": true, "compiled_code": "select\n a.id,\n a.start_time::timestamp as start_datetime,\n a.end_time::timestamp as end_datetime,\n a.patient_id,\n a.clinician_id,\n a.encounter_id,\n a.schedule_id,\n a.location_group_id,\n a.appointment_type_id,\n case\n when a.is_high_priority then 'Yes' else 'No'\n end as priority,\n a.status,\n s.until_date::date as until_date,\n s.interval,\n s.days_of_week,\n s.frequency,\n s.nth_weekday,\n s.occurrence_count,\n s.is_fully_generated,\n s.generated_until_date,\n s.cancelled_at_date\nfrom \"app\".\"public\".\"appointments\" a\nleft join \"app\".\"public\".\"appointment_schedules\" s on s.id = a.schedule_id\nwhere a.deleted_at is null\n and a.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n and a.appointment_type_id notnull", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.outpatient_appointments_change_logs": {"database": "app", "schema": "reporting", "name": "outpatient_appointments_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.sql", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.sql", "unique_id": "model.tamanu_source_dbt.outpatient_appointments_change_logs", "fqn": ["tamanu_source_dbt", "bases", "outpatient_appointments_change_logs"], "alias": "outpatient_appointments_change_logs", "checksum": {"name": "sha256", "checksum": "b4e8dcfa6fed1e0d00ff4873c669923783956614959bab206314cd35bf98cfde"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "base", "clinical", "audit"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "audit"], "description": "Base model for appointment change logs. Contains all changes to appointments extracted from the logs.changes table, including the initial creation. Each row represents a change event with both current and previous values.\n", "columns": {"change_id": {"name": "change_id", "description": "Unique identifier for the change log entry (UUID from logs.changes).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id"]}, "appointment_id": {"name": "appointment_id", "description": "Reference to the [appointment](#!/model/model.tamanu_source_dbt.outpatient_appointments) that was modified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id"]}, "modified_datetime": {"name": "modified_datetime", "description": "Timestamp when the change was logged (from logs.changes.logged_at).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime"]}, "modified_by_user_id": {"name": "modified_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who made the modification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who originally created the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/model/model.tamanu_source_dbt.patients) associated with the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id"]}, "start_datetime": {"name": "start_datetime", "description": "Current appointment start date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime"]}, "end_datetime": {"name": "end_datetime", "description": "Current appointment end date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime"]}, "clinician_id": {"name": "clinician_id", "description": "Current [clinician](#!/model/model.tamanu_source_dbt.users) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id"]}, "location_group_id": {"name": "location_group_id", "description": "Current [location group](#!/model/model.tamanu_source_dbt.location_groups)/area ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Current [appointment type](#!/model/model.tamanu_source_dbt.reference_data) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id"]}, "is_high_priority": {"name": "is_high_priority", "description": "Current priority status (after the change). Boolean indicating if the appointment is high priority.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority"]}, "status": {"name": "status", "description": "Current appointment status (after the change).\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__status"]}, "schedule_id": {"name": "schedule_id", "description": "Current recurring schedule ID (after the change). References appointment_schedules table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id"]}, "prev_start_datetime": {"name": "prev_start_datetime", "description": "Previous appointment start date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime"]}, "prev_end_datetime": {"name": "prev_end_datetime", "description": "Previous appointment end date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime"]}, "prev_clinician_id": {"name": "prev_clinician_id", "description": "Previous clinician ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id"]}, "prev_location_group_id": {"name": "prev_location_group_id", "description": "Previous location group/area ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id"]}, "prev_appointment_type_id": {"name": "prev_appointment_type_id", "description": "Previous appointment type ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id"]}, "prev_is_high_priority": {"name": "prev_is_high_priority", "description": "Previous priority status (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority"]}, "prev_status": {"name": "prev_status", "description": "Previous appointment status (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_status"]}, "change_sequence": {"name": "change_sequence", "description": "Sequential number of this change for the appointment.\r\n- 1 = initial creation event\r\n- 2+ = subsequent modifications\r\n\r\nUses ROW_NUMBER() partitioned by appointment_id and ordered by logged_at.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_sequence"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\outpatient_appointments_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["base", "clinical", "audit"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0661294, "relation_name": "\"app\".\"reporting\".\"outpatient_appointments_change_logs\"", "raw_code": "-- Base model for outpatient appointment change logs\r\n-- Extracts appointment modifications from logs.changes table\r\n-- Each row represents a change event to an appointment\r\n\r\nwith appointment_changes as (\r\n select\r\n c.id as change_id,\r\n c.record_id as appointment_id,\r\n c.logged_at as modified_datetime,\r\n c.updated_by_user_id as modified_by_user_id,\r\n -- Extract current values from the change log record_data\r\n (c.record_data ->> 'start_time')::timestamp as start_datetime,\r\n (c.record_data ->> 'end_time')::timestamp as end_datetime,\r\n c.record_data ->> 'patient_id' as patient_id,\r\n c.record_data ->> 'clinician_id' as clinician_id,\r\n c.record_data ->> 'location_group_id' as location_group_id,\r\n c.record_data ->> 'appointment_type_id' as appointment_type_id,\r\n (c.record_data ->> 'is_high_priority')::boolean as is_high_priority,\r\n c.record_data ->> 'status' as status,\r\n (c.record_data ->> 'schedule_id')::uuid as schedule_id,\r\n -- Get creator from the first change_sequence (initial creation)\r\n first_value(c.updated_by_user_id) over (\r\n partition by c.record_id\r\n order by c.logged_at\r\n ) as created_by_user_id,\r\n -- Use LAG to get the previous record state\r\n lag(c.record_data) over (\r\n partition by c.record_id\r\n order by c.logged_at\r\n ) as previous_record_data,\r\n -- Track change sequence\r\n row_number() over (\r\n partition by c.record_id\r\n order by c.logged_at\r\n ) as change_sequence\r\n from {{ source('logs__tamanu', 'changes') }} c\r\n where c.table_name = 'appointments'\r\n and c.record_deleted_at is null\r\n and (c.record_data ->> 'appointment_type_id') is not null\r\n)\r\n\r\nselect\r\n change_id,\r\n appointment_id,\r\n modified_datetime,\r\n modified_by_user_id,\r\n created_by_user_id,\r\n patient_id,\r\n -- Current appointment details\r\n start_datetime,\r\n end_datetime,\r\n clinician_id,\r\n location_group_id,\r\n appointment_type_id,\r\n is_high_priority,\r\n status,\r\n schedule_id,\r\n -- Previous appointment details\r\n (previous_record_data ->> 'start_time')::timestamp as prev_start_datetime,\r\n (previous_record_data ->> 'end_time')::timestamp as prev_end_datetime,\r\n (previous_record_data ->> 'clinician_id') as prev_clinician_id,\r\n (previous_record_data ->> 'location_group_id') as prev_location_group_id,\r\n (previous_record_data ->> 'appointment_type_id') as prev_appointment_type_id,\r\n (previous_record_data ->> 'is_high_priority')::boolean as prev_is_high_priority,\r\n (previous_record_data ->> 'status') as prev_status,\r\n change_sequence\r\nfrom appointment_changes", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\outpatient_appointments_change_logs.sql", "compiled": true, "compiled_code": "-- Base model for outpatient appointment change logs\n-- Extracts appointment modifications from logs.changes table\n-- Each row represents a change event to an appointment\n\nwith appointment_changes as (\n select\n c.id as change_id,\n c.record_id as appointment_id,\n c.logged_at as modified_datetime,\n c.updated_by_user_id as modified_by_user_id,\n -- Extract current values from the change log record_data\n (c.record_data ->> 'start_time')::timestamp as start_datetime,\n (c.record_data ->> 'end_time')::timestamp as end_datetime,\n c.record_data ->> 'patient_id' as patient_id,\n c.record_data ->> 'clinician_id' as clinician_id,\n c.record_data ->> 'location_group_id' as location_group_id,\n c.record_data ->> 'appointment_type_id' as appointment_type_id,\n (c.record_data ->> 'is_high_priority')::boolean as is_high_priority,\n c.record_data ->> 'status' as status,\n (c.record_data ->> 'schedule_id')::uuid as schedule_id,\n -- Get creator from the first change_sequence (initial creation)\n first_value(c.updated_by_user_id) over (\n partition by c.record_id\n order by c.logged_at\n ) as created_by_user_id,\n -- Use LAG to get the previous record state\n lag(c.record_data) over (\n partition by c.record_id\n order by c.logged_at\n ) as previous_record_data,\n -- Track change sequence\n row_number() over (\n partition by c.record_id\n order by c.logged_at\n ) as change_sequence\n from \"app\".\"logs\".\"changes\" c\n where c.table_name = 'appointments'\n and c.record_deleted_at is null\n and (c.record_data ->> 'appointment_type_id') is not null\n)\n\nselect\n change_id,\n appointment_id,\n modified_datetime,\n modified_by_user_id,\n created_by_user_id,\n patient_id,\n -- Current appointment details\n start_datetime,\n end_datetime,\n clinician_id,\n location_group_id,\n appointment_type_id,\n is_high_priority,\n status,\n schedule_id,\n -- Previous appointment details\n (previous_record_data ->> 'start_time')::timestamp as prev_start_datetime,\n (previous_record_data ->> 'end_time')::timestamp as prev_end_datetime,\n (previous_record_data ->> 'clinician_id') as prev_clinician_id,\n (previous_record_data ->> 'location_group_id') as prev_location_group_id,\n (previous_record_data ->> 'appointment_type_id') as prev_appointment_type_id,\n (previous_record_data ->> 'is_high_priority')::boolean as prev_is_high_priority,\n (previous_record_data ->> 'status') as prev_status,\n change_sequence\nfrom appointment_changes", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients": {"database": "app", "schema": "reporting", "name": "patients", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients.sql", "original_file_path": "models\\bases\\patients.sql", "unique_id": "model.tamanu_source_dbt.patients", "fqn": ["tamanu_source_dbt", "bases", "patients"], "alias": "patients", "checksum": {"name": "sha256", "checksum": "6e2d2af9162713cafefd9e038afff857a01dbd1a94ed5d837788a09c6e0a083c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient"], "description": "The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "email": {"name": "email", "description": "Email address of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__email"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.0661294, "relation_name": "\"app\".\"reporting\".\"patients\"", "raw_code": "select\r\n id,\r\n created_at as created_datetime,\r\n updated_at as updated_datetime\r\n {%- set columns = [\r\n {'expr': 'display_id', 'name': 'display_id', 'is_direct_identifier': true},\r\n {'expr': 'first_name', 'name': 'first_name', 'is_direct_identifier': true},\r\n {'expr': 'middle_name', 'name': 'middle_name', 'is_direct_identifier': true},\r\n {'expr': 'last_name', 'name': 'last_name', 'is_direct_identifier': true},\r\n {'expr': 'cultural_name', 'name': 'cultural_name', 'is_direct_identifier': true},\r\n {'expr': 'email', 'name': 'email', 'is_direct_identifier': true},\r\n {'expr': 'initcap(sex::text)', 'name': 'sex', 'is_direct_identifier': false},\r\n {'expr': 'date_of_birth::date', 'name': 'date_of_birth', 'is_direct_identifier': false},\r\n {'expr': 'date_of_death::timestamp', 'name': 'date_of_death', 'is_direct_identifier': false},\r\n {'expr': 'village_id', 'name': 'village_id', 'is_direct_identifier': false}\r\n ] -%}\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom {{ source('tamanu', 'patients') }}\r\nwhere deleted_at is null\r\n and id != '{{ var(\"test_patient\") }}'\r\n and visibility_status != 'merged'", "doc_blocks": ["doc.tamanu_source_dbt.table__patients"], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients.sql", "compiled": true, "compiled_code": "select\n id,\n created_at as created_datetime,\n updated_at as updated_datetime,\n display_id as display_id,\n first_name as first_name,\n middle_name as middle_name,\n last_name as last_name,\n cultural_name as cultural_name,\n email as email,\n initcap(sex::text) as sex,\n date_of_birth::date as date_of_birth,\n date_of_death::timestamp as date_of_death,\n village_id as village_id\nfrom \"app\".\"public\".\"patients\"\nwhere deleted_at is null\n and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n and visibility_status != 'merged'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients_access_logs": {"database": "app", "schema": "reporting", "name": "patients_access_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients_access_logs.sql", "original_file_path": "models\\bases\\patients_access_logs.sql", "unique_id": "model.tamanu_source_dbt.patients_access_logs", "fqn": ["tamanu_source_dbt", "bases", "patients_access_logs"], "alias": "patients_access_logs", "checksum": {"name": "sha256", "checksum": "6a1d0a0ddb46200746dab446cec594f037e828140742c41f875f79dbd5e4574b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration", "log"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration", "log"], "description": "Access logs of patient data", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients_access_logs.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "facility_id": {"name": "facility_id", "description": "The facility that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__facility_id"]}, "logged_at": {"name": "logged_at", "description": "The time string of when the record was accessed", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__logged_at"]}, "session_id": {"name": "session_id", "description": "The user session that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__session_id"]}, "device_id": {"name": "device_id", "description": "The id for the device that the user was accessing the record on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__device_id"]}, "is_mobile": {"name": "is_mobile", "description": "Whether or not the user accessed the record from mobile", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__is_mobile"]}, "version": {"name": "version", "description": "The version of tamanu the record was created on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__version"]}, "front_end_context": {"name": "front_end_context", "description": "A JSON object containing front end information about the record access", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__front_end_context"]}, "back_end_context": {"name": "back_end_context", "description": "A JSON object containing back end information about the record access", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__back_end_context"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients_access_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration", "log"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782423652.0661294, "relation_name": "\"app\".\"reporting\".\"patients_access_logs\"", "raw_code": "select\n id,\n user_id,\n record_id as patient_id,\n facility_id,\n logged_at at time zone '{{ var(\"timezone\") }}' as logged_at,\n session_id,\n device_id,\n is_mobile,\n version,\n front_end_context,\n back_end_context\nfrom {{ source(\"logs__tamanu\", \"accesses\") }}\nwhere deleted_at is null\n and record_type = 'Patient'", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients_access_logs.sql", "compiled": true, "compiled_code": "select\n id,\n user_id,\n record_id as patient_id,\n facility_id,\n logged_at at time zone 'Australia/Sydney' as logged_at,\n session_id,\n device_id,\n is_mobile,\n version,\n front_end_context,\n back_end_context\nfrom \"app\".\"logs\".\"accesses\"\nwhere deleted_at is null\n and record_type = 'Patient'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients_change_logs": {"database": "app", "schema": "reporting", "name": "patients_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients_change_logs.sql", "original_file_path": "models\\bases\\patients_change_logs.sql", "unique_id": "model.tamanu_source_dbt.patients_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patients_change_logs"], "alias": "patients_change_logs", "checksum": {"name": "sha256", "checksum": "8632f3b94a79b72db0976148f8f1ec191bc9615129d73c25953149595dd85ae1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient", "log"], "description": "Change logs for The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table).", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in patients history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in patients history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "email": {"name": "email", "description": "Email address of patient from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__email"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other` from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient from history.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patients history which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.0818102, "relation_name": "\"app\".\"reporting\".\"patients_change_logs\"", "raw_code": "{%- set columns = [\r\n {'expr': \"fc.record_data ->> 'display_id'\", 'name': 'display_id', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'first_name'\", 'name': 'first_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'middle_name'\", 'name': 'middle_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'last_name'\", 'name': 'last_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'cultural_name'\", 'name': 'cultural_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'email'\", 'name': 'email', 'is_direct_identifier': true},\r\n {'expr': \"initcap(fc.record_data ->> 'sex')\", 'name': 'sex', 'is_direct_identifier': false},\r\n {'expr': \"(fc.record_data ->> 'date_of_birth')::date\", 'name': 'date_of_birth', 'is_direct_identifier': false},\r\n {'expr': \"(fc.record_data ->> 'date_of_death')::timestamp\", 'name': 'date_of_death', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'village_id'\", 'name': 'village_id', 'is_direct_identifier': false},\r\n {'expr': \"(fc.record_data ->> 'created_at')::date\", 'name': 'registration_date', 'is_direct_identifier': false}\r\n] -%}\r\n\r\nwith filtered_changes as (\r\n {{ base_history_from_log('patients') }}\r\n and record_id != '{{ var(\"test_patient\") }}'\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at at time zone '{{ var(\"timezone\") }}' as logged_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as id\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__patients"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"], ["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log", "macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patients'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"patients\" t\n where t.deleted_at notnull\n )\n and record_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n)\n\nselect\n fc.changelog_id,\n fc.logged_at at time zone 'Australia/Sydney' as logged_at,\n fc.updated_by_user_id,\n fc.record_id as id,\n fc.record_data ->> 'display_id' as display_id,\n fc.record_data ->> 'first_name' as first_name,\n fc.record_data ->> 'middle_name' as middle_name,\n fc.record_data ->> 'last_name' as last_name,\n fc.record_data ->> 'cultural_name' as cultural_name,\n fc.record_data ->> 'email' as email,\n initcap(fc.record_data ->> 'sex') as sex,\n (fc.record_data ->> 'date_of_birth')::date as date_of_birth,\n (fc.record_data ->> 'date_of_death')::timestamp as date_of_death,\n fc.record_data ->> 'village_id' as village_id,\n (fc.record_data ->> 'created_at')::date as registration_date\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients_merged": {"database": "app", "schema": "reporting", "name": "patients_merged", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients_merged.sql", "original_file_path": "models\\bases\\patients_merged.sql", "unique_id": "model.tamanu_source_dbt.patients_merged", "fqn": ["tamanu_source_dbt", "bases", "patients_merged"], "alias": "patients_merged", "checksum": {"name": "sha256", "checksum": "608b46511e43c8d0c86454462e7a11e3b10b5b06c3e86208a1954a1da01ea864"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient"], "description": "Only includes patients that have been merged. The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "email": {"name": "email", "description": "Email address of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__email"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patients which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients_merged.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.0818102, "relation_name": "\"app\".\"reporting\".\"patients_merged\"", "raw_code": "select\r\n id\r\n {%- set columns = [\r\n {'expr': 'display_id', 'name': 'display_id', 'is_direct_identifier': true},\r\n {'expr': 'first_name', 'name': 'first_name', 'is_direct_identifier': true},\r\n {'expr': 'middle_name', 'name': 'middle_name', 'is_direct_identifier': true},\r\n {'expr': 'last_name', 'name': 'last_name', 'is_direct_identifier': true},\r\n {'expr': 'cultural_name', 'name': 'cultural_name', 'is_direct_identifier': true},\r\n {'expr': 'email', 'name': 'email', 'is_direct_identifier': true},\r\n {'expr': 'initcap(sex::text)', 'name': 'sex', 'is_direct_identifier': false},\r\n {'expr': 'date_of_birth::date', 'name': 'date_of_birth', 'is_direct_identifier': false},\r\n {'expr': 'date_of_death::timestamp', 'name': 'date_of_death', 'is_direct_identifier': false},\r\n {'expr': 'village_id', 'name': 'village_id', 'is_direct_identifier': false},\r\n {'expr': 'created_at::date', 'name': 'registration_date', 'is_direct_identifier': false}\r\n ] -%}\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom {{ source('tamanu', 'patients') }}\r\nwhere deleted_at is null\r\n and id != '{{ var(\"test_patient\") }}'\r\n and visibility_status = 'merged'", "doc_blocks": ["doc.tamanu_source_dbt.table__patients"], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients_merged.sql", "compiled": true, "compiled_code": "select\n id,\n display_id as display_id,\n first_name as first_name,\n middle_name as middle_name,\n last_name as last_name,\n cultural_name as cultural_name,\n email as email,\n initcap(sex::text) as sex,\n date_of_birth::date as date_of_birth,\n date_of_death::timestamp as date_of_death,\n village_id as village_id,\n created_at::date as registration_date\nfrom \"app\".\"public\".\"patients\"\nwhere deleted_at is null\n and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n and visibility_status = 'merged'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patients_metadata": {"database": "app", "schema": "reporting", "name": "patients_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patients_metadata.sql", "original_file_path": "models\\bases\\patients_metadata.sql", "unique_id": "model.tamanu_source_dbt.patients_metadata", "fqn": ["tamanu_source_dbt", "bases", "patients_metadata"], "alias": "patients_metadata", "checksum": {"name": "sha256", "checksum": "1d490a12778d1e209b3cb8bd8cee1be564501e0424a6a0ac50d85f40385e0edd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient", "log"], "description": "Metadata information extracted from the change logs for patients.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the patients table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the patients table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patients_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.0818102, "relation_name": "\"app\".\"reporting\".\"patients_metadata\"", "raw_code": "{{ get_metadata_from_changes('patients') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patients_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patients'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_additional_data": {"database": "app", "schema": "reporting", "name": "patient_additional_data", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_additional_data.sql", "original_file_path": "models\\bases\\patient_additional_data.sql", "unique_id": "model.tamanu_source_dbt.patient_additional_data", "fqn": ["tamanu_source_dbt", "bases", "patient_additional_data"], "alias": "patient_additional_data", "checksum": {"name": "sha256", "checksum": "0a7dcbc4dc0550d29a89c718b6d3ceb7425550e18bd47ade9320ebf6e94c766e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient"], "description": "Core or adjunct patient data that doesn't fit elsewhere, but is only downloaded to a facility once a\r\npatient is marked for sync.\r\n\r\nThis is often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`, `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and specify custom/non-standard data to be stored against patients.", "columns": {"patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) in patient_additional_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "title": {"name": "title", "description": "Patient name: title.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__title"]}, "marital_status": {"name": "marital_status", "description": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__marital_status"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "emergency_contact_name": {"name": "emergency_contact_name", "description": "Name of emergency contact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name"]}, "emergency_contact_number": {"name": "emergency_contact_number", "description": "Phone number of emergency contact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number"]}, "social_media": {"name": "social_media", "description": "Free-form social media contact.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__social_media"]}, "ethnicity_id": {"name": "ethnicity_id", "description": "Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__ethnicity_id"]}, "religion_id": {"name": "religion_id", "description": "Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__religion_id"]}, "nationality_id": {"name": "nationality_id", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "secondary_village_id": {"name": "secondary_village_id", "description": "Reference to patient administrative village of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\nSee also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_village_id"]}, "country_id": {"name": "country_id", "description": "Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_id"]}, "division_id": {"name": "division_id", "description": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__division_id"]}, "subdivision_id": {"name": "subdivision_id", "description": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__subdivision_id"]}, "medical_area_id": {"name": "medical_area_id", "description": "Reference to patient administrative medical area of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__medical_area_id"]}, "nursing_zone_id": {"name": "nursing_zone_id", "description": "Reference to patient administrative nursing zone of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id"]}, "settlement_id": {"name": "settlement_id", "description": "Reference to patient residence settlement ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__settlement_id"]}, "city_town": {"name": "city_town", "description": "Patient current address city or town.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__city_town"]}, "street_village": {"name": "street_village", "description": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__street_village"]}, "country_of_birth_id": {"name": "country_of_birth_id", "description": "Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id"]}, "place_of_birth": {"name": "place_of_birth", "description": "Free-form place of birth (typically a place name or country).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__place_of_birth"]}, "birth_certificate": {"name": "birth_certificate", "description": "Birth certificate identifier.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__birth_certificate"]}, "driving_license": {"name": "driving_license", "description": "Driving licence identifier.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__driving_license"]}, "passport": {"name": "passport", "description": "Passport number.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__passport"]}, "educational_level": {"name": "educational_level", "description": "Highest educational attainment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__educational_level"]}, "occupation_id": {"name": "occupation_id", "description": "Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__occupation_id"]}, "blood_type": {"name": "blood_type", "description": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__blood_type"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "health_center_id": {"name": "health_center_id", "description": "Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__health_center_id"]}, "insurer_id": {"name": "insurer_id", "description": "Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_id"]}, "insurer_policy_number": {"name": "insurer_policy_number", "description": "Policy number of patient insurance.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number"]}, "mother_id": {"name": "mother_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father_id": {"name": "father_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who registered the patient in Tamanu.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__registered_by_id"]}, "updated_by_field": {"name": "updated_by_field", "description": "JSON object recording the updated datetime for individual columns.\r\n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields are edited separately in\r\ndifferent facilities. The default sync strategy is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict, but this can lead to discarding important data in the case of PADs. This field\r\nis used to implement per-field \"last edit wins\" instead.", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patient_additional_data which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_additional_data.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.0818102, "relation_name": "\"app\".\"reporting\".\"patient_additional_data\"", "raw_code": "select\r\n patient_id\r\n {%- set columns = [\r\n {'expr': 'title', 'name': 'title', 'is_direct_identifier': false},\r\n {'expr': 'marital_status', 'name': 'marital_status', 'is_direct_identifier': false},\r\n {'expr': 'primary_contact_number', 'name': 'primary_contact_number', 'is_direct_identifier': true},\r\n {'expr': 'secondary_contact_number', 'name': 'secondary_contact_number', 'is_direct_identifier': true},\r\n {'expr': 'emergency_contact_name', 'name': 'emergency_contact_name', 'is_direct_identifier': true},\r\n {'expr': 'emergency_contact_number', 'name': 'emergency_contact_number', 'is_direct_identifier': true},\r\n {'expr': 'social_media', 'name': 'social_media', 'is_direct_identifier': true},\r\n {'expr': 'ethnicity_id', 'name': 'ethnicity_id', 'is_direct_identifier': false},\r\n {'expr': 'religion_id', 'name': 'religion_id', 'is_direct_identifier': false},\r\n {'expr': 'nationality_id', 'name': 'nationality_id', 'is_direct_identifier': false},\r\n {'expr': 'secondary_village_id', 'name': 'secondary_village_id', 'is_direct_identifier': false},\r\n {'expr': 'country_id', 'name': 'country_id', 'is_direct_identifier': false},\r\n {'expr': 'division_id', 'name': 'division_id', 'is_direct_identifier': false},\r\n {'expr': 'subdivision_id', 'name': 'subdivision_id', 'is_direct_identifier': false},\r\n {'expr': 'medical_area_id', 'name': 'medical_area_id', 'is_direct_identifier': false},\r\n {'expr': 'nursing_zone_id', 'name': 'nursing_zone_id', 'is_direct_identifier': false},\r\n {'expr': 'settlement_id', 'name': 'settlement_id', 'is_direct_identifier': true},\r\n {'expr': 'city_town', 'name': 'city_town', 'is_direct_identifier': true},\r\n {'expr': 'street_village', 'name': 'street_village', 'is_direct_identifier': true},\r\n {'expr': 'country_of_birth_id', 'name': 'country_of_birth_id', 'is_direct_identifier': false},\r\n {'expr': 'place_of_birth', 'name': 'place_of_birth', 'is_direct_identifier': false},\r\n {'expr': 'birth_certificate', 'name': 'birth_certificate', 'is_direct_identifier': true},\r\n {'expr': 'driving_license', 'name': 'driving_license', 'is_direct_identifier': true},\r\n {'expr': 'passport', 'name': 'passport', 'is_direct_identifier': true},\r\n {'expr': 'educational_level', 'name': 'educational_level', 'is_direct_identifier': false},\r\n {'expr': 'occupation_id', 'name': 'occupation_id', 'is_direct_identifier': false},\r\n {'expr': 'blood_type', 'name': 'blood_type', 'is_direct_identifier': false},\r\n {'expr': 'patient_billing_type_id', 'name': 'patient_billing_type_id', 'is_direct_identifier': false},\r\n {'expr': 'health_center_id', 'name': 'health_center_id', 'is_direct_identifier': false},\r\n {'expr': 'insurer_id', 'name': 'insurer_id', 'is_direct_identifier': false},\r\n {'expr': 'insurer_policy_number', 'name': 'insurer_policy_number', 'is_direct_identifier': true},\r\n {'expr': 'mother_id', 'name': 'mother_id', 'is_direct_identifier': false},\r\n {'expr': 'father_id', 'name': 'father_id', 'is_direct_identifier': false},\r\n {'expr': 'registered_by_id', 'name': 'registered_by_id', 'is_direct_identifier': false},\r\n {'expr': 'updated_at_by_field', 'name': 'updated_by_field', 'is_direct_identifier': false},\r\n {'expr': 'created_at::date', 'name': 'registration_date', 'is_direct_identifier': false}\r\n ] -%}\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom {{ source('tamanu', 'patient_additional_data') }}\r\nwhere deleted_at is null\r\n and id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_additional_data"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_additional_data.sql", "compiled": true, "compiled_code": "select\n patient_id,\n title as title,\n marital_status as marital_status,\n primary_contact_number as primary_contact_number,\n secondary_contact_number as secondary_contact_number,\n emergency_contact_name as emergency_contact_name,\n emergency_contact_number as emergency_contact_number,\n social_media as social_media,\n ethnicity_id as ethnicity_id,\n religion_id as religion_id,\n nationality_id as nationality_id,\n secondary_village_id as secondary_village_id,\n country_id as country_id,\n division_id as division_id,\n subdivision_id as subdivision_id,\n medical_area_id as medical_area_id,\n nursing_zone_id as nursing_zone_id,\n settlement_id as settlement_id,\n city_town as city_town,\n street_village as street_village,\n country_of_birth_id as country_of_birth_id,\n place_of_birth as place_of_birth,\n birth_certificate as birth_certificate,\n driving_license as driving_license,\n passport as passport,\n educational_level as educational_level,\n occupation_id as occupation_id,\n blood_type as blood_type,\n patient_billing_type_id as patient_billing_type_id,\n health_center_id as health_center_id,\n insurer_id as insurer_id,\n insurer_policy_number as insurer_policy_number,\n mother_id as mother_id,\n father_id as father_id,\n registered_by_id as registered_by_id,\n updated_at_by_field as updated_by_field,\n created_at::date as registration_date\nfrom \"app\".\"public\".\"patient_additional_data\"\nwhere deleted_at is null\n and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_additional_data_change_logs": {"database": "app", "schema": "reporting", "name": "patient_additional_data_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_additional_data_change_logs.sql", "original_file_path": "models\\bases\\patient_additional_data_change_logs.sql", "unique_id": "model.tamanu_source_dbt.patient_additional_data_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_additional_data_change_logs"], "alias": "patient_additional_data_change_logs", "checksum": {"name": "sha256", "checksum": "16de1cd6976c01dcd7cee4358a77b3d18e623ed54c61c671a89d605320ad47f1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient", "log"], "description": "Change logs of Core or adjunct patient data that doesn't fit elsewhere, but is only downloaded to a facility once a\r\npatient is marked for sync.\r\n\r\nThis is often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`, `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and specify custom/non-standard data to be stored against patients.", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in patient additional data history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in patient additional data history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) in patient_additional_data from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "title": {"name": "title", "description": "Patient name: title. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__title"]}, "marital_status": {"name": "marital_status", "description": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown` from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__marital_status"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "emergency_contact_name": {"name": "emergency_contact_name", "description": "Name of emergency contact. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name"]}, "emergency_contact_number": {"name": "emergency_contact_number", "description": "Phone number of emergency contact. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number"]}, "social_media": {"name": "social_media", "description": "Free-form social media contact.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__social_media"]}, "ethnicity_id": {"name": "ethnicity_id", "description": "Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__ethnicity_id"]}, "religion_id": {"name": "religion_id", "description": "Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__religion_id"]}, "nationality_id": {"name": "nationality_id", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "secondary_village_id": {"name": "secondary_village_id", "description": "Reference to patient administrative village of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\nSee also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_village_id"]}, "country_id": {"name": "country_id", "description": "Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_id"]}, "division_id": {"name": "division_id", "description": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__division_id"]}, "subdivision_id": {"name": "subdivision_id", "description": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__subdivision_id"]}, "medical_area_id": {"name": "medical_area_id", "description": "Reference to patient administrative medical area of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__medical_area_id"]}, "nursing_zone_id": {"name": "nursing_zone_id", "description": "Reference to patient administrative nursing zone of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id"]}, "settlement_id": {"name": "settlement_id", "description": "Reference to patient residence settlement ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__settlement_id"]}, "city_town": {"name": "city_town", "description": "Patient current address city or town.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__city_town"]}, "street_village": {"name": "street_village", "description": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__street_village"]}, "country_of_birth_id": {"name": "country_of_birth_id", "description": "Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id"]}, "place_of_birth": {"name": "place_of_birth", "description": "Free-form place of birth (typically a place name or country). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__place_of_birth"]}, "birth_certificate": {"name": "birth_certificate", "description": "Birth certificate identifier. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__birth_certificate"]}, "driving_license": {"name": "driving_license", "description": "Driving licence identifier. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__driving_license"]}, "passport": {"name": "passport", "description": "Passport number. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__passport"]}, "educational_level": {"name": "educational_level", "description": "Highest educational attainment. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__educational_level"]}, "occupation_id": {"name": "occupation_id", "description": "Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__occupation_id"]}, "blood_type": {"name": "blood_type", "description": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-` from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__blood_type"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "Reference to patient billing type. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "health_center_id": {"name": "health_center_id", "description": "Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__health_center_id"]}, "insurer_id": {"name": "insurer_id", "description": "Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_id"]}, "insurer_policy_number": {"name": "insurer_policy_number", "description": "Policy number of patient insurance. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["direct_identifier"]}, "tags": ["direct_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number"]}, "mother_id": {"name": "mother_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father_id": {"name": "father_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": ["quasi_identifier"]}, "tags": ["quasi_identifier"], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who registered the patient in Tamanu. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__registered_by_id"]}, "updated_by_field": {"name": "updated_by_field", "description": "JSON object recording the updated datetime for individual columns.\r\n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields are edited separately in\r\ndifferent facilities. The default sync strategy is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict, but this can lead to discarding important data in the case of PADs. This field\r\nis used to implement per-field \"last edit wins\" instead. from history.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patient additional data history which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_additional_data_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.0818102, "relation_name": "\"app\".\"reporting\".\"patient_additional_data_change_logs\"", "raw_code": "{%- set columns = [\r\n {'expr': \"fc.record_data ->> 'title'\", 'name': 'title', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'marital_status'\", 'name': 'marital_status', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'primary_contact_number'\", 'name': 'primary_contact_number', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'secondary_contact_number'\", 'name': 'secondary_contact_number', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'emergency_contact_name'\", 'name': 'emergency_contact_name', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'emergency_contact_number'\", 'name': 'emergency_contact_number', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'social_media'\", 'name': 'social_media', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'ethnicity_id'\", 'name': 'ethnicity_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'religion_id'\", 'name': 'religion_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'nationality_id'\", 'name': 'nationality_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'secondary_village_id'\", 'name': 'secondary_village_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'country_id'\", 'name': 'country_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'division_id'\", 'name': 'division_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'subdivision_id'\", 'name': 'subdivision_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'medical_area_id'\", 'name': 'medical_area_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'nursing_zone_id'\", 'name': 'nursing_zone_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'settlement_id'\", 'name': 'settlement_id', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'city_town'\", 'name': 'city_town', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'street_village'\", 'name': 'street_village', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'country_of_birth_id'\", 'name': 'country_of_birth_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'place_of_birth'\", 'name': 'place_of_birth', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'birth_certificate'\", 'name': 'birth_certificate', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'driving_license'\", 'name': 'driving_license', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'passport'\", 'name': 'passport', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'educational_level'\", 'name': 'educational_level', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'occupation_id'\", 'name': 'occupation_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'blood_type'\", 'name': 'blood_type', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'patient_billing_type_id'\", 'name': 'patient_billing_type_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'health_center_id'\", 'name': 'health_center_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'insurer_id'\", 'name': 'insurer_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'insurer_policy_number'\", 'name': 'insurer_policy_number', 'is_direct_identifier': true},\r\n {'expr': \"fc.record_data ->> 'mother_id'\", 'name': 'mother_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'father_id'\", 'name': 'father_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data ->> 'registered_by_id'\", 'name': 'registered_by_id', 'is_direct_identifier': false},\r\n {'expr': \"fc.record_data -> 'updated_at_by_field'\", 'name': 'updated_by_field', 'is_direct_identifier': false},\r\n {'expr': \"(fc.record_data ->> 'created_at')::date\", 'name': 'registration_date', 'is_direct_identifier': false}\r\n] -%}\r\n\r\nwith filtered_changes as (\r\n {{ base_history_from_log('patient_additional_data') }}\r\n and record_id != '{{ var(\"test_patient\") }}' -- noqa: ST10\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at at time zone '{{ var(\"timezone\") }}' as logged_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as patient_id\r\n {%- for col in columns -%}\r\n {%- if not (is_analytics_target() and col.is_direct_identifier) -%}\r\n ,\r\n {{ col.expr }} as {{ col.name }}\r\n {%- endif -%}\r\n {%- endfor %}\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_additional_data"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"], ["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log", "macro.tamanu_source_dbt.is_analytics_target"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_additional_data_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patient_additional_data'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"patient_additional_data\" t\n where t.deleted_at notnull\n )\n and record_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3' -- noqa: ST10\n)\n\nselect\n fc.changelog_id,\n fc.logged_at at time zone 'Australia/Sydney' as logged_at,\n fc.updated_by_user_id,\n fc.record_id as patient_id,\n fc.record_data ->> 'title' as title,\n fc.record_data ->> 'marital_status' as marital_status,\n fc.record_data ->> 'primary_contact_number' as primary_contact_number,\n fc.record_data ->> 'secondary_contact_number' as secondary_contact_number,\n fc.record_data ->> 'emergency_contact_name' as emergency_contact_name,\n fc.record_data ->> 'emergency_contact_number' as emergency_contact_number,\n fc.record_data ->> 'social_media' as social_media,\n fc.record_data ->> 'ethnicity_id' as ethnicity_id,\n fc.record_data ->> 'religion_id' as religion_id,\n fc.record_data ->> 'nationality_id' as nationality_id,\n fc.record_data ->> 'secondary_village_id' as secondary_village_id,\n fc.record_data ->> 'country_id' as country_id,\n fc.record_data ->> 'division_id' as division_id,\n fc.record_data ->> 'subdivision_id' as subdivision_id,\n fc.record_data ->> 'medical_area_id' as medical_area_id,\n fc.record_data ->> 'nursing_zone_id' as nursing_zone_id,\n fc.record_data ->> 'settlement_id' as settlement_id,\n fc.record_data ->> 'city_town' as city_town,\n fc.record_data ->> 'street_village' as street_village,\n fc.record_data ->> 'country_of_birth_id' as country_of_birth_id,\n fc.record_data ->> 'place_of_birth' as place_of_birth,\n fc.record_data ->> 'birth_certificate' as birth_certificate,\n fc.record_data ->> 'driving_license' as driving_license,\n fc.record_data ->> 'passport' as passport,\n fc.record_data ->> 'educational_level' as educational_level,\n fc.record_data ->> 'occupation_id' as occupation_id,\n fc.record_data ->> 'blood_type' as blood_type,\n fc.record_data ->> 'patient_billing_type_id' as patient_billing_type_id,\n fc.record_data ->> 'health_center_id' as health_center_id,\n fc.record_data ->> 'insurer_id' as insurer_id,\n fc.record_data ->> 'insurer_policy_number' as insurer_policy_number,\n fc.record_data ->> 'mother_id' as mother_id,\n fc.record_data ->> 'father_id' as father_id,\n fc.record_data ->> 'registered_by_id' as registered_by_id,\n fc.record_data -> 'updated_at_by_field' as updated_by_field,\n (fc.record_data ->> 'created_at')::date as registration_date\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_allergies": {"database": "app", "schema": "reporting", "name": "patient_allergies", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_allergies.sql", "original_file_path": "models\\bases\\patient_allergies.sql", "unique_id": "model.tamanu_source_dbt.patient_allergies", "fqn": ["tamanu_source_dbt", "bases", "patient_allergies"], "alias": "patient_allergies", "checksum": {"name": "sha256", "checksum": "6685b33a6b5c1b98449620bfb28a079a3bda9bfdb3f3fd9f5de925b9fcfbfeff"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "List of allergies known of the patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Allergies\".\r\n\r\nSee also: `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`, `public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_allergies.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__patient_id"]}, "allergy_id": {"name": "allergy_id", "description": "Reference to an allergy ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__allergy_id"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this allergy was recorded.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__recorded_date"]}, "recorded_by": {"name": "recorded_by", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this allergy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__practitioner_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_allergies.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0976565, "relation_name": "\"app\".\"reporting\".\"patient_allergies\"", "raw_code": "select\r\n id,\r\n patient_id,\r\n allergy_id,\r\n recorded_date::date as recorded_date,\r\n practitioner_id as recorded_by\r\nfrom {{ source('tamanu', 'patient_allergies') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_allergies"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_allergies.sql", "compiled": true, "compiled_code": "select\n id,\n patient_id,\n allergy_id,\n recorded_date::date as recorded_date,\n practitioner_id as recorded_by\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_birth_data": {"database": "app", "schema": "reporting", "name": "patient_birth_data", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_birth_data.sql", "original_file_path": "models\\bases\\patient_birth_data.sql", "unique_id": "model.tamanu_source_dbt.patient_birth_data", "fqn": ["tamanu_source_dbt", "bases", "patient_birth_data"], "alias": "patient_birth_data", "checksum": {"name": "sha256", "checksum": "d884675f759eaf593300b85741ef2b6e017627964a7f5fa887896aa5829062d2"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Information about the birth of the patient, if their birth was recorded into Tamanu.\r\n\r\nThis is specifically data about the newborn, and only the birth-relevant data.\r\nOther patient data is found in the normal tables i.e. `patients`, `patient_additional_data`, etc.", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_birth_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__patient_id"]}, "birth_time": {"name": "birth_time", "description": "Datetime of birth.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__time_of_birth"]}, "gestational_age_estimate": {"name": "gestational_age_estimate", "description": "Gestational age estimate (weeks).", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate"]}, "attendant_at_birth": {"name": "attendant_at_birth", "description": "The type of the attendant at birth.\r\n\r\nOne of:\r\n- `doctor`\r\n- `midwife`\r\n- `nurse`\r\n- `traditional_birth_attentdant`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth"]}, "name_of_attendant_at_birth": {"name": "name_of_attendant_at_birth", "description": "Name of attendant at birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth"]}, "birth_type": {"name": "birth_type", "description": "`single` or `plural` birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_type"]}, "birth_delivery_type": {"name": "birth_delivery_type", "description": "Type of delivery.\r\n\r\nOne of:\r\n- `normal_vaginal_delivery`\r\n- `breech`\r\n- `emergency_c_section`\r\n- `elective_c_section`\r\n- `vacuum_extraction`\r\n- `forceps`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type"]}, "birth_weight": {"name": "birth_weight", "description": "Weight in kg at birth.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_weight"]}, "birth_length": {"name": "birth_length", "description": "Length in cm at birth.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_length"]}, "apgar_score_one_minute": {"name": "apgar_score_one_minute", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) one minute after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute"]}, "apgar_score_five_minutes": {"name": "apgar_score_five_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) five minutes after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes"]}, "apgar_score_ten_minutes": {"name": "apgar_score_ten_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) ten minutes after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes"]}, "registered_birth_place": {"name": "registered_birth_place", "description": "Type of the actual birth place.\r\n\r\nOne of:\r\n- `health_facility`\r\n- `home`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__registered_birth_place"]}, "birth_facility_id": {"name": "birth_facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) the birth was recorded at.\r\n\r\nThis is only required when `registered_birth_place` is `health_facility`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_facility_id"]}, "registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patient_birth_data.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_birth_data.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0976565, "relation_name": "\"app\".\"reporting\".\"patient_birth_data\"", "raw_code": "select\r\n patient_id,\r\n time_of_birth::time as birth_time,\r\n gestational_age_estimate,\r\n attendant_at_birth,\r\n name_of_attendant_at_birth,\r\n birth_type,\r\n birth_delivery_type,\r\n birth_weight,\r\n birth_length,\r\n apgar_score_one_minute,\r\n apgar_score_five_minutes,\r\n apgar_score_ten_minutes,\r\n registered_birth_place,\r\n birth_facility_id,\r\n created_at::date as registration_date\r\nfrom {{ source('tamanu', 'patient_birth_data') }}\r\nwhere deleted_at is null\r\n and id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_birth_data"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_birth_data.sql", "compiled": true, "compiled_code": "select\n patient_id,\n time_of_birth::time as birth_time,\n gestational_age_estimate,\n attendant_at_birth,\n name_of_attendant_at_birth,\n birth_type,\n birth_delivery_type,\n birth_weight,\n birth_length,\n apgar_score_one_minute,\n apgar_score_five_minutes,\n apgar_score_ten_minutes,\n registered_birth_place,\n birth_facility_id,\n created_at::date as registration_date\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere deleted_at is null\n and id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_care_plans": {"database": "app", "schema": "reporting", "name": "patient_care_plans", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_care_plans.sql", "original_file_path": "models\\bases\\patient_care_plans.sql", "unique_id": "model.tamanu_source_dbt.patient_care_plans", "fqn": ["tamanu_source_dbt", "bases", "patient_care_plans"], "alias": "patient_care_plans", "checksum": {"name": "sha256", "checksum": "eb4f2bb1fe1ee00b93e8b84cfcda79699979052f1e9ec69731e4b11ef943e79c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "List of current care plans the patient is on.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Care plans\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_conditions`, `public.patient_family_histories`,\r\n`public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_care_plans.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "care_plan_datetime": {"name": "care_plan_datetime", "description": "Local date for the record in patient_care_plans.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) who prescribed this care plan.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__examiner_id"]}, "care_plan_id": {"name": "care_plan_id", "description": "Reference to the care plan ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__care_plan_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_care_plans.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0976565, "relation_name": "\"app\".\"reporting\".\"patient_care_plans\"", "raw_code": "select\r\n id,\r\n date::timestamp as care_plan_datetime,\r\n patient_id,\r\n examiner_id as clinician_id,\r\n care_plan_id\r\nfrom {{ source('tamanu', 'patient_care_plans') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_care_plans"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_care_plans.sql", "compiled": true, "compiled_code": "select\n id,\n date::timestamp as care_plan_datetime,\n patient_id,\n examiner_id as clinician_id,\n care_plan_id\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_conditions": {"database": "app", "schema": "reporting", "name": "patient_conditions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_conditions.sql", "original_file_path": "models\\bases\\patient_conditions.sql", "unique_id": "model.tamanu_source_dbt.patient_conditions", "fqn": ["tamanu_source_dbt", "bases", "patient_conditions"], "alias": "patient_conditions", "checksum": {"name": "sha256", "checksum": "c0579283389e6bee224848bfec97c60a824a1684ad6153d7a0fb60271213c920"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "List of ongoing conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Ongoing conditions\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`,\r\n`public.patient_family_histories`, `public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "recorded_datetime": {"name": "recorded_datetime", "description": "Datetime at which this issue was recorded.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__recorded_date"]}, "note": {"name": "note", "description": "Free-form description of this condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__note"]}, "condition_id": {"name": "condition_id", "description": "Reference to a diagnosis describing this issue ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__condition_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__patient_id"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording this\r\ncondition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__examiner_id"]}, "is_resolved": {"name": "is_resolved", "description": "Whether the condition has resolved.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolved"]}, "resolved_datetime": {"name": "resolved_datetime", "description": "Datetime at which this issue was resolved.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_date"]}, "resolved_by_id": {"name": "resolved_by_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording the\r\nresolution of this condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_practitioner_id"]}, "resolution_note": {"name": "resolution_note", "description": "Free-form description or notes about the resolution of this condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_note"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_conditions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0976565, "relation_name": "\"app\".\"reporting\".\"patient_conditions\"", "raw_code": "select\r\n id,\r\n recorded_date::timestamp as recorded_datetime,\r\n note,\r\n condition_id,\r\n patient_id,\r\n examiner_id as recorded_by_id,\r\n resolved as is_resolved,\r\n resolution_date::timestamp as resolved_datetime,\r\n resolution_practitioner_id as resolved_by_id,\r\n resolution_note\r\nfrom {{ source('tamanu', 'patient_conditions') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_conditions"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_conditions.sql", "compiled": true, "compiled_code": "select\n id,\n recorded_date::timestamp as recorded_datetime,\n note,\n condition_id,\n patient_id,\n examiner_id as recorded_by_id,\n resolved as is_resolved,\n resolution_date::timestamp as resolved_datetime,\n resolution_practitioner_id as resolved_by_id,\n resolution_note\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_death_contributing_causes": {"database": "app", "schema": "reporting", "name": "patient_death_contributing_causes", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_death_contributing_causes.sql", "original_file_path": "models\\bases\\patient_death_contributing_causes.sql", "unique_id": "model.tamanu_source_dbt.patient_death_contributing_causes", "fqn": ["tamanu_source_dbt", "bases", "patient_death_contributing_causes"], "alias": "patient_death_contributing_causes", "checksum": {"name": "sha256", "checksum": "8dbfe45201dff63b401ccb04dd03429745c9bab36330ff7129277805d4d07c6d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Contributing causes recorded with the patient's death data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in contributing_death_causes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "min_after_onset": {"name": "min_after_onset", "description": "Time between onset of recorded cause and death in minutes.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__time_after_onset"]}, "patient_death_data_id": {"name": "patient_death_data_id", "description": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id"]}, "condition_id": {"name": "condition_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_death_contributing_causes.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.0976565, "relation_name": "\"app\".\"reporting\".\"patient_death_contributing_causes\"", "raw_code": "select\r\n cdc.id,\r\n cdc.time_after_onset as mins_after_onset,\r\n cdc.patient_death_data_id,\r\n cdc.condition_id\r\nfrom {{ source('tamanu', 'contributing_death_causes') }} cdc\r\njoin {{ source('tamanu', 'patient_death_data') }} pdd on pdd.id = cdc.patient_death_data_id\r\nwhere cdc.deleted_at is null\r\n and pdd.deleted_at is null\r\n and pdd.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__contributing_death_causes"], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_death_contributing_causes.sql", "compiled": true, "compiled_code": "select\n cdc.id,\n cdc.time_after_onset as mins_after_onset,\n cdc.patient_death_data_id,\n cdc.condition_id\nfrom \"app\".\"public\".\"contributing_death_causes\" cdc\njoin \"app\".\"public\".\"patient_death_data\" pdd on pdd.id = cdc.patient_death_data_id\nwhere cdc.deleted_at is null\n and pdd.deleted_at is null\n and pdd.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_death_data": {"database": "app", "schema": "reporting", "name": "patient_death_data", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_death_data.sql", "original_file_path": "models\\bases\\patient_death_data.sql", "unique_id": "model.tamanu_source_dbt.patient_death_data", "fqn": ["tamanu_source_dbt", "bases", "patient_death_data"], "alias": "patient_death_data", "checksum": {"name": "sha256", "checksum": "0606e5802809c3a219abc95add67dab24a6690c1d318e1caea360fce79b1847a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Information about a patient's death.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_death_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "manner": {"name": "manner", "description": "A descriptive text specifying the manner of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner"]}, "had_recent_surgery": {"name": "had_recent_surgery", "description": "Whether the deceased patient had a recent surgery, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__recent_surgery"]}, "last_surgery_date": {"name": "last_surgery_date", "description": "Datetime of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_date"]}, "last_surgery_reason_id": {"name": "last_surgery_reason_id", "description": "Reference to a `diagnosis` ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) for the\r\nreason of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id"]}, "external_cause_date": {"name": "external_cause_date", "description": "Datetime of external cause of death, if applicable.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_date"]}, "external_cause_location": {"name": "external_cause_location", "description": "Physical location of external cause of death, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_location"]}, "external_cause_notes": {"name": "external_cause_notes", "description": "Free-form description of the location of external cause of death, if applicable.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_notes"]}, "was_pregnant": {"name": "was_pregnant", "description": "Whether the deceased was pregnant.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__was_pregnant"]}, "pregnancy_contributed": {"name": "pregnancy_contributed", "description": "Whether the pregnancy contributed to the death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed"]}, "was_fetal_or_infant": {"name": "was_fetal_or_infant", "description": "Whether the deceased was themselves a foetus or infant.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__fetal_or_infant"]}, "was_stillborn": {"name": "was_stillborn", "description": "Whether the deceased was themselves stillborn.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__stillborn"]}, "birth_weight": {"name": "birth_weight", "description": "If the deceased was a foetus, stillborn, or infant, their birth weight.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__birth_weight"]}, "was_within_day_of_birth": {"name": "was_within_day_of_birth", "description": "If the deceased was a foetus, stillborn, or infant, whether their passing was on the day of their birth.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__within_day_of_birth"]}, "hours_survived_since_birth": {"name": "hours_survived_since_birth", "description": "If the deceased was an infant, how many days since the birth passed before their death.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth"]}, "carrier_age": {"name": "carrier_age", "description": "If the deceased was a foetus, stillborn, or infant, the age of the carrier.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_age"]}, "carrier_pregnancy_weeks": {"name": "carrier_pregnancy_weeks", "description": "If the deceased was a foetus, stillborn, or infant, how many weeks pregnant their carrier was.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks"]}, "was_outside_health_facility": {"name": "was_outside_health_facility", "description": "Whether the death occurred outside of the facility.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__outside_health_facility"]}, "primary_cause_mins_after_onset": {"name": "primary_cause_mins_after_onset", "description": "The time in minutes after onset of the primary cause of death, if known.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset"]}, "primary_cause_condition_id": {"name": "primary_cause_condition_id", "description": "Reference to the primary cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if known.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id"]}, "antecedent_cause1_mins_after_onset": {"name": "antecedent_cause1_mins_after_onset", "description": "The time in minutes after onset of an antecedent (1) cause of death, if applicable.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_time_after_onset"]}, "antecedent_cause1_condition_id": {"name": "antecedent_cause1_condition_id", "description": "Reference to an antecedent (1) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id"]}, "antecedent_cause2_mins_after_onset": {"name": "antecedent_cause2_mins_after_onset", "description": "The time in minutes after onset of an antecedent (2) cause of death, if applicable.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_time_after_onset"]}, "antecedent_cause2_condition_id": {"name": "antecedent_cause2_condition_id", "description": "Reference to an antecedent (2) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id"]}, "antecedent_cause3_mins_after_onset": {"name": "antecedent_cause3_mins_after_onset", "description": "The time in minutes after onset of an antecedent (3) cause of death, if applicable.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_time_after_onset"]}, "antecedent_cause3_condition_id": {"name": "antecedent_cause3_condition_id", "description": "Reference to an antecedent (3) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_condition_id"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients) who died.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__patient_id"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who is recording this death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__clinician_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where this death is being recorded.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__facility_id"]}, "is_final": {"name": "is_final", "description": "Whether this date record is final.\r\n\r\nIn Tamanu, this is set by a supervisor after review, and cannot be reversed; it causes all fields to\r\nbecome read-only. The only way to undo this record is through a `death_revert_logs`.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__is_final"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patient_death_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "autopsy_requested": {"name": "autopsy_requested", "description": "Whether an autopsy was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__autopsy_requested"]}, "autopsy_findings_used": {"name": "autopsy_findings_used", "description": "If an autopsy was requested, whether the findings were used in the death certification.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__autopsy_findings_used"]}, "manner_of_death_description": {"name": "manner_of_death_description", "description": "If an external cause occurred, a text description on how and if applicable, notes of poisoning agent.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner_of_death_description"]}, "pregnancy_moment": {"name": "pregnancy_moment", "description": "The status of the pregnancy of the deceased, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_moment"]}, "multiple_pregnancy": {"name": "multiple_pregnancy", "description": "Whether the deceased infant happened in a multiple pregnancy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__multiple_pregnancy"]}, "mother_condition_description": {"name": "mother_condition_description", "description": "A text description stating the conditions of mother that affected the fetus/newborn, if the death was perinatal.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__mother_condition_description"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_death_data.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1133375, "relation_name": "\"app\".\"reporting\".\"patient_death_data\"", "raw_code": "select\r\n id,\r\n manner,\r\n recent_surgery as had_recent_surgery,\r\n last_surgery_date::date as last_surgery_date,\r\n last_surgery_reason_id,\r\n external_cause_date::date as external_cause_date,\r\n external_cause_location,\r\n external_cause_notes,\r\n was_pregnant,\r\n pregnancy_contributed,\r\n fetal_or_infant as was_fetal_or_infant,\r\n stillborn as was_stillborn,\r\n birth_weight,\r\n within_day_of_birth as was_within_day_of_birth,\r\n hours_survived_since_birth,\r\n carrier_age,\r\n carrier_pregnancy_weeks,\r\n outside_health_facility as was_outside_health_facility,\r\n primary_cause_time_after_onset as primary_cause_mins_after_onset,\r\n primary_cause_condition_id,\r\n antecedent_cause1_time_after_onset as antecedent_cause1_mins_after_onset,\r\n antecedent_cause1_condition_id,\r\n antecedent_cause2_time_after_onset as antecedent_cause2_mins_after_onset,\r\n antecedent_cause2_condition_id,\r\n antecedent_cause3_time_after_onset as antecedent_cause3_mins_after_onset,\r\n antecedent_cause3_condition_id,\r\n patient_id,\r\n clinician_id as recorded_by_id,\r\n facility_id,\r\n is_final,\r\n visibility_status,\r\n autopsy_requested,\r\n autopsy_findings_used,\r\n manner_of_death_description,\r\n pregnancy_moment,\r\n multiple_pregnancy,\r\n mother_condition_description\r\nfrom {{ source('tamanu', 'patient_death_data') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_death_data"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_death_data.sql", "compiled": true, "compiled_code": "select\n id,\n manner,\n recent_surgery as had_recent_surgery,\n last_surgery_date::date as last_surgery_date,\n last_surgery_reason_id,\n external_cause_date::date as external_cause_date,\n external_cause_location,\n external_cause_notes,\n was_pregnant,\n pregnancy_contributed,\n fetal_or_infant as was_fetal_or_infant,\n stillborn as was_stillborn,\n birth_weight,\n within_day_of_birth as was_within_day_of_birth,\n hours_survived_since_birth,\n carrier_age,\n carrier_pregnancy_weeks,\n outside_health_facility as was_outside_health_facility,\n primary_cause_time_after_onset as primary_cause_mins_after_onset,\n primary_cause_condition_id,\n antecedent_cause1_time_after_onset as antecedent_cause1_mins_after_onset,\n antecedent_cause1_condition_id,\n antecedent_cause2_time_after_onset as antecedent_cause2_mins_after_onset,\n antecedent_cause2_condition_id,\n antecedent_cause3_time_after_onset as antecedent_cause3_mins_after_onset,\n antecedent_cause3_condition_id,\n patient_id,\n clinician_id as recorded_by_id,\n facility_id,\n is_final,\n visibility_status,\n autopsy_requested,\n autopsy_findings_used,\n manner_of_death_description,\n pregnancy_moment,\n multiple_pregnancy,\n mother_condition_description\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_facilities": {"database": "app", "schema": "reporting", "name": "patient_facilities", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_facilities.sql", "original_file_path": "models\\bases\\patient_facilities.sql", "unique_id": "model.tamanu_source_dbt.patient_facilities", "fqn": ["tamanu_source_dbt", "bases", "patient_facilities"], "alias": "patient_facilities", "checksum": {"name": "sha256", "checksum": "672bd9c337f992cf9f22c5c9525c266619488dd18cac16fb95a1683268763a12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Tracks which patients are of interest to which facilities.\r\n\r\nThis is used to refine sync data: only patient data related to these patients is synced to a\r\nfacility (plus general data, and some exceptions apply like vaccine data under some conditions).\r\n\r\nIn Tamanu, this can be set manually on the facility server (via the \"mark for sync\" button), or\r\ncentrally (via some labs / vaccine programs, or via bulk-imports).\r\n\r\n_(\"Joe Patient attends X Clinic\" is clinical info; even though an entry in patient facilities\r\ndoesn't necessarily imply this, it often does.)_", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_facilities.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_facilities__patient_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_facilities__facility_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_facilities.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1133375, "relation_name": "\"app\".\"reporting\".\"patient_facilities\"", "raw_code": "select\r\n id,\r\n created_at,\r\n patient_id,\r\n facility_id\r\nfrom {{ source('tamanu', 'patient_facilities') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_facilities"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_facilities.sql", "compiled": true, "compiled_code": "select\n id,\n created_at,\n patient_id,\n facility_id\nfrom \"app\".\"public\".\"patient_facilities\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_family_histories": {"database": "app", "schema": "reporting", "name": "patient_family_histories", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_family_histories.sql", "original_file_path": "models\\bases\\patient_family_histories.sql", "unique_id": "model.tamanu_source_dbt.patient_family_histories", "fqn": ["tamanu_source_dbt", "bases", "patient_family_histories"], "alias": "patient_family_histories", "checksum": {"name": "sha256", "checksum": "a67fc1038c9a348aa4991b8e88a0491dd07cca150cab3d9632dfa56bfc1ca8c0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "List of family history conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Family history\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_family_histories.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "recorded_datetime": {"name": "recorded_datetime", "description": "Datetime at which this issue was recorded.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__recorded_date"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this history.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__practitioner_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "Reference to a diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))\r\ndescribing this issue.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__diagnosis_id"]}, "relationship": {"name": "relationship", "description": "Free-form description of the family relationship.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__relationship"]}, "note": {"name": "note", "description": "Free-form description of this issue.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__note"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_family_histories.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1133375, "relation_name": "\"app\".\"reporting\".\"patient_family_histories\"", "raw_code": "select\r\n id,\r\n recorded_date::timestamp as recorded_datetime,\r\n patient_id,\r\n practitioner_id as clinician_id,\r\n diagnosis_id,\r\n relationship,\r\n note\r\nfrom {{ source('tamanu', 'patient_family_histories') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_family_histories"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_family_histories.sql", "compiled": true, "compiled_code": "select\n id,\n recorded_date::timestamp as recorded_datetime,\n patient_id,\n practitioner_id as clinician_id,\n diagnosis_id,\n relationship,\n note\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_field_values": {"database": "app", "schema": "reporting", "name": "patient_field_values", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_field_values.sql", "original_file_path": "models\\bases\\patient_field_values.sql", "unique_id": "model.tamanu_source_dbt.patient_field_values", "fqn": ["tamanu_source_dbt", "bases", "patient_field_values"], "alias": "patient_field_values", "checksum": {"name": "sha256", "checksum": "f539fcc1d6c3dcf6127e3e6e7dec4a4edd7104e5379459c206ded0b2867d2bf8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "patient"], "description": "Values recorded in custom patient fields.\r\n\r\nThe `id` column is generated to enforce one value row per field definition per patient.", "columns": {"value": {"name": "value", "description": "Value.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__value"]}, "definition_id": {"name": "definition_id", "description": "The [field definition](#!/source/source.tamanu.tamanu.patient_field_definitions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__definition_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__patient_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_field_values.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.1133375, "relation_name": "\"app\".\"reporting\".\"patient_field_values\"", "raw_code": "select\r\n patient_id,\r\n definition_id,\r\n value\r\nfrom {{ source('tamanu', 'patient_field_values') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_field_values"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_field_values.sql", "compiled": true, "compiled_code": "select\n patient_id,\n definition_id,\n value\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_program_registrations": {"database": "app", "schema": "reporting", "name": "patient_program_registrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registrations.sql", "original_file_path": "models\\bases\\patient_program_registrations.sql", "unique_id": "model.tamanu_source_dbt.patient_program_registrations", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registrations"], "alias": "patient_program_registrations", "checksum": {"name": "sha256", "checksum": "ee4fb8f6fdce789d05d0ba389f948b997e8bfc09d2b2857fe4ec5629b4942c0f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table with information about the program registrations of a patient. This is helpful\r\nto enroll a specific patient within a program that will be followed for an extended\r\nperiod of time.\r\n\r\n**This table is append-only.**\r\nA new record is created every time there is a change to the status of a registration. \r\n\r\nAt the moment, this implies that when merging two patients, both with a registration to the same\r\nregistry, the merged patient ends up with two registrations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registrations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in patient_program_registrations.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "registration_status": {"name": "registration_status", "description": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registration_status"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [Patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__patient_id"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__program_registry_id"]}, "clinical_status_id": {"name": "clinical_status_id", "description": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinician_id"]}, "registering_facility_id": {"name": "registering_facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) this program\r\nregistration is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__facility_id"]}, "village_id": {"name": "village_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=village`) this program registration is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__village_id"]}, "deactivated_by_id": {"name": "deactivated_by_id", "description": "The clinician that removed the patient from the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id"]}, "deactivated_datetime": {"name": "deactivated_datetime", "description": "The date that the patient from the program registry.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_program_registrations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1133375, "relation_name": "\"app\".\"reporting\".\"patient_program_registrations\"", "raw_code": "select\r\n id,\r\n date::timestamp as datetime,\r\n registration_status,\r\n patient_id,\r\n program_registry_id,\r\n clinical_status_id,\r\n clinician_id as registered_by_id,\r\n registering_facility_id,\r\n facility_id,\r\n village_id,\r\n deactivated_clinician_id as deactivated_by_id,\r\n deactivated_date::timestamp as deactivated_datetime\r\nfrom {{ source('tamanu', 'patient_program_registrations') }}\r\nwhere deleted_at is null\r\n and patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registrations"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_program_registrations.sql", "compiled": true, "compiled_code": "select\n id,\n date::timestamp as datetime,\n registration_status,\n patient_id,\n program_registry_id,\n clinical_status_id,\n clinician_id as registered_by_id,\n registering_facility_id,\n facility_id,\n village_id,\n deactivated_clinician_id as deactivated_by_id,\n deactivated_date::timestamp as deactivated_datetime\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere deleted_at is null\n and patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_program_registrations_change_logs": {"database": "app", "schema": "reporting", "name": "patient_program_registrations_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registrations_change_logs.sql", "original_file_path": "models\\bases\\patient_program_registrations_change_logs.sql", "unique_id": "model.tamanu_source_dbt.patient_program_registrations_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registrations_change_logs"], "alias": "patient_program_registrations_change_logs", "checksum": {"name": "sha256", "checksum": "d29b6e35e35a5ef73209472a4e7ad2af4c0fa7bfe11b6718413dba212509778b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Change logs of Table with information about the program registrations of a patient. This is helpful\r\nto enroll a specific patient within a program that will be followed for an extended\r\nperiod of time.\r\n\r\n**This table is append-only.**\r\nA new record is created every time there is a change to the status of a registration. \r\n\r\nAt the moment, this implies that when merging two patients, both with a registration to the same\r\nregistry, the merged patient ends up with two registrations.", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in patient_program registrations history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in patient_program registrations history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registrations.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in patient_program_registrations history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "registration_status": {"name": "registration_status", "description": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError` from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registration_status"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [Patient](#!/source/source.tamanu.tamanu.patients). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__patient_id"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__program_registry_id"]}, "clinical_status_id": {"name": "clinical_status_id", "description": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinician_id"]}, "registering_facility_id": {"name": "registering_facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) this program\r\nregistration is from. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__facility_id"]}, "village_id": {"name": "village_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=village`) this program registration is from. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__village_id"]}, "deactivated_by_id": {"name": "deactivated_by_id", "description": "The clinician that removed the patient from the program registry. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id"]}, "deactivated_datetime": {"name": "deactivated_datetime", "description": "The date that the patient from the program registry. from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_program_registrations_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1133375, "relation_name": "\"app\".\"reporting\".\"patient_program_registrations_change_logs\"", "raw_code": "with filtered_changes as (\r\n {{ base_history_from_log('patient_program_registrations') }}\r\n and (\r\n version = 'unknown'\r\n or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int []\r\n )\r\n and record_data ->> 'patient_id' != '{{ var(\"test_patient\") }}'\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as id,\r\n (fc.record_data ->> 'date')::timestamp as datetime,\r\n fc.record_data ->> 'registration_status' as registration_status,\r\n fc.record_data ->> 'patient_id' as patient_id,\r\n fc.record_data ->> 'program_registry_id' as program_registry_id,\r\n fc.record_data ->> 'clinical_status_id' as clinical_status_id,\r\n fc.record_data ->> 'clinician_id' as registered_by_id,\r\n fc.record_data ->> 'registering_facility_id' as registering_facility_id,\r\n fc.record_data ->> 'facility_id' as facility_id,\r\n fc.record_data ->> 'village_id' as village_id,\r\n fc.record_data ->> 'deactivated_clinician_id' as deactivated_by_id,\r\n (fc.record_data ->> 'deactivated_date')::timestamp as deactivated_datetime\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registrations"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_program_registrations_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patient_program_registrations'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"patient_program_registrations\" t\n where t.deleted_at notnull\n )\n and (\n version = 'unknown'\n or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int []\n )\n and record_data ->> 'patient_id' != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n)\n\nselect\n fc.changelog_id,\n fc.logged_at,\n fc.updated_by_user_id,\n fc.record_id as id,\n (fc.record_data ->> 'date')::timestamp as datetime,\n fc.record_data ->> 'registration_status' as registration_status,\n fc.record_data ->> 'patient_id' as patient_id,\n fc.record_data ->> 'program_registry_id' as program_registry_id,\n fc.record_data ->> 'clinical_status_id' as clinical_status_id,\n fc.record_data ->> 'clinician_id' as registered_by_id,\n fc.record_data ->> 'registering_facility_id' as registering_facility_id,\n fc.record_data ->> 'facility_id' as facility_id,\n fc.record_data ->> 'village_id' as village_id,\n fc.record_data ->> 'deactivated_clinician_id' as deactivated_by_id,\n (fc.record_data ->> 'deactivated_date')::timestamp as deactivated_datetime\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_program_registration_conditions": {"database": "app", "schema": "reporting", "name": "patient_program_registration_conditions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registration_conditions.sql", "original_file_path": "models\\bases\\patient_program_registration_conditions.sql", "unique_id": "model.tamanu_source_dbt.patient_program_registration_conditions", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registration_conditions"], "alias": "patient_program_registration_conditions", "checksum": {"name": "sha256", "checksum": "464c2040ab7711bcc6a0086fc1bdd5dcc9379f7967ec14e0cdb61928a6bcc98b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table of conditions related to patients in a program registration.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registration_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "program_registry_condition_id": {"name": "program_registry_condition_id", "description": "Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id"]}, "patient_program_registration_id": {"name": "patient_program_registration_id", "description": "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\nof the condition.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id"]}, "program_registry_condition_category_id": {"name": "program_registry_condition_category_id", "description": "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\nof the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id"]}, "reason_for_change": {"name": "reason_for_change", "description": "Optional field for recording the reason for changing the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id"]}, "deleted_datetime": {"name": "deleted_datetime", "description": "Date field which is a timestamp of record being deleted in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deletion_date"]}, "deleted_by_id": {"name": "deleted_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) that removed the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_program_registration_conditions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1449962, "relation_name": "\"app\".\"reporting\".\"patient_program_registration_conditions\"", "raw_code": "select\r\n pprc.id,\r\n pprc.date::timestamp as datetime,\r\n pprc.program_registry_condition_id,\r\n pprc.patient_program_registration_id,\r\n pprc.program_registry_condition_category_id,\r\n pprc.reason_for_change,\r\n pprc.clinician_id as recorded_by_id,\r\n pprc.deletion_date::timestamp as deleted_datetime,\r\n pprc.deletion_clinician_id as deleted_by_id\r\nfrom {{ source('tamanu', 'patient_program_registration_conditions') }} pprc\r\njoin {{ source('tamanu', 'patient_program_registrations') }} ppr\r\n on ppr.id = pprc.patient_program_registration_id\r\nwhere pprc.deleted_at is null\r\n and ppr.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registration_conditions"], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_program_registration_conditions.sql", "compiled": true, "compiled_code": "select\n pprc.id,\n pprc.date::timestamp as datetime,\n pprc.program_registry_condition_id,\n pprc.patient_program_registration_id,\n pprc.program_registry_condition_category_id,\n pprc.reason_for_change,\n pprc.clinician_id as recorded_by_id,\n pprc.deletion_date::timestamp as deleted_datetime,\n pprc.deletion_clinician_id as deleted_by_id\nfrom \"app\".\"public\".\"patient_program_registration_conditions\" pprc\njoin \"app\".\"public\".\"patient_program_registrations\" ppr\n on ppr.id = pprc.patient_program_registration_id\nwhere pprc.deleted_at is null\n and ppr.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs": {"database": "app", "schema": "reporting", "name": "patient_program_registration_conditions_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registration_conditions_change_logs.sql", "original_file_path": "models\\bases\\patient_program_registration_conditions_change_logs.sql", "unique_id": "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registration_conditions_change_logs"], "alias": "patient_program_registration_conditions_change_logs", "checksum": {"name": "sha256", "checksum": "f93ec951fb904d5ca0bbfa3df7184ab1a1c52263d7be761940932ac857c99af5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Change logs of Table of conditions related to patients in a program registration.", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in patient program registration condition record.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in patient program registration condition record.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registration_conditions.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in patient_program_registration_conditions history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "program_registry_condition_id": {"name": "program_registry_condition_id", "description": "Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id"]}, "patient_program_registration_id": {"name": "patient_program_registration_id", "description": "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\nof the condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id"]}, "program_registry_condition_category_id": {"name": "program_registry_condition_category_id", "description": "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\nof the condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id"]}, "reason_for_change": {"name": "reason_for_change", "description": "Optional field for recording the reason for changing the condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id"]}, "deleted_datetime": {"name": "deleted_datetime", "description": "Date field which is a timestamp of record being deleted in patient_program_registration_conditions history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deletion_date"]}, "deleted_by_id": {"name": "deleted_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) that removed the condition. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_program_registration_conditions_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1449962, "relation_name": "\"app\".\"reporting\".\"patient_program_registration_conditions_change_logs\"", "raw_code": "with filtered_changes as (\r\n {{ base_history_from_log('patient_program_registration_conditions') }}\r\n and (\r\n version = 'unknown'\r\n or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int []\r\n )\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as id,\r\n (fc.record_data ->> 'date')::timestamp as datetime,\r\n fc.record_data ->> 'program_registry_condition_id' as program_registry_condition_id,\r\n fc.record_data ->> 'patient_program_registration_id' as patient_program_registration_id,\r\n fc.record_data ->> 'program_registry_condition_category_id' as program_registry_condition_category_id,\r\n fc.record_data ->> 'reason_for_change' as reason_for_change,\r\n fc.record_data ->> 'clinician_id' as recorded_by_id,\r\n (fc.record_data ->> 'deletion_date')::timestamp as deleted_datetime,\r\n fc.record_data ->> 'deletion_clinician_id' as deleted_by_id\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registration_conditions"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"], ["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_program_registration_conditions_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'patient_program_registration_conditions'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"patient_program_registration_conditions\" t\n where t.deleted_at notnull\n )\n and (\n version = 'unknown'\n or string_to_array(version, '.')::int [] >= string_to_array('2.33.0', '.')::int []\n )\n)\n\nselect\n fc.changelog_id,\n fc.logged_at,\n fc.updated_by_user_id,\n fc.record_id as id,\n (fc.record_data ->> 'date')::timestamp as datetime,\n fc.record_data ->> 'program_registry_condition_id' as program_registry_condition_id,\n fc.record_data ->> 'patient_program_registration_id' as patient_program_registration_id,\n fc.record_data ->> 'program_registry_condition_category_id' as program_registry_condition_category_id,\n fc.record_data ->> 'reason_for_change' as reason_for_change,\n fc.record_data ->> 'clinician_id' as recorded_by_id,\n (fc.record_data ->> 'deletion_date')::timestamp as deleted_datetime,\n fc.record_data ->> 'deletion_clinician_id' as deleted_by_id\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient_vaccinations_upcoming": {"database": "app", "schema": "reporting", "name": "patient_vaccinations_upcoming", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\patient_vaccinations_upcoming.sql", "original_file_path": "models\\bases\\patient_vaccinations_upcoming.sql", "unique_id": "model.tamanu_source_dbt.patient_vaccinations_upcoming", "fqn": ["tamanu_source_dbt", "bases", "patient_vaccinations_upcoming"], "alias": "patient_vaccinations_upcoming", "checksum": {"name": "sha256", "checksum": "b8ae7fa60356879bfd4fd61bf4d2bcf074a8fe38d0cb135680d219895ae345a3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A **view** which lists patients and next vaccine due for a given vaccine type.\r\n\r\nThe first dose of a vaccine type is based on weeks from birth due whilst subsequent doses are based on weeks from last \r\nvaccination due.\r\n\r\nAge limits in years and thresholds in days for scheduled status are configurable with the following defaults:\r\n\r\n- Age = 15\r\n- Status: Scheduled = 28\r\n- Status: Upcoming = 7\r\n- Status: Due = -7\r\n- Status: Overdue = -55\r\n- Status: Missed = -Infinity", "columns": {"patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__patient_id"]}, "vaccine_schedules_id": {"name": "vaccine_schedules_id", "description": "Reference to the [scheduled vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_category"]}, "vaccine_id": {"name": "vaccine_id", "description": "Reference to the vaccine ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_id"]}, "due_date": {"name": "due_date", "description": "Due date of the scheduled vaccine.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__due_date"]}, "days_till_due": {"name": "days_till_due", "description": "Number of days until the scheduled vaccine is due. Negative numbers indicates the number of days in the past the vaccine\r\nwas due.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__days_till_due"]}, "status": {"name": "status", "description": "Status of the upcoming vaccination listed ['DUE', 'OVERDUE', 'MISSED', 'SCHEDULED', 'UPCOMING']", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\patient_vaccinations_upcoming.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1449962, "relation_name": "\"app\".\"reporting\".\"patient_vaccinations_upcoming\"", "raw_code": "select\r\n patient_id,\r\n scheduled_vaccine_id as vaccine_schedules_id,\r\n vaccine_category,\r\n vaccine_id,\r\n due_date::date,\r\n days_till_due,\r\n status\r\nfrom {{ source('tamanu', 'upcoming_vaccinations') }}\r\nwhere patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__upcoming_vaccinations"], "language": "sql", "refs": [], "sources": [["tamanu", "upcoming_vaccinations"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.upcoming_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\patient_vaccinations_upcoming.sql", "compiled": true, "compiled_code": "select\n patient_id,\n scheduled_vaccine_id as vaccine_schedules_id,\n vaccine_category,\n vaccine_id,\n due_date::date,\n days_till_due,\n status\nfrom \"app\".\"public\".\"upcoming_vaccinations\"\nwhere patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.pharmacy_orders": {"database": "app", "schema": "reporting", "name": "pharmacy_orders", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\pharmacy_orders.sql", "original_file_path": "models\\bases\\pharmacy_orders.sql", "unique_id": "model.tamanu_source_dbt.pharmacy_orders", "fqn": ["tamanu_source_dbt", "bases", "pharmacy_orders"], "alias": "pharmacy_orders", "checksum": {"name": "sha256", "checksum": "682559c607b08c8612cf31db9fafe762c8b11720d8e13c953299383948d6f283"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "reference"], "description": "An order for prescriptions placed by Tamanu to a Pharmacy", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in pharmacy_orders.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) for the order.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__encounter_id"]}, "ordering_clinician_id": {"name": "ordering_clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who placed the order.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__ordering_clinician_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where the pharmacy order was placed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__facility_id"]}, "is_discharge_prescription": {"name": "is_discharge_prescription", "description": "If the patient is being discharged with this prescription.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__is_discharge_prescription"]}, "datetime": {"name": "datetime", "description": "Local date and time for the record in pharmacy_orders.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\pharmacy_orders.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1449962, "relation_name": "\"app\".\"reporting\".\"pharmacy_orders\"", "raw_code": "select\r\n po.id,\r\n po.encounter_id,\r\n po.ordering_clinician_id,\r\n po.facility_id,\r\n po.is_discharge_prescription,\r\n po.date::timestamp as datetime\r\nfrom {{ source('tamanu', 'pharmacy_orders') }} po\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = po.encounter_id\r\nwhere po.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__pharmacy_orders"], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\pharmacy_orders.sql", "compiled": true, "compiled_code": "select\n po.id,\n po.encounter_id,\n po.ordering_clinician_id,\n po.facility_id,\n po.is_discharge_prescription,\n po.date::timestamp as datetime\nfrom \"app\".\"public\".\"pharmacy_orders\" po\njoin \"app\".\"public\".\"encounters\" e on e.id = po.encounter_id\nwhere po.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.pharmacy_order_prescriptions": {"database": "app", "schema": "reporting", "name": "pharmacy_order_prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\pharmacy_order_prescriptions.sql", "original_file_path": "models\\bases\\pharmacy_order_prescriptions.sql", "unique_id": "model.tamanu_source_dbt.pharmacy_order_prescriptions", "fqn": ["tamanu_source_dbt", "bases", "pharmacy_order_prescriptions"], "alias": "pharmacy_order_prescriptions", "checksum": {"name": "sha256", "checksum": "b6a6d2568db0852cf46cab069e8dbea56d465e2bff65c65f980f4fe4f953f1ef"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "reference"], "description": "Individual prescriptions that are included in a [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in pharmacy_order_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "pharmacy_order_id": {"name": "pharmacy_order_id", "description": "Reference to the [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__pharmacy_order_id"]}, "prescription_id": {"name": "prescription_id", "description": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__prescription_id"]}, "ongoing_prescription_id": {"name": "ongoing_prescription_id", "description": "When this pharmacy order prescription was created from an ongoing prescription (send to pharmacy flow), references the ongoing [prescription](#!/source/source.tamanu.tamanu.prescriptions). Null for encounter-based pharmacy orders.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__ongoing_prescription_id"]}, "display_id": {"name": "display_id", "description": "Human-readable request number for this prescription order. A new request number is generated each time a prescription is sent to pharmacy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__display_id"]}, "quantity": {"name": "quantity", "description": "Quantity of medication ordered.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__quantity"]}, "repeats": {"name": "repeats", "description": "Number of repeats for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__repeats"]}, "is_completed": {"name": "is_completed", "description": "Indicates whether this prescription has been fully completed. Set to `true` when all repeats have been dispensed for a discharge prescription (outpatient medication). Used to filter completed prescriptions from active medication request lists.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__is_completed"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\pharmacy_order_prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "reference"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1608412, "relation_name": "\"app\".\"reporting\".\"pharmacy_order_prescriptions\"", "raw_code": "select\r\n pop.id,\r\n pop.pharmacy_order_id,\r\n pop.prescription_id,\r\n pop.ongoing_prescription_id,\r\n pop.display_id,\r\n pop.quantity,\r\n pop.repeats,\r\n pop.is_completed\r\nfrom {{ source('tamanu', 'pharmacy_order_prescriptions') }} pop\r\njoin {{ source('tamanu', 'pharmacy_orders') }} po on po.id = pop.pharmacy_order_id\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = po.encounter_id\r\nwhere pop.deleted_at is null\r\n and po.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__pharmacy_order_prescriptions"], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"], ["tamanu", "pharmacy_orders"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "source.tamanu_source_dbt.tamanu.pharmacy_orders", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\pharmacy_order_prescriptions.sql", "compiled": true, "compiled_code": "select\n pop.id,\n pop.pharmacy_order_id,\n pop.prescription_id,\n pop.ongoing_prescription_id,\n pop.display_id,\n pop.quantity,\n pop.repeats,\n pop.is_completed\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\" pop\njoin \"app\".\"public\".\"pharmacy_orders\" po on po.id = pop.pharmacy_order_id\njoin \"app\".\"public\".\"encounters\" e on e.id = po.encounter_id\nwhere pop.deleted_at is null\n and po.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.prescriptions": {"database": "app", "schema": "reporting", "name": "prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\prescriptions.sql", "original_file_path": "models\\bases\\prescriptions.sql", "unique_id": "model.tamanu_source_dbt.prescriptions", "fqn": ["tamanu_source_dbt", "bases", "prescriptions"], "alias": "prescriptions", "checksum": {"name": "sha256", "checksum": "38c7cb130a61d97d686d25759bf535b7dfbe97deb112cfbde60971ad8294c832"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Records prescriptions for medications.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in prescriptions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date and time for the record in prescriptions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "start_datetime": {"name": "start_datetime", "description": "The start date of the prescription", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__start_date"]}, "end_datetime": {"name": "end_datetime", "description": "When the prescription ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__end_date"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "prescriber_id": {"name": "prescriber_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) prescribed the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__prescriber_id"]}, "indication": {"name": "indication", "description": "The [indication of use](https://en.wikipedia.org/wiki/Indication_(medicine)) for the medicine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__indication"]}, "route": {"name": "route", "description": "Administration route for the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__route"]}, "quantity": {"name": "quantity", "description": "Quantity of medicine to dispense.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__quantity"]}, "repeats": {"name": "repeats", "description": "How many times this prescription can be repeatedly dispensed without a new prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__repeats"]}, "is_ongoing": {"name": "is_ongoing", "description": "A flag to determine whether or not the current prescription is ongoing", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_ongoing"]}, "is_prn": {"name": "is_prn", "description": "A flag to determine whether or not the current prescription is prn", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_prn"]}, "is_variable_dose": {"name": "is_variable_dose", "description": "A flag to determine whether or not the current prescription is variable does", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_variable_dose"]}, "dose_amount": {"name": "dose_amount", "description": "Numeric field to record dose amount", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__dose_amount"]}, "units": {"name": "units", "description": "The units of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__units"]}, "frequency": {"name": "frequency", "description": "The frequency of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__frequency"]}, "duration_value": {"name": "duration_value", "description": "The duration value of the prescription", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__duration_value"]}, "duration_unit": {"name": "duration_unit", "description": "The duration unit of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__duration_unit"]}, "is_phone_order": {"name": "is_phone_order", "description": "A flag to determine whether or not the current prescription is phone order", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_phone_order"]}, "ideal_times": {"name": "ideal_times", "description": "Ideal times which are specified by prescriber", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__ideal_times"]}, "is_discontinued": {"name": "is_discontinued", "description": "Whether the prescription was discontinued.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinued"]}, "discontinued_by_id": {"name": "discontinued_by_id", "description": "If the prescription was discontinued, who did it.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinuing_clinician_id"]}, "discontinuing_reason": {"name": "discontinuing_reason", "description": "If the prescription was discontinued, why that happened.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinuing_reason"]}, "discontinued_datetime": {"name": "discontinued_datetime", "description": "If the prescription was discontinued, when that happened.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinued_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.1608412, "relation_name": "\"app\".\"reporting\".\"prescriptions\"", "raw_code": "select\r\n p.id,\r\n p.date::timestamp as datetime,\r\n p.start_date::timestamp as start_datetime,\r\n p.end_date::timestamp as end_datetime,\r\n p.medication_id,\r\n p.prescriber_id,\r\n p.indication,\r\n p.route,\r\n p.quantity,\r\n p.repeats,\r\n p.is_ongoing,\r\n p.is_prn,\r\n p.is_variable_dose,\r\n p.dose_amount,\r\n p.units,\r\n p.frequency,\r\n p.duration_value,\r\n p.duration_unit,\r\n p.is_phone_order,\r\n p.ideal_times,\r\n p.discontinued as is_discontinued,\r\n p.discontinuing_clinician_id as discontinued_by_id,\r\n p.discontinuing_reason,\r\n p.discontinued_date::timestamp as discontinued_datetime\r\nfrom {{ source('tamanu', 'prescriptions') }} p\r\nwhere p.deleted_at is null\r\n and exists (\r\n select 1\r\n from {{ source('tamanu', 'encounter_prescriptions') }} ep\r\n join {{ source('tamanu', 'encounters') }} e on e.id = ep.encounter_id\r\n where ep.prescription_id = p.id\r\n and ep.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'\r\n )", "doc_blocks": ["doc.tamanu_source_dbt.table__prescriptions"], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"], ["tamanu", "encounter_prescriptions"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions", "source.tamanu_source_dbt.tamanu.encounter_prescriptions", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\prescriptions.sql", "compiled": true, "compiled_code": "select\n p.id,\n p.date::timestamp as datetime,\n p.start_date::timestamp as start_datetime,\n p.end_date::timestamp as end_datetime,\n p.medication_id,\n p.prescriber_id,\n p.indication,\n p.route,\n p.quantity,\n p.repeats,\n p.is_ongoing,\n p.is_prn,\n p.is_variable_dose,\n p.dose_amount,\n p.units,\n p.frequency,\n p.duration_value,\n p.duration_unit,\n p.is_phone_order,\n p.ideal_times,\n p.discontinued as is_discontinued,\n p.discontinuing_clinician_id as discontinued_by_id,\n p.discontinuing_reason,\n p.discontinued_date::timestamp as discontinued_datetime\nfrom \"app\".\"public\".\"prescriptions\" p\nwhere p.deleted_at is null\n and exists (\n select 1\n from \"app\".\"public\".\"encounter_prescriptions\" ep\n join \"app\".\"public\".\"encounters\" e on e.id = ep.encounter_id\n where ep.prescription_id = p.id\n and ep.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n )", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.procedures": {"database": "app", "schema": "reporting", "name": "procedures", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\procedures.sql", "original_file_path": "models\\bases\\procedures.sql", "unique_id": "model.tamanu_source_dbt.procedures", "fqn": ["tamanu_source_dbt", "bases", "procedures"], "alias": "procedures", "checksum": {"name": "sha256", "checksum": "d16b70404a0df73a186c61ef5d663fdde7517d67612dc8990fe75c26e118a9e7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Record of each procedure in progress or completed.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedures.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "date": {"name": "date", "description": "Local date for the record in procedures.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "start_time": {"name": "start_time", "description": "When the procedure started.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time"]}, "end_time": {"name": "end_time", "description": "When the procedure ended, if it's completed.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time"]}, "is_completed": {"name": "is_completed", "description": "Whether the procedure has completed.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed"]}, "note": {"name": "note", "description": "Free-form description of the procedure.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__note"]}, "completed_note": {"name": "completed_note", "description": "Free-form notes at completion of the procedure.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed_note"]}, "encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters) this procedure is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__encounter_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the procedure happens in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__location_id"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__procedure_type_id"]}, "anaesthetic_id": {"name": "anaesthetic_id", "description": "Reference to the anaesthetic ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetic_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [physician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__physician_id"]}, "anaesthetist_id": {"name": "anaesthetist_id", "description": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetist_id"]}, "assistant_anaesthetist_id": {"name": "assistant_anaesthetist_id", "description": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id"]}, "time_in": {"name": "time_in", "description": "The time when the patient entered the procedure room or when the procedure setup began.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_in"]}, "time_out": {"name": "time_out", "description": "The time when the patient left the procedure room or when the procedure cleanup was completed.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_out"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\procedures.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1608412, "relation_name": "\"app\".\"reporting\".\"procedures\"", "raw_code": "select\r\n p.id,\r\n p.date::date as date,\r\n p.start_time::timestamp::time as start_time,\r\n p.end_time::timestamp::time as end_time,\r\n p.completed as is_completed,\r\n p.note,\r\n p.completed_note,\r\n p.encounter_id,\r\n p.location_id,\r\n p.procedure_type_id,\r\n p.anaesthetic_id,\r\n p.physician_id as clinician_id,\r\n p.anaesthetist_id,\r\n p.assistant_anaesthetist_id,\r\n p.time_in::time as time_in,\r\n p.time_out::time as time_out\r\nfrom {{ source('tamanu', 'procedures') }} p\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = p.encounter_id\r\nwhere p.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__procedures"], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\procedures.sql", "compiled": true, "compiled_code": "select\n p.id,\n p.date::date as date,\n p.start_time::timestamp::time as start_time,\n p.end_time::timestamp::time as end_time,\n p.completed as is_completed,\n p.note,\n p.completed_note,\n p.encounter_id,\n p.location_id,\n p.procedure_type_id,\n p.anaesthetic_id,\n p.physician_id as clinician_id,\n p.anaesthetist_id,\n p.assistant_anaesthetist_id,\n p.time_in::time as time_in,\n p.time_out::time as time_out\nfrom \"app\".\"public\".\"procedures\" p\njoin \"app\".\"public\".\"encounters\" e on e.id = p.encounter_id\nwhere p.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.procedures_metadata": {"database": "app", "schema": "reporting", "name": "procedures_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\procedures_metadata.sql", "original_file_path": "models\\bases\\procedures_metadata.sql", "unique_id": "model.tamanu_source_dbt.procedures_metadata", "fqn": ["tamanu_source_dbt", "bases", "procedures_metadata"], "alias": "procedures_metadata", "checksum": {"name": "sha256", "checksum": "64134447231619ed044da54c869a5cf3f815409fae95cd53830cf0cab3ee765f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Metadata information extracted from the change logs for procedures.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedures.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the procedures table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the procedures table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\procedures_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1608412, "relation_name": "\"app\".\"reporting\".\"procedures_metadata\"", "raw_code": "{{ get_metadata_from_changes('procedures') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\procedures_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'procedures'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.programs": {"database": "app", "schema": "reporting", "name": "programs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\programs.sql", "original_file_path": "models\\bases\\programs.sql", "unique_id": "model.tamanu_source_dbt.programs", "fqn": ["tamanu_source_dbt", "bases", "programs"], "alias": "programs", "checksum": {"name": "sha256", "checksum": "ebab7a5641a255a2e5eca27d6b209c7f9a93b36498848db4e2939def72331639"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Groups of [surveys](#!/source/source.tamanu.tamanu.surveys) or [program registries](#!/source/source.tamanu.tamanu.program_registries).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in programs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Machine-friendly code.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.programs__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.programs__name"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\programs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1608412, "relation_name": "\"app\".\"reporting\".\"programs\"", "raw_code": "select\r\n id,\r\n code,\r\n name\r\nfrom {{ source('tamanu', 'programs') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__programs"], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\programs.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name\nfrom \"app\".\"public\".\"programs\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_data_elements": {"database": "app", "schema": "reporting", "name": "program_data_elements", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_data_elements.sql", "original_file_path": "models\\bases\\program_data_elements.sql", "unique_id": "model.tamanu_source_dbt.program_data_elements", "fqn": ["tamanu_source_dbt", "bases", "program_data_elements"], "alias": "program_data_elements", "checksum": {"name": "sha256", "checksum": "e7a2635b7674f9578a72a47d086ee08779c775d719ec067bdd61b1a55f0037e7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Describes how a survey question gets stored.\r\n\r\nSee [survey screen components](#!/source/source.tamanu.tamanu.survey_screen_components), which\r\ndescribes how the question is displayed.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_data_elements.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Machine-friendly short name for the question.\r\n\r\nThis is also used to refer to questions within criteria and such.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__code"]}, "name": {"name": "name", "description": "Human-friendly name", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__name"]}, "type": {"name": "type", "description": "Type of the field.\r\n\r\nTypes are here: ", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__type"]}, "indicator": {"name": "indicator", "description": "Another name for the data element.\r\n\r\nIt's named `indicator` from mimicry of Tupaia.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__indicator"]}, "default_text": {"name": "default_text", "description": "Default value.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__default_text"]}, "default_options": {"name": "default_options", "description": "Default options if this is a dropdown.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__default_options"]}, "visualisation_config": {"name": "visualisation_config", "description": "JSON visualisation configuration.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__visualisation_config"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_data_elements.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1608412, "relation_name": "\"app\".\"reporting\".\"program_data_elements\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n type,\r\n indicator,\r\n default_text,\r\n default_options,\r\n visualisation_config\r\nfrom {{ source('tamanu', 'program_data_elements') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_data_elements"], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_data_elements.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n type,\n indicator,\n default_text,\n default_options,\n visualisation_config\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_registries": {"database": "app", "schema": "reporting", "name": "program_registries", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_registries.sql", "original_file_path": "models\\bases\\program_registries.sql", "unique_id": "model.tamanu_source_dbt.program_registries", "fqn": ["tamanu_source_dbt", "bases", "program_registries"], "alias": "program_registries", "checksum": {"name": "sha256", "checksum": "42e8b06322eef654ed0045eb1ccc9b151572583b392dde41dfeb9ad08b0e6d84"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table of program registries.\r\n\r\nThis provides functionality to track a patient population defined by a particular disease or\r\ncondition, and follow this population over time.\r\n\r\nThis table defines the different registries available to track users with.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registries.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Machine-friendly identifier.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__name"]}, "currently_at_type": {"name": "currently_at_type", "description": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__currently_at_type"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registries.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_id": {"name": "program_id", "description": "Reference to a [program](#!/source/source.tamanu.tamanu.programs).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__program_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_registries.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1765943, "relation_name": "\"app\".\"reporting\".\"program_registries\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n currently_at_type,\r\n visibility_status,\r\n program_id\r\nfrom {{ source('tamanu', 'program_registries') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registries"], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_registries.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n currently_at_type,\n visibility_status,\n program_id\nfrom \"app\".\"public\".\"program_registries\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_registry_clinical_statuses": {"database": "app", "schema": "reporting", "name": "program_registry_clinical_statuses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_registry_clinical_statuses.sql", "original_file_path": "models\\bases\\program_registry_clinical_statuses.sql", "unique_id": "model.tamanu_source_dbt.program_registry_clinical_statuses", "fqn": ["tamanu_source_dbt", "bases", "program_registry_clinical_statuses"], "alias": "program_registry_clinical_statuses", "checksum": {"name": "sha256", "checksum": "ed760481a9bb62f58bf8c22aeee3271af189d23d0dc983d5cde496d7b12d43ee"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table of clinical statuses used in program registries.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_clinical_statuses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code (identifier) for the clinical status.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__code"]}, "name": {"name": "name", "description": "The name of the clinical status.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__name"]}, "color": {"name": "color", "description": "A color for the clinical status.\r\n\r\nOne of:\r\n- `purple`\r\n- `pink`\r\n- `orange`\r\n- `yellow`\r\n- `blue`\r\n- `green`\r\n- `grey`\r\n- `red`\r\n- `brown`\r\n- `teal`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__color"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_clinical_statuses.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe status is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__program_registry_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_registry_clinical_statuses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1765943, "relation_name": "\"app\".\"reporting\".\"program_registry_clinical_statuses\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n color,\r\n visibility_status,\r\n program_registry_id\r\nfrom {{ source('tamanu', 'program_registry_clinical_statuses') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_clinical_statuses"], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_registry_clinical_statuses.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n color,\n visibility_status,\n program_registry_id\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_registry_conditions": {"database": "app", "schema": "reporting", "name": "program_registry_conditions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_registry_conditions.sql", "original_file_path": "models\\bases\\program_registry_conditions.sql", "unique_id": "model.tamanu_source_dbt.program_registry_conditions", "fqn": ["tamanu_source_dbt", "bases", "program_registry_conditions"], "alias": "program_registry_conditions", "checksum": {"name": "sha256", "checksum": "821a2997bc136c1e8c7361c86c679e3a074f3e90a8d650aecbc833644f5cecc9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Table of program registry conditions.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code (identifier) for the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__code"]}, "name": {"name": "name", "description": "The name of the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_conditions.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe condition is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__program_registry_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_registry_conditions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1765943, "relation_name": "\"app\".\"reporting\".\"program_registry_conditions\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n visibility_status,\r\n program_registry_id\r\nfrom {{ source('tamanu', 'program_registry_conditions') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_conditions"], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_registry_conditions.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n visibility_status,\n program_registry_id\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program_registry_condition_categories": {"database": "app", "schema": "reporting", "name": "program_registry_condition_categories", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\program_registry_condition_categories.sql", "original_file_path": "models\\bases\\program_registry_condition_categories.sql", "unique_id": "model.tamanu_source_dbt.program_registry_condition_categories", "fqn": ["tamanu_source_dbt", "bases", "program_registry_condition_categories"], "alias": "program_registry_condition_categories", "checksum": {"name": "sha256", "checksum": "da8b2b96aa51941ff54a0678deede901b9562d5f6dc8e051e60bb7c2726b81ea"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Categories to be set against patient program registry conditions. The categories are configured through the program importer for each program registry. There is a hard-loaded list that is seeded by default in the database for each program registry.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_condition_categories.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "The code for the category.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__code"]}, "name": {"name": "name", "description": "The name for the category.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_condition_categories.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "The id of the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__program_registry_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\program_registry_condition_categories.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1765943, "relation_name": "\"app\".\"reporting\".\"program_registry_condition_categories\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n visibility_status,\r\n program_registry_id\r\nfrom {{ source('tamanu', 'program_registry_condition_categories') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_condition_categories"], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\program_registry_condition_categories.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n visibility_status,\n program_registry_id\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.reference_data": {"database": "app", "schema": "reporting", "name": "reference_data", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\reference_data.sql", "original_file_path": "models\\bases\\reference_data.sql", "unique_id": "model.tamanu_source_dbt.reference_data", "fqn": ["tamanu_source_dbt", "bases", "reference_data"], "alias": "reference_data", "checksum": {"name": "sha256", "checksum": "0b1a8aadda3b4279fca4db92d86cdf488dd9975766fd010e173b0373aa2ab1d3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "User imported reference data for the environment grouped by type.\r\n\r\n- Catch-all for simple reference data types - there are a LOT of kinds of reference data that exist as just an ID, a \r\nstring label, and occasionally a code; these are all grouped into this table to avoid overcomplicating the schema.\r\n- Occasionally a type of simple reference data will gain some complexity, at which point it will be refactored/migrated \r\nout to use its own table.\r\n- Simple reference data types include a code, type, name and visibility status.\r\n- Example types include `diagnosis`, `procedures`", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Code of the data item (short value, alphanumerics and hyphens).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__code"]}, "name": {"name": "name", "description": "Actual data", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "type": {"name": "type", "description": "Class of the data (referred to in code).\r\n\r\nWhenever this table is referred to in a relationship, it's to a specific `type` here. For example a\r\ntable might have a `diagnosis_id`, which is a reference to this table, for specifically only the\r\nrows with `type = diagnosis`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__type"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in reference_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\reference_data.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1765943, "relation_name": "\"app\".\"reporting\".\"reference_data\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n type,\r\n visibility_status\r\nfrom {{ source('tamanu', 'reference_data') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_data"], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\reference_data.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n type,\n visibility_status\nfrom \"app\".\"public\".\"reference_data\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.referrals": {"database": "app", "schema": "reporting", "name": "referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\referrals.sql", "original_file_path": "models\\bases\\referrals.sql", "unique_id": "model.tamanu_source_dbt.referrals", "fqn": ["tamanu_source_dbt", "bases", "referrals"], "alias": "referrals", "checksum": {"name": "sha256", "checksum": "0ed81ae12f4e69f0ee4c7dfdbffc32dc91adcfb85d0e1cf86b983b85fcf45c4d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "[Referrals](https://en.wikipedia.org/wiki/Referral_(medicine)).\r\n\r\nReferrals use a confusing mix of data in the `referrals` table and\r\n[`survey_response_answers`](#!/source/source.tamanu.tamanu.survey_response_answers) identified by\r\nthe text of the question they are for. \r\n\r\nSome additional data is captured in\r\n[survey response answers](#!/source/source.tamanu.tamanu.survey_response_answers), but this is\r\nvariable and not enforced through any validation:\r\n- Where the person is being referred to can be captured by a range of questions, sometimes with a\r\n list of hard coded facility name options, or location groups, or departments.\r\n- Who the referral is \"completed by\" can be captured by a question either the name\r\n 'Referring doctor' or 'Referral completed by'.\r\n- Some referrals are the product of a previous screening survey. In some cases (e.g. Samoa) there is\r\n a SurveyLink question that captures which survey led to this referral, in others (e.g. Nauru)\r\n there is no such question so the two survey responses cannot be reliably linked.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in referrals.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "status": {"name": "status", "description": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__status"]}, "referred_facility": {"name": "referred_facility", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__referred_facility"]}, "initiating_encounter_id": {"name": "initiating_encounter_id", "description": "Reference to the [initiating encounter](#!/source/source.tamanu.tamanu.encounters).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__initiating_encounter_id"]}, "survey_response_id": {"name": "survey_response_id", "description": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) with more data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__survey_response_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\referrals.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1765943, "relation_name": "\"app\".\"reporting\".\"referrals\"", "raw_code": "select\r\n id,\r\n status,\r\n referred_facility,\r\n initiating_encounter_id,\r\n survey_response_id\r\nfrom {{ source('tamanu', 'referrals') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__referrals"], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\referrals.sql", "compiled": true, "compiled_code": "select\n id,\n status,\n referred_facility,\n initiating_encounter_id,\n survey_response_id\nfrom \"app\".\"public\".\"referrals\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.refresh_tokens": {"database": "app", "schema": "reporting", "name": "refresh_tokens", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\refresh_tokens.sql", "original_file_path": "models\\bases\\refresh_tokens.sql", "unique_id": "model.tamanu_source_dbt.refresh_tokens", "fqn": ["tamanu_source_dbt", "bases", "refresh_tokens"], "alias": "refresh_tokens", "checksum": {"name": "sha256", "checksum": "04fd90e3d6cac266030987bca91678ff1d567a443d89e087a66d3d93d56aac21"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "Refresh tokens are used by API clients to refresh their authentication quickly, within a timeout.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "device_id": {"name": "device_id", "description": "Unique device ID from the client.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__device_id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) being authenticated as.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__user_id"]}, "expires_at": {"name": "expires_at", "description": "When the refresh token expires.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__expires_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\refresh_tokens.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782423652.1765943, "relation_name": "\"app\".\"reporting\".\"refresh_tokens\"", "raw_code": "select\r\n id,\r\n device_id,\r\n user_id,\r\n expires_at,\r\n created_at,\r\n updated_at\r\nfrom\r\n {{ source('tamanu', 'refresh_tokens') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__refresh_tokens"], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\refresh_tokens.sql", "compiled": true, "compiled_code": "select\n id,\n device_id,\n user_id,\n expires_at,\n created_at,\n updated_at\nfrom\n \"app\".\"public\".\"refresh_tokens\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.roles": {"database": "app", "schema": "reporting", "name": "roles", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\roles.sql", "original_file_path": "models\\bases\\roles.sql", "unique_id": "model.tamanu_source_dbt.roles", "fqn": ["tamanu_source_dbt", "bases", "roles"], "alias": "roles", "checksum": {"name": "sha256", "checksum": "7ac5061d54bd4d356160f3050960a352c91dd1b00e7493803e8c126e5f594866"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "These are sets of permissions that are given to users to determine what they can do in Tamanu.\r\n\r\nThe actual permissions are associated to the role in the\r\n[`permissions`](#!/source/source.tamanu.tamanu.permissions) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in roles.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Readable name for the role.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.roles__name"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\roles.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782423652.1765943, "relation_name": "\"app\".\"reporting\".\"roles\"", "raw_code": "select\r\n id,\r\n name\r\nfrom {{ source('tamanu', 'roles') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__roles"], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\roles.sql", "compiled": true, "compiled_code": "select\n id,\n name\nfrom \"app\".\"public\".\"roles\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.surveys": {"database": "app", "schema": "reporting", "name": "surveys", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\surveys.sql", "original_file_path": "models\\bases\\surveys.sql", "unique_id": "model.tamanu_source_dbt.surveys", "fqn": ["tamanu_source_dbt", "bases", "surveys"], "alias": "surveys", "checksum": {"name": "sha256", "checksum": "849a85fd6de0ddb3245c0a18426080696e49f8345db51b3ff6120d5110717e95"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Surveys, aka custom forms that can be filled by practitioners.\r\n\r\nThese are composed of [screen components](#!/source/source.tamanu.tamanu.survey_screen_components).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in surveys.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "code": {"name": "code", "description": "Machine-friendly code.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__name"]}, "survey_type": {"name": "survey_type", "description": "Type of survey.\r\n\r\nOne of:\r\n- `programs`\r\n- `referral`\r\n- `obsolete`\r\n- `vitals`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__survey_type"]}, "is_sensitive": {"name": "is_sensitive", "description": "Whether the data recorded in the survey is sensitive.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__is_sensitive"]}, "is_notifiable": {"name": "is_notifiable", "description": "Whether filling this survey sends a notification email.\r\n\r\nThese are sent by the `SurveyCompletionNotifierProcessor` scheduled task.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__notifiable"]}, "notify_email_addresses": {"name": "notify_email_addresses", "description": "If `notifiable` is true, where to send the notification.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__notify_email_addresses"]}, "program_id": {"name": "program_id", "description": "The [program](#!/source/source.tamanu.tamanu.programs) grouping this survey.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__program_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in surveys.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\surveys.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1765943, "relation_name": "\"app\".\"reporting\".\"surveys\"", "raw_code": "select\r\n id,\r\n code,\r\n name,\r\n survey_type,\r\n is_sensitive,\r\n notifiable as is_notifiable,\r\n notify_email_addresses,\r\n program_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'surveys') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__surveys"], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\surveys.sql", "compiled": true, "compiled_code": "select\n id,\n code,\n name,\n survey_type,\n is_sensitive,\n notifiable as is_notifiable,\n notify_email_addresses,\n program_id,\n visibility_status\nfrom \"app\".\"public\".\"surveys\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.survey_responses": {"database": "app", "schema": "reporting", "name": "survey_responses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\survey_responses.sql", "original_file_path": "models\\bases\\survey_responses.sql", "unique_id": "model.tamanu_source_dbt.survey_responses", "fqn": ["tamanu_source_dbt", "bases", "survey_responses"], "alias": "survey_responses", "checksum": {"name": "sha256", "checksum": "ae6c270610e2a981a7ccdc13e2d5dd5b404c00de218dcb6026bf6c8893984303"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A response to a survey (as recorded by a practitioner).\r\n\r\nTypically surveys are filled on behalf of patients as part of an encounter.\r\n\r\nBecause there are multiple distinct kinds of dates at play here:\r\n- `created_at`, `updated_at`, `deleted_at` are system data for syncing and cannot be relied on for realtime\r\n- `start_time`, `end_time` are real datetimes automatically recorded when starting and submitting a survey response\r\n- in survey response answers, there could be a data element for targeting the date of when exactly the data is recorded in real time.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_responses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_datetime": {"name": "start_datetime", "description": "When the survey was started.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__start_time"]}, "end_datetime": {"name": "end_datetime", "description": "When the survey was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__end_time"]}, "result_text": {"name": "result_text", "description": "The textual value that is the summary of the survey response.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__result_text"]}, "is_notified": {"name": "is_notified", "description": "If the [survey](#!/source/source.tamanu.tamanu.surveys) is `notifiable`, whether this response's\r\nnotification has been sent.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__notified"]}, "survey_id": {"name": "survey_id", "description": "The [survey](#!/source/source.tamanu.tamanu.surveys) being responded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__survey_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this survey response is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__encounter_id"]}, "submitted_by_id": {"name": "submitted_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) recording this survey response.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__user_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\survey_responses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1927004, "relation_name": "\"app\".\"reporting\".\"survey_responses\"", "raw_code": "select\r\n id,\r\n start_time::timestamp as start_datetime,\r\n end_time::timestamp as end_datetime,\r\n result_text,\r\n notified as is_notified,\r\n survey_id,\r\n encounter_id,\r\n user_id as submitted_by_id\r\nfrom {{ source('tamanu', 'survey_responses') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_responses"], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\survey_responses.sql", "compiled": true, "compiled_code": "select\n id,\n start_time::timestamp as start_datetime,\n end_time::timestamp as end_datetime,\n result_text,\n notified as is_notified,\n survey_id,\n encounter_id,\n user_id as submitted_by_id\nfrom \"app\".\"public\".\"survey_responses\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.survey_response_answers": {"database": "app", "schema": "reporting", "name": "survey_response_answers", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\survey_response_answers.sql", "original_file_path": "models\\bases\\survey_response_answers.sql", "unique_id": "model.tamanu_source_dbt.survey_response_answers", "fqn": ["tamanu_source_dbt", "bases", "survey_response_answers"], "alias": "survey_response_answers", "checksum": {"name": "sha256", "checksum": "fff314c883c021aea5a91940122a4fd17cae8044ef8c2508216f75a3c2ebbc01"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A single answer as part of a [survey response](#!/source/source.tamanu.tamanu.survey_responses).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_response_answers.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Name of the question.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__name"]}, "body": {"name": "body", "description": "Value of the answer.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__body"]}, "response_id": {"name": "response_id", "description": "The [survey response](#!/source/source.tamanu.tamanu.survey_responses).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__response_id"]}, "data_element_id": {"name": "data_element_id", "description": "Reference to the [question](#!/source/source.tamanu.tamanu.program_data_elements).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__data_element_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\survey_response_answers.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1927004, "relation_name": "\"app\".\"reporting\".\"survey_response_answers\"", "raw_code": "select\r\n id,\r\n name,\r\n body,\r\n response_id,\r\n data_element_id\r\nfrom {{ source('tamanu', 'survey_response_answers') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_response_answers"], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\survey_response_answers.sql", "compiled": true, "compiled_code": "select\n id,\n name,\n body,\n response_id,\n data_element_id\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.survey_screen_components": {"database": "app", "schema": "reporting", "name": "survey_screen_components", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\survey_screen_components.sql", "original_file_path": "models\\bases\\survey_screen_components.sql", "unique_id": "model.tamanu_source_dbt.survey_screen_components", "fqn": ["tamanu_source_dbt", "bases", "survey_screen_components"], "alias": "survey_screen_components", "checksum": {"name": "sha256", "checksum": "662d5ae56488459829e019f5720133959fb980e540308ade5e8d3dafff44dbb4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Describes how a survey question gets displayed.\r\n\r\nSee [program data element](#!/source/source.tamanu.tamanu.program_data_elements), which describes\r\nhow the data from the question is stored.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_screen_components.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "screen_index": {"name": "screen_index", "description": "Screen this component should appear on.\r\n\r\nSurveys can have multiple \"screens\" or pages, this index sets where this particular question sits.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__screen_index"]}, "component_index": {"name": "component_index", "description": "The absolute index (order) of the component in the survey.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__component_index"]}, "text": {"name": "text", "description": "Description or question of this component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__text"]}, "visibility_criteria": {"name": "visibility_criteria", "description": "JSON criteria that determines when this component is visible.\r\n\r\nA criteria is a list of other components' codes and the value that will make this question show up:\r\n\r\n```json\r\n{\r\n \"otherQuestion\": \"Yes\"\r\n}\r\n```\r\n\r\nThere can also be the special criterium `{\"hidden\": true}` which always hides the question, and the\r\nspecial key `\"_conjunction\": \"or\"` which makes it so _any one_ item in the list is sufficient to\r\nshow the question, instead of the default where _all_ items must match.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__visibility_criteria"]}, "validation_criteria": {"name": "validation_criteria", "description": "JSON criteria that determines whether the value entered in this component is accepted.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__validation_criteria"]}, "detail": {"name": "detail", "description": "Longer description or explanatory text of this component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__detail"]}, "config": {"name": "config", "description": "JSON additional config of the component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__config"]}, "options": {"name": "options", "description": "JSON array of strings of options to be selected.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__options"]}, "calculation": {"name": "calculation", "description": "Math expression to do calculations on the entered value before it's saved.\r\n\r\nFor example `questionCode + 3`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__calculation"]}, "survey_id": {"name": "survey_id", "description": "The [survey](#!/source/source.tamanu.tamanu.surveys).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__survey_id"]}, "data_element_id": {"name": "data_element_id", "description": "Reference to the [data element](#!/source/source.tamanu.tamanu.program_data_elements) configuring\r\nhow the data from the question is stored.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__data_element_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in survey_screen_components.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\survey_screen_components.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1927004, "relation_name": "\"app\".\"reporting\".\"survey_screen_components\"", "raw_code": "select\r\n id,\r\n screen_index,\r\n component_index,\r\n text,\r\n visibility_criteria,\r\n validation_criteria,\r\n detail,\r\n config,\r\n options,\r\n calculation,\r\n survey_id,\r\n data_element_id,\r\n visibility_status\r\nfrom {{ source('tamanu', 'survey_screen_components') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_screen_components"], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\survey_screen_components.sql", "compiled": true, "compiled_code": "select\n id,\n screen_index,\n component_index,\n text,\n visibility_criteria,\n validation_criteria,\n detail,\n config,\n options,\n calculation,\n survey_id,\n data_element_id,\n visibility_status\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.translated_strings": {"database": "app", "schema": "reporting", "name": "translated_strings", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\translated_strings.sql", "original_file_path": "models\\bases\\translated_strings.sql", "unique_id": "model.tamanu_source_dbt.translated_strings", "fqn": ["tamanu_source_dbt", "bases", "translated_strings"], "alias": "translated_strings", "checksum": {"name": "sha256", "checksum": "e9ffa528aeeb77ad6526f7845c94cc284cc9109b037f041ff3738fc13dd8d985"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "reference"], "description": "Localisation and translation strings.\r\n\r\nThese are used for two distinct purposes:\r\n- to translate Tamanu in languages other than English\r\n- to adjust the wording of specific items in the UI", "columns": {"string_id": {"name": "string_id", "description": "The internal reference of the item being translated.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__string_id"]}, "language": {"name": "language", "description": "The language code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__language"]}, "text": {"name": "text", "description": "The actual translated text.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__text"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\translated_strings.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "internal"}}, "created_at": 1782423652.1927004, "relation_name": "\"app\".\"reporting\".\"translated_strings\"", "raw_code": "select\r\n string_id,\r\n language,\r\n text\r\nfrom {{ source('tamanu', 'translated_strings') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__translated_strings"], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\translated_strings.sql", "compiled": true, "compiled_code": "select\n string_id,\n language,\n text\nfrom \"app\".\"public\".\"translated_strings\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.triages": {"database": "app", "schema": "reporting", "name": "triages", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\triages.sql", "original_file_path": "models\\bases\\triages.sql", "unique_id": "model.tamanu_source_dbt.triages", "fqn": ["tamanu_source_dbt", "bases", "triages"], "alias": "triages", "checksum": {"name": "sha256", "checksum": "a7fc95c67d4564a688a6b4811274cf5289d3ba93da29d35b796009500b60c85e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Triage data of patients waiting in an emergency department.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in triages.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "arrival_datetime": {"name": "arrival_datetime", "description": "When the patient arrived.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time"]}, "triage_datetime": {"name": "triage_datetime", "description": "When the patient was triaged.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time"]}, "closed_datetime": {"name": "closed_datetime", "description": "When the patient was processed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time"]}, "arrival_mode_id": {"name": "arrival_mode_id", "description": "Reference to how the patient arrived ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = arrivalMode`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_mode_id"]}, "score": {"name": "score", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__encounter_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__practitioner_id"]}, "chief_complaint_id": {"name": "chief_complaint_id", "description": "Reference to the primary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__chief_complaint_id"]}, "secondary_complaint_id": {"name": "secondary_complaint_id", "description": "Reference to the secondary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__secondary_complaint_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\triages.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.1927004, "relation_name": "\"app\".\"reporting\".\"triages\"", "raw_code": "select\r\n t.id,\r\n t.arrival_time::timestamp as arrival_datetime,\r\n t.triage_time::timestamp as triage_datetime,\r\n t.closed_time::timestamp as closed_datetime,\r\n t.arrival_mode_id,\r\n t.score,\r\n t.encounter_id,\r\n t.practitioner_id as clinician_id,\r\n t.chief_complaint_id,\r\n t.secondary_complaint_id\r\nfrom {{ source('tamanu', 'triages') }} t\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = t.encounter_id\r\nwhere t.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__triages"], "language": "sql", "refs": [], "sources": [["tamanu", "triages"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.triages", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\triages.sql", "compiled": true, "compiled_code": "select\n t.id,\n t.arrival_time::timestamp as arrival_datetime,\n t.triage_time::timestamp as triage_datetime,\n t.closed_time::timestamp as closed_datetime,\n t.arrival_mode_id,\n t.score,\n t.encounter_id,\n t.practitioner_id as clinician_id,\n t.chief_complaint_id,\n t.secondary_complaint_id\nfrom \"app\".\"public\".\"triages\" t\njoin \"app\".\"public\".\"encounters\" e on e.id = t.encounter_id\nwhere t.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.users": {"database": "app", "schema": "reporting", "name": "users", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\users.sql", "original_file_path": "models\\bases\\users.sql", "unique_id": "model.tamanu_source_dbt.users", "fqn": ["tamanu_source_dbt", "bases", "users"], "alias": "users", "checksum": {"name": "sha256", "checksum": "87cc2c2b62a6259690e0bf7c2ecd50b04c3ab76593058909131c3b07719ceea4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration"], "description": "Records of each user that can login to Tamanu.\r\n\r\nThis includes machine users.\r\n\r\nThere is one special user account with an all-zero `id`, which is the global \"system\" user. This is\r\nused as a pseudo identity where the Tamanu system itself takes an action that normally is performed\r\nby a human or API user.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_id"]}, "display_name": {"name": "display_name", "description": "The human readable display name for the user.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "email": {"name": "email", "description": "Email address for user. This is used to login and receive emails.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__email"]}, "phone_number": {"name": "phone_number", "description": "Phone number for the user.\r\n\r\nThis is not currently available anywhere visible.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__phone_number"]}, "role": {"name": "role", "description": "The role of the user, which sets their permission level.\r\n\r\nThe special values `admin` and `system` indicate a superadmin and a system user respectively.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__role"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\users.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.1927004, "relation_name": "\"app\".\"reporting\".\"users\"", "raw_code": "select\r\n id,\r\n display_id,\r\n display_name,\r\n email,\r\n phone_number,\r\n role,\r\n visibility_status\r\nfrom {{ source('tamanu', 'users') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__users"], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\users.sql", "compiled": true, "compiled_code": "select\n id,\n display_id,\n display_name,\n email,\n phone_number,\n role,\n visibility_status\nfrom \"app\".\"public\".\"users\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.users_metadata": {"database": "app", "schema": "reporting", "name": "users_metadata", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\users_metadata.sql", "original_file_path": "models\\bases\\users_metadata.sql", "unique_id": "model.tamanu_source_dbt.users_metadata", "fqn": ["tamanu_source_dbt", "bases", "users_metadata"], "alias": "users_metadata", "checksum": {"name": "sha256", "checksum": "52bb5c10702129b47919cc72e6a9d2db0bfd8cf8429be9602a58eb5959dea591"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "administration", "log"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "administration", "log"], "description": "Metadata information extracted from the change logs for users.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_datetime": {"name": "created_datetime", "description": "Timestamp of when record was created in the users table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_datetime": {"name": "updated_datetime", "description": "Timestamp of when record was last updated in the users table.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\users_metadata.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration", "log"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "silver", "pii": false, "classification": "confidential"}}, "created_at": 1782423652.1927004, "relation_name": "\"app\".\"reporting\".\"users_metadata\"", "raw_code": "{{ get_metadata_from_changes('users') }}", "doc_blocks": ["doc.tamanu_source_dbt.generic__metadata"], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_metadata_from_changes"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\users_metadata.sql", "compiled": true, "compiled_code": "with change_logs as (\n select \n record_id,\n logged_at,\n least(record_created_at, logged_at) as created_datetime\n from \"app\".\"logs\".\"changes\"\n where table_name = 'users'\n)\nselect \n record_id as id,\n min(created_datetime) as created_datetime,\n max(logged_at) as updated_datetime\nfrom change_logs\ngroup by record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine_administrations": {"database": "app", "schema": "reporting", "name": "vaccine_administrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\vaccine_administrations.sql", "original_file_path": "models\\bases\\vaccine_administrations.sql", "unique_id": "model.tamanu_source_dbt.vaccine_administrations", "fqn": ["tamanu_source_dbt", "bases", "vaccine_administrations"], "alias": "vaccine_administrations", "checksum": {"name": "sha256", "checksum": "123b27c35f50309e5bff15c52527b33b881c63d573983fb3e4a1f0afaf35afd6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "Table of vaccines administered to patients.\r\n\r\nVaccinations are recorded via the Vaccinations modal; they are selected\r\nfrom a list of Scheduled Vaccines and linked to a Patient via an Encounter.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vaccine_administrations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in vaccine_administrations.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) this vaccine was given in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__encounter_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "status": {"name": "status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "reason": {"name": "reason", "description": "Reason for vaccine administrations `NOT_GIVEN` status. This is a free text field", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__reason"]}, "not_given_reason_id": {"name": "not_given_reason_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "is_consented": {"name": "is_consented", "description": "Consent of the vaccine administrations recorded", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent"]}, "consent_given_by": {"name": "consent_given_by", "description": "Free text field recording who gave consent for the vaccination.\r\nThis is usually the patient themselves, but may differ for children or dependent\r\npersons or other cases.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent_given_by"]}, "injection_site": {"name": "injection_site", "description": "Injection site of the vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__injection_site"]}, "given_by_id": {"name": "given_by_id", "description": "Free text field for the name of the health practitioner who administered the\r\nvaccine. This is defaulted to the `display_name` of the logged-in User, but can\r\nbe changed. It is not a requirement that the administerer is a Tamanu User.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_by"]}, "is_given_elsewhere": {"name": "is_given_elsewhere", "description": "Checks if the vaccine was given elsewhere", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "circumstance_ids": {"name": "circumstance_ids", "description": "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineCircumstance`).", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__circumstance_ids"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [User](#!/source/source.tamanu.tamanu.users) who recorded this vaccination.\r\nThis may differ from the User or person who administered the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__recorder_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\vaccine_administrations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.2084012, "relation_name": "\"app\".\"reporting\".\"vaccine_administrations\"", "raw_code": "select\r\n av.id,\r\n av.date::timestamp as datetime,\r\n av.encounter_id,\r\n av.location_id,\r\n av.department_id,\r\n av.scheduled_vaccine_id,\r\n av.status,\r\n av.reason,\r\n av.not_given_reason_id,\r\n av.batch,\r\n av.vaccine_name,\r\n av.vaccine_brand,\r\n av.disease,\r\n av.consent as is_consented,\r\n av.consent_given_by,\r\n av.injection_site,\r\n av.given_by,\r\n av.given_elsewhere as is_given_elsewhere,\r\n av.circumstance_ids,\r\n av.recorder_id as recorded_by_id\r\nfrom {{ source('tamanu', 'administered_vaccines') }} av\r\njoin {{ source('tamanu', 'encounters') }} e on e.id = av.encounter_id\r\nwhere av.deleted_at is null\r\n and e.deleted_at is null\r\n and e.patient_id != '{{ var(\"test_patient\") }}'", "doc_blocks": ["doc.tamanu_source_dbt.table__administered_vaccines"], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\vaccine_administrations.sql", "compiled": true, "compiled_code": "select\n av.id,\n av.date::timestamp as datetime,\n av.encounter_id,\n av.location_id,\n av.department_id,\n av.scheduled_vaccine_id,\n av.status,\n av.reason,\n av.not_given_reason_id,\n av.batch,\n av.vaccine_name,\n av.vaccine_brand,\n av.disease,\n av.consent as is_consented,\n av.consent_given_by,\n av.injection_site,\n av.given_by,\n av.given_elsewhere as is_given_elsewhere,\n av.circumstance_ids,\n av.recorder_id as recorded_by_id\nfrom \"app\".\"public\".\"administered_vaccines\" av\njoin \"app\".\"public\".\"encounters\" e on e.id = av.encounter_id\nwhere av.deleted_at is null\n and e.deleted_at is null\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine_administrations_change_logs": {"database": "app", "schema": "reporting", "name": "vaccine_administrations_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\vaccine_administrations_change_logs.sql", "original_file_path": "models\\bases\\vaccine_administrations_change_logs.sql", "unique_id": "model.tamanu_source_dbt.vaccine_administrations_change_logs", "fqn": ["tamanu_source_dbt", "bases", "vaccine_administrations_change_logs"], "alias": "vaccine_administrations_change_logs", "checksum": {"name": "sha256", "checksum": "8353f5a246b26eab790c69c0e28861a5d7cacac6a7c6fedcfc92b0638aeeb849"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical", "log"], "description": "Change logs of Table of vaccines administered to patients.\r\n\r\nVaccinations are recorded via the Vaccinations modal; they are selected\r\nfrom a list of Scheduled Vaccines and linked to a Patient via an Encounter.", "columns": {"changelog_id": {"name": "changelog_id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged. in vaccine administrations history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in vaccine_administrations from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in vaccine_administrations from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. in vaccine administrations history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vaccine_administrations from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "datetime": {"name": "datetime", "description": "Local date for the record in vaccine_administrations from history.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "is_consented": {"name": "is_consented", "description": "Consent of the vaccine administrations recorded from history.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "given_by": {"name": "given_by", "description": "Free text field for the name of the health practitioner who administered the\r\nvaccine. This is defaulted to the `display_name` of the logged-in User, but can\r\nbe changed. It is not a requirement that the administerer is a Tamanu User. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_by"]}, "is_given_elsewhere": {"name": "is_given_elsewhere", "description": "Checks if the vaccine was given elsewhere from history.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "circumstance_ids": {"name": "circumstance_ids", "description": "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineCircumstance`). from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__circumstance_ids"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [User](#!/source/source.tamanu.tamanu.users) who recorded this vaccination.\r\nThis may differ from the User or person who administered the vaccine. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__recorder_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) this vaccine was given in. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__encounter_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "injection_site": {"name": "injection_site", "description": "Injection site of the vaccine administrations recorded from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__injection_site"]}, "consent_given_by": {"name": "consent_given_by", "description": "Free text field recording who gave consent for the vaccination.\r\nThis is usually the patient themselves, but may differ for children or dependent\r\npersons or other cases. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent_given_by"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "status": {"name": "status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "reason": {"name": "reason", "description": "Reason for vaccine administrations `NOT_GIVEN` status. This is a free text field from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__reason"]}, "not_given_reason_id": {"name": "not_given_reason_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field. from history.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\vaccine_administrations_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "log"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.2084012, "relation_name": "\"app\".\"reporting\".\"vaccine_administrations_change_logs\"", "raw_code": "with filtered_changes as (\r\n select\r\n av.changelog_id,\r\n av.logged_at,\r\n av.updated_by_user_id,\r\n av.record_created_at,\r\n av.record_updated_at,\r\n av.record_id,\r\n av.record_data\r\n from ({{ base_history_from_log('administered_vaccines') }}) av\r\n join {{ ref(\"encounters\") }} e on e.id = av.record_data ->> 'encounter_id'\r\n)\r\n\r\nselect\r\n fc.changelog_id,\r\n fc.logged_at at time zone '{{ var(\"timezone\") }}' as logged_at,\r\n fc.record_created_at at time zone '{{ var(\"timezone\") }}' as created_at,\r\n fc.record_updated_at at time zone '{{ var(\"timezone\") }}' as updated_at,\r\n fc.updated_by_user_id,\r\n fc.record_id as id,\r\n (fc.record_data ->> 'date')::timestamp as datetime,\r\n fc.record_data ->> 'batch' as batch,\r\n (fc.record_data ->> 'consent')::boolean as is_consented,\r\n fc.record_data ->> 'disease' as disease,\r\n fc.record_data ->> 'given_by' as given_by,\r\n (fc.record_data ->> 'given_elsewhere')::boolean as is_given_elsewhere,\r\n fc.record_data ->> 'circumstance_ids' as circumstance_ids,\r\n fc.record_data ->> 'recorder_id' as recorded_by_id,\r\n fc.record_data ->> 'encounter_id' as encounter_id,\r\n fc.record_data ->> 'location_id' as location_id,\r\n fc.record_data ->> 'department_id' as department_id,\r\n fc.record_data ->> 'vaccine_name' as vaccine_name,\r\n fc.record_data ->> 'vaccine_brand' as vaccine_brand,\r\n fc.record_data ->> 'injection_site' as injection_site,\r\n fc.record_data ->> 'consent_given_by' as consent_given_by,\r\n fc.record_data ->> 'scheduled_vaccine_id' as scheduled_vaccine_id,\r\n fc.record_data ->> 'status' as status,\r\n fc.record_data ->> 'reason' as reason,\r\n fc.record_data ->> 'not_given_reason_id' as not_given_reason_id\r\nfrom filtered_changes fc", "doc_blocks": ["doc.tamanu_source_dbt.table__administered_vaccines"], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}], "sources": [["logs__tamanu", "changes"], ["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.base_history_from_log"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.administered_vaccines", "model.tamanu_source_dbt.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\vaccine_administrations_change_logs.sql", "compiled": true, "compiled_code": "with filtered_changes as (\n select\n av.changelog_id,\n av.logged_at,\n av.updated_by_user_id,\n av.record_created_at,\n av.record_updated_at,\n av.record_id,\n av.record_data\n from (select \n id as changelog_id,\n logged_at,\n updated_by_user_id,\n record_created_at,\n record_updated_at,\n record_id,\n record_data\n from \"app\".\"logs\".\"changes\"\n where table_name = 'administered_vaccines'\n and record_id not in (\n select id::text\n from \"app\".\"public\".\"administered_vaccines\" t\n where t.deleted_at notnull\n )) av\n join \"app\".\"reporting\".\"encounters\" e on e.id = av.record_data ->> 'encounter_id'\n)\n\nselect\n fc.changelog_id,\n fc.logged_at at time zone 'Australia/Sydney' as logged_at,\n fc.record_created_at at time zone 'Australia/Sydney' as created_at,\n fc.record_updated_at at time zone 'Australia/Sydney' as updated_at,\n fc.updated_by_user_id,\n fc.record_id as id,\n (fc.record_data ->> 'date')::timestamp as datetime,\n fc.record_data ->> 'batch' as batch,\n (fc.record_data ->> 'consent')::boolean as is_consented,\n fc.record_data ->> 'disease' as disease,\n fc.record_data ->> 'given_by' as given_by,\n (fc.record_data ->> 'given_elsewhere')::boolean as is_given_elsewhere,\n fc.record_data ->> 'circumstance_ids' as circumstance_ids,\n fc.record_data ->> 'recorder_id' as recorded_by_id,\n fc.record_data ->> 'encounter_id' as encounter_id,\n fc.record_data ->> 'location_id' as location_id,\n fc.record_data ->> 'department_id' as department_id,\n fc.record_data ->> 'vaccine_name' as vaccine_name,\n fc.record_data ->> 'vaccine_brand' as vaccine_brand,\n fc.record_data ->> 'injection_site' as injection_site,\n fc.record_data ->> 'consent_given_by' as consent_given_by,\n fc.record_data ->> 'scheduled_vaccine_id' as scheduled_vaccine_id,\n fc.record_data ->> 'status' as status,\n fc.record_data ->> 'reason' as reason,\n fc.record_data ->> 'not_given_reason_id' as not_given_reason_id\nfrom filtered_changes fc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine_schedules": {"database": "app", "schema": "reporting", "name": "vaccine_schedules", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "bases\\vaccine_schedules.sql", "original_file_path": "models\\bases\\vaccine_schedules.sql", "unique_id": "model.tamanu_source_dbt.vaccine_schedules", "fqn": ["tamanu_source_dbt", "bases", "vaccine_schedules"], "alias": "vaccine_schedules", "checksum": {"name": "sha256", "checksum": "e936e32720e0849d7838101a275a76d9c5dfec4f21e8204f24e712fd49a41ce5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["base", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["base", "clinical"], "description": "A vaccine schedule listing all vaccines expected to be given to a child as part of a country wide Expanded Program of \r\nImmunisation can be incorporated into Tamanu to show each dose and due date on the front end of the system. \r\n\r\nFirst dose of a vaccine should use `weeks_from_birth_due` whilst subsequent doses should use \r\n`weeks_from_last_vaccination_due`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vaccine_schedules.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "category": {"name": "category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "vaccine_id": {"name": "vaccine_id", "description": "Use the vaccineId column to link the id column of the Reference Data sheet Drug to the vaccine schedule. Copy the exact \r\nid from the id column in the reference data sheet Drug and paste it in the vaccineId column in the Scheduled Vaccine \r\nsheet.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__vaccine_id"]}, "label": {"name": "label", "description": "Contents of the label column is what will be displayed on the front end of Tamanu \r\nunder fields labelled 'Vaccine'. This is where the vaccine name is listed. E.g. 'BCG'.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__label"]}, "dose_label": {"name": "dose_label", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "index": {"name": "index", "description": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__index"]}, "weeks_from_birth_due": {"name": "weeks_from_birth_due", "description": "This column is used to tell Tamanu how many weeks from the child's date of birth a vaccine is due. This will populate \r\nthe front end within the Vaccine schedule section in the column 'Due date'. For a vaccine to appear in the Vaccine \r\nschedule a dose must have a `weeksFromBirthDue` entered into the reference data. \r\n\r\nThis field should be used only for the first dose of the vaccine. Subsequent doses should use \r\n`weeks_from_last_vaccination_due`", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_birth_due"]}, "weeks_from_last_vaccination_due": {"name": "weeks_from_last_vaccination_due", "description": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given. The order of a vaccine dose is defined at the `index` field. \r\n\r\nThis field should not be used for the first dose but for subsequent doses. First dose should use `weeks_from_birth_due`", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_last_vaccination_due"]}, "sort_index": {"name": "sort_index", "description": "Sort index defaults to 0", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__sort_index"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in vaccine_schedules.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\bases\\vaccine_schedules.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "silver", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.2084012, "relation_name": "\"app\".\"reporting\".\"vaccine_schedules\"", "raw_code": "select\r\n id,\r\n category,\r\n vaccine_id,\r\n label,\r\n dose_label,\r\n index,\r\n weeks_from_birth_due,\r\n weeks_from_last_vaccination_due,\r\n sort_index,\r\n visibility_status\r\nfrom {{ source('tamanu', 'scheduled_vaccines') }}\r\nwhere deleted_at is null", "doc_blocks": ["doc.tamanu_source_dbt.table__scheduled_vaccines"], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\vaccine_schedules.sql", "compiled": true, "compiled_code": "select\n id,\n category,\n vaccine_id,\n label,\n dose_label,\n index,\n weeks_from_birth_due,\n weeks_from_last_vaccination_due,\n sort_index,\n visibility_status\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere deleted_at is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_admissions": {"database": "app", "schema": "reporting", "name": "ds__sensitive_admissions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_admissions.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_admissions.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_admissions", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_admissions"], "alias": "ds__sensitive_admissions", "checksum": {"name": "sha256", "checksum": "b0f9be4b79072d34b987ff3007fe009e9a67936172827c5153515b6f0aee81bd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility admissions", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the appointment.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "admitting_clinician_id": {"name": "admitting_clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "admitting_clinician": {"name": "admitting_clinician", "description": "Display identifier for the user who admitted the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "admission_datetime": {"name": "admission_datetime", "description": "Local date for the record on admission.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "admission_status": {"name": "admission_status", "description": "The current status of the admission.\r\n\r\n- `active` indicates the patient is currently admitted\r\n- `discharged` indicates the patient has been discharged", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__admission_status"]}, "discharge_datetime": {"name": "discharge_datetime", "description": "Local date for the record on discharge.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_ids": {"name": "department_ids", "description": "An array referencing the [department](#!/source/tamanu-source-dbt.tamanu.departments) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_ids"]}, "departments": {"name": "departments", "description": "A comma separated list of names of the departments the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__departments"]}, "department_datetimes": {"name": "department_datetimes", "description": "A comma separated list of dates and times of the departments associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "location_group_ids": {"name": "location_group_ids", "description": "An array referencing the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_ids"]}, "location_groups": {"name": "location_groups", "description": "A comma separated list of names of the location groups the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_groups"]}, "location_group_datetimes": {"name": "location_group_datetimes", "description": "A comma separated list of dates and times of the location groups associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "location_ids": {"name": "location_ids", "description": "An array referencing the [location](#!/source/tamanu-source-dbt.tamanu.locations) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_ids"]}, "locations": {"name": "locations", "description": "A comma separated list of names of the locations the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__locations"]}, "location_datetimes": {"name": "location_datetimes", "description": "A comma separated list of dates and times of the locations associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "primary_diagnoses": {"name": "primary_diagnoses", "description": "Full list of diagnoses that are primary for the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}, "secondary_diagnoses": {"name": "secondary_diagnoses", "description": "Full list of diagnoses that are secondary for the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_admissions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2084012, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_admissions\"", "raw_code": "{{ admissions_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.admissions_dataset"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_admissions.sql", "compiled": true, "compiled_code": "\n\nwith admission_encounters as (\n select\n e.id,\n e.patient_id,\n e.start_datetime,\n e.end_datetime,\n e.location_id,\n e.patient_billing_type_id,\n f.id as facility_id,\n f.name as facility_name\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\n where e.encounter_type = 'admission'\n and f.is_sensitive = True\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n u.display_name as clinician_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n -- Window functions for ordering and lag operations\n row_number() over (\n partition by eh.encounter_id, ('encounter_type' = any(eh.change_type))\n order by eh.datetime\n ) as encounter_type_change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from admission_encounters ae\n left join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = ae.id\n and eh.encounter_type = 'admission'\n and (eh.change_type is null or eh.change_type && array['encounter_type', 'examiner', 'department', 'location'])\n left join \"app\".\"reporting\".\"users\" u\n on u.id = eh.clinician_id\n left join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n left join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\n-- Clinician changes and admitting clinician logic\nclinician_data as (\n select\n encounter_id,\n bool_or('encounter_type' = any(change_type) and encounter_type_change_sequence = 1) as is_transfer,\n min(datetime) filter (where change_type is null or change_type && array['encounter_type', 'examiner']) as admission_datetime,\n array_agg(\n datetime\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_datetimes,\n array_agg(\n clinician_id\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_ids,\n array_agg(\n clinician_name\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_names\n from encounter_history_consolidated\n group by encounter_id\n),\n\n-- Admitting clinician determination\nadmitting_clinicians as (\n select\n encounter_id,\n admission_datetime,\n case\n when is_transfer and array_length(clinician_ids, 1) > 1\n then clinician_ids[2]\n else clinician_ids[1]\n end as admitting_clinician_id,\n case\n when is_transfer and array_length(clinician_names, 1) > 1\n then clinician_names[2]\n else clinician_names[1]\n end as admitting_clinician_name\n from clinician_data\n),\n\n-- Department changes aggregation\ndepartment_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) as departments\n from encounter_history_consolidated\n where change_type is null or change_type && array['encounter_type', 'department']\n group by encounter_id\n),\n\n-- Location changes aggregation\nlocation_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) as locations\n from encounter_history_consolidated\n where change_type is null or change_type && array['encounter_type', 'location']\n group by encounter_id\n),\n\n-- Location group changes (deduplicated in single pass)\nlocation_group_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) as location_groups\n from encounter_history_consolidated\n where (change_type is null or change_type && array['encounter_type', 'location'])\n and (location_group_id != prev_location_group_id or prev_location_group_id is null)\n group by encounter_id\n),\n\n-- Diagnoses aggregation\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n case when ed.is_primary\n then rd.name || ' (' || rd.code || ')'\n end,\n '; '\n order by ed.datetime\n ) as primary_diagnoses,\n string_agg(\n case when not ed.is_primary\n then rd.name || ' (' || rd.code || ')'\n end,\n '; '\n order by ed.datetime\n ) as secondary_diagnoses\n from admission_encounters ae\n inner join \"app\".\"reporting\".\"encounter_diagnoses\" ed\n on ed.encounter_id = ae.id\n inner join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = ed.diagnosis_id\n where ed.certainty not in ('disproven', 'error')\n group by ed.encounter_id\n),\n\n-- Patient and reference data\npatient_data as (\n select\n ae.id as encounter_id,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village_name,\n ae.patient_billing_type_id,\n bt.name as billing_type_name,\n ae.start_datetime,\n ae.end_datetime,\n ae.location_id,\n ae.facility_id,\n ae.facility_name\n from admission_encounters ae\n left join \"app\".\"reporting\".\"patients\" p\n on p.id = ae.patient_id\n left join \"app\".\"reporting\".\"reference_data\" village\n on village.id = p.village_id\n left join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = ae.patient_billing_type_id\n)\n\nselect\n pd.patient_id,\n pd.display_id,\n pd.first_name,\n pd.last_name,\n pd.date_of_birth,\n date_part('year', age(ac.admission_datetime, pd.date_of_birth)) as age,\n initcap(pd.sex::text) as sex,\n pd.village_id,\n pd.village_name as village,\n pd.patient_billing_type_id as billing_type_id,\n pd.billing_type_name as billing_type,\n ac.admitting_clinician_id,\n ac.admitting_clinician_name as admitting_clinician,\n ac.admission_datetime,\n case\n when pd.end_datetime is null then 'active'\n else 'discharged'\n end as admission_status,\n pd.end_datetime as discharge_datetime,\n pd.facility_id,\n pd.facility_name as facility,\n dc.department_ids,\n dc.departments,\n dc.department_datetimes,\n lgc.location_group_ids,\n lgc.location_groups,\n lgc.location_group_datetimes,\n lc.location_ids,\n lc.locations,\n lc.location_datetimes,\n ed.primary_diagnoses,\n ed.secondary_diagnoses\nfrom patient_data pd\nleft join admitting_clinicians ac\n on ac.encounter_id = pd.encounter_id\nleft join department_changes dc\n on dc.encounter_id = pd.encounter_id\nleft join location_changes lc\n on lc.encounter_id = pd.encounter_id\nleft join location_group_changes lgc\n on lgc.encounter_id = pd.encounter_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = pd.encounter_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_diagnoses": {"database": "app", "schema": "reporting", "name": "ds__sensitive_diagnoses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_diagnoses.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_diagnoses.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_diagnoses", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_diagnoses"], "alias": "ds__sensitive_diagnoses", "checksum": {"name": "sha256", "checksum": "4b81533bedec21d9e91cd557e411298d9289af04ddebfa030a9583f0a1b5605d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility diagnoses", "columns": {"encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__encounter_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id"]}, "diagnosis": {"name": "diagnosis", "description": "Full readable name of the diagnosis", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "diagnosis_datetime": {"name": "diagnosis_datetime", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "age": {"name": "age", "description": "Patient's age at the time of diagnosis.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "contact_number": {"name": "contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who diagnosed the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "certainty": {"name": "certainty", "description": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__certainty"]}, "is_primary": {"name": "is_primary", "description": "A boolean indicating if this is a primary diagnosis", "meta": {}, "data_type": "bool", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__is_primary"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_diagnoses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2084012, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_diagnoses\"", "raw_code": "{{ diagnoses_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.diagnoses_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_diagnoses.sql", "compiled": true, "compiled_code": "\n\nselect\n e.id as encounter_id,\n p.id as patient_id,\n diagnosis.id as diagnosis_id,\n diagnosis.name as diagnosis,\n ed.datetime as diagnosis_datetime,\n p.first_name,\n p.last_name,\n p.display_id,\n date_part('year', age(ed.datetime::date, p.date_of_birth)) as age,\n p.sex,\n coalesce(pad.primary_contact_number, pad.secondary_contact_number) as contact_number,\n village.id as village_id,\n village.name as village,\n clinician.id as clinician_id,\n clinician.display_name as clinician,\n d.id as department_id,\n d.name as department,\n l.id as location_id,\n l.name as location,\n f.id as facility_id,\n f.name as facility,\n initcap(ed.certainty) as certainty,\n case when ed.is_primary = true then 'Yes' else 'No' end as is_primary\nfrom \"app\".\"reporting\".\"encounter_diagnoses\" ed\njoin \"app\".\"reporting\".\"reference_data\" diagnosis on diagnosis.id = ed.diagnosis_id\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ed.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = e.clinician_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_encounters_emergency": {"database": "app", "schema": "reporting", "name": "ds__sensitive_encounters_emergency", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_encounters_emergency.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_encounters_emergency.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_encounters_emergency"], "alias": "ds__sensitive_encounters_emergency", "checksum": {"name": "sha256", "checksum": "538862355d9f352377664654562b81f233d36ee0dfa22a68b414ed83e33b6713"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Emergency encounters with triage information from sensitive facilities", "columns": {"triage_id": {"name": "triage_id", "description": "Tamanu internal identifier (generally a UUID) in triages.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "arrival_datetime": {"name": "arrival_datetime", "description": "When the patient arrived.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time"]}, "triage_datetime": {"name": "triage_datetime", "description": "When the patient was triaged.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time"]}, "closed_datetime": {"name": "closed_datetime", "description": "When the patient was processed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time"]}, "score": {"name": "score", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__encounter_id"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "arrival_mode": {"name": "arrival_mode", "description": "Full readable name of the triage arrival mode.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "chief_complaint": {"name": "chief_complaint", "description": "Full readable name of the chief complaint.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "secondary_complaint": {"name": "secondary_complaint", "description": "Full readable name of the secondary complaint.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__practitioner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who triaged the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) the triage is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility the triage is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_encounters_emergency.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2243633, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_encounters_emergency\"", "raw_code": "{{ encounters_emergency_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "triages", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounters_emergency_dataset"], "nodes": ["model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_encounters_emergency.sql", "compiled": true, "compiled_code": "\n\nselect\n t.id as triage_id,\n t.arrival_datetime,\n t.triage_datetime,\n t.closed_datetime,\n t.score,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village,\n e.id as encounter_id,\n e.encounter_type,\n arrival_mode.name as arrival_mode,\n chief_complaint.name as chief_complaint,\n secondary_complaint.name as secondary_complaint,\n clinician.display_name as clinician,\n t.clinician_id,\n f.id as facility_id,\n f.name as facility\nfrom \"app\".\"reporting\".\"triages\" t\njoin \"app\".\"reporting\".\"encounters\" e on e.id = t.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" arrival_mode on arrival_mode.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" chief_complaint on chief_complaint.id = t.chief_complaint_id\nleft join \"app\".\"reporting\".\"reference_data\" secondary_complaint on secondary_complaint.id = t.secondary_complaint_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = t.clinician_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_encounter_diets": {"database": "app", "schema": "reporting", "name": "ds__sensitive_encounter_diets", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_encounter_diets.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_encounter_diets.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_encounter_diets"], "alias": "ds__sensitive_encounter_diets", "checksum": {"name": "sha256", "checksum": "8a88b2033ddb0e472619517ea0192975fbebd85da4bdf21c5c0a2f6502b75edf"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility active encounters with their associated dietary requirements", "columns": {"encounter_id": {"name": "encounter_id", "description": "Tamanu internal identifier (generally a UUID) of encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "patient_name": {"name": "patient_name", "description": "Patient Name", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_name"]}, "age": {"name": "age", "description": "Patient's age at the time of the encounter, formatted with appropriate unit (days/weeks/months/years).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "diets": {"name": "diets", "description": "Full readable name of dietary requirements for the patient during this encounter, comma-separated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "allergies": {"name": "allergies", "description": "Full readable name of allergies for the patient during this encounter, comma-separated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_encounter_diets.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.2243633, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_encounter_diets\"", "raw_code": "{{ encounter_diets_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diets", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patient_allergies", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_diets_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patient_allergies", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_encounter_diets.sql", "compiled": true, "compiled_code": "\n\nwith diets as (\n select\n ed.encounter_id,\n string_agg(\n rd.name, ', '\n order by rd.name\n ) as diets\n from \"app\".\"reporting\".\"encounter_diets\" ed\n join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = ed.diet_id\n group by ed.encounter_id\n),\n\nallergies as (\n select\n pa.patient_id,\n string_agg(\n rd.name, ', '\n order by rd.name\n ) as allergies\n from \"app\".\"reporting\".\"patient_allergies\" pa\n join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = pa.allergy_id\n group by pa.patient_id\n)\n\nselect\n e.id as encounter_id,\n p.id as patient_id,\n p.display_id,\n concat(p.first_name, ' ', p.last_name) as patient_name,\n e.start_datetime,\n case\n when age(current_date, p.date_of_birth) < interval '8 days'\n then concat(extract(day from age(current_date, p.date_of_birth)), ' days')\n when age(current_date, p.date_of_birth) >= interval '8 days'\n and age(current_date, p.date_of_birth) < interval '1 month'\n then concat(extract(week from age(current_date, p.date_of_birth)), ' weeks')\n when age(current_date, p.date_of_birth) >= interval '1 month'\n and age(current_date, p.date_of_birth) < interval '2 years'\n then concat(extract(month from age(current_date, p.date_of_birth)), ' months')\n when age(current_date, p.date_of_birth) >= interval '2 years'\n then concat(extract(year from age(current_date, p.date_of_birth)), ' years')\n end as age,\n l.id as location_id,\n l.name as location,\n lg.id as location_group_id,\n lg.name as location_group,\n d.diets,\n a.allergies\nfrom \"app\".\"reporting\".\"encounters\" e\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join diets d\n on d.encounter_id = e.id\nleft join allergies a\n on a.patient_id = p.id\nwhere e.end_datetime is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions": {"database": "app", "schema": "reporting", "name": "ds__sensitive_encounter_prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_encounter_prescriptions.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_encounter_prescriptions.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_encounter_prescriptions"], "alias": "ds__sensitive_encounter_prescriptions", "checksum": {"name": "sha256", "checksum": "f2365cad836c4dc5f48bd2c4246b63777337ffd1fba3bdd877982bf50ee0b2ba"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility encounter prescriptions", "columns": {"encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__encounter_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__prescription_id"]}, "datetime": {"name": "datetime", "description": "Local date and time for the record in prescriptions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "is_selected_for_discharge": {"name": "is_selected_for_discharge", "description": "Whether the prescription is for when the patient is discharged.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "medication_code": {"name": "medication_code", "description": "Full readable name code of the prescribed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "medication": {"name": "medication", "description": "Full readable name name of the prescribed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "quantity": {"name": "quantity", "description": "Quantity of medicine to dispense.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__quantity"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_encounter_prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2243633, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_encounter_prescriptions\"", "raw_code": "{{ encounter_prescriptions_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_prescriptions_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_encounter_prescriptions.sql", "compiled": true, "compiled_code": "\n\nselect\n ep.encounter_id,\n ep.prescription_id,\n pr.datetime,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pr.datetime, p.date_of_birth)) as age,\n p.sex,\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\n vil.id as village_id,\n vil.name as village,\n l.facility_id,\n f.name as facility,\n ep.is_selected_for_discharge,\n pr.medication_id,\n m.code as medication_code,\n m.name as medication,\n pr.route,\n pr.quantity,\n pr.repeats,\n pr.is_ongoing,\n pr.is_prn,\n pr.is_variable_dose,\n pr.dose_amount,\n pr.units,\n pr.frequency,\n pr.is_discontinued,\n pr.discontinued_by_id,\n pr.discontinuing_reason,\n pr.discontinued_datetime\nfrom \"app\".\"reporting\".\"encounter_prescriptions\" ep\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ep.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"prescriptions\" pr on pr.id = ep.prescription_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f \n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\njoin \"app\".\"reporting\".\"reference_data\" m on m.id = pr.medication_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_imaging_requests": {"database": "app", "schema": "reporting", "name": "ds__sensitive_imaging_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_imaging_requests.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_imaging_requests.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_imaging_requests"], "alias": "ds__sensitive_imaging_requests", "checksum": {"name": "sha256", "checksum": "c88a9d97bb65276116d3727ca959d54928b296b3022b3373720c935b58cf9a70"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility imaging requests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of imaging.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "request_id": {"name": "request_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the imaging was requested.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date"]}, "supervising_clinician_id": {"name": "supervising_clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "supervising_clinician": {"name": "supervising_clinician", "description": "Display identifier for the user where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "requesting_clinician_id": {"name": "requesting_clinician_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "requesting_clinician": {"name": "requesting_clinician", "description": "Display identifier for the user who requested the imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "priority": {"name": "priority", "description": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__priority"]}, "imaging_type": {"name": "imaging_type", "description": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__imaging_type"]}, "imaging_area": {"name": "imaging_area", "description": "Full readable name of the imaging area.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "completed_datetime": {"name": "completed_datetime", "description": "When this result was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_at"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113).", "meta": {}, "data_type": "character varying(1024)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_imaging_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2243633, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_imaging_requests\"", "raw_code": "{{ imaging_requests_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "imaging_results", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.imaging_requests_dataset"], "nodes": ["model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_imaging_requests.sql", "compiled": true, "compiled_code": "\n\nwith results as (\n select\n imaging_request_id,\n min(datetime) as completed_datetime\n from \"app\".\"reporting\".\"imaging_results\"\n group by imaging_request_id\n),\n\nimaging_area_notes as (\n select\n record_id as imaging_request_id,\n string_agg(content, ', ' order by datetime) as imaging_area\n from \"app\".\"reporting\".\"notes\"\n where record_type = 'ImagingRequest'\n and note_type_id = 'notetype-areaToBeImaged'\n group by record_id\n),\n\nimaging_areas as (\n select\n ir.id as imaging_request_id,\n coalesce(\n string_agg(ia.name, ', ' order by ia.name),\n n.imaging_area\n ) as imaging_area\n from \"app\".\"reporting\".\"imaging_requests\" ir\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" ia on ia.id = ira.area_id\n left join imaging_area_notes n on n.imaging_request_id = ir.id\n group by ir.id, n.imaging_area\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(ir.datetime::date, p.date_of_birth)) as age,\n p.sex,\n v.id as village_id,\n v.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n ir.display_id as request_id,\n ir.datetime as requested_datetime,\n su.id as supervising_clinician_id,\n su.display_name as supervising_clinician,\n ru.id as requesting_clinician_id,\n ru.display_name as requesting_clinician,\n case\n when ir.priority = 'routine' then 'Routine'\n when ir.priority = 'urgent' then 'Urgent'\n when ir.priority = 'asap' then 'ASAP'\n when ir.priority = 'stat' then 'STAT'\n when ir.priority = 'today' then 'Today'\n else ir.priority\n end as priority,\n ir.imaging_type,\n areas.imaging_area,\n ir.status as status_id,\n case\n when ir.status = 'pending' then 'Pending'\n when ir.status = 'in_progress' then 'In progress'\n when ir.status = 'completed' then 'Completed'\n when ir.status = 'cancelled' then 'Cancelled'\n when ir.status = 'deleted' then 'Deleted'\n when ir.status = 'entered_in_error' then 'Entered in error'\n else 'Unknown'\n end as status,\n case\n when ir.status = 'completed' then irs.completed_datetime\n end as completed_datetime,\n case\n when ir.reason_for_cancellation = 'clinical' then 'Clinical reason'\n when ir.reason_for_cancellation = 'duplicate' then 'Duplicate'\n when ir.reason_for_cancellation = 'entered-in-error' then 'Entered in error'\n when ir.reason_for_cancellation = 'patient-discharged' then 'Patient discharged'\n when ir.reason_for_cancellation = 'patient-refused' then 'Patient refused'\n when ir.reason_for_cancellation = 'other' then 'Other'\n end as reason_for_cancellation\nfrom \"app\".\"reporting\".\"imaging_requests\" ir\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ir.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"users\" su on su.id = e.clinician_id\nleft join \"app\".\"reporting\".\"users\" ru on ru.id = ir.requested_by_id\nleft join imaging_areas areas on areas.imaging_request_id = ir.id\nleft join \"app\".\"reporting\".\"reference_data\" v on v.id = p.village_id\nleft join results irs on irs.imaging_request_id = ir.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_lab_requests": {"database": "app", "schema": "reporting", "name": "ds__sensitive_lab_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_lab_requests.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_lab_requests.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_lab_requests", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_lab_requests"], "alias": "ds__sensitive_lab_requests", "checksum": {"name": "sha256", "checksum": "f999b55c957b16b9c5a6bd0c9e95e1ee157221c32a837bc3ee7cbb91614453d0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive lab requests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "laboratory_id": {"name": "laboratory_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id"]}, "laboratory": {"name": "laboratory", "description": "Full readable name of the laboratory", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "request_id": {"name": "request_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "requested_by": {"name": "requested_by", "description": "Display identifier for the user who requested the lab test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "requesting_department_id": {"name": "requesting_department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) from which the lab test was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "requesting_department": {"name": "requesting_department", "description": "Full readable name of the department from which the lab test was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "priority_id": {"name": "priority_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_priority_id"]}, "priority": {"name": "priority", "description": "Full readable name of the lab test priority.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__category_id"]}, "category": {"name": "category", "description": "Full readable name of the lab test category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "lab_test_panel": {"name": "lab_test_panel", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "tests": {"name": "tests", "description": "Full list of tests", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__tests"]}, "collected_datetime": {"name": "collected_datetime", "description": "When the sample was collected.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time"]}, "collected_by_id": {"name": "collected_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__collected_by_id"]}, "collected_by": {"name": "collected_by", "description": "Display identifier for the user who collected the specimen.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "specimen_type_id": {"name": "specimen_type_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_type_id"]}, "specimen_type": {"name": "specimen_type", "description": "Used to indicate if the lab test type is sensitive and should be hidden accordingly.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__is_sensitive"]}, "site": {"name": "site", "description": "Full readable name of the specimen collection site.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "completed_datetime": {"name": "completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_lab_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2243633, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_lab_requests\"", "raw_code": "{{ lab_requests_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.lab_requests_dataset"], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_lab_requests.sql", "compiled": true, "compiled_code": "\n\nwith lab_test_data as (\n select\n lr.id as lab_request_id,\n string_agg(ltt.name, ', '\n order by ltt.name\n ) as tests,\n max(lt.completed_datetime) as completed_datetime\n from \"app\".\"reporting\".\"lab_requests\" lr\n join \"app\".\"reporting\".\"lab_tests\" lt on lt.lab_request_id = lr.id\n join \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = lt.lab_test_type_id\n where ltt.is_sensitive = True\n group by lr.id\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(lr.requested_datetime, p.date_of_birth)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n f.id as facility_id,\n f.name as facility,\n d.name as department,\n d.id as department_id,\n l.id as location_id,\n l.name as location,\n lg.id as location_group_id,\n lg.name as location_group,\n laboratory.id as laboratory_id,\n laboratory.name as laboratory,\n lr.display_id as request_id,\n case lr.status\n when 'reception_pending' then 'Reception pending'\n when 'results_pending' then 'Results pending'\n when 'to_be_verified' then 'To be verified'\n when 'verified' then 'Verified'\n when 'published' then 'Published'\n when 'cancelled' then 'Cancelled'\n when 'deleted' then 'Deleted'\n when 'sample-not-collected' then 'Sample not collected'\n when 'entered-in-error' then 'Entered in error'\n else lr.status\n end as status,\n lr.status as status_id,\n lr.requested_datetime,\n req_clinician.id as requested_by_id,\n req_clinician.display_name as requested_by,\n lr.department_id as requesting_department_id,\n req_department.name as requesting_department,\n lr.lab_test_priority_id as priority_id,\n priority.name as priority,\n category.id as lab_test_category_id,\n category.name as lab_test_category,\n ltp.name as lab_test_panel,\n lta.tests,\n lr.collected_datetime,\n lr.collected_by_id,\n collector.display_name as collected_by,\n lr.specimen_type_id,\n specimen.name as specimen_type,\n site.name as site,\n lta.completed_datetime,\n case lr.reason_for_cancellation\n when 'clinical' then 'Clinical reason'\n when 'duplicate' then 'Duplicate'\n when 'entered-in-error' then 'Entered in error'\n when 'patient-discharged' then 'Patient discharged'\n when 'patient-refused' then 'Patient refused'\n when 'other' then 'Other'\n else lr.reason_for_cancellation\n end as reason_for_cancellation\nfrom \"app\".\"reporting\".\"lab_requests\" lr\njoin lab_test_data lta on lta.lab_request_id = lr.id\njoin \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" laboratory on laboratory.id = lr.lab_test_laboratory_id\nleft join \"app\".\"reporting\".\"users\" req_clinician on req_clinician.id = lr.requested_by_id\nleft join \"app\".\"reporting\".\"departments\" req_department on req_department.id = lr.department_id\nleft join \"app\".\"reporting\".\"reference_data\" priority on priority.id = lr.lab_test_priority_id\nleft join \"app\".\"reporting\".\"reference_data\" category on category.id = lr.lab_test_category_id\nleft join \"app\".\"reporting\".\"users\" collector on collector.id = lr.collected_by_id\nleft join \"app\".\"reporting\".\"reference_data\" specimen on specimen.id = lr.specimen_type_id\nleft join \"app\".\"reporting\".\"reference_data\" site on site.id = lr.lab_sample_site_id\nleft join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ltpr.lab_test_panel_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_lab_tests": {"database": "app", "schema": "reporting", "name": "ds__sensitive_lab_tests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_lab_tests.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_lab_tests.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_lab_tests", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_lab_tests"], "alias": "ds__sensitive_lab_tests", "checksum": {"name": "sha256", "checksum": "ea7d9444ce7303e1b0e07544fe519a041a9248a4c5033d79feee2af08c4a3549"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive lab tests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "lab_request_id": {"name": "lab_request_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id"]}, "lab_test_panel": {"name": "lab_test_panel", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__category_id"]}, "lab_test_category": {"name": "lab_test_category", "description": "Full readable name of the lab test category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "requested_by": {"name": "requested_by", "description": "Display identifier for the user who requested the lab test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "lab_request_published_datetime": {"name": "lab_request_published_datetime", "description": "When this lab request's results were published.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__published_date"]}, "lab_test_date": {"name": "lab_test_date", "description": "Local date for the record in lab_tests.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "result": {"name": "result", "description": "The result of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__result"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_type_id"]}, "lab_test_type": {"name": "lab_test_type", "description": "Human-friendly name of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__name"]}, "lab_test_completed_datetime": {"name": "lab_test_completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_lab_tests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.242432, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_lab_tests\"", "raw_code": "{{ lab_tests_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.lab_tests_dataset"], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_lab_tests.sql", "compiled": true, "compiled_code": "\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(lr.requested_datetime, p.date_of_birth::date)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n req_dept.id as requesting_department_id,\n req_dept.name as requesting_department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n lr.display_id as lab_request_id,\n lr.status as status_id,\n case lr.status\n when 'reception_pending' then 'Reception pending'\n when 'results_pending' then 'Results pending'\n when 'to_be_verified' then 'To be verified'\n when 'verified' then 'Verified'\n when 'published' then 'Published'\n when 'cancelled' then 'Cancelled'\n when 'deleted' then 'Deleted'\n when 'sample-not-collected' then 'Sample not collected'\n when 'entered-in-error' then 'Entered in error'\n else lr.status\n end as status,\n ltp.id as lab_test_panel_id,\n ltp.name as lab_test_panel,\n category.id as lab_test_category_id,\n category.name as lab_test_category,\n lr.requested_datetime,\n requester.id as requested_by_id,\n requester.display_name as requested_by,\n lr.published_datetime as lab_request_published_datetime,\n lt.date as lab_test_date,\n lt.result,\n lt.verification,\n ltt.id as lab_test_type_id,\n ltt.name as lab_test_type,\n lt.completed_datetime as lab_test_completed_datetime\nfrom \"app\".\"reporting\".\"lab_requests\" lr\njoin \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"departments\" req_dept on req_dept.id = lr.department_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nleft join \"app\".\"reporting\".\"users\" requester on requester.id = lr.requested_by_id\nleft join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr on ltpr.id = lr.lab_test_panel_request_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ltpr.lab_test_panel_id\nleft join \"app\".\"reporting\".\"reference_data\" category on category.id = lr.lab_test_category_id\njoin \"app\".\"reporting\".\"lab_tests\" lt on lt.lab_request_id = lr.id\njoin \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = lt.lab_test_type_id\nwhere ltt.is_sensitive = True\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_location_bookings": {"database": "app", "schema": "reporting", "name": "ds__sensitive_location_bookings", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_location_bookings.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_location_bookings.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_location_bookings", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_location_bookings"], "alias": "ds__sensitive_location_bookings", "checksum": {"name": "sha256", "checksum": "13d5c0cbf8459c6f8123bff9bce08a28ae460deedcd2db65ba3165a42addc9b5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility location bookings", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the booking.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "booking_start_datetime": {"name": "booking_start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "booking_end_datetime": {"name": "booking_end_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "booking_type_id": {"name": "booking_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "booking_type": {"name": "booking_type", "description": "Full readable name of the booking type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "booking_status": {"name": "booking_status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who booked the location.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_location_bookings.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2461653, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_location_bookings\"", "raw_code": "{{ location_bookings_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "location_bookings", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.location_bookings_dataset"], "nodes": ["model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_location_bookings.sql", "compiled": true, "compiled_code": "\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(a.start_datetime::date, p.date_of_birth)) as age,\n p.sex,\n vil.id as village_id,\n vil.name as village,\n billing.id as billing_type_id,\n billing.name as billing_type,\n a.start_datetime as booking_start_datetime,\n a.end_datetime as booking_end_datetime,\n a.status as booking_status,\n u.id as clinician_id,\n u.display_name as clinician,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n a.booking_type_id,\n bt.name as booking_type\nfrom \"app\".\"reporting\".\"location_bookings\" a\njoin \"app\".\"reporting\".\"patients\" p on p.id = a.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = a.clinician_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = a.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pd.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" bt on bt.id = a.booking_type_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_medication_dispenses": {"database": "app", "schema": "reporting", "name": "ds__sensitive_medication_dispenses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_medication_dispenses.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_medication_dispenses.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_medication_dispenses", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_medication_dispenses"], "alias": "ds__sensitive_medication_dispenses", "checksum": {"name": "sha256", "checksum": "98703ea5eeee9b576ce68a53fd72b8171044ef32798a7414ba938357b347110a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility medication dispense records", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_dispenses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "quantity": {"name": "quantity", "description": "The quantity of medication units dispensed to the patient in each dispensing.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__quantity"]}, "dispensed_at": {"name": "dispensed_at", "description": "The timestamp indicating when the medication was physically dispensed to the patient.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_at"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the medication was dispensed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the medication was dispensed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "medication_code": {"name": "medication_code", "description": "Full readable name code of the dispensed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "medication": {"name": "medication", "description": "Full readable name name of the dispensed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_medication_dispenses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.2482307, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_medication_dispenses\"", "raw_code": "{{ medication_dispenses_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "medication_dispenses", "package": null, "version": null}, {"name": "pharmacy_order_prescriptions", "package": null, "version": null}, {"name": "pharmacy_orders", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.medication_dispenses_dataset"], "nodes": ["model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_medication_dispenses.sql", "compiled": true, "compiled_code": "\n\nselect\n md.id,\n md.quantity,\n md.dispensed_at,\n po.facility_id,\n f.name as facility,\n pr.medication_id,\n m.code as medication_code,\n m.name as medication\nfrom \"app\".\"reporting\".\"medication_dispenses\" md\njoin \"app\".\"reporting\".\"pharmacy_order_prescriptions\" pop\n on pop.id = md.pharmacy_order_prescription_id\njoin \"app\".\"reporting\".\"pharmacy_orders\" po\n on po.id = pop.pharmacy_order_id\n-- prescription_id is not null on all pharmacy_order_prescriptions rows (enforced by source not_null test).\n-- ongoing_prescription_id is the nullable supplementary reference and is not used for the medication lookup\njoin \"app\".\"reporting\".\"prescriptions\" pr\n on pr.id = pop.prescription_id\njoin \"app\".\"reporting\".\"reference_data\" m\n on m.id = pr.medication_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = po.facility_id\n and f.is_sensitive = True\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments": {"database": "app", "schema": "reporting", "name": "ds__sensitive_outpatient_appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_outpatient_appointments.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_outpatient_appointments"], "alias": "ds__sensitive_outpatient_appointments", "checksum": {"name": "sha256", "checksum": "180009b1081dc495f6748dbd3899fcef44a7593ff95dff557e6698eb2fddacbb"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility appointments", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the appointment.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "contact_number": {"name": "contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. where available otherwise Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number", "doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "appointment_start_datetime": {"name": "appointment_start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "appointment_end_datetime": {"name": "appointment_end_datetime", "description": "When the appointment ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__appointment_type_id"]}, "appointment_type": {"name": "appointment_type", "description": "Full readable name of the appointment type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "appointment_status": {"name": "appointment_status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who booked the appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "priority": {"name": "priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "schedule_id": {"name": "schedule_id", "description": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__schedule_id"]}, "until_date": {"name": "until_date", "description": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__until_date"]}, "interval": {"name": "interval", "description": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\"", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__interval"]}, "frequency": {"name": "frequency", "description": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__frequency"]}, "nth_weekday": {"name": "nth_weekday", "description": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__nth_weekday"]}, "days_of_week": {"name": "days_of_week", "description": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__days_of_week"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Display identifier for the user who created the appointment, sourced from the earliest change log entry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "created_by": {"name": "created_by", "description": "Display name of the user who created the appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.251327, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_outpatient_appointments\"", "raw_code": "{{ outpatient_appointments_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments_change_logs", "package": null, "version": null}, {"name": "outpatient_appointments", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.outpatient_appointments_dataset"], "nodes": ["model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments.sql", "compiled": true, "compiled_code": "\n\nwith appointment_creators as (\n select\n appointment_id,\n created_by_user_id\n from \"app\".\"reporting\".\"outpatient_appointments_change_logs\"\n where change_sequence = 1\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(a.start_datetime, p.date_of_birth)) as age,\n p.sex,\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\n vil.id as village_id,\n vil.name as village,\n billing.id as billing_type_id,\n billing.name as billing_type,\n a.start_datetime as appointment_start_datetime,\n a.end_datetime as appointment_end_datetime,\n a.appointment_type_id,\n apt.name as appointment_type,\n a.status as appointment_status,\n u.id as clinician_id,\n u.display_name as clinician,\n lg.id as location_group_id,\n lg.name as location_group,\n a.priority,\n a.schedule_id,\n a.until_date,\n a.interval,\n a.days_of_week,\n a.frequency,\n a.nth_weekday,\n ac.created_by_user_id,\n creator.display_name as created_by\nfrom \"app\".\"reporting\".\"outpatient_appointments\" a\njoin \"app\".\"reporting\".\"patients\" p on p.id = a.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = a.clinician_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = a.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = lg.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pd.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" apt on apt.id = a.appointment_type_id\nleft join appointment_creators ac on ac.appointment_id = a.id\nleft join \"app\".\"reporting\".\"users\" creator on creator.id = ac.created_by_user_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit": {"database": "app", "schema": "reporting", "name": "ds__sensitive_outpatient_appointments_audit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_outpatient_appointments_audit.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments_audit.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_outpatient_appointments_audit"], "alias": "ds__sensitive_outpatient_appointments_audit", "checksum": {"name": "sha256", "checksum": "a0b6536dfbe25618cf8647940c5dafcd411e311adff58db53c5ea088ef8cf539"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "dataset", "clinical", "audit", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "dataset", "clinical", "audit"], "description": "Sensitive facility dataset for outpatient appointment audit report. Tracks all modifications and cancellations to appointments at sensitive facilities, showing both current and previous values. Excludes status-only changes unless the status changes to 'Cancelled'.\n", "columns": {"change_id": {"name": "change_id", "description": "Unique identifier for the change log entry (UUID from logs.changes).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id"]}, "appointment_id": {"name": "appointment_id", "description": "Reference to the [appointment](#!/model/model.tamanu_source_dbt.outpatient_appointments) that was modified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id"]}, "change_number": {"name": "change_number", "description": "Sequential change number for this appointment where initial creation is excluded. 1 = first modification, 2 = second modification, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__change_number"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/model/model.tamanu_source_dbt.patients) associated with the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "appointment_start_datetime": {"name": "appointment_start_datetime", "description": "Current appointment start date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime"]}, "appointment_end_datetime": {"name": "appointment_end_datetime", "description": "Current appointment end date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime"]}, "appointment_type": {"name": "appointment_type", "description": "Current Actual data for appointment type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Current [appointment type](#!/model/model.tamanu_source_dbt.reference_data) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id"]}, "clinician": {"name": "clinician", "description": "Current The human readable display name for the user. for clinician", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "clinician_id": {"name": "clinician_id", "description": "Current [clinician](#!/model/model.tamanu_source_dbt.users) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id"]}, "location_group": {"name": "location_group", "description": "Current Full readable name for location group for area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "location_group_id": {"name": "location_group_id", "description": "Current [location group](#!/model/model.tamanu_source_dbt.location_groups)/area ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id"]}, "priority": {"name": "priority", "description": "Current Current priority status (after the change). Boolean indicating if the appointment is high priority. formatted as Yes/No", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority"]}, "schedule_id": {"name": "schedule_id", "description": "Current recurring schedule ID (after the change). References appointment_schedules table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id"]}, "is_repeating": {"name": "is_repeating", "description": "Whether the appointment is part of a repeating schedule. Values: Yes (has schedule_id), No (no schedule_id).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_repeating"]}, "created_by": {"name": "created_by", "description": "The human readable display name for the user. who created the appointment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who originally created the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id"]}, "modified_by": {"name": "modified_by", "description": "The human readable display name for the user. who modified the appointment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "modified_by_user_id": {"name": "modified_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who made the modification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id"]}, "modified_datetime": {"name": "modified_datetime", "description": "Timestamp when the change was logged (from logs.changes.logged_at).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime"]}, "is_cancelled": {"name": "is_cancelled", "description": "Whether the appointment status is 'Cancelled'. Values: Yes/No.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_cancelled"]}, "prev_start_datetime": {"name": "prev_start_datetime", "description": "Previous appointment start date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime"]}, "prev_end_datetime": {"name": "prev_end_datetime", "description": "Previous appointment end date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime"]}, "prev_appointment_type": {"name": "prev_appointment_type", "description": "Previous Actual data for appointment type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "prev_appointment_type_id": {"name": "prev_appointment_type_id", "description": "Previous appointment type ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id"]}, "prev_clinician": {"name": "prev_clinician", "description": "Previous The human readable display name for the user. for clinician", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "prev_clinician_id": {"name": "prev_clinician_id", "description": "Previous clinician ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id"]}, "prev_location_group": {"name": "prev_location_group", "description": "Previous Full readable name for location group for area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "prev_location_group_id": {"name": "prev_location_group_id", "description": "Previous location group/area ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id"]}, "prev_priority": {"name": "prev_priority", "description": "Previous Previous priority status (before the change). Null for creation events (change_sequence = 1). formatted as Yes/No", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority"]}, "facility_id": {"name": "facility_id", "description": "Tamanu internal identifier (generally a UUID) in facilities (for filtering)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "facility": {"name": "facility", "description": "Full readable name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments_audit.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["dataset", "clinical", "audit", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.252359, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_outpatient_appointments_audit\"", "raw_code": "{{ outpatient_appointments_audit_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments_change_logs", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [["tamanu", "appointment_schedules"], ["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.outpatient_appointments_audit_dataset"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_outpatient_appointments_audit.sql", "compiled": true, "compiled_code": "\n\n-- Outpatient Appointments Audit Dataset\n-- This dataset tracks changes/modifications to outpatient appointments\n-- Each row represents a modification event (excludes initial creation)\n--\n-- Included changes:\n-- - Status changed to 'Cancelled' (individual cancellations only)\n-- - Changes to: start/end datetime, clinician, location group, appointment type, priority\n--\n-- Excluded changes:\n-- - Initial appointment creation (change_sequence = 1)\n-- - Status-only changes (unless changing to 'Cancelled')\n-- - Appointments automatically cancelled when their schedule was cancelled\n-- (i.e., bulk cancellations via \"cancel this and all future appointments\")\n--\n-- change_number: starts from 1 for the first modification, increments for subsequent changes\n--\n-- Note: schedule_id never changes on existing appointments in Tamanu.\n-- When a schedule is modified, old appointments are cancelled and new ones are created.\n\nwith change_evaluation as (\n select\n cl.*,\n -- Determine if this change has meaningful field modifications\n case\n -- Status changed to Cancelled\n when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true\n -- Any non-status fields changed\n when (\n cl.prev_start_datetime is distinct from cl.start_datetime\n or cl.prev_end_datetime is distinct from cl.end_datetime\n or cl.prev_clinician_id is distinct from cl.clinician_id\n or cl.prev_location_group_id is distinct from cl.location_group_id\n or cl.prev_appointment_type_id is distinct from cl.appointment_type_id\n or cl.prev_is_high_priority is distinct from cl.is_high_priority\n ) then true\n else false\n end as is_meaningful_change\n from \"app\".\"reporting\".\"outpatient_appointments_change_logs\" cl\n left join \"app\".\"public\".\"appointment_schedules\" s on s.id = cl.schedule_id\n where\n -- Exclude appointments that were automatically cancelled when the schedule was cancelled\n -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule)\n not (\n cl.status = 'Cancelled'\n and s.cancelled_at_date is not null\n and cl.start_datetime::date > s.cancelled_at_date::date\n )\n),\n\nnumbered_changes as (\n select\n ce.*,\n -- Assign change number: starts from 1 for first modification\n row_number() over (\n partition by ce.appointment_id\n order by ce.modified_datetime\n ) as change_number\n from change_evaluation ce\n where ce.is_meaningful_change = true\n and ce.change_sequence > 1 -- Exclude initial creation\n)\n\nselect\n fc.change_id,\n fc.appointment_id,\n fc.change_number,\n -- Patient details\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n -- Current appointment details\n fc.start_datetime as appointment_start_datetime,\n fc.end_datetime as appointment_end_datetime,\n apt.name as appointment_type,\n fc.appointment_type_id,\n clinician.display_name as clinician,\n fc.clinician_id,\n lg.name as location_group,\n fc.location_group_id,\n case when fc.is_high_priority then 'Yes' else 'No' end as priority,\n fc.schedule_id,\n case\n when fc.schedule_id is not null then 'Yes'\n else 'No'\n end as is_repeating,\n -- Modification details\n creator.display_name as created_by,\n fc.created_by_user_id,\n modifier.display_name as modified_by,\n fc.modified_by_user_id,\n fc.modified_datetime,\n case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled,\n -- Previous appointment details (only shown if different from current)\n case\n when fc.prev_start_datetime is distinct from fc.start_datetime\n then fc.prev_start_datetime\n end as prev_start_datetime,\n case\n when fc.prev_end_datetime is distinct from fc.end_datetime\n then fc.prev_end_datetime\n end as prev_end_datetime,\n case\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\n then prev_apt.name\n end as prev_appointment_type,\n case\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\n then fc.prev_appointment_type_id\n end as prev_appointment_type_id,\n case\n when fc.prev_clinician_id is distinct from fc.clinician_id\n then prev_clinician.display_name\n end as prev_clinician,\n case\n when fc.prev_clinician_id is distinct from fc.clinician_id\n then fc.prev_clinician_id\n end as prev_clinician_id,\n case\n when fc.prev_location_group_id is distinct from fc.location_group_id\n then prev_lg.name\n end as prev_location_group,\n case\n when fc.prev_location_group_id is distinct from fc.location_group_id\n then fc.prev_location_group_id\n end as prev_location_group_id,\n case\n when fc.prev_is_high_priority is not null\n and fc.prev_is_high_priority is distinct from fc.is_high_priority\n then case when fc.prev_is_high_priority then 'Yes' else 'No' end\n end as prev_priority,\n -- Facility details for filtering\n f.id as facility_id,\n f.name as facility\nfrom numbered_changes fc\njoin \"app\".\"reporting\".\"patients\" p on p.id = fc.patient_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = fc.clinician_id\nleft join \"app\".\"reporting\".\"users\" prev_clinician on prev_clinician.id = fc.prev_clinician_id\nleft join \"app\".\"reporting\".\"users\" creator on creator.id = fc.created_by_user_id\nleft join \"app\".\"reporting\".\"users\" modifier on modifier.id = fc.modified_by_user_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = fc.location_group_id\nleft join \"app\".\"reporting\".\"location_groups\" prev_lg on prev_lg.id = fc.prev_location_group_id\nleft join \"app\".\"reporting\".\"reference_data\" apt on apt.id = fc.appointment_type_id\nleft join \"app\".\"reporting\".\"reference_data\" prev_apt on prev_apt.id = fc.prev_appointment_type_id\nleft join \"app\".\"public\".\"appointment_schedules\" s on s.id = fc.schedule_id\n-- Join to facility for filtering by sensitivity\njoin \"app\".\"reporting\".\"facilities\" f on f.id = lg.facility_id\n and f.is_sensitive = True\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_procedures": {"database": "app", "schema": "reporting", "name": "ds__sensitive_procedures", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_procedures.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_procedures.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_procedures", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_procedures"], "alias": "ds__sensitive_procedures", "checksum": {"name": "sha256", "checksum": "09ac899a55c011b9b189bd7651cbe3953eb493f9f114bfdf100b7aaaade23fa8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility procedures", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the procedure.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "nationality": {"name": "nationality", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "encounter_facility_id": {"name": "encounter_facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "encounter_facility": {"name": "encounter_facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "encounter_department_id": {"name": "encounter_department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "encounter_department": {"name": "encounter_department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "encounter_start_datetime": {"name": "encounter_start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "encounter_end_datetime": {"name": "encounter_end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "procedure_facility_id": {"name": "procedure_facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "procedure_facility": {"name": "procedure_facility", "description": "Full readable name of the facility where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "procedure_area_id": {"name": "procedure_area_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "procedure_area": {"name": "procedure_area", "description": "Full readable name of the location group where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "procedure_location_id": {"name": "procedure_location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "procedure_location": {"name": "procedure_location", "description": "Full readable name of the location where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__procedure_type_id"]}, "procedure_type": {"name": "procedure_type", "description": "Full readable name of the procedure type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "procedure_start_time": {"name": "procedure_start_time", "description": "When the procedure started.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time"]}, "procedure_end_time": {"name": "procedure_end_time", "description": "When the procedure ended, if it's completed.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time"]}, "procedure_duration": {"name": "procedure_duration", "description": "Duration of the procedure.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__duration"]}, "procedure_clinician_id": {"name": "procedure_clinician_id", "description": "Reference to the [physician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__physician_id"]}, "procedure_clinician": {"name": "procedure_clinician", "description": "Display identifier for the user who performed the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "procedure_anaesthetist_id": {"name": "procedure_anaesthetist_id", "description": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetist_id"]}, "procedure_anaesthetist": {"name": "procedure_anaesthetist", "description": "Display identifier for the user who administered anaesthesia.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "procedure_assistant_anaesthetist_id": {"name": "procedure_assistant_anaesthetist_id", "description": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id"]}, "procedure_assistant_anaesthetist": {"name": "procedure_assistant_anaesthetist", "description": "Display identifier for the user who assisted the anaesthetist in the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "is_completed": {"name": "is_completed", "description": "Whether the procedure has completed.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed"]}, "time_in": {"name": "time_in", "description": "The time when the patient entered the procedure room or when the procedure setup began.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_in"]}, "time_out": {"name": "time_out", "description": "The time when the patient left the procedure room or when the procedure cleanup was completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_out"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_procedures.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2558825, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_procedures\"", "raw_code": "{{ procedures_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "procedures", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.procedures_dataset"], "nodes": ["model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_procedures.sql", "compiled": true, "compiled_code": "\n\nwith filtered_procedure as (\n select\n pc.*,\n eh.department_id,\n eh.encounter_type,\n row_number() over (\n partition by pc.id\n order by eh.datetime desc\n ) as encounter_history_record\n from \"app\".\"reporting\".\"procedures\" pc\n left join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = pc.encounter_id\n and eh.datetime::date <= pc.date\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pc.date, p.date_of_birth)) as age,\n p.sex,\n nationality.name as nationality,\n encounter_facility.id as encounter_facility_id,\n encounter_facility.name as encounter_facility,\n encounter_department.id as encounter_department_id,\n encounter_department.name as encounter_department,\n case\n when coalesce(pc.encounter_type, e.encounter_type) = 'admission' then 'Hospital Admission'\n when coalesce(pc.encounter_type, e.encounter_type) = 'clinic' then 'Clinic'\n when coalesce(pc.encounter_type, e.encounter_type) in ('triage', 'observation', 'emergency') then 'Triage'\n end as encounter_type,\n e.start_datetime as encounter_start_datetime,\n e.end_datetime as encounter_end_datetime,\n procedure_facility.id as procedure_facility_id,\n procedure_facility.name as procedure_facility,\n procedure_area.id as procedure_area_id,\n procedure_area.name as procedure_area,\n procedure_location.id as procedure_location_id,\n procedure_location.name as procedure_location,\n procedure_type.id as procedure_type_id,\n procedure_type.name as procedure_type,\n pc.date as procedure_date,\n pc.start_time as procedure_start_time,\n pc.end_time as procedure_end_time,\n case\n when pc.end_time is not null and pc.start_time is not null then\n concat(\n lpad((\n case\n when pc.end_time < pc.start_time\n then\n (24 + extract(hour from pc.end_time) - extract(hour from pc.start_time))\n else\n extract(hour from (pc.end_time - pc.start_time))\n end\n )::text, 2, '0'), ':',\n lpad((\n case\n when pc.end_time < pc.start_time\n then\n (extract(minute from pc.end_time) - extract(minute from pc.start_time))\n else\n extract(minute from (pc.end_time - pc.start_time))\n end\n )::text, 2, '0')\n )\n end as procedure_duration,\n clinician.id as procedure_clinician_id,\n clinician.display_name as procedure_clinician,\n anaesthetist.id as procedure_anaesthetist_id,\n anaesthetist.display_name as procedure_anaesthetist,\n assistant_anaesthetist.id as procedure_assistant_anaesthetist_id,\n assistant_anaesthetist.display_name as procedure_assistant_anaesthetist,\n case\n when pc.is_completed then 'Y' else 'N'\n end as is_completed,\n pc.time_in,\n pc.time_out\nfrom filtered_procedure pc\njoin \"app\".\"reporting\".\"encounters\" e on e.id = pc.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"reference_data\" procedure_type on procedure_type.id = pc.procedure_type_id\njoin \"app\".\"reporting\".\"locations\" procedure_location\n on procedure_location.id = pc.location_id\nleft join \"app\".\"reporting\".\"location_groups\" procedure_area\n on procedure_area.id = procedure_location.location_group_id\njoin \"app\".\"reporting\".\"facilities\" procedure_facility\n on procedure_facility.id = procedure_location.facility_id\n and procedure_facility.is_sensitive = True\njoin \"app\".\"reporting\".\"locations\" encounter_location\n on encounter_location.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" encounter_facility\n on encounter_facility.id = encounter_location.facility_id\n and encounter_facility.is_sensitive = True\njoin \"app\".\"reporting\".\"departments\" encounter_department\n on encounter_department.id = coalesce(pc.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" nationality on nationality.id = pd.nationality_id\nleft join \"app\".\"reporting\".\"users\" assistant_anaesthetist on assistant_anaesthetist.id = pc.assistant_anaesthetist_id\nleft join \"app\".\"reporting\".\"users\" anaesthetist on anaesthetist.id = pc.anaesthetist_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = pc.clinician_id\nwhere pc.encounter_history_record = 1\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_referrals": {"database": "app", "schema": "reporting", "name": "ds__sensitive_referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_referrals.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_referrals.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_referrals", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_referrals"], "alias": "ds__sensitive_referrals", "checksum": {"name": "sha256", "checksum": "f3e8f4779a07aa7c1285fa3b1ae8039c614863182c60658cf12b85db141a9793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility referrals", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "diagnoses": {"name": "diagnoses", "description": "Full list of diagnoses at the time of referral.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}, "referral_type": {"name": "referral_type", "description": "Full readable name for the referral.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "referring_doctor_id": {"name": "referring_doctor_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "referring_doctor_name": {"name": "referring_doctor_name", "description": "Display identifier for the user who referred the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "referral_datetime": {"name": "referral_datetime", "description": "Local date for the record in encounter_diagnoses.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "status": {"name": "status", "description": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__status"]}, "department": {"name": "department", "description": "Full readable name of the department from which the patient was referred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_referrals.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2558825, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_referrals\"", "raw_code": "{{ referrals_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "referrals", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "survey_responses", "package": null, "version": null}, {"name": "surveys", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.referrals_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.survey_responses", "model.tamanu_source_dbt.surveys", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_referrals.sql", "compiled": true, "compiled_code": "\n\nwith diagnoses as (\n select\n ed.encounter_id,\n string_agg(concat(d.name), '; ') as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n left join \"app\".\"reporting\".\"reference_data\" d on d.id = ed.diagnosis_id\n group by ed.encounter_id\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.village_id,\n ed.diagnoses,\n s.name as referral_type,\n u.id as referring_doctor_id,\n u.display_name as referring_doctor_name,\n sr.end_datetime as referral_datetime,\n rf.status,\n d.name as department\nfrom \"app\".\"reporting\".\"referrals\" rf\njoin \"app\".\"reporting\".\"encounters\" e on e.id = rf.initiating_encounter_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\njoin \"app\".\"reporting\".\"survey_responses\" sr on sr.id = rf.survey_response_id\njoin \"app\".\"reporting\".\"surveys\" s on s.id = sr.survey_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"users\" u on u.id = e.clinician_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join diagnoses ed on ed.encounter_id = rf.initiating_encounter_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_user_audit": {"database": "app", "schema": "reporting", "name": "ds__sensitive_user_audit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_user_audit.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_user_audit.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_user_audit", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_user_audit"], "alias": "ds__sensitive_user_audit", "checksum": {"name": "sha256", "checksum": "4d44b6d0982ec9776d9ae2d29729a6712899b7f83c7ecb5036499ac49a49b370"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility user audit", "columns": {"user_id": {"name": "user_id", "description": "Tamanu internal identifier (generally a UUID) of the user.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_name": {"name": "user_name", "description": "The human readable display name for the user.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "user_role": {"name": "user_role", "description": "Display identifier for the user role.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "patient_category": {"name": "patient_category", "description": "Full readable name of the patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "triage_category": {"name": "triage_category", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "encounter_start_datetime": {"name": "encounter_start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "encounter_end_datetime": {"name": "encounter_end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "first_note_datetime": {"name": "first_note_datetime", "description": "Local date and time for the record of the first note in the encounter.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "last_note_datetime": {"name": "last_note_datetime", "description": "Local date and time for the record of the last note in the encounter.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "is_discharged": {"name": "is_discharged", "description": "Whether the patient has been discharged from the encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "non_discharge_by_clinicians": {"name": "non_discharge_by_clinicians", "description": "Clinician who last wrote a note if the patient was automatically discharged.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_user_audit.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.2558825, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_user_audit\"", "raw_code": "{{ user_audit_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "notes", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "roles", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.user_audit_dataset"], "nodes": ["model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.roles", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_user_audit.sql", "compiled": true, "compiled_code": "\n\nwith non_system_notes as (\n select distinct on (n.record_id)\n n.record_id,\n first_value(n.datetime) over w as first_note_datetime,\n last_value(n.datetime) over w as last_note_datetime,\n last_value(concat_ws(' on behalf of ', author.display_name, on_behalf.display_name)) over w as last_clinician\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"users\" author on author.id = n.authored_by_id\n left join \"app\".\"reporting\".\"users\" on_behalf on on_behalf.id = n.on_behalf_of_id\n where n.note_type_id != 'notetype-system'\n window w as (\n partition by n.record_id\n order by n.datetime\n rows between unbounded preceding and unbounded following\n )\n)\n\nselect\n u.id as user_id,\n u.display_name as user_name,\n r.name as user_role,\n p.id as patient_id,\n p.display_id,\n bt.name as patient_category,\n t.score as triage_category,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n e.start_datetime as encounter_start_datetime,\n e.end_datetime as encounter_end_datetime,\n n.first_note_datetime,\n n.last_note_datetime,\n case when e.end_datetime isnull then 'Patient not discharged'\n else 'Patient discharged'\n end as is_discharged,\n case when ds.note like 'Automatically discharged%' then n.last_clinician\n end as non_discharge_by_clinicians\nfrom \"app\".\"reporting\".\"encounters\" e\nleft join \"app\".\"reporting\".\"users\" u on u.id = e.clinician_id\nleft join \"app\".\"reporting\".\"roles\" r on r.id = u.role\nleft join \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = coalesce(e.patient_billing_type_id, pad.patient_billing_type_id)\nleft join \"app\".\"reporting\".\"triages\" t on t.encounter_id = e.id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"discharges\" ds on ds.encounter_id = e.id\nleft join non_system_notes n on n.record_id = e.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__sensitive_vaccinations": {"database": "app", "schema": "reporting", "name": "ds__sensitive_vaccinations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\sensitive\\ds__sensitive_vaccinations.sql", "original_file_path": "models\\datasets\\sensitive\\ds__sensitive_vaccinations.sql", "unique_id": "model.tamanu_source_dbt.ds__sensitive_vaccinations", "fqn": ["tamanu_source_dbt", "datasets", "sensitive", "ds__sensitive_vaccinations"], "alias": "ds__sensitive_vaccinations", "checksum": {"name": "sha256", "checksum": "79c5072bf23c6f4f059193c7d080eab7c0223b2b7ac97602fd2789d0b7f55d34"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "restricted", "clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "restricted", "clinical"], "description": "Sensitive facility vaccinations", "columns": {"display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of vaccination.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "vaccination_date": {"name": "vaccination_date", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "vaccine_status": {"name": "vaccine_status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "vaccine_schedule": {"name": "vaccine_schedule", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "recorded_by": {"name": "recorded_by", "description": "Display identifier for the user who recorded the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "circumstances": {"name": "circumstances", "description": "Full readable name of the circumstances.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "given_by": {"name": "given_by", "description": "Display identifier for the user who gave the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "given_elsewhere_by": {"name": "given_elsewhere_by", "description": "Checks if the vaccine was given elsewhere", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "not_given_clinician": {"name": "not_given_clinician", "description": "Display identifier for the user who did not give the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "not_given_reason": {"name": "not_given_reason", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}, "modified_by": {"name": "modified_by", "description": "Display identifier for the user who modified the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated for the vaccine administration record, sourced from the change logs.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\sensitive\\ds__sensitive_vaccinations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical", "restricted"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2716434, "relation_name": "\"app\".\"reporting\".\"ds__sensitive_vaccinations\"", "raw_code": "{{ vaccinations_dataset(is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "vaccine_administrations_change_logs", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.vaccinations_dataset"], "nodes": ["model.tamanu_source_dbt.vaccine_administrations_change_logs", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\sensitive\\ds__sensitive_vaccinations.sql", "compiled": true, "compiled_code": "\n\nwith vaccine_administrations_metadata as (\n select\n id,\n max(updated_at) as updated_at\n from \"app\".\"reporting\".\"vaccine_administrations_change_logs\"\n group by id\n),\n\nadministered_circumstances as (\n select\n a.id,\n string_agg(rd_cir.name, '; ') as circumstance_name\n from \"app\".\"reporting\".\"vaccine_administrations\" a\n cross join lateral unnest(a.circumstance_ids) c (unnest_circumstance_id)\n left join \"app\".\"reporting\".\"reference_data\" rd_cir\n on rd_cir.id = c.unnest_circumstance_id\n group by a.id\n)\n\nselect\n p.display_id,\n p.first_name,\n p.last_name,\n p.id as patient_id,\n p.date_of_birth,\n date_part('year', age(p.date_of_birth)) as age,\n p.sex,\n p.village_id,\n rd_vil.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n av.scheduled_vaccine_id,\n case\n when av.is_given_elsewhere = true and av.datetime is null then null\n else av.datetime::date\n end as vaccination_date,\n sv.category as vaccine_category,\n sv.label as vaccine_name,\n case when sv.category = 'Other' then av.vaccine_brand end as vaccine_brand,\n case when sv.category = 'Other' then av.disease end as disease,\n case\n when av.status = 'GIVEN' then 'Given'\n when av.status = 'NOT_GIVEN' then 'Not given'\n when av.status = 'RECORDED_IN_ERROR' then 'Recorded in error'\n when av.status = 'HISTORICAL' then 'Historical'\n end as vaccine_status,\n sv.dose_label as vaccine_schedule,\n av.batch,\n case\n when av.status in ('GIVEN', 'NOT_GIVEN', 'RECORDED_IN_ERROR') then u.display_name\n end as recorded_by,\n case\n when av.is_given_elsewhere = true then ac.circumstance_name\n end as circumstances,\n case\n when av.status = 'NOT_GIVEN' then null\n when av.status = 'GIVEN' and av.is_given_elsewhere = true then null\n when av.status in ('HISTORICAL', 'RECORDED_IN_ERROR') and av.is_given_elsewhere = true then av.given_by\n when av.status = 'GIVEN' then av.given_by\n end as given_by,\n case when av.is_given_elsewhere = true then av.given_by end as given_elsewhere_by,\n case\n when av.status = 'NOT_GIVEN' then av.given_by\n end as not_given_clinician,\n case\n when av.status = 'NOT_GIVEN' then rd_reason.name\n end as not_given_reason,\n case\n when av.status = 'HISTORICAL' then u.display_name\n end as modified_by,\n vam.updated_at\nfrom \"app\".\"reporting\".\"vaccine_administrations\" av\njoin \"app\".\"reporting\".\"encounters\" e on e.id = av.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join vaccine_administrations_metadata vam on vam.id = av.id\njoin \"app\".\"reporting\".\"locations\" l on l.id = av.location_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = av.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\nleft join \"app\".\"reporting\".\"vaccine_schedules\" sv on sv.id = av.scheduled_vaccine_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = av.recorded_by_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_vil on rd_vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_reason on rd_reason.id = av.not_given_reason_id\nleft join administered_circumstances ac on ac.id = av.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__admissions": {"database": "app", "schema": "reporting", "name": "ds__admissions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__admissions.sql", "original_file_path": "models\\datasets\\standard\\ds__admissions.sql", "unique_id": "model.tamanu_source_dbt.ds__admissions", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__admissions"], "alias": "ds__admissions", "checksum": {"name": "sha256", "checksum": "b2bfeaf96cd315fbd3dced74507daa47c3cec8bb0380fc593b6cb3c2f33c1b30"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Admissions", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the appointment.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "admitting_clinician_id": {"name": "admitting_clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "admitting_clinician": {"name": "admitting_clinician", "description": "Display identifier for the user who admitted the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "admission_datetime": {"name": "admission_datetime", "description": "Local date for the record on admission.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "admission_status": {"name": "admission_status", "description": "The current status of the admission.\r\n\r\n- `active` indicates the patient is currently admitted\r\n- `discharged` indicates the patient has been discharged", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__admission_status"]}, "discharge_datetime": {"name": "discharge_datetime", "description": "Local date for the record on discharge.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_ids": {"name": "department_ids", "description": "An array referencing the [department](#!/source/tamanu-source-dbt.tamanu.departments) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_ids"]}, "departments": {"name": "departments", "description": "A comma separated list of names of the departments the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__departments"]}, "department_datetimes": {"name": "department_datetimes", "description": "A comma separated list of dates and times of the departments associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "location_group_ids": {"name": "location_group_ids", "description": "An array referencing the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_ids"]}, "location_groups": {"name": "location_groups", "description": "A comma separated list of names of the location groups the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_groups"]}, "location_group_datetimes": {"name": "location_group_datetimes", "description": "A comma separated list of dates and times of the location groups associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "location_ids": {"name": "location_ids", "description": "An array referencing the [location](#!/source/tamanu-source-dbt.tamanu.locations) the admission is associated with.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_ids"]}, "locations": {"name": "locations", "description": "A comma separated list of names of the locations the admission is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__locations"]}, "location_datetimes": {"name": "location_datetimes", "description": "A comma separated list of dates and times of the locations associated with the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetimes"]}, "primary_diagnoses": {"name": "primary_diagnoses", "description": "Full list of diagnoses that are primary for the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}, "secondary_diagnoses": {"name": "secondary_diagnoses", "description": "Full list of diagnoses that are secondary for the admission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__admissions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2716434, "relation_name": "\"app\".\"reporting\".\"ds__admissions\"", "raw_code": "{{ admissions_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.admissions_dataset"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__admissions.sql", "compiled": true, "compiled_code": "\n\nwith admission_encounters as (\n select\n e.id,\n e.patient_id,\n e.start_datetime,\n e.end_datetime,\n e.location_id,\n e.patient_billing_type_id,\n f.id as facility_id,\n f.name as facility_name\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\n where e.encounter_type = 'admission'\n and f.is_sensitive = False\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n u.display_name as clinician_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n -- Window functions for ordering and lag operations\n row_number() over (\n partition by eh.encounter_id, ('encounter_type' = any(eh.change_type))\n order by eh.datetime\n ) as encounter_type_change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from admission_encounters ae\n left join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = ae.id\n and eh.encounter_type = 'admission'\n and (eh.change_type is null or eh.change_type && array['encounter_type', 'examiner', 'department', 'location'])\n left join \"app\".\"reporting\".\"users\" u\n on u.id = eh.clinician_id\n left join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n left join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\n-- Clinician changes and admitting clinician logic\nclinician_data as (\n select\n encounter_id,\n bool_or('encounter_type' = any(change_type) and encounter_type_change_sequence = 1) as is_transfer,\n min(datetime) filter (where change_type is null or change_type && array['encounter_type', 'examiner']) as admission_datetime,\n array_agg(\n datetime\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_datetimes,\n array_agg(\n clinician_id\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_ids,\n array_agg(\n clinician_name\n order by datetime\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\n ) as clinician_names\n from encounter_history_consolidated\n group by encounter_id\n),\n\n-- Admitting clinician determination\nadmitting_clinicians as (\n select\n encounter_id,\n admission_datetime,\n case\n when is_transfer and array_length(clinician_ids, 1) > 1\n then clinician_ids[2]\n else clinician_ids[1]\n end as admitting_clinician_id,\n case\n when is_transfer and array_length(clinician_names, 1) > 1\n then clinician_names[2]\n else clinician_names[1]\n end as admitting_clinician_name\n from clinician_data\n),\n\n-- Department changes aggregation\ndepartment_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) as departments\n from encounter_history_consolidated\n where change_type is null or change_type && array['encounter_type', 'department']\n group by encounter_id\n),\n\n-- Location changes aggregation\nlocation_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) as locations\n from encounter_history_consolidated\n where change_type is null or change_type && array['encounter_type', 'location']\n group by encounter_id\n),\n\n-- Location group changes (deduplicated in single pass)\nlocation_group_changes as (\n select\n encounter_id,\n string_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI'),\n '; '\n order by datetime\n ) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) as location_groups\n from encounter_history_consolidated\n where (change_type is null or change_type && array['encounter_type', 'location'])\n and (location_group_id != prev_location_group_id or prev_location_group_id is null)\n group by encounter_id\n),\n\n-- Diagnoses aggregation\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n case when ed.is_primary\n then rd.name || ' (' || rd.code || ')'\n end,\n '; '\n order by ed.datetime\n ) as primary_diagnoses,\n string_agg(\n case when not ed.is_primary\n then rd.name || ' (' || rd.code || ')'\n end,\n '; '\n order by ed.datetime\n ) as secondary_diagnoses\n from admission_encounters ae\n inner join \"app\".\"reporting\".\"encounter_diagnoses\" ed\n on ed.encounter_id = ae.id\n inner join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = ed.diagnosis_id\n where ed.certainty not in ('disproven', 'error')\n group by ed.encounter_id\n),\n\n-- Patient and reference data\npatient_data as (\n select\n ae.id as encounter_id,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village_name,\n ae.patient_billing_type_id,\n bt.name as billing_type_name,\n ae.start_datetime,\n ae.end_datetime,\n ae.location_id,\n ae.facility_id,\n ae.facility_name\n from admission_encounters ae\n left join \"app\".\"reporting\".\"patients\" p\n on p.id = ae.patient_id\n left join \"app\".\"reporting\".\"reference_data\" village\n on village.id = p.village_id\n left join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = ae.patient_billing_type_id\n)\n\nselect\n pd.patient_id,\n pd.display_id,\n pd.first_name,\n pd.last_name,\n pd.date_of_birth,\n date_part('year', age(ac.admission_datetime, pd.date_of_birth)) as age,\n initcap(pd.sex::text) as sex,\n pd.village_id,\n pd.village_name as village,\n pd.patient_billing_type_id as billing_type_id,\n pd.billing_type_name as billing_type,\n ac.admitting_clinician_id,\n ac.admitting_clinician_name as admitting_clinician,\n ac.admission_datetime,\n case\n when pd.end_datetime is null then 'active'\n else 'discharged'\n end as admission_status,\n pd.end_datetime as discharge_datetime,\n pd.facility_id,\n pd.facility_name as facility,\n dc.department_ids,\n dc.departments,\n dc.department_datetimes,\n lgc.location_group_ids,\n lgc.location_groups,\n lgc.location_group_datetimes,\n lc.location_ids,\n lc.locations,\n lc.location_datetimes,\n ed.primary_diagnoses,\n ed.secondary_diagnoses\nfrom patient_data pd\nleft join admitting_clinicians ac\n on ac.encounter_id = pd.encounter_id\nleft join department_changes dc\n on dc.encounter_id = pd.encounter_id\nleft join location_changes lc\n on lc.encounter_id = pd.encounter_id\nleft join location_group_changes lgc\n on lgc.encounter_id = pd.encounter_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = pd.encounter_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__births": {"database": "app", "schema": "reporting", "name": "ds__births", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__births.sql", "original_file_path": "models\\datasets\\standard\\ds__births.sql", "unique_id": "model.tamanu_source_dbt.ds__births", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__births"], "alias": "ds__births", "checksum": {"name": "sha256", "checksum": "20c79be8efc44a3481579c49c81a4f6231d664d25f1ed611b3077bde209852aa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Births", "columns": {"registration_date": {"name": "registration_date", "description": "Timestamp of when record was created", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "registered_by": {"name": "registered_by", "description": "Display identifier for the user who registered the patient in Tamanu.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "nationality": {"name": "nationality", "description": "Full readable name of the nationality.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "ethnicity": {"name": "ethnicity", "description": "Full readable name of the ethnicity.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "mother": {"name": "mother", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father": {"name": "father", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "birth_time": {"name": "birth_time", "description": "Datetime of birth.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__time_of_birth"]}, "gestational_age_estimate": {"name": "gestational_age_estimate", "description": "Gestational age estimate (weeks).", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate"]}, "registered_birth_place": {"name": "registered_birth_place", "description": "Type of the actual birth place.\r\n\r\nOne of:\r\n- `health_facility`\r\n- `home`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__registered_birth_place"]}, "birth_facility_id": {"name": "birth_facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) the birth was recorded at.\r\n\r\nThis is only required when `registered_birth_place` is `health_facility`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_facility_id"]}, "birth_facility": {"name": "birth_facility", "description": "Full readable name of the facility where the birth was recorded at.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "attendant_at_birth": {"name": "attendant_at_birth", "description": "The type of the attendant at birth.\r\n\r\nOne of:\r\n- `doctor`\r\n- `midwife`\r\n- `nurse`\r\n- `traditional_birth_attentdant`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth"]}, "name_of_attendant_at_birth": {"name": "name_of_attendant_at_birth", "description": "Name of attendant at birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth"]}, "birth_delivery_type": {"name": "birth_delivery_type", "description": "Type of delivery.\r\n\r\nOne of:\r\n- `normal_vaginal_delivery`\r\n- `breech`\r\n- `emergency_c_section`\r\n- `elective_c_section`\r\n- `vacuum_extraction`\r\n- `forceps`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type"]}, "birth_type": {"name": "birth_type", "description": "`single` or `plural` birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_type"]}, "birth_weight": {"name": "birth_weight", "description": "Weight in kg at birth.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_weight"]}, "birth_length": {"name": "birth_length", "description": "Length in cm at birth.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_length"]}, "apgar_score_one_minute": {"name": "apgar_score_one_minute", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) one minute after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute"]}, "apgar_score_five_minutes": {"name": "apgar_score_five_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) five minutes after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes"]}, "apgar_score_ten_minutes": {"name": "apgar_score_ten_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) ten minutes after birth.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__births.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2716434, "relation_name": "\"app\".\"reporting\".\"ds__births\"", "raw_code": "select\r\n pbd.registration_date,\r\n case\r\n when left(pbd.registration_date::text, 10) = left(pad.registration_date::text, 10) then u.display_name\r\n end as registered_by,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n rd_ethnicity.name as ethnicity,\r\n rd_nationality.name as nationality,\r\n p.village_id,\r\n rd_village.name as village,\r\n case\r\n when\r\n p_mother.id is not null\r\n then concat(p_mother.first_name, ' ', p_mother.last_name, ' (', p_mother.display_id, ')')\r\n end as mother,\r\n case\r\n when\r\n p_father.id is not null\r\n then concat(p_father.first_name, ' ', p_father.last_name, ' (', p_father.display_id, ')')\r\n end as father,\r\n pbd.birth_time,\r\n pbd.gestational_age_estimate,\r\n case when pbd.registered_birth_place = 'health_facility' then 'Health facility'\r\n when pbd.registered_birth_place = 'home' then 'Home'\r\n when pbd.registered_birth_place = 'other' then 'Other'\r\n else pbd.registered_birth_place\r\n end as registered_birth_place,\r\n f.id as birth_facility_id,\r\n f.name as birth_facility,\r\n case when pbd.attendant_at_birth = 'doctor' then 'Doctor'\r\n when pbd.attendant_at_birth = 'midwife' then 'Midwife'\r\n when pbd.attendant_at_birth = 'nurse' then 'Nurse'\r\n when pbd.attendant_at_birth = 'traditional_birth_attentdant' then 'Traditional birth attendant'\r\n when pbd.attendant_at_birth = 'other' then 'Other'\r\n else pbd.attendant_at_birth\r\n end as attendant_at_birth,\r\n pbd.name_of_attendant_at_birth,\r\n case\r\n when pbd.birth_delivery_type = 'normal_vaginal_delivery' then 'Normal vaginal delivery'\r\n when pbd.birth_delivery_type = 'breech' then 'Breech'\r\n when pbd.birth_delivery_type = 'emergency_c_section' then 'Emergency C-section'\r\n when pbd.birth_delivery_type = 'elective_c_section' then 'Elective C-section'\r\n when pbd.birth_delivery_type = 'vacuum_extraction' then 'Vacuum extraction'\r\n when pbd.birth_delivery_type = 'forceps' then 'Forceps'\r\n when pbd.birth_delivery_type = 'other' then 'Other'\r\n else pbd.birth_delivery_type\r\n end as birth_delivery_type,\r\n initcap(pbd.birth_type::text) as birth_type,\r\n pbd.birth_weight,\r\n pbd.birth_length,\r\n pbd.apgar_score_one_minute,\r\n pbd.apgar_score_five_minutes,\r\n pbd.apgar_score_ten_minutes\r\nfrom {{ ref(\"patient_birth_data\") }} pbd\r\njoin {{ ref(\"patients\") }} p on p.id = pbd.patient_id\r\nleft join {{ ref(\"reference_data\") }} rd_village on rd_village.id = p.village_id\r\nleft join {{ ref(\"patient_additional_data\") }} pad on pad.patient_id = p.id\r\nleft join {{ ref(\"reference_data\") }} rd_nationality on rd_nationality.id = pad.nationality_id\r\nleft join {{ ref(\"reference_data\") }} rd_ethnicity on rd_ethnicity.id = pad.ethnicity_id\r\nleft join {{ ref(\"patients\") }} p_mother on p_mother.id = pad.mother_id\r\nleft join {{ ref(\"patients\") }} p_father on p_father.id = pad.father_id\r\nleft join {{ ref(\"facilities\") }} f on f.id = pbd.birth_facility_id\r\nleft join {{ ref(\"users\") }} u on u.id = pad.registered_by_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patient_birth_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__births.sql", "compiled": true, "compiled_code": "select\n pbd.registration_date,\n case\n when left(pbd.registration_date::text, 10) = left(pad.registration_date::text, 10) then u.display_name\n end as registered_by,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n rd_ethnicity.name as ethnicity,\n rd_nationality.name as nationality,\n p.village_id,\n rd_village.name as village,\n case\n when\n p_mother.id is not null\n then concat(p_mother.first_name, ' ', p_mother.last_name, ' (', p_mother.display_id, ')')\n end as mother,\n case\n when\n p_father.id is not null\n then concat(p_father.first_name, ' ', p_father.last_name, ' (', p_father.display_id, ')')\n end as father,\n pbd.birth_time,\n pbd.gestational_age_estimate,\n case when pbd.registered_birth_place = 'health_facility' then 'Health facility'\n when pbd.registered_birth_place = 'home' then 'Home'\n when pbd.registered_birth_place = 'other' then 'Other'\n else pbd.registered_birth_place\n end as registered_birth_place,\n f.id as birth_facility_id,\n f.name as birth_facility,\n case when pbd.attendant_at_birth = 'doctor' then 'Doctor'\n when pbd.attendant_at_birth = 'midwife' then 'Midwife'\n when pbd.attendant_at_birth = 'nurse' then 'Nurse'\n when pbd.attendant_at_birth = 'traditional_birth_attentdant' then 'Traditional birth attendant'\n when pbd.attendant_at_birth = 'other' then 'Other'\n else pbd.attendant_at_birth\n end as attendant_at_birth,\n pbd.name_of_attendant_at_birth,\n case\n when pbd.birth_delivery_type = 'normal_vaginal_delivery' then 'Normal vaginal delivery'\n when pbd.birth_delivery_type = 'breech' then 'Breech'\n when pbd.birth_delivery_type = 'emergency_c_section' then 'Emergency C-section'\n when pbd.birth_delivery_type = 'elective_c_section' then 'Elective C-section'\n when pbd.birth_delivery_type = 'vacuum_extraction' then 'Vacuum extraction'\n when pbd.birth_delivery_type = 'forceps' then 'Forceps'\n when pbd.birth_delivery_type = 'other' then 'Other'\n else pbd.birth_delivery_type\n end as birth_delivery_type,\n initcap(pbd.birth_type::text) as birth_type,\n pbd.birth_weight,\n pbd.birth_length,\n pbd.apgar_score_one_minute,\n pbd.apgar_score_five_minutes,\n pbd.apgar_score_ten_minutes\nfrom \"app\".\"reporting\".\"patient_birth_data\" pbd\njoin \"app\".\"reporting\".\"patients\" p on p.id = pbd.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_village on rd_village.id = p.village_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" rd_nationality on rd_nationality.id = pad.nationality_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_ethnicity on rd_ethnicity.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"patients\" p_mother on p_mother.id = pad.mother_id\nleft join \"app\".\"reporting\".\"patients\" p_father on p_father.id = pad.father_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = pbd.birth_facility_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = pad.registered_by_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__deaths": {"database": "app", "schema": "reporting", "name": "ds__deaths", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__deaths.sql", "original_file_path": "models\\datasets\\standard\\ds__deaths.sql", "unique_id": "model.tamanu_source_dbt.ds__deaths", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__deaths"], "alias": "ds__deaths", "checksum": {"name": "sha256", "checksum": "eb02e6f91b83c0a037977614b8483641be6e3419bac67f51a55654e16ac508da"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Deaths", "columns": {"patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients) who died.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__patient_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "age": {"name": "age", "description": "Patient's age at the time of diagnosis.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "nationality_id": {"name": "nationality_id", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "nationality": {"name": "nationality", "description": "Full readable name of the patient's nationality.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "place_of_death": {"name": "place_of_death", "description": "Whether the death occurred outside of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__outside_health_facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where death occurred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where death occurred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where death occurred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "attending_clinician_id": {"name": "attending_clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who is recording this death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__clinician_id"]}, "attending_clinician": {"name": "attending_clinician", "description": "Full readable name of the clinician who attended the death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "primary_cause_condition_id": {"name": "primary_cause_condition_id", "description": "Reference to the primary cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if known.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id"]}, "primary_cause_condition": {"name": "primary_cause_condition", "description": "Full readable name of the primary cause of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "time_between_onset_and_death": {"name": "time_between_onset_and_death", "description": "The time in minutes after onset of the primary cause of death, if known.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset"]}, "antecedent_cause_1_id": {"name": "antecedent_cause_1_id", "description": "Reference to an antecedent (1) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id"]}, "antecedent_cause_1": {"name": "antecedent_cause_1", "description": "Full readable name of the first antecedent cause of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "antecedent_cause_2_id": {"name": "antecedent_cause_2_id", "description": "Reference to an antecedent (2) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id"]}, "antecedent_cause_2": {"name": "antecedent_cause_2", "description": "Full readable name of the second antecedent cause of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "other_condition_1_id": {"name": "other_condition_1_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "other_condition_1": {"name": "other_condition_1", "description": "Full readable name of the first other contributing condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "other_condition_2_id": {"name": "other_condition_2_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "other_condition_2": {"name": "other_condition_2", "description": "Full readable name of the second other contributing condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "other_condition_3_id": {"name": "other_condition_3_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "other_condition_3": {"name": "other_condition_3", "description": "Full readable name of the third other contributing condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "other_condition_4_id": {"name": "other_condition_4_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "other_condition_4": {"name": "other_condition_4", "description": "Full readable name of the fourth other contributing condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "had_recent_surgery": {"name": "had_recent_surgery", "description": "Whether the deceased patient had a recent surgery, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__recent_surgery"]}, "last_surgery_date": {"name": "last_surgery_date", "description": "Datetime of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_date"]}, "reason_for_surgery_id": {"name": "reason_for_surgery_id", "description": "Reference to a `diagnosis` ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) for the\r\nreason of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id"]}, "reason_for_surgery": {"name": "reason_for_surgery", "description": "Full readable name of the reason for last surgery.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "manner_of_death": {"name": "manner_of_death", "description": "A descriptive text specifying the manner of death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner"]}, "external_cause_date": {"name": "external_cause_date", "description": "Datetime of external cause of death, if applicable.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_date"]}, "external_cause_location": {"name": "external_cause_location", "description": "Physical location of external cause of death, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_location"]}, "was_pregnant": {"name": "was_pregnant", "description": "Whether the deceased was pregnant.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__was_pregnant"]}, "pregnancy_contributed": {"name": "pregnancy_contributed", "description": "Whether the pregnancy contributed to the death.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed"]}, "was_fetal_or_infant": {"name": "was_fetal_or_infant", "description": "Whether the deceased was themselves a foetus or infant.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__fetal_or_infant"]}, "was_stillborn": {"name": "was_stillborn", "description": "Whether the deceased was themselves stillborn.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__stillborn"]}, "birth_weight": {"name": "birth_weight", "description": "If the deceased was a foetus, stillborn, or infant, their birth weight.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__birth_weight"]}, "completed_weeks_of_pregnancy": {"name": "completed_weeks_of_pregnancy", "description": "If the deceased was a foetus, stillborn, or infant, how many weeks pregnant their carrier was.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks"]}, "age_of_mother": {"name": "age_of_mother", "description": "If the deceased was a foetus, stillborn, or infant, the age of the carrier.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_age"]}, "condition_in_mother_affecting_fetus_or_newborn": {"name": "condition_in_mother_affecting_fetus_or_newborn", "description": "A text description stating the conditions of mother that affected the fetus/newborn, if the death was perinatal.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__mother_condition_description"]}, "death_within_day_of_birth": {"name": "death_within_day_of_birth", "description": "If the deceased was a foetus, stillborn, or infant, whether their passing was on the day of their birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__within_day_of_birth"]}, "hours_survived_since_birth": {"name": "hours_survived_since_birth", "description": "If the deceased was an infant, how many days since the birth passed before their death.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__deaths.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2716434, "relation_name": "\"app\".\"reporting\".\"ds__deaths\"", "raw_code": "with contributing_death_causes as (\r\n select\r\n cdc.patient_death_data_id,\r\n array_agg(\r\n cdc.condition_id\r\n order by cdc.time_after_onset\r\n ) as other_conditions\r\n from {{ ref(\"contributing_death_causes\") }} cdc\r\n group by cdc.patient_death_data_id\r\n),\r\n\r\nencounters_with_death as (\r\n select distinct on (e.patient_id)\r\n e.patient_id,\r\n e.start_datetime,\r\n e.end_datetime,\r\n e.location_id,\r\n e.department_id,\r\n e.clinician_id\r\n from {{ ref(\"encounters\") }} e\r\n join {{ ref(\"patients\") }} p\r\n on p.id = e.patient_id\r\n and p.date_of_death between e.start_datetime and e.end_datetime\r\n order by e.patient_id asc, e.end_datetime desc\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(p.date_of_death::date, p.date_of_birth::date)) as age,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n nationality.id as nationality_id,\r\n nationality.name as nationality,\r\n case\r\n when pdd.was_outside_health_facility then 'Died outside health facility'\r\n else facility.name\r\n end as place_of_death,\r\n facility.id as facility_id,\r\n department.id as department_id,\r\n department.name as department,\r\n location_group.id as location_group_id,\r\n location_group.name as location_group,\r\n location.id as location_id,\r\n location.name as location,\r\n p.date_of_death,\r\n clinician.id as attending_clinician_id,\r\n clinician.display_name as attending_clinician,\r\n primary_condition.id as primary_cause_condition_id,\r\n primary_condition.name as primary_cause_condition,\r\n case\r\n when pdd.primary_cause_mins_after_onset is null or pdd.primary_cause_mins_after_onset = 0\r\n then '0 minutes'\r\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 365)) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 365), ' years')\r\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 30)) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 30), ' months')\r\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 7)) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 7), ' weeks')\r\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24)) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24), ' days')\r\n when mod(pdd.primary_cause_mins_after_onset, 60) = 0\r\n then concat(pdd.primary_cause_mins_after_onset / 60, ' hours')\r\n else concat(pdd.primary_cause_mins_after_onset, ' minutes')\r\n end as time_between_onset_and_death,\r\n antecedent_condition_1.id as antecedent_cause_1_id,\r\n antecedent_condition_1.name as antecedent_cause_1,\r\n antecedent_condition_2.id as antecedent_cause_2_id,\r\n antecedent_condition_2.name as antecedent_cause_2,\r\n other_condition_1.id as other_condition_1_id,\r\n other_condition_1.name as other_condition_1,\r\n other_condition_2.id as other_condition_2_id,\r\n other_condition_2.name as other_condition_2,\r\n other_condition_3.id as other_condition_3_id,\r\n other_condition_3.name as other_condition_3,\r\n other_condition_4.id as other_condition_4_id,\r\n other_condition_4.name as other_condition_4,\r\n initcap(pdd.had_recent_surgery) as had_recent_surgery,\r\n pdd.last_surgery_date,\r\n surgery_reason.id as reason_for_surgery_id,\r\n surgery_reason.name as reason_for_surgery,\r\n pdd.manner as manner_of_death,\r\n pdd.external_cause_date,\r\n pdd.external_cause_location,\r\n initcap(pdd.was_pregnant) as was_pregnant,\r\n pdd.pregnancy_contributed,\r\n case\r\n when pdd.was_fetal_or_infant then 'Yes'\r\n else 'No'\r\n end as was_fetal_or_infant,\r\n initcap(pdd.was_stillborn) as was_stillborn,\r\n pdd.birth_weight,\r\n pdd.carrier_pregnancy_weeks as completed_weeks_of_pregnancy,\r\n pdd.carrier_age as age_of_mother,\r\n pdd.mother_condition_description as condition_in_mother_affecting_fetus_or_newborn,\r\n case\r\n when pdd.was_within_day_of_birth then 'Yes'\r\n else 'No'\r\n end as death_within_day_of_birth,\r\n pdd.hours_survived_since_birth\r\nfrom {{ ref(\"patient_death_data\") }} pdd\r\njoin {{ ref(\"patients\") }} p\r\n on p.id = pdd.patient_id\r\nleft join {{ ref(\"patient_additional_data\") }} pd\r\n on pd.patient_id = p.id\r\nleft join {{ ref(\"reference_data\") }} village\r\n on village.id = p.village_id\r\nleft join {{ ref(\"reference_data\") }} nationality\r\n on nationality.id = pd.nationality_id\r\nleft join {{ ref(\"reference_data\") }} primary_condition\r\n on primary_condition.id = pdd.primary_cause_condition_id\r\nleft join {{ ref(\"reference_data\") }} antecedent_condition_1\r\n on antecedent_condition_1.id = pdd.antecedent_cause1_condition_id\r\nleft join {{ ref(\"reference_data\") }} antecedent_condition_2\r\n on antecedent_condition_2.id = pdd.antecedent_cause2_condition_id\r\nleft join contributing_death_causes cdc\r\n on cdc.patient_death_data_id = pdd.id\r\nleft join {{ ref(\"reference_data\") }} other_condition_1\r\n on other_condition_1.id = cdc.other_conditions[1]\r\nleft join {{ ref(\"reference_data\") }} other_condition_2\r\n on other_condition_2.id = cdc.other_conditions[2]\r\nleft join {{ ref(\"reference_data\") }} other_condition_3\r\n on other_condition_3.id = cdc.other_conditions[3]\r\nleft join {{ ref(\"reference_data\") }} other_condition_4\r\n on other_condition_4.id = cdc.other_conditions[4]\r\nleft join {{ ref(\"reference_data\") }} surgery_reason\r\n on surgery_reason.id = pdd.last_surgery_reason_id\r\nleft join encounters_with_death ewd\r\n on ewd.patient_id = p.id\r\nleft join {{ ref(\"facilities\") }} facility\r\n on facility.id = pdd.facility_id\r\nleft join {{ ref(\"departments\") }} department\r\n on department.id = ewd.department_id\r\nleft join {{ ref(\"locations\") }} location\r\n on location.id = ewd.location_id\r\nleft join {{ ref(\"location_groups\") }} location_group\r\n on location_group.id = location.location_group_id\r\nleft join {{ ref(\"users\") }} clinician\r\n on clinician.id = pdd.recorded_by_id\r\nwhere pdd.visibility_status = 'current'\r\n and pdd.is_final", "doc_blocks": [], "language": "sql", "refs": [{"name": "contributing_death_causes", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_death_data", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.contributing_death_causes", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_death_data", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__deaths.sql", "compiled": true, "compiled_code": "with contributing_death_causes as (\n select\n cdc.patient_death_data_id,\n array_agg(\n cdc.condition_id\n order by cdc.time_after_onset\n ) as other_conditions\n from \"app\".\"reporting\".\"contributing_death_causes\" cdc\n group by cdc.patient_death_data_id\n),\n\nencounters_with_death as (\n select distinct on (e.patient_id)\n e.patient_id,\n e.start_datetime,\n e.end_datetime,\n e.location_id,\n e.department_id,\n e.clinician_id\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\n and p.date_of_death between e.start_datetime and e.end_datetime\n order by e.patient_id asc, e.end_datetime desc\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(p.date_of_death::date, p.date_of_birth::date)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n nationality.id as nationality_id,\n nationality.name as nationality,\n case\n when pdd.was_outside_health_facility then 'Died outside health facility'\n else facility.name\n end as place_of_death,\n facility.id as facility_id,\n department.id as department_id,\n department.name as department,\n location_group.id as location_group_id,\n location_group.name as location_group,\n location.id as location_id,\n location.name as location,\n p.date_of_death,\n clinician.id as attending_clinician_id,\n clinician.display_name as attending_clinician,\n primary_condition.id as primary_cause_condition_id,\n primary_condition.name as primary_cause_condition,\n case\n when pdd.primary_cause_mins_after_onset is null or pdd.primary_cause_mins_after_onset = 0\n then '0 minutes'\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 365)) = 0\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 365), ' years')\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 30)) = 0\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 30), ' months')\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 7)) = 0\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 7), ' weeks')\n when mod(pdd.primary_cause_mins_after_onset, (60 * 24)) = 0\n then concat(pdd.primary_cause_mins_after_onset / (60 * 24), ' days')\n when mod(pdd.primary_cause_mins_after_onset, 60) = 0\n then concat(pdd.primary_cause_mins_after_onset / 60, ' hours')\n else concat(pdd.primary_cause_mins_after_onset, ' minutes')\n end as time_between_onset_and_death,\n antecedent_condition_1.id as antecedent_cause_1_id,\n antecedent_condition_1.name as antecedent_cause_1,\n antecedent_condition_2.id as antecedent_cause_2_id,\n antecedent_condition_2.name as antecedent_cause_2,\n other_condition_1.id as other_condition_1_id,\n other_condition_1.name as other_condition_1,\n other_condition_2.id as other_condition_2_id,\n other_condition_2.name as other_condition_2,\n other_condition_3.id as other_condition_3_id,\n other_condition_3.name as other_condition_3,\n other_condition_4.id as other_condition_4_id,\n other_condition_4.name as other_condition_4,\n initcap(pdd.had_recent_surgery) as had_recent_surgery,\n pdd.last_surgery_date,\n surgery_reason.id as reason_for_surgery_id,\n surgery_reason.name as reason_for_surgery,\n pdd.manner as manner_of_death,\n pdd.external_cause_date,\n pdd.external_cause_location,\n initcap(pdd.was_pregnant) as was_pregnant,\n pdd.pregnancy_contributed,\n case\n when pdd.was_fetal_or_infant then 'Yes'\n else 'No'\n end as was_fetal_or_infant,\n initcap(pdd.was_stillborn) as was_stillborn,\n pdd.birth_weight,\n pdd.carrier_pregnancy_weeks as completed_weeks_of_pregnancy,\n pdd.carrier_age as age_of_mother,\n pdd.mother_condition_description as condition_in_mother_affecting_fetus_or_newborn,\n case\n when pdd.was_within_day_of_birth then 'Yes'\n else 'No'\n end as death_within_day_of_birth,\n pdd.hours_survived_since_birth\nfrom \"app\".\"reporting\".\"patient_death_data\" pdd\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = pdd.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd\n on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" village\n on village.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" nationality\n on nationality.id = pd.nationality_id\nleft join \"app\".\"reporting\".\"reference_data\" primary_condition\n on primary_condition.id = pdd.primary_cause_condition_id\nleft join \"app\".\"reporting\".\"reference_data\" antecedent_condition_1\n on antecedent_condition_1.id = pdd.antecedent_cause1_condition_id\nleft join \"app\".\"reporting\".\"reference_data\" antecedent_condition_2\n on antecedent_condition_2.id = pdd.antecedent_cause2_condition_id\nleft join contributing_death_causes cdc\n on cdc.patient_death_data_id = pdd.id\nleft join \"app\".\"reporting\".\"reference_data\" other_condition_1\n on other_condition_1.id = cdc.other_conditions[1]\nleft join \"app\".\"reporting\".\"reference_data\" other_condition_2\n on other_condition_2.id = cdc.other_conditions[2]\nleft join \"app\".\"reporting\".\"reference_data\" other_condition_3\n on other_condition_3.id = cdc.other_conditions[3]\nleft join \"app\".\"reporting\".\"reference_data\" other_condition_4\n on other_condition_4.id = cdc.other_conditions[4]\nleft join \"app\".\"reporting\".\"reference_data\" surgery_reason\n on surgery_reason.id = pdd.last_surgery_reason_id\nleft join encounters_with_death ewd\n on ewd.patient_id = p.id\nleft join \"app\".\"reporting\".\"facilities\" facility\n on facility.id = pdd.facility_id\nleft join \"app\".\"reporting\".\"departments\" department\n on department.id = ewd.department_id\nleft join \"app\".\"reporting\".\"locations\" location\n on location.id = ewd.location_id\nleft join \"app\".\"reporting\".\"location_groups\" location_group\n on location_group.id = location.location_group_id\nleft join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = pdd.recorded_by_id\nwhere pdd.visibility_status = 'current'\n and pdd.is_final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__diagnoses": {"database": "app", "schema": "reporting", "name": "ds__diagnoses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__diagnoses.sql", "original_file_path": "models\\datasets\\standard\\ds__diagnoses.sql", "unique_id": "model.tamanu_source_dbt.ds__diagnoses", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__diagnoses"], "alias": "ds__diagnoses", "checksum": {"name": "sha256", "checksum": "f7d66479638ff25cbf7477b86697b83e291e74875bc55964e492e202b7e00780"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Diagnoses", "columns": {"encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__encounter_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id"]}, "diagnosis": {"name": "diagnosis", "description": "Full readable name of the diagnosis", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "diagnosis_datetime": {"name": "diagnosis_datetime", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "age": {"name": "age", "description": "Patient's age at the time of diagnosis.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "contact_number": {"name": "contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who diagnosed the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "certainty": {"name": "certainty", "description": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__certainty"]}, "is_primary": {"name": "is_primary", "description": "A boolean indicating if this is a primary diagnosis", "meta": {}, "data_type": "bool", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__is_primary"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__diagnoses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2716434, "relation_name": "\"app\".\"reporting\".\"ds__diagnoses\"", "raw_code": "{{ diagnoses_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.diagnoses_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__diagnoses.sql", "compiled": true, "compiled_code": "\n\nselect\n e.id as encounter_id,\n p.id as patient_id,\n diagnosis.id as diagnosis_id,\n diagnosis.name as diagnosis,\n ed.datetime as diagnosis_datetime,\n p.first_name,\n p.last_name,\n p.display_id,\n date_part('year', age(ed.datetime::date, p.date_of_birth)) as age,\n p.sex,\n coalesce(pad.primary_contact_number, pad.secondary_contact_number) as contact_number,\n village.id as village_id,\n village.name as village,\n clinician.id as clinician_id,\n clinician.display_name as clinician,\n d.id as department_id,\n d.name as department,\n l.id as location_id,\n l.name as location,\n f.id as facility_id,\n f.name as facility,\n initcap(ed.certainty) as certainty,\n case when ed.is_primary = true then 'Yes' else 'No' end as is_primary\nfrom \"app\".\"reporting\".\"encounter_diagnoses\" ed\njoin \"app\".\"reporting\".\"reference_data\" diagnosis on diagnosis.id = ed.diagnosis_id\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ed.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = e.clinician_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__encounters_emergency": {"database": "app", "schema": "reporting", "name": "ds__encounters_emergency", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__encounters_emergency.sql", "original_file_path": "models\\datasets\\standard\\ds__encounters_emergency.sql", "unique_id": "model.tamanu_source_dbt.ds__encounters_emergency", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__encounters_emergency"], "alias": "ds__encounters_emergency", "checksum": {"name": "sha256", "checksum": "45f17850fc96bb1747ba1a8c5f523bdc59c893123f8273b0664a9682e4793f04"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Emergency encounters with triage information", "columns": {"triage_id": {"name": "triage_id", "description": "Tamanu internal identifier (generally a UUID) in triages.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "arrival_datetime": {"name": "arrival_datetime", "description": "When the patient arrived.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time"]}, "triage_datetime": {"name": "triage_datetime", "description": "When the patient was triaged.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time"]}, "closed_datetime": {"name": "closed_datetime", "description": "When the patient was processed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time"]}, "score": {"name": "score", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__encounter_id"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "arrival_mode": {"name": "arrival_mode", "description": "Full readable name of the triage arrival mode.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "chief_complaint": {"name": "chief_complaint", "description": "Full readable name of the chief complaint.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "secondary_complaint": {"name": "secondary_complaint", "description": "Full readable name of the secondary complaint.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__practitioner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who triaged the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) the triage is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility the triage is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__encounters_emergency.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2877684, "relation_name": "\"app\".\"reporting\".\"ds__encounters_emergency\"", "raw_code": "{{ encounters_emergency_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "triages", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounters_emergency_dataset"], "nodes": ["model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__encounters_emergency.sql", "compiled": true, "compiled_code": "\n\nselect\n t.id as triage_id,\n t.arrival_datetime,\n t.triage_datetime,\n t.closed_datetime,\n t.score,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village,\n e.id as encounter_id,\n e.encounter_type,\n arrival_mode.name as arrival_mode,\n chief_complaint.name as chief_complaint,\n secondary_complaint.name as secondary_complaint,\n clinician.display_name as clinician,\n t.clinician_id,\n f.id as facility_id,\n f.name as facility\nfrom \"app\".\"reporting\".\"triages\" t\njoin \"app\".\"reporting\".\"encounters\" e on e.id = t.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" arrival_mode on arrival_mode.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" chief_complaint on chief_complaint.id = t.chief_complaint_id\nleft join \"app\".\"reporting\".\"reference_data\" secondary_complaint on secondary_complaint.id = t.secondary_complaint_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = t.clinician_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__encounter_diets": {"database": "app", "schema": "reporting", "name": "ds__encounter_diets", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__encounter_diets.sql", "original_file_path": "models\\datasets\\standard\\ds__encounter_diets.sql", "unique_id": "model.tamanu_source_dbt.ds__encounter_diets", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__encounter_diets"], "alias": "ds__encounter_diets", "checksum": {"name": "sha256", "checksum": "ef4a9682a3710abde0aa9083eb6f1e23269999e63cc043cfbe49fa15b1e8c41e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Active encounters with their associated dietary requirements", "columns": {"encounter_id": {"name": "encounter_id", "description": "Tamanu internal identifier (generally a UUID) of encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "patient_name": {"name": "patient_name", "description": "Patient Name", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_name"]}, "age": {"name": "age", "description": "Patient's age at the time of the encounter, formatted with appropriate unit (days/weeks/months/years).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "diets": {"name": "diets", "description": "Full readable name of dietary requirements for the patient during this encounter, comma-separated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "allergies": {"name": "allergies", "description": "Full readable name of allergies for the patient during this encounter, comma-separated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__encounter_diets.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.2877684, "relation_name": "\"app\".\"reporting\".\"ds__encounter_diets\"", "raw_code": "{{ encounter_diets_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diets", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "patient_allergies", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_diets_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.patient_allergies", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__encounter_diets.sql", "compiled": true, "compiled_code": "\n\nwith diets as (\n select\n ed.encounter_id,\n string_agg(\n rd.name, ', '\n order by rd.name\n ) as diets\n from \"app\".\"reporting\".\"encounter_diets\" ed\n join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = ed.diet_id\n group by ed.encounter_id\n),\n\nallergies as (\n select\n pa.patient_id,\n string_agg(\n rd.name, ', '\n order by rd.name\n ) as allergies\n from \"app\".\"reporting\".\"patient_allergies\" pa\n join \"app\".\"reporting\".\"reference_data\" rd\n on rd.id = pa.allergy_id\n group by pa.patient_id\n)\n\nselect\n e.id as encounter_id,\n p.id as patient_id,\n p.display_id,\n concat(p.first_name, ' ', p.last_name) as patient_name,\n e.start_datetime,\n case\n when age(current_date, p.date_of_birth) < interval '8 days'\n then concat(extract(day from age(current_date, p.date_of_birth)), ' days')\n when age(current_date, p.date_of_birth) >= interval '8 days'\n and age(current_date, p.date_of_birth) < interval '1 month'\n then concat(extract(week from age(current_date, p.date_of_birth)), ' weeks')\n when age(current_date, p.date_of_birth) >= interval '1 month'\n and age(current_date, p.date_of_birth) < interval '2 years'\n then concat(extract(month from age(current_date, p.date_of_birth)), ' months')\n when age(current_date, p.date_of_birth) >= interval '2 years'\n then concat(extract(year from age(current_date, p.date_of_birth)), ' years')\n end as age,\n l.id as location_id,\n l.name as location,\n lg.id as location_group_id,\n lg.name as location_group,\n d.diets,\n a.allergies\nfrom \"app\".\"reporting\".\"encounters\" e\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join diets d\n on d.encounter_id = e.id\nleft join allergies a\n on a.patient_id = p.id\nwhere e.end_datetime is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__encounter_prescriptions": {"database": "app", "schema": "reporting", "name": "ds__encounter_prescriptions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__encounter_prescriptions.sql", "original_file_path": "models\\datasets\\standard\\ds__encounter_prescriptions.sql", "unique_id": "model.tamanu_source_dbt.ds__encounter_prescriptions", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__encounter_prescriptions"], "alias": "ds__encounter_prescriptions", "checksum": {"name": "sha256", "checksum": "c931fda430f27105081915009477fabc910ce26c3a3e4da11467af8150d4dc84"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Encounter prescriptions", "columns": {"encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__encounter_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__prescription_id"]}, "datetime": {"name": "datetime", "description": "Local date and time for the record in prescriptions.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "is_selected_for_discharge": {"name": "is_selected_for_discharge", "description": "Whether the prescription is for when the patient is discharged.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "medication_code": {"name": "medication_code", "description": "Full readable name code of the prescribed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "medication": {"name": "medication", "description": "Full readable name name of the prescribed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "quantity": {"name": "quantity", "description": "Quantity of medicine to dispense.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__quantity"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__encounter_prescriptions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2877684, "relation_name": "\"app\".\"reporting\".\"ds__encounter_prescriptions\"", "raw_code": "{{ encounter_prescriptions_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_prescriptions_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__encounter_prescriptions.sql", "compiled": true, "compiled_code": "\n\nselect\n ep.encounter_id,\n ep.prescription_id,\n pr.datetime,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pr.datetime, p.date_of_birth)) as age,\n p.sex,\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\n vil.id as village_id,\n vil.name as village,\n l.facility_id,\n f.name as facility,\n ep.is_selected_for_discharge,\n pr.medication_id,\n m.code as medication_code,\n m.name as medication,\n pr.route,\n pr.quantity,\n pr.repeats,\n pr.is_ongoing,\n pr.is_prn,\n pr.is_variable_dose,\n pr.dose_amount,\n pr.units,\n pr.frequency,\n pr.is_discontinued,\n pr.discontinued_by_id,\n pr.discontinuing_reason,\n pr.discontinued_datetime\nfrom \"app\".\"reporting\".\"encounter_prescriptions\" ep\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ep.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"prescriptions\" pr on pr.id = ep.prescription_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f \n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\njoin \"app\".\"reporting\".\"reference_data\" m on m.id = pr.medication_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__imaging_requests": {"database": "app", "schema": "reporting", "name": "ds__imaging_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__imaging_requests.sql", "original_file_path": "models\\datasets\\standard\\ds__imaging_requests.sql", "unique_id": "model.tamanu_source_dbt.ds__imaging_requests", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__imaging_requests"], "alias": "ds__imaging_requests", "checksum": {"name": "sha256", "checksum": "bfd2311b5ca832349ca06b3f9aad480a9b603b4f3b3c5eeeb842b500d3e10f3c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Imaging requests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of imaging.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "request_id": {"name": "request_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the imaging was requested.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date"]}, "supervising_clinician_id": {"name": "supervising_clinician_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "supervising_clinician": {"name": "supervising_clinician", "description": "Display identifier for the user where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "requesting_clinician_id": {"name": "requesting_clinician_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "requesting_clinician": {"name": "requesting_clinician", "description": "Display identifier for the user who requested the imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "priority": {"name": "priority", "description": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__priority"]}, "imaging_type": {"name": "imaging_type", "description": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__imaging_type"]}, "imaging_area": {"name": "imaging_area", "description": "Full readable name of the imaging area.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "completed_datetime": {"name": "completed_datetime", "description": "When this result was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_at"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113).", "meta": {}, "data_type": "character varying(1024)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__imaging_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2877684, "relation_name": "\"app\".\"reporting\".\"ds__imaging_requests\"", "raw_code": "{{ imaging_requests_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "imaging_results", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.imaging_requests_dataset"], "nodes": ["model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__imaging_requests.sql", "compiled": true, "compiled_code": "\n\nwith results as (\n select\n imaging_request_id,\n min(datetime) as completed_datetime\n from \"app\".\"reporting\".\"imaging_results\"\n group by imaging_request_id\n),\n\nimaging_area_notes as (\n select\n record_id as imaging_request_id,\n string_agg(content, ', ' order by datetime) as imaging_area\n from \"app\".\"reporting\".\"notes\"\n where record_type = 'ImagingRequest'\n and note_type_id = 'notetype-areaToBeImaged'\n group by record_id\n),\n\nimaging_areas as (\n select\n ir.id as imaging_request_id,\n coalesce(\n string_agg(ia.name, ', ' order by ia.name),\n n.imaging_area\n ) as imaging_area\n from \"app\".\"reporting\".\"imaging_requests\" ir\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" ia on ia.id = ira.area_id\n left join imaging_area_notes n on n.imaging_request_id = ir.id\n group by ir.id, n.imaging_area\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(ir.datetime::date, p.date_of_birth)) as age,\n p.sex,\n v.id as village_id,\n v.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n ir.display_id as request_id,\n ir.datetime as requested_datetime,\n su.id as supervising_clinician_id,\n su.display_name as supervising_clinician,\n ru.id as requesting_clinician_id,\n ru.display_name as requesting_clinician,\n case\n when ir.priority = 'routine' then 'Routine'\n when ir.priority = 'urgent' then 'Urgent'\n when ir.priority = 'asap' then 'ASAP'\n when ir.priority = 'stat' then 'STAT'\n when ir.priority = 'today' then 'Today'\n else ir.priority\n end as priority,\n ir.imaging_type,\n areas.imaging_area,\n ir.status as status_id,\n case\n when ir.status = 'pending' then 'Pending'\n when ir.status = 'in_progress' then 'In progress'\n when ir.status = 'completed' then 'Completed'\n when ir.status = 'cancelled' then 'Cancelled'\n when ir.status = 'deleted' then 'Deleted'\n when ir.status = 'entered_in_error' then 'Entered in error'\n else 'Unknown'\n end as status,\n case\n when ir.status = 'completed' then irs.completed_datetime\n end as completed_datetime,\n case\n when ir.reason_for_cancellation = 'clinical' then 'Clinical reason'\n when ir.reason_for_cancellation = 'duplicate' then 'Duplicate'\n when ir.reason_for_cancellation = 'entered-in-error' then 'Entered in error'\n when ir.reason_for_cancellation = 'patient-discharged' then 'Patient discharged'\n when ir.reason_for_cancellation = 'patient-refused' then 'Patient refused'\n when ir.reason_for_cancellation = 'other' then 'Other'\n end as reason_for_cancellation\nfrom \"app\".\"reporting\".\"imaging_requests\" ir\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ir.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"users\" su on su.id = e.clinician_id\nleft join \"app\".\"reporting\".\"users\" ru on ru.id = ir.requested_by_id\nleft join imaging_areas areas on areas.imaging_request_id = ir.id\nleft join \"app\".\"reporting\".\"reference_data\" v on v.id = p.village_id\nleft join results irs on irs.imaging_request_id = ir.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__invoice_products": {"database": "app", "schema": "reporting", "name": "ds__invoice_products", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__invoice_products.sql", "original_file_path": "models\\datasets\\standard\\ds__invoice_products.sql", "unique_id": "model.tamanu_source_dbt.ds__invoice_products", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__invoice_products"], "alias": "ds__invoice_products", "checksum": {"name": "sha256", "checksum": "4dbf560bf699ac3fe327179d9a4d8b05102c360ca679a0092ef216c5d1c4d12c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "internal"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "reference"], "description": "Invoice products pivoted with their prices across all price lists and insurance coverage across all insurance plans. One row per product.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Name of the product.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__name"]}, "insurable": {"name": "insurable", "description": "Whether or not discounts can be applied to a product", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__insurable"]}, "category": {"name": "category", "description": "The category of the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__category"]}, "source_record_id": {"name": "source_record_id", "description": "The id of the source record for the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__source_record_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "external_code": {"name": "external_code", "description": "External code from the linked lab test type or lab test panel, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__invoice_products.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["reference"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "internal"}}, "created_at": 1782423652.2877684, "relation_name": "\"app\".\"reporting\".\"ds__invoice_products\"", "raw_code": "{%- set price_lists_query %}\r\n select id, name\r\n from {{ ref('invoice_price_lists') }}\r\n order by name\r\n{%- endset %}\r\n\r\n{%- set insurance_plans_query %}\r\n select id, name, default_coverage\r\n from {{ ref('invoice_insurance_plans') }}\r\n order by name\r\n{%- endset %}\r\n\r\n{%- if execute %}\r\n {%- set price_lists = run_query(price_lists_query) %}\r\n {%- set insurance_plans = run_query(insurance_plans_query) %}\r\n{%- else %}\r\n {%- set price_lists = [] %}\r\n {%- set insurance_plans = [] %}\r\n{%- endif %}\r\n\r\nwith price_pivot as (\r\n select\r\n invoice_product_id\r\n {%- for row in price_lists %}\r\n , max(case when invoice_price_list_id = '{{ row[0] }}' then price end)\r\n as price_{{ loop.index }}\r\n {%- endfor %}\r\n from {{ ref('invoice_price_list_items') }}\r\n where is_hidden = false\r\n group by invoice_product_id\r\n),\r\n\r\ninsurance_pivot as (\r\n select\r\n invoice_product_id\r\n {%- for row in insurance_plans %}\r\n , max(case when invoice_insurance_plan_id = '{{ row[0] }}' then coverage_value end)\r\n as cov_{{ loop.index }}\r\n {%- endfor %}\r\n from {{ ref('invoice_insurance_plan_items') }}\r\n group by invoice_product_id\r\n)\r\n\r\nselect\r\n ip.id,\r\n ip.name,\r\n ip.insurable,\r\n ip.category,\r\n ip.source_record_id,\r\n ip.visibility_status,\r\n coalesce(ltt.external_code, ltp.external_code) as external_code\r\n {%- for row in price_lists %}\r\n , pp.price_{{ loop.index }} as \"Price: {{ row[1] }}\"\r\n {%- endfor %}\r\n {%- for row in insurance_plans %}\r\n , case\r\n when ip.insurable = false then 'n/a'\r\n else cast(\r\n coalesce(\r\n insurp.cov_{{ loop.index }},\r\n {%- if row[2] is not none %}{{ row[2] }}{%- else %}null{%- endif %}\r\n ) as text\r\n )\r\n end as \"Insurance: {{ row[1] }}\"\r\n {%- endfor %}\r\nfrom {{ ref('invoice_products') }} ip\r\nleft join price_pivot pp on pp.invoice_product_id = ip.id\r\nleft join insurance_pivot insurp on insurp.invoice_product_id = ip.id\r\nleft join {{ ref('lab_test_types') }} ltt on ltt.id = ip.source_record_id\r\nleft join {{ ref('lab_test_panels') }} ltp on ltp.id = ip.source_record_id", "doc_blocks": ["doc.tamanu_source_dbt.ds__invoice_products"], "language": "sql", "refs": [{"name": "invoice_price_lists", "package": null, "version": null}, {"name": "invoice_insurance_plans", "package": null, "version": null}, {"name": "invoice_price_list_items", "package": null, "version": null}, {"name": "invoice_insurance_plan_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.run_query"], "nodes": ["model.tamanu_source_dbt.invoice_price_lists", "model.tamanu_source_dbt.invoice_insurance_plans", "model.tamanu_source_dbt.invoice_price_list_items", "model.tamanu_source_dbt.invoice_insurance_plan_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__invoice_products.sql", "compiled": true, "compiled_code": "\n\nwith price_pivot as (\n select\n invoice_product_id\n from \"app\".\"reporting\".\"invoice_price_list_items\"\n where is_hidden = false\n group by invoice_product_id\n),\n\ninsurance_pivot as (\n select\n invoice_product_id\n from \"app\".\"reporting\".\"invoice_insurance_plan_items\"\n group by invoice_product_id\n)\n\nselect\n ip.id,\n ip.name,\n ip.insurable,\n ip.category,\n ip.source_record_id,\n ip.visibility_status,\n coalesce(ltt.external_code, ltp.external_code) as external_code\nfrom \"app\".\"reporting\".\"invoice_products\" ip\nleft join price_pivot pp on pp.invoice_product_id = ip.id\nleft join insurance_pivot insurp on insurp.invoice_product_id = ip.id\nleft join \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = ip.source_record_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ip.source_record_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__lab_requests": {"database": "app", "schema": "reporting", "name": "ds__lab_requests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__lab_requests.sql", "original_file_path": "models\\datasets\\standard\\ds__lab_requests.sql", "unique_id": "model.tamanu_source_dbt.ds__lab_requests", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__lab_requests"], "alias": "ds__lab_requests", "checksum": {"name": "sha256", "checksum": "4d2ce2f53b05b2324dfc59e20241a37ca4801c67c38a39d50521d45120aeb4f9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Lab requests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "laboratory_id": {"name": "laboratory_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id"]}, "laboratory": {"name": "laboratory", "description": "Full readable name of the laboratory", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "request_id": {"name": "request_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "requested_by": {"name": "requested_by", "description": "Display identifier for the user who requested the lab test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "requesting_department_id": {"name": "requesting_department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) from which the lab test was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "requesting_department": {"name": "requesting_department", "description": "Full readable name of the department from which the lab test was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "priority_id": {"name": "priority_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_priority_id"]}, "priority": {"name": "priority", "description": "Full readable name of the lab test priority.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__category_id"]}, "category": {"name": "category", "description": "Full readable name of the lab test category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "lab_test_panel": {"name": "lab_test_panel", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "tests": {"name": "tests", "description": "Full list of tests", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__tests"]}, "collected_datetime": {"name": "collected_datetime", "description": "When the sample was collected.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time"]}, "collected_by_id": {"name": "collected_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__collected_by_id"]}, "collected_by": {"name": "collected_by", "description": "Display identifier for the user who collected the specimen.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "specimen_type_id": {"name": "specimen_type_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_type_id"]}, "specimen_type": {"name": "specimen_type", "description": "Used to indicate if the lab test type is sensitive and should be hidden accordingly.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__is_sensitive"]}, "site": {"name": "site", "description": "Full readable name of the specimen collection site.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "completed_datetime": {"name": "completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__reason_for_cancellation"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__lab_requests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2877684, "relation_name": "\"app\".\"reporting\".\"ds__lab_requests\"", "raw_code": "{{ lab_requests_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.lab_requests_dataset"], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__lab_requests.sql", "compiled": true, "compiled_code": "\n\nwith lab_test_data as (\n select\n lr.id as lab_request_id,\n string_agg(ltt.name, ', '\n order by ltt.name\n ) as tests,\n max(lt.completed_datetime) as completed_datetime\n from \"app\".\"reporting\".\"lab_requests\" lr\n join \"app\".\"reporting\".\"lab_tests\" lt on lt.lab_request_id = lr.id\n join \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = lt.lab_test_type_id\n where ltt.is_sensitive = False\n group by lr.id\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(lr.requested_datetime, p.date_of_birth)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n f.id as facility_id,\n f.name as facility,\n d.name as department,\n d.id as department_id,\n l.id as location_id,\n l.name as location,\n lg.id as location_group_id,\n lg.name as location_group,\n laboratory.id as laboratory_id,\n laboratory.name as laboratory,\n lr.display_id as request_id,\n case lr.status\n when 'reception_pending' then 'Reception pending'\n when 'results_pending' then 'Results pending'\n when 'to_be_verified' then 'To be verified'\n when 'verified' then 'Verified'\n when 'published' then 'Published'\n when 'cancelled' then 'Cancelled'\n when 'deleted' then 'Deleted'\n when 'sample-not-collected' then 'Sample not collected'\n when 'entered-in-error' then 'Entered in error'\n else lr.status\n end as status,\n lr.status as status_id,\n lr.requested_datetime,\n req_clinician.id as requested_by_id,\n req_clinician.display_name as requested_by,\n lr.department_id as requesting_department_id,\n req_department.name as requesting_department,\n lr.lab_test_priority_id as priority_id,\n priority.name as priority,\n category.id as lab_test_category_id,\n category.name as lab_test_category,\n ltp.name as lab_test_panel,\n lta.tests,\n lr.collected_datetime,\n lr.collected_by_id,\n collector.display_name as collected_by,\n lr.specimen_type_id,\n specimen.name as specimen_type,\n site.name as site,\n lta.completed_datetime,\n case lr.reason_for_cancellation\n when 'clinical' then 'Clinical reason'\n when 'duplicate' then 'Duplicate'\n when 'entered-in-error' then 'Entered in error'\n when 'patient-discharged' then 'Patient discharged'\n when 'patient-refused' then 'Patient refused'\n when 'other' then 'Other'\n else lr.reason_for_cancellation\n end as reason_for_cancellation\nfrom \"app\".\"reporting\".\"lab_requests\" lr\njoin lab_test_data lta on lta.lab_request_id = lr.id\njoin \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" laboratory on laboratory.id = lr.lab_test_laboratory_id\nleft join \"app\".\"reporting\".\"users\" req_clinician on req_clinician.id = lr.requested_by_id\nleft join \"app\".\"reporting\".\"departments\" req_department on req_department.id = lr.department_id\nleft join \"app\".\"reporting\".\"reference_data\" priority on priority.id = lr.lab_test_priority_id\nleft join \"app\".\"reporting\".\"reference_data\" category on category.id = lr.lab_test_category_id\nleft join \"app\".\"reporting\".\"users\" collector on collector.id = lr.collected_by_id\nleft join \"app\".\"reporting\".\"reference_data\" specimen on specimen.id = lr.specimen_type_id\nleft join \"app\".\"reporting\".\"reference_data\" site on site.id = lr.lab_sample_site_id\nleft join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ltpr.lab_test_panel_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__lab_tests": {"database": "app", "schema": "reporting", "name": "ds__lab_tests", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__lab_tests.sql", "original_file_path": "models\\datasets\\standard\\ds__lab_tests.sql", "unique_id": "model.tamanu_source_dbt.ds__lab_tests", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__lab_tests"], "alias": "ds__lab_tests", "checksum": {"name": "sha256", "checksum": "294b1354acbe716e42bfe198c6d31abe317871261363dae78fa362ccb0ea7ae7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Lab tests", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of request", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "lab_request_id": {"name": "lab_request_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "status_id": {"name": "status_id", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id"]}, "lab_test_panel": {"name": "lab_test_panel", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__category_id"]}, "lab_test_category": {"name": "lab_test_category", "description": "Full readable name of the lab test category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "requested_datetime": {"name": "requested_datetime", "description": "When the request was submitted.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "requested_by": {"name": "requested_by", "description": "Display identifier for the user who requested the lab test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "lab_request_published_datetime": {"name": "lab_request_published_datetime", "description": "When this lab request's results were published.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__published_date"]}, "lab_test_date": {"name": "lab_test_date", "description": "Local date for the record in lab_tests.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "result": {"name": "result", "description": "The result of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__result"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_type_id"]}, "lab_test_type": {"name": "lab_test_type", "description": "Human-friendly name of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__name"]}, "lab_test_completed_datetime": {"name": "lab_test_completed_datetime", "description": "Datetime at which the test was completed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__lab_tests.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2877684, "relation_name": "\"app\".\"reporting\".\"ds__lab_tests\"", "raw_code": "{{ lab_tests_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.lab_tests_dataset"], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__lab_tests.sql", "compiled": true, "compiled_code": "\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(lr.requested_datetime, p.date_of_birth::date)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n req_dept.id as requesting_department_id,\n req_dept.name as requesting_department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n lr.display_id as lab_request_id,\n lr.status as status_id,\n case lr.status\n when 'reception_pending' then 'Reception pending'\n when 'results_pending' then 'Results pending'\n when 'to_be_verified' then 'To be verified'\n when 'verified' then 'Verified'\n when 'published' then 'Published'\n when 'cancelled' then 'Cancelled'\n when 'deleted' then 'Deleted'\n when 'sample-not-collected' then 'Sample not collected'\n when 'entered-in-error' then 'Entered in error'\n else lr.status\n end as status,\n ltp.id as lab_test_panel_id,\n ltp.name as lab_test_panel,\n category.id as lab_test_category_id,\n category.name as lab_test_category,\n lr.requested_datetime,\n requester.id as requested_by_id,\n requester.display_name as requested_by,\n lr.published_datetime as lab_request_published_datetime,\n lt.date as lab_test_date,\n lt.result,\n lt.verification,\n ltt.id as lab_test_type_id,\n ltt.name as lab_test_type,\n lt.completed_datetime as lab_test_completed_datetime\nfrom \"app\".\"reporting\".\"lab_requests\" lr\njoin \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"departments\" req_dept on req_dept.id = lr.department_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nleft join \"app\".\"reporting\".\"users\" requester on requester.id = lr.requested_by_id\nleft join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr on ltpr.id = lr.lab_test_panel_request_id\nleft join \"app\".\"reporting\".\"lab_test_panels\" ltp on ltp.id = ltpr.lab_test_panel_id\nleft join \"app\".\"reporting\".\"reference_data\" category on category.id = lr.lab_test_category_id\njoin \"app\".\"reporting\".\"lab_tests\" lt on lt.lab_request_id = lr.id\njoin \"app\".\"reporting\".\"lab_test_types\" ltt on ltt.id = lt.lab_test_type_id\nwhere ltt.is_sensitive = False\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__location_bookings": {"database": "app", "schema": "reporting", "name": "ds__location_bookings", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__location_bookings.sql", "original_file_path": "models\\datasets\\standard\\ds__location_bookings.sql", "unique_id": "model.tamanu_source_dbt.ds__location_bookings", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__location_bookings"], "alias": "ds__location_bookings", "checksum": {"name": "sha256", "checksum": "5c2696edaa85adcd9f5115cb6dde7cb7dea86499475c030a39ce73f99c32eed4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Location bookings", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the booking.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "booking_start_datetime": {"name": "booking_start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "booking_end_datetime": {"name": "booking_end_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "booking_type_id": {"name": "booking_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "booking_type": {"name": "booking_type", "description": "Full readable name of the booking type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "booking_status": {"name": "booking_status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who booked the location.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__location_bookings.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.2877684, "relation_name": "\"app\".\"reporting\".\"ds__location_bookings\"", "raw_code": "{{ location_bookings_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "location_bookings", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.location_bookings_dataset"], "nodes": ["model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__location_bookings.sql", "compiled": true, "compiled_code": "\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(a.start_datetime::date, p.date_of_birth)) as age,\n p.sex,\n vil.id as village_id,\n vil.name as village,\n billing.id as billing_type_id,\n billing.name as billing_type,\n a.start_datetime as booking_start_datetime,\n a.end_datetime as booking_end_datetime,\n a.status as booking_status,\n u.id as clinician_id,\n u.display_name as clinician,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n a.booking_type_id,\n bt.name as booking_type\nfrom \"app\".\"reporting\".\"location_bookings\" a\njoin \"app\".\"reporting\".\"patients\" p on p.id = a.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = a.clinician_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = a.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pd.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" bt on bt.id = a.booking_type_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__medication_dispenses": {"database": "app", "schema": "reporting", "name": "ds__medication_dispenses", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__medication_dispenses.sql", "original_file_path": "models\\datasets\\standard\\ds__medication_dispenses.sql", "unique_id": "model.tamanu_source_dbt.ds__medication_dispenses", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__medication_dispenses"], "alias": "ds__medication_dispenses", "checksum": {"name": "sha256", "checksum": "2742eab92b82d9f0bac6177a2feb8d7812718a5823ad78147e0de2d90c9cf0db"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Medication dispense records", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_dispenses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "quantity": {"name": "quantity", "description": "The quantity of medication units dispensed to the patient in each dispensing.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__quantity"]}, "dispensed_at": {"name": "dispensed_at", "description": "The timestamp indicating when the medication was physically dispensed to the patient.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_at"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the medication was dispensed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the medication was dispensed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "medication_code": {"name": "medication_code", "description": "Full readable name code of the dispensed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "medication": {"name": "medication", "description": "Full readable name name of the dispensed medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__medication_dispenses.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.2877684, "relation_name": "\"app\".\"reporting\".\"ds__medication_dispenses\"", "raw_code": "{{ medication_dispenses_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "medication_dispenses", "package": null, "version": null}, {"name": "pharmacy_order_prescriptions", "package": null, "version": null}, {"name": "pharmacy_orders", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.medication_dispenses_dataset"], "nodes": ["model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__medication_dispenses.sql", "compiled": true, "compiled_code": "\n\nselect\n md.id,\n md.quantity,\n md.dispensed_at,\n po.facility_id,\n f.name as facility,\n pr.medication_id,\n m.code as medication_code,\n m.name as medication\nfrom \"app\".\"reporting\".\"medication_dispenses\" md\njoin \"app\".\"reporting\".\"pharmacy_order_prescriptions\" pop\n on pop.id = md.pharmacy_order_prescription_id\njoin \"app\".\"reporting\".\"pharmacy_orders\" po\n on po.id = pop.pharmacy_order_id\n-- prescription_id is not null on all pharmacy_order_prescriptions rows (enforced by source not_null test).\n-- ongoing_prescription_id is the nullable supplementary reference and is not used for the medication lookup\njoin \"app\".\"reporting\".\"prescriptions\" pr\n on pr.id = pop.prescription_id\njoin \"app\".\"reporting\".\"reference_data\" m\n on m.id = pr.medication_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = po.facility_id\n and f.is_sensitive = False\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__ongoing_conditions": {"database": "app", "schema": "reporting", "name": "ds__ongoing_conditions", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__ongoing_conditions.sql", "original_file_path": "models\\datasets\\standard\\ds__ongoing_conditions.sql", "unique_id": "model.tamanu_source_dbt.ds__ongoing_conditions", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__ongoing_conditions"], "alias": "ds__ongoing_conditions", "checksum": {"name": "sha256", "checksum": "8dab420a4bb3411a2856822e95ca7bfa69d7cdac04a129f82d0711dc47b0c816"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Ongoing conditions", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "age": {"name": "age", "description": "Patient's age when the condition was recorded.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "condition": {"name": "condition", "description": "Full readable name of the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "condition_id": {"name": "condition_id", "description": "Reference to a diagnosis describing this issue ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__condition_id"]}, "recorded_datetime": {"name": "recorded_datetime", "description": "Datetime at which this issue was recorded.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__recorded_date"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording this\r\ncondition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__examiner_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user diagnosing/recording this condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "date_resolved": {"name": "date_resolved", "description": "Datetime at which this issue was resolved.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_date"]}, "clinician_resolving": {"name": "clinician_resolving", "description": "Display identifier for the user who resolved the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__ongoing_conditions.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3035204, "relation_name": "\"app\".\"reporting\".\"ds__ongoing_conditions\"", "raw_code": "select\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(pc.recorded_datetime::date, p.date_of_birth)) as age,\r\n p.sex,\r\n village.name as village,\r\n village.id as village_id,\r\n conditions.name as condition,\r\n conditions.id as condition_id,\r\n pc.recorded_datetime,\r\n clinician.id as clinician_id,\r\n clinician.display_name as clinician,\r\n case when pc.is_resolved then pc.resolved_datetime end as date_resolved,\r\n case when pc.is_resolved then resolving_clinician.display_name end as clinician_resolving\r\nfrom {{ ref('patient_conditions') }} pc\r\njoin {{ ref('patients') }} p on p.id = pc.patient_id\r\njoin {{ ref('reference_data') }} conditions on conditions.id = pc.condition_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('users') }} clinician on clinician.id = pc.recorded_by_id\r\nleft join {{ ref('users') }} resolving_clinician\r\n on resolving_clinician.id = pc.resolved_by_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patient_conditions", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_conditions", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__ongoing_conditions.sql", "compiled": true, "compiled_code": "select\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pc.recorded_datetime::date, p.date_of_birth)) as age,\n p.sex,\n village.name as village,\n village.id as village_id,\n conditions.name as condition,\n conditions.id as condition_id,\n pc.recorded_datetime,\n clinician.id as clinician_id,\n clinician.display_name as clinician,\n case when pc.is_resolved then pc.resolved_datetime end as date_resolved,\n case when pc.is_resolved then resolving_clinician.display_name end as clinician_resolving\nfrom \"app\".\"reporting\".\"patient_conditions\" pc\njoin \"app\".\"reporting\".\"patients\" p on p.id = pc.patient_id\njoin \"app\".\"reporting\".\"reference_data\" conditions on conditions.id = pc.condition_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = pc.recorded_by_id\nleft join \"app\".\"reporting\".\"users\" resolving_clinician\n on resolving_clinician.id = pc.resolved_by_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__outpatient_appointments": {"database": "app", "schema": "reporting", "name": "ds__outpatient_appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments.sql", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments.sql", "unique_id": "model.tamanu_source_dbt.ds__outpatient_appointments", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__outpatient_appointments"], "alias": "ds__outpatient_appointments", "checksum": {"name": "sha256", "checksum": "cb748b9c0a17173f8fc925290ff00c2aae824f974f9d1a4efcc3bfdf96228c37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Appointments", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the appointment.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "contact_number": {"name": "contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`. where available otherwise Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number", "doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "billing_type_id": {"name": "billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "billing_type": {"name": "billing_type", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "appointment_start_datetime": {"name": "appointment_start_datetime", "description": "When the appointment starts.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "appointment_end_datetime": {"name": "appointment_end_datetime", "description": "When the appointment ends.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__appointment_type_id"]}, "appointment_type": {"name": "appointment_type", "description": "Full readable name of the appointment type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "appointment_status": {"name": "appointment_status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "clinician": {"name": "clinician", "description": "Display identifier for the user who booked the appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "priority": {"name": "priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "schedule_id": {"name": "schedule_id", "description": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__schedule_id"]}, "until_date": {"name": "until_date", "description": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__until_date"]}, "interval": {"name": "interval", "description": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\"", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__interval"]}, "frequency": {"name": "frequency", "description": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__frequency"]}, "nth_weekday": {"name": "nth_weekday", "description": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__nth_weekday"]}, "days_of_week": {"name": "days_of_week", "description": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__days_of_week"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Display identifier for the user who created the appointment, sourced from the earliest change log entry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "created_by": {"name": "created_by", "description": "Display name of the user who created the appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__outpatient_appointments.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3035204, "relation_name": "\"app\".\"reporting\".\"ds__outpatient_appointments\"", "raw_code": "{{ outpatient_appointments_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments_change_logs", "package": null, "version": null}, {"name": "outpatient_appointments", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.outpatient_appointments_dataset"], "nodes": ["model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__outpatient_appointments.sql", "compiled": true, "compiled_code": "\n\nwith appointment_creators as (\n select\n appointment_id,\n created_by_user_id\n from \"app\".\"reporting\".\"outpatient_appointments_change_logs\"\n where change_sequence = 1\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(a.start_datetime, p.date_of_birth)) as age,\n p.sex,\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\n vil.id as village_id,\n vil.name as village,\n billing.id as billing_type_id,\n billing.name as billing_type,\n a.start_datetime as appointment_start_datetime,\n a.end_datetime as appointment_end_datetime,\n a.appointment_type_id,\n apt.name as appointment_type,\n a.status as appointment_status,\n u.id as clinician_id,\n u.display_name as clinician,\n lg.id as location_group_id,\n lg.name as location_group,\n a.priority,\n a.schedule_id,\n a.until_date,\n a.interval,\n a.days_of_week,\n a.frequency,\n a.nth_weekday,\n ac.created_by_user_id,\n creator.display_name as created_by\nfrom \"app\".\"reporting\".\"outpatient_appointments\" a\njoin \"app\".\"reporting\".\"patients\" p on p.id = a.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = a.clinician_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = a.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = lg.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pd.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" vil on vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" apt on apt.id = a.appointment_type_id\nleft join appointment_creators ac on ac.appointment_id = a.id\nleft join \"app\".\"reporting\".\"users\" creator on creator.id = ac.created_by_user_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__outpatient_appointments_audit": {"database": "app", "schema": "reporting", "name": "ds__outpatient_appointments_audit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments_audit.sql", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments_audit.sql", "unique_id": "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__outpatient_appointments_audit"], "alias": "ds__outpatient_appointments_audit", "checksum": {"name": "sha256", "checksum": "ca5aceba0bb67c1362aeeef99ec4cfa3e97ccdd4d4f104adcf61ce1d8521a3e7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "dataset", "clinical", "audit"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "dataset", "clinical", "audit"], "description": "Dataset for outpatient appointment audit report. Tracks all modifications and cancellations to appointments, showing both current and previous values. Excludes status-only changes unless the status changes to 'Cancelled'.\n", "columns": {"change_id": {"name": "change_id", "description": "Unique identifier for the change log entry (UUID from logs.changes).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id"]}, "appointment_id": {"name": "appointment_id", "description": "Reference to the [appointment](#!/model/model.tamanu_source_dbt.outpatient_appointments) that was modified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id"]}, "change_number": {"name": "change_number", "description": "Sequential change number for this appointment where initial creation is excluded. 1 = first modification, 2 = second modification, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__change_number"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/model/model.tamanu_source_dbt.patients) associated with the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "appointment_start_datetime": {"name": "appointment_start_datetime", "description": "Current appointment start date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime"]}, "appointment_end_datetime": {"name": "appointment_end_datetime", "description": "Current appointment end date and time (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime"]}, "appointment_type": {"name": "appointment_type", "description": "Current Actual data for appointment type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Current [appointment type](#!/model/model.tamanu_source_dbt.reference_data) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id"]}, "clinician": {"name": "clinician", "description": "Current The human readable display name for the user. for clinician", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "clinician_id": {"name": "clinician_id", "description": "Current [clinician](#!/model/model.tamanu_source_dbt.users) ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id"]}, "location_group": {"name": "location_group", "description": "Current Full readable name for location group for area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "location_group_id": {"name": "location_group_id", "description": "Current [location group](#!/model/model.tamanu_source_dbt.location_groups)/area ID (after the change).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id"]}, "priority": {"name": "priority", "description": "Current Current priority status (after the change). Boolean indicating if the appointment is high priority. formatted as Yes/No", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority"]}, "schedule_id": {"name": "schedule_id", "description": "Current recurring schedule ID (after the change). References appointment_schedules table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id"]}, "is_repeating": {"name": "is_repeating", "description": "Whether the appointment is part of a repeating schedule. Values: Yes (has schedule_id), No (no schedule_id).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_repeating"]}, "created_by": {"name": "created_by", "description": "The human readable display name for the user. who created the appointment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who originally created the appointment.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id"]}, "modified_by": {"name": "modified_by", "description": "The human readable display name for the user. who modified the appointment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "modified_by_user_id": {"name": "modified_by_user_id", "description": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who made the modification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id"]}, "modified_datetime": {"name": "modified_datetime", "description": "Timestamp when the change was logged (from logs.changes.logged_at).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime"]}, "is_cancelled": {"name": "is_cancelled", "description": "Whether the appointment status is 'Cancelled'. Values: Yes/No.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_cancelled"]}, "prev_start_datetime": {"name": "prev_start_datetime", "description": "Previous appointment start date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime"]}, "prev_end_datetime": {"name": "prev_end_datetime", "description": "Previous appointment end date and time (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime"]}, "prev_appointment_type": {"name": "prev_appointment_type", "description": "Previous Actual data for appointment type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "prev_appointment_type_id": {"name": "prev_appointment_type_id", "description": "Previous appointment type ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id"]}, "prev_clinician": {"name": "prev_clinician", "description": "Previous The human readable display name for the user. for clinician", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "prev_clinician_id": {"name": "prev_clinician_id", "description": "Previous clinician ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id"]}, "prev_location_group": {"name": "prev_location_group", "description": "Previous Full readable name for location group for area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "prev_location_group_id": {"name": "prev_location_group_id", "description": "Previous location group/area ID (before the change). Null for creation events (change_sequence = 1).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id"]}, "prev_priority": {"name": "prev_priority", "description": "Previous Previous priority status (before the change). Null for creation events (change_sequence = 1). formatted as Yes/No", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority"]}, "facility_id": {"name": "facility_id", "description": "Tamanu internal identifier (generally a UUID) in facilities (for filtering)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "facility": {"name": "facility", "description": "Full readable name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__outpatient_appointments_audit.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["dataset", "clinical", "audit"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3035204, "relation_name": "\"app\".\"reporting\".\"ds__outpatient_appointments_audit\"", "raw_code": "{{ outpatient_appointments_audit_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments_change_logs", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [["tamanu", "appointment_schedules"], ["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.outpatient_appointments_audit_dataset"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__outpatient_appointments_audit.sql", "compiled": true, "compiled_code": "\n\n-- Outpatient Appointments Audit Dataset\n-- This dataset tracks changes/modifications to outpatient appointments\n-- Each row represents a modification event (excludes initial creation)\n--\n-- Included changes:\n-- - Status changed to 'Cancelled' (individual cancellations only)\n-- - Changes to: start/end datetime, clinician, location group, appointment type, priority\n--\n-- Excluded changes:\n-- - Initial appointment creation (change_sequence = 1)\n-- - Status-only changes (unless changing to 'Cancelled')\n-- - Appointments automatically cancelled when their schedule was cancelled\n-- (i.e., bulk cancellations via \"cancel this and all future appointments\")\n--\n-- change_number: starts from 1 for the first modification, increments for subsequent changes\n--\n-- Note: schedule_id never changes on existing appointments in Tamanu.\n-- When a schedule is modified, old appointments are cancelled and new ones are created.\n\nwith change_evaluation as (\n select\n cl.*,\n -- Determine if this change has meaningful field modifications\n case\n -- Status changed to Cancelled\n when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true\n -- Any non-status fields changed\n when (\n cl.prev_start_datetime is distinct from cl.start_datetime\n or cl.prev_end_datetime is distinct from cl.end_datetime\n or cl.prev_clinician_id is distinct from cl.clinician_id\n or cl.prev_location_group_id is distinct from cl.location_group_id\n or cl.prev_appointment_type_id is distinct from cl.appointment_type_id\n or cl.prev_is_high_priority is distinct from cl.is_high_priority\n ) then true\n else false\n end as is_meaningful_change\n from \"app\".\"reporting\".\"outpatient_appointments_change_logs\" cl\n left join \"app\".\"public\".\"appointment_schedules\" s on s.id = cl.schedule_id\n where\n -- Exclude appointments that were automatically cancelled when the schedule was cancelled\n -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule)\n not (\n cl.status = 'Cancelled'\n and s.cancelled_at_date is not null\n and cl.start_datetime::date > s.cancelled_at_date::date\n )\n),\n\nnumbered_changes as (\n select\n ce.*,\n -- Assign change number: starts from 1 for first modification\n row_number() over (\n partition by ce.appointment_id\n order by ce.modified_datetime\n ) as change_number\n from change_evaluation ce\n where ce.is_meaningful_change = true\n and ce.change_sequence > 1 -- Exclude initial creation\n)\n\nselect\n fc.change_id,\n fc.appointment_id,\n fc.change_number,\n -- Patient details\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n -- Current appointment details\n fc.start_datetime as appointment_start_datetime,\n fc.end_datetime as appointment_end_datetime,\n apt.name as appointment_type,\n fc.appointment_type_id,\n clinician.display_name as clinician,\n fc.clinician_id,\n lg.name as location_group,\n fc.location_group_id,\n case when fc.is_high_priority then 'Yes' else 'No' end as priority,\n fc.schedule_id,\n case\n when fc.schedule_id is not null then 'Yes'\n else 'No'\n end as is_repeating,\n -- Modification details\n creator.display_name as created_by,\n fc.created_by_user_id,\n modifier.display_name as modified_by,\n fc.modified_by_user_id,\n fc.modified_datetime,\n case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled,\n -- Previous appointment details (only shown if different from current)\n case\n when fc.prev_start_datetime is distinct from fc.start_datetime\n then fc.prev_start_datetime\n end as prev_start_datetime,\n case\n when fc.prev_end_datetime is distinct from fc.end_datetime\n then fc.prev_end_datetime\n end as prev_end_datetime,\n case\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\n then prev_apt.name\n end as prev_appointment_type,\n case\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\n then fc.prev_appointment_type_id\n end as prev_appointment_type_id,\n case\n when fc.prev_clinician_id is distinct from fc.clinician_id\n then prev_clinician.display_name\n end as prev_clinician,\n case\n when fc.prev_clinician_id is distinct from fc.clinician_id\n then fc.prev_clinician_id\n end as prev_clinician_id,\n case\n when fc.prev_location_group_id is distinct from fc.location_group_id\n then prev_lg.name\n end as prev_location_group,\n case\n when fc.prev_location_group_id is distinct from fc.location_group_id\n then fc.prev_location_group_id\n end as prev_location_group_id,\n case\n when fc.prev_is_high_priority is not null\n and fc.prev_is_high_priority is distinct from fc.is_high_priority\n then case when fc.prev_is_high_priority then 'Yes' else 'No' end\n end as prev_priority,\n -- Facility details for filtering\n f.id as facility_id,\n f.name as facility\nfrom numbered_changes fc\njoin \"app\".\"reporting\".\"patients\" p on p.id = fc.patient_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = fc.clinician_id\nleft join \"app\".\"reporting\".\"users\" prev_clinician on prev_clinician.id = fc.prev_clinician_id\nleft join \"app\".\"reporting\".\"users\" creator on creator.id = fc.created_by_user_id\nleft join \"app\".\"reporting\".\"users\" modifier on modifier.id = fc.modified_by_user_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = fc.location_group_id\nleft join \"app\".\"reporting\".\"location_groups\" prev_lg on prev_lg.id = fc.prev_location_group_id\nleft join \"app\".\"reporting\".\"reference_data\" apt on apt.id = fc.appointment_type_id\nleft join \"app\".\"reporting\".\"reference_data\" prev_apt on prev_apt.id = fc.prev_appointment_type_id\nleft join \"app\".\"public\".\"appointment_schedules\" s on s.id = fc.schedule_id\n-- Join to facility for filtering by sensitivity\njoin \"app\".\"reporting\".\"facilities\" f on f.id = lg.facility_id\n and f.is_sensitive = False\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patients": {"database": "app", "schema": "reporting", "name": "ds__patients", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__patients.sql", "original_file_path": "models\\datasets\\standard\\ds__patients.sql", "unique_id": "model.tamanu_source_dbt.ds__patients", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__patients"], "alias": "ds__patients", "checksum": {"name": "sha256", "checksum": "66f9b8ca402db02f876217583e643b915bad1975203bbbeb7b61c4045cdd4938"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "patient"], "description": "Patients", "columns": {"registration_date": {"name": "registration_date", "description": "Timestamp of when record was created from the patients_metadata.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "registered_by": {"name": "registered_by", "description": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number. the patient record is registered by.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {"metrics": {"total_patients_count": {"type": "count"}}}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"metrics": {"total_patients_count": {"type": "count"}}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village": {"name": "village", "description": "Full readable name of the village", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "birth_certificate": {"name": "birth_certificate", "description": "Birth certificate identifier.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__birth_certificate"]}, "driving_license": {"name": "driving_license", "description": "Driving licence identifier.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__driving_license"]}, "passport": {"name": "passport", "description": "Passport number.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__passport"]}, "blood_type": {"name": "blood_type", "description": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__blood_type"]}, "title": {"name": "title", "description": "Patient name: title.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__title"]}, "marital_status": {"name": "marital_status", "description": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__marital_status"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "country_of_birth": {"name": "country_of_birth", "description": "Full readable name of the country of birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "nationality": {"name": "nationality", "description": "Full readable name of the nationality.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "ethnicity": {"name": "ethnicity", "description": "Full readable name of the ethnicity.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "occupation": {"name": "occupation", "description": "Full readable name of the occupation.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "religion": {"name": "religion", "description": "Full readable name of the religion.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "patient_billing_type": {"name": "patient_billing_type", "description": "Full readable name of the patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "mother_id": {"name": "mother_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father_id": {"name": "father_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "street_village": {"name": "street_village", "description": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__street_village"]}, "registration_type": {"name": "registration_type", "description": "Indicates whether the patient was registered as a birth or patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "age": {"name": "age", "description": "Patient's age", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "status": {"name": "status", "description": "Indicates whether the patient is alive or deceased.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__patients.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3035204, "relation_name": "\"app\".\"reporting\".\"ds__patients\"", "raw_code": "select\r\n p.created_datetime as registration_date,\r\n u.display_name as registered_by,\r\n p.id as patient_id,\r\n p.first_name,\r\n p.middle_name,\r\n p.last_name,\r\n p.cultural_name,\r\n p.display_id,\r\n p.sex,\r\n p.village_id,\r\n village.name as village,\r\n p.date_of_birth,\r\n p.date_of_death,\r\n pad.birth_certificate,\r\n pad.driving_license,\r\n pad.passport,\r\n pad.blood_type,\r\n pad.title,\r\n pad.marital_status,\r\n pad.primary_contact_number,\r\n pad.secondary_contact_number,\r\n cob.name as country_of_birth,\r\n nationality.name as nationality,\r\n ethnicity.name as ethnicity,\r\n occupation.name as occupation,\r\n religion.name as religion,\r\n billing.name as patient_billing_type,\r\n pad.mother_id,\r\n pad.father_id,\r\n pad.street_village,\r\n case\r\n when pbd.patient_id is null then 'Patient'\r\n else 'Birth'\r\n end as registration_type,\r\n date_part(\r\n 'year',\r\n age(\r\n coalesce(p.date_of_death::date, current_date),\r\n p.date_of_birth\r\n )\r\n ) as age,\r\n case\r\n when p.date_of_death is not null then 'Deceased'\r\n else 'Alive'\r\n end as status\r\nfrom {{ ref(\"patients\") }} p\r\nleft join {{ ref(\"patient_additional_data\") }} pad on pad.patient_id = p.id\r\nleft join {{ ref(\"patient_birth_data\") }} pbd on pbd.patient_id = p.id\r\nleft join {{ ref(\"users\") }} u on u.id = pad.registered_by_id\r\nleft join {{ ref(\"reference_data\") }} village on village.id = p.village_id and village.type = 'village'\r\nleft join {{ ref(\"reference_data\") }} cob on cob.id = pad.country_of_birth_id and cob.type = 'country'\r\nleft join {{ ref(\"reference_data\") }} nationality on nationality.id = pad.nationality_id and nationality.type = 'nationality'\r\nleft join {{ ref(\"reference_data\") }} ethnicity on ethnicity.id = pad.ethnicity_id and ethnicity.type = 'ethnicity'\r\nleft join {{ ref(\"reference_data\") }} occupation on occupation.id = pad.occupation_id and occupation.type = 'occupation'\r\nleft join {{ ref(\"reference_data\") }} religion on religion.id = pad.religion_id and religion.type = 'religion'\r\nleft join {{ ref(\"reference_data\") }} billing on billing.id = pad.patient_billing_type_id and billing.type = 'patientBillingType'", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "patient_birth_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__patients.sql", "compiled": true, "compiled_code": "select\n p.created_datetime as registration_date,\n u.display_name as registered_by,\n p.id as patient_id,\n p.first_name,\n p.middle_name,\n p.last_name,\n p.cultural_name,\n p.display_id,\n p.sex,\n p.village_id,\n village.name as village,\n p.date_of_birth,\n p.date_of_death,\n pad.birth_certificate,\n pad.driving_license,\n pad.passport,\n pad.blood_type,\n pad.title,\n pad.marital_status,\n pad.primary_contact_number,\n pad.secondary_contact_number,\n cob.name as country_of_birth,\n nationality.name as nationality,\n ethnicity.name as ethnicity,\n occupation.name as occupation,\n religion.name as religion,\n billing.name as patient_billing_type,\n pad.mother_id,\n pad.father_id,\n pad.street_village,\n case\n when pbd.patient_id is null then 'Patient'\n else 'Birth'\n end as registration_type,\n date_part(\n 'year',\n age(\n coalesce(p.date_of_death::date, current_date),\n p.date_of_birth\n )\n ) as age,\n case\n when p.date_of_death is not null then 'Deceased'\n else 'Alive'\n end as status\nfrom \"app\".\"reporting\".\"patients\" p\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"patient_birth_data\" pbd on pbd.patient_id = p.id\nleft join \"app\".\"reporting\".\"users\" u on u.id = pad.registered_by_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id and village.type = 'village'\nleft join \"app\".\"reporting\".\"reference_data\" cob on cob.id = pad.country_of_birth_id and cob.type = 'country'\nleft join \"app\".\"reporting\".\"reference_data\" nationality on nationality.id = pad.nationality_id and nationality.type = 'nationality'\nleft join \"app\".\"reporting\".\"reference_data\" ethnicity on ethnicity.id = pad.ethnicity_id and ethnicity.type = 'ethnicity'\nleft join \"app\".\"reporting\".\"reference_data\" occupation on occupation.id = pad.occupation_id and occupation.type = 'occupation'\nleft join \"app\".\"reporting\".\"reference_data\" religion on religion.id = pad.religion_id and religion.type = 'religion'\nleft join \"app\".\"reporting\".\"reference_data\" billing on billing.id = pad.patient_billing_type_id and billing.type = 'patientBillingType'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patients_access_logs": {"database": "app", "schema": "reporting", "name": "ds__patients_access_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__patients_access_logs.sql", "original_file_path": "models\\datasets\\standard\\ds__patients_access_logs.sql", "unique_id": "model.tamanu_source_dbt.ds__patients_access_logs", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__patients_access_logs"], "alias": "ds__patients_access_logs", "checksum": {"name": "sha256", "checksum": "38c690024df58cac627e940c5dc405b92aaca10fe4037f86fe8179560ee065a1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "administration"], "description": "Patient record views tracking which users accessed patient records. If the user's details is blank, it indicates that the user has been deleted from Tamanu.", "columns": {"patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) in patients (UUID format).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu internal identifier (generally a UUID) in reference_data for village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "village": {"name": "village", "description": "Full readable name village name where patient resides.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "viewed_by_user_id": {"name": "viewed_by_user_id", "description": "Tamanu internal identifier (generally a UUID) in users who viewed the patient record.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "viewed_by_user": {"name": "viewed_by_user", "description": "The human readable display name for the user. who viewed the patient record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "user_email": {"name": "user_email", "description": "Email address for user. This is used to login and receive emails. of the user who viewed the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__email"]}, "user_role": {"name": "user_role", "description": "The role of the user, which sets their permission level.\r\n\r\nThe special values `admin` and `system` indicate a superadmin and a system user respectively. of the user who viewed the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__role"]}, "viewed_at_facility": {"name": "viewed_at_facility", "description": "Full readable name. where the user was logged in when viewing the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}, "date_time_viewed": {"name": "date_time_viewed", "description": "Local date and time for the record when the patient record was accessed.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the access occurred.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "is_mobile": {"name": "is_mobile", "description": "Whether or not the user accessed the record from mobile", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__is_mobile"]}, "session_id": {"name": "session_id", "description": "The user session that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__session_id"]}, "device_id": {"name": "device_id", "description": "The id for the device that the user was accessing the record on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__device_id"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__patients_access_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3035204, "relation_name": "\"app\".\"reporting\".\"ds__patients_access_logs\"", "raw_code": "with grouped_access_logs as (\r\n select\r\n lap.patient_id,\r\n lap.user_id,\r\n lap.facility_id,\r\n date_trunc('minute', min(lap.logged_at)) as date_time_viewed,\r\n -- Take the first values for fields that might vary within the same minute\r\n lap.is_mobile,\r\n lap.session_id,\r\n lap.device_id\r\n from {{ ref('patients_access_logs') }} lap\r\n group by\r\n lap.patient_id,\r\n lap.user_id,\r\n lap.facility_id,\r\n lap.is_mobile,\r\n lap.session_id,\r\n lap.device_id\r\n)\r\n\r\nselect\r\n gal.patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n p.village_id,\r\n village.name as village,\r\n gal.user_id as viewed_by_user_id,\r\n u.display_name as viewed_by_user,\r\n u.email as user_email,\r\n u.role as user_role,\r\n f.name as viewed_at_facility,\r\n gal.date_time_viewed,\r\n gal.facility_id,\r\n gal.is_mobile,\r\n gal.session_id,\r\n gal.device_id\r\nfrom grouped_access_logs gal\r\njoin {{ ref('patients') }} p on p.id = gal.patient_id\r\nleft join {{ ref('users') }} u on u.id = gal.user_id\r\nleft join {{ ref('facilities') }} f on f.id = gal.facility_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients_access_logs", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients_access_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__patients_access_logs.sql", "compiled": true, "compiled_code": "with grouped_access_logs as (\n select\n lap.patient_id,\n lap.user_id,\n lap.facility_id,\n date_trunc('minute', min(lap.logged_at)) as date_time_viewed,\n -- Take the first values for fields that might vary within the same minute\n lap.is_mobile,\n lap.session_id,\n lap.device_id\n from \"app\".\"reporting\".\"patients_access_logs\" lap\n group by\n lap.patient_id,\n lap.user_id,\n lap.facility_id,\n lap.is_mobile,\n lap.session_id,\n lap.device_id\n)\n\nselect\n gal.patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n village.name as village,\n gal.user_id as viewed_by_user_id,\n u.display_name as viewed_by_user,\n u.email as user_email,\n u.role as user_role,\n f.name as viewed_at_facility,\n gal.date_time_viewed,\n gal.facility_id,\n gal.is_mobile,\n gal.session_id,\n gal.device_id\nfrom grouped_access_logs gal\njoin \"app\".\"reporting\".\"patients\" p on p.id = gal.patient_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = gal.user_id\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = gal.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patients_change_logs": {"database": "app", "schema": "reporting", "name": "ds__patients_change_logs", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__patients_change_logs.sql", "original_file_path": "models\\datasets\\standard\\ds__patients_change_logs.sql", "unique_id": "model.tamanu_source_dbt.ds__patients_change_logs", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__patients_change_logs"], "alias": "ds__patients_change_logs", "checksum": {"name": "sha256", "checksum": "cc0cab715768647073c8b49b36b636f333d5685c1852174b29d9b6d67f7fa5b2"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "patient", "history"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "patient", "history"], "description": "Patient details edits tracking - lists all users that have edited patient personal details or additional data with timestamps.", "columns": {"patient_id": {"name": "patient_id", "description": "Tamanu internal identifier (generally a UUID) of the patient whose details were edited.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table. of the patient whose details were edited.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient at the time of edit.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other` at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Village name where the patient resides at the time of edit.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "edited_by_user_id": {"name": "edited_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on. of the user who edited the patient details.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "edited_by_user": {"name": "edited_by_user", "description": "Display name of the user who edited the patient details.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email address of the user who edited the patient details.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_role": {"name": "user_role", "description": "Role of the user who edited the patient details.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "edited_datetime": {"name": "edited_datetime", "description": "Date and time when the patient details were edited.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__patients_change_logs.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["patient", "history"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3035204, "relation_name": "\"app\".\"reporting\".\"ds__patients_change_logs\"", "raw_code": "with patient_edits as (\r\n -- Patient details edits\r\n select\r\n lcp.id as patient_id,\r\n lcp.display_id,\r\n lcp.first_name,\r\n lcp.last_name,\r\n lcp.date_of_birth,\r\n lcp.sex,\r\n lcp.village_id,\r\n lcp.updated_by_user_id,\r\n lcp.logged_at\r\n from {{ ref('patients_change_logs') }} lcp\r\n\r\n union all\r\n\r\n -- Patient additional data edits\r\n select\r\n lcpad.patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n p.village_id,\r\n lcpad.updated_by_user_id,\r\n lcpad.logged_at\r\n from {{ ref('patient_additional_data_change_logs') }} lcpad\r\n left join {{ ref('patients') }} p on p.id = lcpad.patient_id\r\n),\r\n\r\ngrouped_edits as (\r\n select\r\n pe.patient_id,\r\n pe.display_id,\r\n pe.first_name,\r\n pe.last_name,\r\n pe.date_of_birth,\r\n pe.sex,\r\n pe.village_id,\r\n pe.updated_by_user_id,\r\n date_trunc('minute', pe.logged_at) as edited_datetime\r\n from patient_edits pe\r\n group by\r\n pe.patient_id,\r\n pe.display_id,\r\n pe.first_name,\r\n pe.last_name,\r\n pe.date_of_birth,\r\n pe.sex,\r\n pe.village_id,\r\n pe.updated_by_user_id,\r\n date_trunc('minute', pe.logged_at)\r\n)\r\n\r\nselect\r\n ge.patient_id,\r\n ge.display_id,\r\n ge.first_name,\r\n ge.last_name,\r\n ge.date_of_birth,\r\n ge.sex,\r\n ge.village_id,\r\n village.name as village,\r\n ge.updated_by_user_id as edited_by_user_id,\r\n u.display_name as edited_by_user,\r\n u.email as user_email,\r\n u.role as user_role,\r\n ge.edited_datetime\r\nfrom grouped_edits ge\r\nleft join {{ ref('users') }} u on u.id = ge.updated_by_user_id\r\nleft join {{ ref('reference_data') }} village on village.id = ge.village_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients_change_logs", "package": null, "version": null}, {"name": "patient_additional_data_change_logs", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients_change_logs", "model.tamanu_source_dbt.patient_additional_data_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__patients_change_logs.sql", "compiled": true, "compiled_code": "with patient_edits as (\n -- Patient details edits\n select\n lcp.id as patient_id,\n lcp.display_id,\n lcp.first_name,\n lcp.last_name,\n lcp.date_of_birth,\n lcp.sex,\n lcp.village_id,\n lcp.updated_by_user_id,\n lcp.logged_at\n from \"app\".\"reporting\".\"patients_change_logs\" lcp\n\n union all\n\n -- Patient additional data edits\n select\n lcpad.patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n p.village_id,\n lcpad.updated_by_user_id,\n lcpad.logged_at\n from \"app\".\"reporting\".\"patient_additional_data_change_logs\" lcpad\n left join \"app\".\"reporting\".\"patients\" p on p.id = lcpad.patient_id\n),\n\ngrouped_edits as (\n select\n pe.patient_id,\n pe.display_id,\n pe.first_name,\n pe.last_name,\n pe.date_of_birth,\n pe.sex,\n pe.village_id,\n pe.updated_by_user_id,\n date_trunc('minute', pe.logged_at) as edited_datetime\n from patient_edits pe\n group by\n pe.patient_id,\n pe.display_id,\n pe.first_name,\n pe.last_name,\n pe.date_of_birth,\n pe.sex,\n pe.village_id,\n pe.updated_by_user_id,\n date_trunc('minute', pe.logged_at)\n)\n\nselect\n ge.patient_id,\n ge.display_id,\n ge.first_name,\n ge.last_name,\n ge.date_of_birth,\n ge.sex,\n ge.village_id,\n village.name as village,\n ge.updated_by_user_id as edited_by_user_id,\n u.display_name as edited_by_user,\n u.email as user_email,\n u.role as user_role,\n ge.edited_datetime\nfrom grouped_edits ge\nleft join \"app\".\"reporting\".\"users\" u on u.id = ge.updated_by_user_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = ge.village_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patient_program_registrations": {"database": "app", "schema": "reporting", "name": "ds__patient_program_registrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__patient_program_registrations.sql", "original_file_path": "models\\datasets\\standard\\ds__patient_program_registrations.sql", "unique_id": "model.tamanu_source_dbt.ds__patient_program_registrations", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__patient_program_registrations"], "alias": "ds__patient_program_registrations", "checksum": {"name": "sha256", "checksum": "eb450c33b13d2d7a37deab6c2623e15c772ba96299e016b9c2fa9b15ad601392"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Patient program registrations", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "registering_facility_id": {"name": "registering_facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id"]}, "registering_facility": {"name": "registering_facility", "description": "Full readable name of the facility where the patient was registered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinician_id"]}, "registered_by": {"name": "registered_by", "description": "Display identifier for the user who registered the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "currently_at": {"name": "currently_at", "description": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__currently_at_type"]}, "currently_at_type": {"name": "currently_at_type", "description": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__currently_at_type"]}, "related_conditions": {"name": "related_conditions", "description": "Full list of conditions", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patient_conditions"]}, "clinical_status_id": {"name": "clinical_status_id", "description": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id"]}, "clinical_status": {"name": "clinical_status", "description": "Full readable name of the clinical status.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "registration_status": {"name": "registration_status", "description": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registration_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__program_registry_id"]}, "subdivision_id": {"name": "subdivision_id", "description": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__subdivision_id"]}, "subdivision": {"name": "subdivision", "description": "Full readable name of the patient's subdivision.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "division_id": {"name": "division_id", "description": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__division_id"]}, "division": {"name": "division", "description": "Full readable name of the patient's division.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "registration_datetime": {"name": "registration_datetime", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "deactivated_by_id": {"name": "deactivated_by_id", "description": "The clinician that removed the patient from the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id"]}, "deactivated_by": {"name": "deactivated_by", "description": "Display identifier for the user who deactivated the patient program registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "deactivated_datetime": {"name": "deactivated_datetime", "description": "The date that the patient from the program registry.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_date"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "emergency_contact_name": {"name": "emergency_contact_name", "description": "Name of emergency contact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name"]}, "emergency_contact_number": {"name": "emergency_contact_number", "description": "Phone number of emergency contact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__patient_program_registrations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3195822, "relation_name": "\"app\".\"reporting\".\"ds__patient_program_registrations\"", "raw_code": "with related_conditions as (\r\n select\r\n ppr.id as patient_program_registration_id,\r\n string_agg(\r\n prc.name, '; '\r\n order by pprc.datetime\r\n ) as conditions,\r\n array_agg(\r\n pprc.program_registry_condition_id\r\n order by pprc.datetime\r\n ) as condition_ids,\r\n string_agg(\r\n prcc.name, '; '\r\n order by pprc.datetime\r\n ) as condition_categories,\r\n array_agg(\r\n pprc.program_registry_condition_category_id\r\n order by pprc.datetime\r\n ) as condition_category_ids\r\n from {{ ref('patient_program_registration_conditions') }} pprc\r\n join {{ ref('patient_program_registrations') }} ppr on ppr.id = pprc.patient_program_registration_id\r\n left join {{ ref('program_registry_conditions') }} prc on prc.id = pprc.program_registry_condition_id\r\n left join {{ ref('program_registry_condition_categories') }} prcc on prcc.id = pprc.program_registry_condition_category_id\r\n group by ppr.id\r\n)\r\n\r\nselect\r\n ppr.id as patient_program_registration_id,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n registering_facility.id as registering_facility_id,\r\n registering_facility.name as registering_facility,\r\n registered_by.id as registered_by_id,\r\n registered_by.display_name as registered_by,\r\n case\r\n when pr.currently_at_type = 'facility' then currently_at_facility.name\r\n when pr.currently_at_type = 'village' then currently_at_village.name\r\n end as currently_at,\r\n pr.currently_at_type,\r\n c.condition_ids as related_condition_ids,\r\n c.conditions as related_conditions,\r\n c.condition_category_ids as related_condition_category_ids,\r\n c.condition_categories as related_condition_categories,\r\n prcs.id as clinical_status_id,\r\n prcs.name as clinical_status,\r\n ppr.registration_status,\r\n ppr.program_registry_id,\r\n subdivision.id as subdivision_id,\r\n subdivision.name as subdivision,\r\n division.id as division_id,\r\n division.name as division,\r\n ppr.datetime as registration_datetime,\r\n ppr.deactivated_by_id,\r\n deactivated_by.display_name as deactivated_by,\r\n ppr.deactivated_datetime,\r\n pad.primary_contact_number,\r\n pad.secondary_contact_number,\r\n pad.emergency_contact_name,\r\n pad.emergency_contact_number\r\nfrom {{ ref('patient_program_registrations') }} ppr\r\njoin {{ ref('program_registries') }} pr on pr.id = ppr.program_registry_id\r\njoin {{ ref('patients') }} p on p.id = ppr.patient_id\r\nleft join {{ ref(\"patient_additional_data\") }} pad on pad.patient_id = p.id\r\nleft join {{ ref('facilities') }} registering_facility on registering_facility.id = ppr.registering_facility_id\r\nleft join {{ ref('users') }} registered_by on registered_by.id = ppr.registered_by_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('facilities') }} currently_at_facility on currently_at_facility.id = ppr.facility_id\r\nleft join {{ ref('reference_data') }} subdivision on subdivision.id = pad.subdivision_id\r\nleft join {{ ref('reference_data') }} division on division.id = pad.division_id\r\nleft join {{ ref('reference_data') }} currently_at_village on currently_at_village.id = ppr.village_id\r\nleft join related_conditions c on c.patient_program_registration_id = ppr.id\r\nleft join {{ ref('program_registry_clinical_statuses') }} prcs on prcs.id = ppr.clinical_status_id\r\nleft join {{ ref('users') }} deactivated_by on deactivated_by.id = ppr.deactivated_by_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "patient_program_registration_conditions", "package": null, "version": null}, {"name": "patient_program_registrations", "package": null, "version": null}, {"name": "program_registry_conditions", "package": null, "version": null}, {"name": "program_registry_condition_categories", "package": null, "version": null}, {"name": "patient_program_registrations", "package": null, "version": null}, {"name": "program_registries", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "program_registry_clinical_statuses", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_program_registration_conditions", "model.tamanu_source_dbt.patient_program_registrations", "model.tamanu_source_dbt.program_registry_conditions", "model.tamanu_source_dbt.program_registry_condition_categories", "model.tamanu_source_dbt.program_registries", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__patient_program_registrations.sql", "compiled": true, "compiled_code": "with related_conditions as (\n select\n ppr.id as patient_program_registration_id,\n string_agg(\n prc.name, '; '\n order by pprc.datetime\n ) as conditions,\n array_agg(\n pprc.program_registry_condition_id\n order by pprc.datetime\n ) as condition_ids,\n string_agg(\n prcc.name, '; '\n order by pprc.datetime\n ) as condition_categories,\n array_agg(\n pprc.program_registry_condition_category_id\n order by pprc.datetime\n ) as condition_category_ids\n from \"app\".\"reporting\".\"patient_program_registration_conditions\" pprc\n join \"app\".\"reporting\".\"patient_program_registrations\" ppr on ppr.id = pprc.patient_program_registration_id\n left join \"app\".\"reporting\".\"program_registry_conditions\" prc on prc.id = pprc.program_registry_condition_id\n left join \"app\".\"reporting\".\"program_registry_condition_categories\" prcc on prcc.id = pprc.program_registry_condition_category_id\n group by ppr.id\n)\n\nselect\n ppr.id as patient_program_registration_id,\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n p.sex,\n village.id as village_id,\n village.name as village,\n registering_facility.id as registering_facility_id,\n registering_facility.name as registering_facility,\n registered_by.id as registered_by_id,\n registered_by.display_name as registered_by,\n case\n when pr.currently_at_type = 'facility' then currently_at_facility.name\n when pr.currently_at_type = 'village' then currently_at_village.name\n end as currently_at,\n pr.currently_at_type,\n c.condition_ids as related_condition_ids,\n c.conditions as related_conditions,\n c.condition_category_ids as related_condition_category_ids,\n c.condition_categories as related_condition_categories,\n prcs.id as clinical_status_id,\n prcs.name as clinical_status,\n ppr.registration_status,\n ppr.program_registry_id,\n subdivision.id as subdivision_id,\n subdivision.name as subdivision,\n division.id as division_id,\n division.name as division,\n ppr.datetime as registration_datetime,\n ppr.deactivated_by_id,\n deactivated_by.display_name as deactivated_by,\n ppr.deactivated_datetime,\n pad.primary_contact_number,\n pad.secondary_contact_number,\n pad.emergency_contact_name,\n pad.emergency_contact_number\nfrom \"app\".\"reporting\".\"patient_program_registrations\" ppr\njoin \"app\".\"reporting\".\"program_registries\" pr on pr.id = ppr.program_registry_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = ppr.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = p.id\nleft join \"app\".\"reporting\".\"facilities\" registering_facility on registering_facility.id = ppr.registering_facility_id\nleft join \"app\".\"reporting\".\"users\" registered_by on registered_by.id = ppr.registered_by_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nleft join \"app\".\"reporting\".\"facilities\" currently_at_facility on currently_at_facility.id = ppr.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" subdivision on subdivision.id = pad.subdivision_id\nleft join \"app\".\"reporting\".\"reference_data\" division on division.id = pad.division_id\nleft join \"app\".\"reporting\".\"reference_data\" currently_at_village on currently_at_village.id = ppr.village_id\nleft join related_conditions c on c.patient_program_registration_id = ppr.id\nleft join \"app\".\"reporting\".\"program_registry_clinical_statuses\" prcs on prcs.id = ppr.clinical_status_id\nleft join \"app\".\"reporting\".\"users\" deactivated_by on deactivated_by.id = ppr.deactivated_by_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming": {"database": "app", "schema": "reporting", "name": "ds__patient_vaccinations_upcoming", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__patient_vaccinations_upcoming.sql", "original_file_path": "models\\datasets\\standard\\ds__patient_vaccinations_upcoming.sql", "unique_id": "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__patient_vaccinations_upcoming"], "alias": "ds__patient_vaccinations_upcoming", "checksum": {"name": "sha256", "checksum": "0d17504b8760eb77fb0ef196270e4035949622cd613ef2b70909921fcc80eda4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Patient vaccinations upcoming", "columns": {"display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age when patient was vaccinated.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the village", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "due_date": {"name": "due_date", "description": "Due date of the scheduled vaccine.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__due_date"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "vaccine_schedules_id": {"name": "vaccine_schedules_id", "description": "Reference to the [scheduled vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id"]}, "vaccine_name": {"name": "vaccine_name", "description": "Contents of the label column is what will be displayed on the front end of Tamanu \r\nunder fields labelled 'Vaccine'. This is where the vaccine name is listed. E.g. 'BCG'.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__label"]}, "vaccine_schedule": {"name": "vaccine_schedule", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "vaccine_status": {"name": "vaccine_status", "description": "Status of the upcoming vaccination listed ['DUE', 'OVERDUE', 'MISSED', 'SCHEDULED', 'UPCOMING']", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__status"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__patient_vaccinations_upcoming.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3195822, "relation_name": "\"app\".\"reporting\".\"ds__patient_vaccinations_upcoming\"", "raw_code": "select\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.id as patient_id,\r\n p.date_of_birth,\r\n date_part('year', age(p.date_of_birth)) as age,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n pvu.due_date,\r\n pvu.vaccine_category,\r\n pvu.vaccine_schedules_id,\r\n sv.label as vaccine_name,\r\n sv.dose_label as vaccine_schedule,\r\n pvu.status as vaccine_status\r\nfrom {{ ref(\"patient_vaccinations_upcoming\") }} pvu\r\njoin {{ ref(\"patients\") }} p on p.id = pvu.patient_id\r\njoin {{ ref(\"vaccine_schedules\") }} sv on sv.id = pvu.vaccine_schedules_id\r\nleft join {{ ref(\"reference_data\") }} village on village.id = p.village_id\r\nwhere p.date_of_death is null", "doc_blocks": [], "language": "sql", "refs": [{"name": "patient_vaccinations_upcoming", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_vaccinations_upcoming", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__patient_vaccinations_upcoming.sql", "compiled": true, "compiled_code": "select\n p.display_id,\n p.first_name,\n p.last_name,\n p.id as patient_id,\n p.date_of_birth,\n date_part('year', age(p.date_of_birth)) as age,\n p.sex,\n village.id as village_id,\n village.name as village,\n pvu.due_date,\n pvu.vaccine_category,\n pvu.vaccine_schedules_id,\n sv.label as vaccine_name,\n sv.dose_label as vaccine_schedule,\n pvu.status as vaccine_status\nfrom \"app\".\"reporting\".\"patient_vaccinations_upcoming\" pvu\njoin \"app\".\"reporting\".\"patients\" p on p.id = pvu.patient_id\njoin \"app\".\"reporting\".\"vaccine_schedules\" sv on sv.id = pvu.vaccine_schedules_id\nleft join \"app\".\"reporting\".\"reference_data\" village on village.id = p.village_id\nwhere p.date_of_death is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__procedures": {"database": "app", "schema": "reporting", "name": "ds__procedures", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__procedures.sql", "original_file_path": "models\\datasets\\standard\\ds__procedures.sql", "unique_id": "model.tamanu_source_dbt.ds__procedures", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__procedures"], "alias": "ds__procedures", "checksum": {"name": "sha256", "checksum": "acf1f45ba3c9e1d72e460f02b212ade3438fc78c8961bd6c9b0bb08f12f95745"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Procedures", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of the procedure.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "nationality": {"name": "nationality", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "encounter_facility_id": {"name": "encounter_facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "encounter_facility": {"name": "encounter_facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "encounter_department_id": {"name": "encounter_department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "encounter_department": {"name": "encounter_department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "encounter_start_datetime": {"name": "encounter_start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "encounter_end_datetime": {"name": "encounter_end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "procedure_facility_id": {"name": "procedure_facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "procedure_facility": {"name": "procedure_facility", "description": "Full readable name of the facility where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "procedure_area_id": {"name": "procedure_area_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "procedure_area": {"name": "procedure_area", "description": "Full readable name of the location group where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "procedure_location_id": {"name": "procedure_location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "procedure_location": {"name": "procedure_location", "description": "Full readable name of the location where the procedure was performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__procedure_type_id"]}, "procedure_type": {"name": "procedure_type", "description": "Full readable name of the procedure type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "procedure_start_time": {"name": "procedure_start_time", "description": "When the procedure started.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time"]}, "procedure_end_time": {"name": "procedure_end_time", "description": "When the procedure ended, if it's completed.", "meta": {}, "data_type": "time", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time"]}, "procedure_duration": {"name": "procedure_duration", "description": "Duration of the procedure.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__duration"]}, "procedure_clinician_id": {"name": "procedure_clinician_id", "description": "Reference to the [physician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__physician_id"]}, "procedure_clinician": {"name": "procedure_clinician", "description": "Display identifier for the user who performed the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "procedure_anaesthetist_id": {"name": "procedure_anaesthetist_id", "description": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetist_id"]}, "procedure_anaesthetist": {"name": "procedure_anaesthetist", "description": "Display identifier for the user who administered anaesthesia.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "procedure_assistant_anaesthetist_id": {"name": "procedure_assistant_anaesthetist_id", "description": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id"]}, "procedure_assistant_anaesthetist": {"name": "procedure_assistant_anaesthetist", "description": "Display identifier for the user who assisted the anaesthetist in the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "is_completed": {"name": "is_completed", "description": "Whether the procedure has completed.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed"]}, "time_in": {"name": "time_in", "description": "The time when the patient entered the procedure room or when the procedure setup began.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_in"]}, "time_out": {"name": "time_out", "description": "The time when the patient left the procedure room or when the procedure cleanup was completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_out"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__procedures.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3195822, "relation_name": "\"app\".\"reporting\".\"ds__procedures\"", "raw_code": "{{ procedures_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "procedures", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.procedures_dataset"], "nodes": ["model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__procedures.sql", "compiled": true, "compiled_code": "\n\nwith filtered_procedure as (\n select\n pc.*,\n eh.department_id,\n eh.encounter_type,\n row_number() over (\n partition by pc.id\n order by eh.datetime desc\n ) as encounter_history_record\n from \"app\".\"reporting\".\"procedures\" pc\n left join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = pc.encounter_id\n and eh.datetime::date <= pc.date\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.date_of_birth,\n date_part('year', age(pc.date, p.date_of_birth)) as age,\n p.sex,\n nationality.name as nationality,\n encounter_facility.id as encounter_facility_id,\n encounter_facility.name as encounter_facility,\n encounter_department.id as encounter_department_id,\n encounter_department.name as encounter_department,\n case\n when coalesce(pc.encounter_type, e.encounter_type) = 'admission' then 'Hospital Admission'\n when coalesce(pc.encounter_type, e.encounter_type) = 'clinic' then 'Clinic'\n when coalesce(pc.encounter_type, e.encounter_type) in ('triage', 'observation', 'emergency') then 'Triage'\n end as encounter_type,\n e.start_datetime as encounter_start_datetime,\n e.end_datetime as encounter_end_datetime,\n procedure_facility.id as procedure_facility_id,\n procedure_facility.name as procedure_facility,\n procedure_area.id as procedure_area_id,\n procedure_area.name as procedure_area,\n procedure_location.id as procedure_location_id,\n procedure_location.name as procedure_location,\n procedure_type.id as procedure_type_id,\n procedure_type.name as procedure_type,\n pc.date as procedure_date,\n pc.start_time as procedure_start_time,\n pc.end_time as procedure_end_time,\n case\n when pc.end_time is not null and pc.start_time is not null then\n concat(\n lpad((\n case\n when pc.end_time < pc.start_time\n then\n (24 + extract(hour from pc.end_time) - extract(hour from pc.start_time))\n else\n extract(hour from (pc.end_time - pc.start_time))\n end\n )::text, 2, '0'), ':',\n lpad((\n case\n when pc.end_time < pc.start_time\n then\n (extract(minute from pc.end_time) - extract(minute from pc.start_time))\n else\n extract(minute from (pc.end_time - pc.start_time))\n end\n )::text, 2, '0')\n )\n end as procedure_duration,\n clinician.id as procedure_clinician_id,\n clinician.display_name as procedure_clinician,\n anaesthetist.id as procedure_anaesthetist_id,\n anaesthetist.display_name as procedure_anaesthetist,\n assistant_anaesthetist.id as procedure_assistant_anaesthetist_id,\n assistant_anaesthetist.display_name as procedure_assistant_anaesthetist,\n case\n when pc.is_completed then 'Y' else 'N'\n end as is_completed,\n pc.time_in,\n pc.time_out\nfrom filtered_procedure pc\njoin \"app\".\"reporting\".\"encounters\" e on e.id = pc.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"reference_data\" procedure_type on procedure_type.id = pc.procedure_type_id\njoin \"app\".\"reporting\".\"locations\" procedure_location\n on procedure_location.id = pc.location_id\nleft join \"app\".\"reporting\".\"location_groups\" procedure_area\n on procedure_area.id = procedure_location.location_group_id\njoin \"app\".\"reporting\".\"facilities\" procedure_facility\n on procedure_facility.id = procedure_location.facility_id\n and procedure_facility.is_sensitive = False\njoin \"app\".\"reporting\".\"locations\" encounter_location\n on encounter_location.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" encounter_facility\n on encounter_facility.id = encounter_location.facility_id\n and encounter_facility.is_sensitive = False\njoin \"app\".\"reporting\".\"departments\" encounter_department\n on encounter_department.id = coalesce(pc.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"patient_additional_data\" pd on pd.patient_id = p.id\nleft join \"app\".\"reporting\".\"reference_data\" nationality on nationality.id = pd.nationality_id\nleft join \"app\".\"reporting\".\"users\" assistant_anaesthetist on assistant_anaesthetist.id = pc.assistant_anaesthetist_id\nleft join \"app\".\"reporting\".\"users\" anaesthetist on anaesthetist.id = pc.anaesthetist_id\nleft join \"app\".\"reporting\".\"users\" clinician on clinician.id = pc.clinician_id\nwhere pc.encounter_history_record = 1\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__referrals": {"database": "app", "schema": "reporting", "name": "ds__referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__referrals.sql", "original_file_path": "models\\datasets\\standard\\ds__referrals.sql", "unique_id": "model.tamanu_source_dbt.ds__referrals", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__referrals"], "alias": "ds__referrals", "checksum": {"name": "sha256", "checksum": "be7d976be9bfcdf7945737d021f9edaec87843f491d5579adc68306148ea6246"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Referrals", "columns": {"patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {"metrics": {"total_patients_count": {"type": "count"}}}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"metrics": {"total_patients_count": {"type": "count"}}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "diagnoses": {"name": "diagnoses", "description": "Full list of diagnoses at the time of referral.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__diagnoses"]}, "referral_type": {"name": "referral_type", "description": "Full readable name for the referral.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "referring_doctor_id": {"name": "referring_doctor_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "referring_doctor_name": {"name": "referring_doctor_name", "description": "Display identifier for the user who referred the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "referral_datetime": {"name": "referral_datetime", "description": "Local date for the record in encounter_diagnoses.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "status": {"name": "status", "description": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__status"]}, "department": {"name": "department", "description": "Full readable name of the department from which the patient was referred.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__referrals.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.3195822, "relation_name": "\"app\".\"reporting\".\"ds__referrals\"", "raw_code": "{{ referrals_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "referrals", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "survey_responses", "package": null, "version": null}, {"name": "surveys", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.referrals_dataset"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.survey_responses", "model.tamanu_source_dbt.surveys", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__referrals.sql", "compiled": true, "compiled_code": "\n\nwith diagnoses as (\n select\n ed.encounter_id,\n string_agg(concat(d.name), '; ') as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n left join \"app\".\"reporting\".\"reference_data\" d on d.id = ed.diagnosis_id\n group by ed.encounter_id\n)\n\nselect\n p.id as patient_id,\n p.display_id,\n p.first_name,\n p.last_name,\n p.village_id,\n ed.diagnoses,\n s.name as referral_type,\n u.id as referring_doctor_id,\n u.display_name as referring_doctor_name,\n sr.end_datetime as referral_datetime,\n rf.status,\n d.name as department\nfrom \"app\".\"reporting\".\"referrals\" rf\njoin \"app\".\"reporting\".\"encounters\" e on e.id = rf.initiating_encounter_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\njoin \"app\".\"reporting\".\"survey_responses\" sr on sr.id = rf.survey_response_id\njoin \"app\".\"reporting\".\"surveys\" s on s.id = sr.survey_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"users\" u on u.id = e.clinician_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join diagnoses ed on ed.encounter_id = rf.initiating_encounter_id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details": {"database": "app", "schema": "reporting", "name": "ds__usage_quality_metrics_patient_details", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__usage_quality_metrics_patient_details.sql", "original_file_path": "models\\datasets\\standard\\ds__usage_quality_metrics_patient_details.sql", "unique_id": "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__usage_quality_metrics_patient_details"], "alias": "ds__usage_quality_metrics_patient_details", "checksum": {"name": "sha256", "checksum": "9110e873bdfe86bd5deb88d8176a2bf12c20dbc172eb04fbb2b9ee80ff82cd41"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Usage quality metrics - patient details", "columns": {"total_patients": {"name": "total_patients", "description": "Total patients in the database includes merged", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_incomplete_name": {"name": "total_patients_with_incomplete_name", "description": "Total patients with incomplete name (missing first or last name)", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_missing_dob": {"name": "total_patients_with_missing_dob", "description": "Total patients with missing date of birth", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_invalid_dob": {"name": "total_patients_with_invalid_dob", "description": "Total patients with invalid date of birth (on or before 1900-01-01 or after today's date)", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_missing_location": {"name": "total_patients_with_missing_location", "description": "Total patients with missing location information (no entry for village, nursing zone, medical_area, sub-division, division)", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_with_missing_contact": {"name": "total_patients_with_missing_contact", "description": "Total patients with missing contact information (no entry for primary nor secondary contact)", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_patients_merged": {"name": "total_patients_merged", "description": "Total patients merged", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__usage_quality_metrics_patient_details.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.3195822, "relation_name": "\"app\".\"reporting\".\"ds__usage_quality_metrics_patient_details\"", "raw_code": "with data as (\r\n select\r\n p.id as patient_id,\r\n pm.id as patient_merged_id,\r\n coalesce(nullif(trim(p.first_name), ''), nullif(trim(pm.first_name), '')) as first_name,\r\n coalesce(nullif(trim(p.last_name), ''), nullif(trim(pm.last_name), '')) as last_name,\r\n coalesce(p.date_of_birth, pm.date_of_birth) as date_of_birth,\r\n coalesce(nullif(trim(p.village_id), ''), nullif(trim(pm.village_id), '')) as village_id,\r\n nullif(trim(pad.nursing_zone_id), '') as nursing_zone_id,\r\n nullif(trim(pad.medical_area_id), '') as medical_area_id,\r\n nullif(trim(pad.subdivision_id), '') as subdivision_id,\r\n nullif(trim(pad.division_id), '') as division_id,\r\n nullif(trim(pad.primary_contact_number), '') as primary_contact_number,\r\n nullif(trim(pad.secondary_contact_number), '') as secondary_contact_number\r\n from {{ ref(\"patients\") }} p\r\n full join {{ ref(\"patients_merged\") }} pm\r\n on pm.id = p.id\r\n left join {{ ref(\"patient_additional_data\") }} pad\r\n on pad.patient_id = coalesce(p.id, pm.id)\r\n)\r\n\r\nselect\r\n count(*) as total_patients,\r\n count(*) filter (where first_name is null or last_name is null) as total_patients_with_incomplete_name,\r\n count(*) filter (where date_of_birth is null) as total_patients_with_missing_dob,\r\n count(*) filter (where date_of_birth <= '1900-01-01' or date_of_birth > now()::date) as total_patients_with_invalid_dob,\r\n count(*) filter (where coalesce(village_id, nursing_zone_id, medical_area_id, subdivision_id, division_id) is null) as total_patients_with_missing_location,\r\n count(*) filter (where coalesce(primary_contact_number, secondary_contact_number) is null) as total_patients_with_missing_contact,\r\n count(patient_merged_id) as total_patients_merged\r\nfrom data", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients", "package": null, "version": null}, {"name": "patients_merged", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_merged", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__usage_quality_metrics_patient_details.sql", "compiled": true, "compiled_code": "with data as (\n select\n p.id as patient_id,\n pm.id as patient_merged_id,\n coalesce(nullif(trim(p.first_name), ''), nullif(trim(pm.first_name), '')) as first_name,\n coalesce(nullif(trim(p.last_name), ''), nullif(trim(pm.last_name), '')) as last_name,\n coalesce(p.date_of_birth, pm.date_of_birth) as date_of_birth,\n coalesce(nullif(trim(p.village_id), ''), nullif(trim(pm.village_id), '')) as village_id,\n nullif(trim(pad.nursing_zone_id), '') as nursing_zone_id,\n nullif(trim(pad.medical_area_id), '') as medical_area_id,\n nullif(trim(pad.subdivision_id), '') as subdivision_id,\n nullif(trim(pad.division_id), '') as division_id,\n nullif(trim(pad.primary_contact_number), '') as primary_contact_number,\n nullif(trim(pad.secondary_contact_number), '') as secondary_contact_number\n from \"app\".\"reporting\".\"patients\" p\n full join \"app\".\"reporting\".\"patients_merged\" pm\n on pm.id = p.id\n left join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = coalesce(p.id, pm.id)\n)\n\nselect\n count(*) as total_patients,\n count(*) filter (where first_name is null or last_name is null) as total_patients_with_incomplete_name,\n count(*) filter (where date_of_birth is null) as total_patients_with_missing_dob,\n count(*) filter (where date_of_birth <= '1900-01-01' or date_of_birth > now()::date) as total_patients_with_invalid_dob,\n count(*) filter (where coalesce(village_id, nursing_zone_id, medical_area_id, subdivision_id, division_id) is null) as total_patients_with_missing_location,\n count(*) filter (where coalesce(primary_contact_number, secondary_contact_number) is null) as total_patients_with_missing_contact,\n count(patient_merged_id) as total_patients_merged\nfrom data", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations": {"database": "app", "schema": "reporting", "name": "ds__usage_quality_metrics_patient_registrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__usage_quality_metrics_patient_registrations.sql", "original_file_path": "models\\datasets\\standard\\ds__usage_quality_metrics_patient_registrations.sql", "unique_id": "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__usage_quality_metrics_patient_registrations"], "alias": "ds__usage_quality_metrics_patient_registrations", "checksum": {"name": "sha256", "checksum": "e30799ffc774154012b206b5d5e50fd410296f4d26a5c909e965d5c49e713cb8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Usage quality metrics - patient registrations", "columns": {"registration_date": {"name": "registration_date", "description": "Timestamp of when record was created in patients which is used as a best estimate of registration date.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "total_patient_registrations": {"name": "total_patient_registrations", "description": "Total patient registrations", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_birth_registrations": {"name": "total_birth_registrations", "description": "Total birth registrations", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_incorrect_registrations_for_patient_under_6mth": {"name": "total_incorrect_registrations_for_patient_under_6mth", "description": "Total registrations for patient under 6 months incorrectly registered as a new patient instead of a birth registration", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__usage_quality_metrics_patient_registrations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": false, "classification": "restricted"}}, "created_at": 1782423652.3195822, "relation_name": "\"app\".\"reporting\".\"ds__usage_quality_metrics_patient_registrations\"", "raw_code": "with data as (\r\n select\r\n p.created_datetime as registration_date,\r\n p.id as registration_patient_id,\r\n pbd.patient_id as birth_patient_id,\r\n p.date_of_birth,\r\n age(p.created_datetime, p.date_of_birth) < interval '6 months' as age_under_6m_at_registration\r\n from {{ ref(\"patients\") }} p\r\n left join {{ ref(\"patient_birth_data\") }} pbd\r\n on pbd.patient_id = p.id\r\n)\r\n\r\nselect\r\n registration_date,\r\n count(*) filter (where birth_patient_id is null) as total_patient_registrations,\r\n count(birth_patient_id) as total_birth_registrations,\r\n count(*) filter (where birth_patient_id is null and age_under_6m_at_registration) as total_incorrect_registrations_for_patient_under_6mth\r\nfrom data\r\ngroup by registration_date", "doc_blocks": [], "language": "sql", "refs": [{"name": "patients", "package": null, "version": null}, {"name": "patient_birth_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__usage_quality_metrics_patient_registrations.sql", "compiled": true, "compiled_code": "with data as (\n select\n p.created_datetime as registration_date,\n p.id as registration_patient_id,\n pbd.patient_id as birth_patient_id,\n p.date_of_birth,\n age(p.created_datetime, p.date_of_birth) < interval '6 months' as age_under_6m_at_registration\n from \"app\".\"reporting\".\"patients\" p\n left join \"app\".\"reporting\".\"patient_birth_data\" pbd\n on pbd.patient_id = p.id\n)\n\nselect\n registration_date,\n count(*) filter (where birth_patient_id is null) as total_patient_registrations,\n count(birth_patient_id) as total_birth_registrations,\n count(*) filter (where birth_patient_id is null and age_under_6m_at_registration) as total_incorrect_registrations_for_patient_under_6mth\nfrom data\ngroup by registration_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__user_audit": {"database": "app", "schema": "reporting", "name": "ds__user_audit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__user_audit.sql", "original_file_path": "models\\datasets\\standard\\ds__user_audit.sql", "unique_id": "model.tamanu_source_dbt.ds__user_audit", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__user_audit"], "alias": "ds__user_audit", "checksum": {"name": "sha256", "checksum": "77625673664a8f2ca8bc7ae447e8cfeaed8e7ada97f111d8f3d22e6f3ff2ac32"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "confidential"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "administration"], "description": "User audit", "columns": {"user_id": {"name": "user_id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_name": {"name": "user_name", "description": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_id"]}, "user_role": {"name": "user_role", "description": "Readable name for the role.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.roles__name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "patient_category": {"name": "patient_category", "description": "Full readable name of the billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "triage_category": {"name": "triage_category", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations) where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location where the encounter is currently active or has ended.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "encounter_start_datetime": {"name": "encounter_start_datetime", "description": "The beginning of the encounter", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "encounter_end_datetime": {"name": "encounter_end_datetime", "description": "The date encounter was discharged/ended", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "first_note_datetime": {"name": "first_note_datetime", "description": "Local date and time for the record of the first note.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "last_note_datetime": {"name": "last_note_datetime", "description": "Local date and time for the record of the last note.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__datetime"]}, "is_discharged": {"name": "is_discharged", "description": "Indicates whether the patient has been discharged.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patient_is_discharged"]}, "non_discharge_by_clinicians": {"name": "non_discharge_by_clinicians", "description": "Display identifier for the user who did not discharge the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}}, "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "confidential"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__user_audit.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["administration"], "meta": {"owner": "bes-maui", "domain": "admin", "tier": "gold", "pii": false, "classification": "confidential"}}, "created_at": 1782423652.3195822, "relation_name": "\"app\".\"reporting\".\"ds__user_audit\"", "raw_code": "{{ user_audit_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "notes", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "roles", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.user_audit_dataset"], "nodes": ["model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.roles", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__user_audit.sql", "compiled": true, "compiled_code": "\n\nwith non_system_notes as (\n select distinct on (n.record_id)\n n.record_id,\n first_value(n.datetime) over w as first_note_datetime,\n last_value(n.datetime) over w as last_note_datetime,\n last_value(concat_ws(' on behalf of ', author.display_name, on_behalf.display_name)) over w as last_clinician\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"users\" author on author.id = n.authored_by_id\n left join \"app\".\"reporting\".\"users\" on_behalf on on_behalf.id = n.on_behalf_of_id\n where n.note_type_id != 'notetype-system'\n window w as (\n partition by n.record_id\n order by n.datetime\n rows between unbounded preceding and unbounded following\n )\n)\n\nselect\n u.id as user_id,\n u.display_name as user_name,\n r.name as user_role,\n p.id as patient_id,\n p.display_id,\n bt.name as patient_category,\n t.score as triage_category,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n e.start_datetime as encounter_start_datetime,\n e.end_datetime as encounter_end_datetime,\n n.first_note_datetime,\n n.last_note_datetime,\n case when e.end_datetime isnull then 'Patient not discharged'\n else 'Patient discharged'\n end as is_discharged,\n case when ds.note like 'Automatically discharged%' then n.last_clinician\n end as non_discharge_by_clinicians\nfrom \"app\".\"reporting\".\"encounters\" e\nleft join \"app\".\"reporting\".\"users\" u on u.id = e.clinician_id\nleft join \"app\".\"reporting\".\"roles\" r on r.id = u.role\nleft join \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad on pad.patient_id = e.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = coalesce(e.patient_billing_type_id, pad.patient_billing_type_id)\nleft join \"app\".\"reporting\".\"triages\" t on t.encounter_id = e.id\njoin \"app\".\"reporting\".\"locations\" l on l.id = e.location_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"departments\" d on d.id = e.department_id\nleft join \"app\".\"reporting\".\"discharges\" ds on ds.encounter_id = e.id\nleft join non_system_notes n on n.record_id = e.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ds__vaccinations": {"database": "app", "schema": "reporting", "name": "ds__vaccinations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__vaccinations.sql", "original_file_path": "models\\datasets\\standard\\ds__vaccinations.sql", "unique_id": "model.tamanu_source_dbt.ds__vaccinations", "fqn": ["tamanu_source_dbt", "datasets", "standard", "ds__vaccinations"], "alias": "ds__vaccinations", "checksum": {"name": "sha256", "checksum": "2371b8a1e50ff7a4e175d3ff6a9d47bea6d32f5c99ec97d2ca8382bc5c898ba8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["datasets", "clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["datasets", "clinical"], "description": "Vaccinations", "columns": {"display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "age": {"name": "age", "description": "Patient's age at the time of vaccination.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__patients_age"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "village": {"name": "village", "description": "Full readable name of the patient's village.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities) at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility_id"]}, "facility": {"name": "facility", "description": "Full readable name of the facility at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__facility"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "department": {"name": "department", "description": "Full readable name of the department at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__department"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups) at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group_id"]}, "location_group": {"name": "location_group", "description": "Full readable name of the location group at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location_group"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "location": {"name": "location", "description": "Full readable name of the location at which the vaccine was given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__location"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "vaccination_date": {"name": "vaccination_date", "description": "Local date for the record", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "vaccine_status": {"name": "vaccine_status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "vaccine_schedule": {"name": "vaccine_schedule", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "recorded_by": {"name": "recorded_by", "description": "Display identifier for the user who recorded the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "circumstances": {"name": "circumstances", "description": "Full readable name of the circumstances.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__reference_data"]}, "given_by": {"name": "given_by", "description": "Display identifier for the user who gave the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "given_elsewhere_by": {"name": "given_elsewhere_by", "description": "Checks if the vaccine was given elsewhere", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "not_given_clinician": {"name": "not_given_clinician", "description": "Display identifier for the user who did not give the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "not_given_reason": {"name": "not_given_reason", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}, "modified_by": {"name": "modified_by", "description": "Display identifier for the user who modified the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__user"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated for the vaccine administration record, sourced from the change logs.", "meta": {}, "data_type": "timestamp", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://models\\datasets\\standard\\ds__vaccinations.yml", "build_path": null, "unrendered_config": {"docs": {"show": true}, "materialized": "view", "tags": ["clinical"], "meta": {"owner": "bes-maui", "domain": "clinical", "tier": "gold", "pii": true, "classification": "restricted"}}, "created_at": 1782423652.335289, "relation_name": "\"app\".\"reporting\".\"ds__vaccinations\"", "raw_code": "{{ vaccinations_dataset(is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "vaccine_administrations_change_logs", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.vaccinations_dataset"], "nodes": ["model.tamanu_source_dbt.vaccine_administrations_change_logs", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\datasets\\standard\\ds__vaccinations.sql", "compiled": true, "compiled_code": "\n\nwith vaccine_administrations_metadata as (\n select\n id,\n max(updated_at) as updated_at\n from \"app\".\"reporting\".\"vaccine_administrations_change_logs\"\n group by id\n),\n\nadministered_circumstances as (\n select\n a.id,\n string_agg(rd_cir.name, '; ') as circumstance_name\n from \"app\".\"reporting\".\"vaccine_administrations\" a\n cross join lateral unnest(a.circumstance_ids) c (unnest_circumstance_id)\n left join \"app\".\"reporting\".\"reference_data\" rd_cir\n on rd_cir.id = c.unnest_circumstance_id\n group by a.id\n)\n\nselect\n p.display_id,\n p.first_name,\n p.last_name,\n p.id as patient_id,\n p.date_of_birth,\n date_part('year', age(p.date_of_birth)) as age,\n p.sex,\n p.village_id,\n rd_vil.name as village,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n lg.id as location_group_id,\n lg.name as location_group,\n l.id as location_id,\n l.name as location,\n av.scheduled_vaccine_id,\n case\n when av.is_given_elsewhere = true and av.datetime is null then null\n else av.datetime::date\n end as vaccination_date,\n sv.category as vaccine_category,\n sv.label as vaccine_name,\n case when sv.category = 'Other' then av.vaccine_brand end as vaccine_brand,\n case when sv.category = 'Other' then av.disease end as disease,\n case\n when av.status = 'GIVEN' then 'Given'\n when av.status = 'NOT_GIVEN' then 'Not given'\n when av.status = 'RECORDED_IN_ERROR' then 'Recorded in error'\n when av.status = 'HISTORICAL' then 'Historical'\n end as vaccine_status,\n sv.dose_label as vaccine_schedule,\n av.batch,\n case\n when av.status in ('GIVEN', 'NOT_GIVEN', 'RECORDED_IN_ERROR') then u.display_name\n end as recorded_by,\n case\n when av.is_given_elsewhere = true then ac.circumstance_name\n end as circumstances,\n case\n when av.status = 'NOT_GIVEN' then null\n when av.status = 'GIVEN' and av.is_given_elsewhere = true then null\n when av.status in ('HISTORICAL', 'RECORDED_IN_ERROR') and av.is_given_elsewhere = true then av.given_by\n when av.status = 'GIVEN' then av.given_by\n end as given_by,\n case when av.is_given_elsewhere = true then av.given_by end as given_elsewhere_by,\n case\n when av.status = 'NOT_GIVEN' then av.given_by\n end as not_given_clinician,\n case\n when av.status = 'NOT_GIVEN' then rd_reason.name\n end as not_given_reason,\n case\n when av.status = 'HISTORICAL' then u.display_name\n end as modified_by,\n vam.updated_at\nfrom \"app\".\"reporting\".\"vaccine_administrations\" av\njoin \"app\".\"reporting\".\"encounters\" e on e.id = av.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\nleft join vaccine_administrations_metadata vam on vam.id = av.id\njoin \"app\".\"reporting\".\"locations\" l on l.id = av.location_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = av.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\nleft join \"app\".\"reporting\".\"vaccine_schedules\" sv on sv.id = av.scheduled_vaccine_id\nleft join \"app\".\"reporting\".\"users\" u on u.id = av.recorded_by_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_vil on rd_vil.id = p.village_id\nleft join \"app\".\"reporting\".\"reference_data\" rd_reason on rd_reason.id = av.not_given_reason_id\nleft join administered_circumstances ac on ac.id = av.id\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.int__admission_history_department": {"database": "app", "schema": "reporting", "name": "int__admission_history_department", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "intermediate\\standard\\int__admission_history_department.sql", "original_file_path": "models\\intermediate\\standard\\int__admission_history_department.sql", "unique_id": "model.tamanu_source_dbt.int__admission_history_department", "fqn": ["tamanu_source_dbt", "intermediate", "standard", "int__admission_history_department"], "alias": "int__admission_history_department", "checksum": {"name": "sha256", "checksum": "2b1d04e3fb3e2d57dc4a8e82bac99ead2e7cbd3c9bdac731f7582e32a1434f6c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1782423650.9922504, "relation_name": null, "raw_code": "with admission_department_log as (\r\n select\r\n eh.id,\r\n eh.encounter_id,\r\n eh.datetime as start_datetime,\r\n eh.department_id,\r\n case\r\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\r\n else 'transfer-in'\r\n end as type\r\n from {{ ref('encounter_history') }} eh\r\n where (eh.change_type isnull or eh.change_type && array['department', 'encounter_type'])\r\n and eh.encounter_type = 'admission'\r\n)\r\n\r\nselect\r\n dl.encounter_id,\r\n dl.department_id,\r\n d.name as department,\r\n d.facility_id,\r\n f.name as facility,\r\n dl.start_datetime,\r\n coalesce(lead(dl.start_datetime) over w, e.end_datetime) as end_datetime,\r\n case\r\n when coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date < 1 then 1\r\n else coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date\r\n end as length_of_stay,\r\n coalesce(dl.type = 'admission', false) as admission,\r\n coalesce(lead(dl.department_id) over w isnull and e.end_datetime notnull, false) as discharge,\r\n coalesce(dl.type = 'transfer-in', false) as transfer_in,\r\n coalesce(lead(dl.department_id) over w notnull, false) as transfer_out,\r\n coalesce(lead(dl.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\r\nfrom admission_department_log dl\r\njoin {{ ref('encounters') }} e on e.id = dl.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('departments') }} d on d.id = dl.department_id\r\njoin {{ ref('facilities') }} f on f.id = d.facility_id\r\nwindow w as (\r\n partition by encounter_id\r\n order by dl.start_datetime\r\n)", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_history", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\intermediate\\standard\\int__admission_history_department.sql", "compiled": true, "compiled_code": "with admission_department_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.department_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['department', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n dl.encounter_id,\n dl.department_id,\n d.name as department,\n d.facility_id,\n f.name as facility,\n dl.start_datetime,\n coalesce(lead(dl.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date < 1 then 1\n else coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date\n end as length_of_stay,\n coalesce(dl.type = 'admission', false) as admission,\n coalesce(lead(dl.department_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(dl.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(dl.department_id) over w notnull, false) as transfer_out,\n coalesce(lead(dl.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_department_log dl\njoin \"app\".\"reporting\".\"encounters\" e on e.id = dl.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = dl.department_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nwindow w as (\n partition by encounter_id\n order by dl.start_datetime\n)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.int__admission_history_location": {"database": "app", "schema": "reporting", "name": "int__admission_history_location", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "intermediate\\standard\\int__admission_history_location.sql", "original_file_path": "models\\intermediate\\standard\\int__admission_history_location.sql", "unique_id": "model.tamanu_source_dbt.int__admission_history_location", "fqn": ["tamanu_source_dbt", "intermediate", "standard", "int__admission_history_location"], "alias": "int__admission_history_location", "checksum": {"name": "sha256", "checksum": "9bd5b95f97e6eb41cd33e1723c61de27577802c720ea42502c30cd8a074512f7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1782423650.9922504, "relation_name": null, "raw_code": "with admission_location_log as (\r\n select\r\n eh.id,\r\n eh.encounter_id,\r\n eh.datetime as start_datetime,\r\n eh.location_id,\r\n case\r\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\r\n else 'transfer-in'\r\n end as type\r\n from {{ ref('encounter_history') }} eh\r\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\r\n and eh.encounter_type = 'admission'\r\n)\r\n\r\nselect\r\n ll.encounter_id,\r\n l.location_group_id,\r\n lg.name as location_group,\r\n ll.location_id,\r\n l.name as location,\r\n l.facility_id,\r\n f.name as facility,\r\n ll.start_datetime,\r\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\r\n case\r\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\r\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\r\n end as length_of_stay,\r\n coalesce(ll.type = 'admission', false) as admission,\r\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\r\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\r\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\r\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\r\nfrom admission_location_log ll\r\njoin {{ ref('encounters') }} e on e.id = ll.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('locations') }} l on l.id = ll.location_id\r\njoin {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\njoin {{ ref('facilities') }} f on f.id = l.facility_id\r\nwindow w as (\r\n partition by ll.encounter_id\r\n order by ll.start_datetime\r\n)", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_history", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\intermediate\\standard\\int__admission_history_location.sql", "compiled": true, "compiled_code": "with admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.int__lab_requests_history": {"database": "app", "schema": "reporting", "name": "int__lab_requests_history", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "intermediate\\standard\\int__lab_requests_history.sql", "original_file_path": "models\\intermediate\\standard\\int__lab_requests_history.sql", "unique_id": "model.tamanu_source_dbt.int__lab_requests_history", "fqn": ["tamanu_source_dbt", "intermediate", "standard", "int__lab_requests_history"], "alias": "int__lab_requests_history", "checksum": {"name": "sha256", "checksum": "bc9c567691b687199b960c05a2c18e13345544686b59c60157b85341df25fe51"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1782423650.9922504, "relation_name": null, "raw_code": "select distinct on (lr.id, coalesce(lrl.status, lr.status))\r\n lr.id as request_id,\r\n lr.requested_datetime::date as requested_date,\r\n lr.encounter_id,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n ltc.id as lab_test_category_id,\r\n ltc.name as lab_test_category,\r\n coalesce(lrl.status, lr.status) as status,\r\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date as status_start_date,\r\n case\r\n when coalesce(lrl.status, lr.status) = 'published'\r\n then\r\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date\r\n when lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w is not null\r\n then\r\n case\r\n when coalesce(lrl.updated_datetime, lr.updated_datetime)::date\r\n = (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\r\n then (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\r\n else (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w - interval '1 day')::date\r\n end\r\n else current_date\r\n end as status_end_date\r\nfrom {{ ref('lab_requests') }} lr\r\nleft join {{ ref('lab_request_logs') }} lrl on lrl.lab_request_id = lr.id\r\nleft join {{ ref('encounters') }} e on e.id = lr.encounter_id\r\nleft join {{ ref('departments') }} d on d.id = coalesce(lr.department_id, e.department_id)\r\nleft join {{ ref('facilities') }} f on f.id = d.facility_id\r\nleft join {{ ref('reference_data') }} ltc on ltc.id = lr.lab_test_category_id\r\nwhere lr.status not in ('deleted', 'cancelled', 'entered-in-error')\r\nwindow\r\n w as (\r\n partition by lr.id\r\n order by coalesce(lrl.updated_datetime, lr.updated_datetime)\r\n )\r\norder by lr.id, coalesce(lrl.status, lr.status)", "doc_blocks": [], "language": "sql", "refs": [{"name": "lab_requests", "package": null, "version": null}, {"name": "lab_request_logs", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_request_logs", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\intermediate\\standard\\int__lab_requests_history.sql", "compiled": true, "compiled_code": "select distinct on (lr.id, coalesce(lrl.status, lr.status))\n lr.id as request_id,\n lr.requested_datetime::date as requested_date,\n lr.encounter_id,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n ltc.id as lab_test_category_id,\n ltc.name as lab_test_category,\n coalesce(lrl.status, lr.status) as status,\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date as status_start_date,\n case\n when coalesce(lrl.status, lr.status) = 'published'\n then\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n when lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w is not null\n then\n case\n when coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n = (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n then (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n else (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w - interval '1 day')::date\n end\n else current_date\n end as status_end_date\nfrom \"app\".\"reporting\".\"lab_requests\" lr\nleft join \"app\".\"reporting\".\"lab_request_logs\" lrl on lrl.lab_request_id = lr.id\nleft join \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = coalesce(lr.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" ltc on ltc.id = lr.lab_test_category_id\nwhere lr.status not in ('deleted', 'cancelled', 'entered-in-error')\nwindow\n w as (\n partition by lr.id\n order by coalesce(lrl.updated_datetime, lr.updated_datetime)\n )\norder by lr.id, coalesce(lrl.status, lr.status)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-admissions-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-admissions-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-admissions-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-admissions-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-admissions-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-admissions-line-list"], "alias": "sensitive-admissions-line-list", "checksum": {"name": "sha256", "checksum": "6966bc718aefee1203b2722918339e748bd1916676c6a356f67179548d2129ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423650.9922504, "relation_name": "\"app\".\"reporting\".\"sensitive-admissions-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n admitting_clinician as \"{{ translate_label('admittingClinician') }}\",\r\n to_char(admission_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('admissionDateTime') }}\",\r\n admission_status as \"{{ translate_label('admissionStatus') }}\",\r\n to_char(discharge_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('dischargeDateTime') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n departments as \"{{ translate_label('encounterDepartmentHistory') }}\",\r\n department_datetimes as \"{{ translate_label('encounterDepartmentHistoryDateTimes') }}\",\r\n location_groups as \"{{ translate_label('encounterLocationGroupHistory') }}\",\r\n location_group_datetimes as \"{{ translate_label('encounterLocationGroupHistoryDateTimes') }}\",\r\n locations as \"{{ translate_label('encounterLocationHistory') }}\",\r\n location_datetimes as \"{{ translate_label('encounterLocationHistoryDateTimes') }}\",\r\n primary_diagnoses as \"{{ translate_label('diagnosesPrimary') }}\",\r\n secondary_diagnoses as \"{{ translate_label('diagnosesSecondary') }}\"\r\nfrom {{ ref('ds__sensitive_admissions') }}\r\nwhere\r\n case when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else admission_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else admission_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case when {{ parameter('locationGroupId') }} is null then true\r\n else {{ parameter('locationGroupId') }} = any(location_group_ids::text [])\r\n end\r\n and case when {{ parameter('facilityId') }} is null then true\r\n else {{ parameter('facilityId') }} = facility_id\r\n end\r\n and case when {{ parameter('departmentId') }} is null then true\r\n else {{ parameter('departmentId') }} = any(department_ids::text [])\r\n end\r\n and case when {{ parameter('patientBillingTypeId') }} is null then true\r\n else billing_type_id like {{ parameter('patientBillingTypeId') }}\r\n end\r\n and case when {{ parameter('clinicianId') }} is null then true\r\n else admitting_clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and case when coalesce({{ parameter('admissionStatus') }}) is null then true\r\n else admission_status in ({{ parameter('admissionStatus') }})\r\n end\r\norder by admission_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_admissions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_admissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-admissions-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n billing_type as \"Billing type\",\n admitting_clinician as \"Admitting clinician\",\n to_char(admission_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Admission date and time\",\n admission_status as \"Admission status\",\n to_char(discharge_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Discharge date and time\",\n facility as \"Facility\",\n departments as \"Department history\",\n department_datetimes as \"Department history date and times\",\n location_groups as \"Area history\",\n location_group_datetimes as \"Area history date and times\",\n locations as \"Location history\",\n location_datetimes as \"Location history date and times\",\n primary_diagnoses as \"Primary diagnoses\",\n secondary_diagnoses as \"Secondary diagnoses\"\nfrom \"app\".\"reporting\".\"ds__sensitive_admissions\"\nwhere\n case when nullif('2024-01-01', '')::date is null then true\n else admission_datetime >= nullif('2024-01-01', '')::date\n end\n and case when nullif('2024-01-31', '')::date is null then true\n else admission_datetime <= nullif('2024-01-31', '')::date\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = any(location_group_ids::text [])\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = facility_id\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = any(department_ids::text [])\n end\n and case when nullif('', '')::text is null then true\n else billing_type_id like nullif('', '')::text\n end\n and case when nullif('', '')::text is null then true\n else admitting_clinician_id = nullif('', '')::text\n end\n and case when coalesce(nullif('', '')::text) is null then true\n else admission_status in (nullif('', '')::text)\n end\norder by admission_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments": {"database": "app", "schema": "reporting", "name": "sensitive-audit-outpatient-appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-audit-outpatient-appointments.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-audit-outpatient-appointments.sql", "unique_id": "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-audit-outpatient-appointments"], "alias": "sensitive-audit-outpatient-appointments", "checksum": {"name": "sha256", "checksum": "8440d3a19cf10c5771ac8793b18d5df24891c421e4e44c4753d5e6f213f8c2a9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.0418456, "relation_name": "\"app\".\"reporting\".\"sensitive-audit-outpatient-appointments\"", "raw_code": "-- Sensitive Outpatient Appointment Audit Report\r\n-- Shows all modifications and cancellations to outpatient appointments at sensitive facilities\r\n-- Each row represents a change event with both current and previous appointment details\r\n\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n -- Change event details\r\n change_number as \"{{ translate_label('auditChangeNumber') }}\",\r\n -- Current appointment details (at time of report)\r\n to_char(appointment_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentDateTime') }}\",\r\n appointment_type as \"{{ translate_label('appointmentType') }}\",\r\n clinician as \"{{ translate_label('appointmentClinician') }}\",\r\n location_group as \"{{ translate_label('appointmentLocationGroup') }}\",\r\n priority as \"{{ translate_label('appointmentPriority') }}\",\r\n is_repeating as \"{{ translate_label('appointmentIsRepeating') }}\",\r\n -- Modification details\r\n created_by as \"{{ translate_label('auditCreatedBy') }}\",\r\n modified_by as \"{{ translate_label('auditModifiedBy') }}\",\r\n to_char(modified_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('auditModifiedDateTime') }}\",\r\n is_cancelled as \"{{ translate_label('appointmentIsCancelled') }}\",\r\n -- Previous appointment details (prior to changes)\r\n to_char(prev_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('auditPrevAppointmentDateTime') }}\",\r\n prev_appointment_type as \"{{ translate_label('auditPrevAppointmentType') }}\",\r\n prev_clinician as \"{{ translate_label('auditPrevClinician') }}\",\r\n prev_location_group as \"{{ translate_label('auditPrevLocationGroup') }}\",\r\n prev_priority as \"{{ translate_label('auditPrevPriority') }}\"\r\nfrom {{ ref('ds__sensitive_outpatient_appointments_audit') }}\r\nwhere\r\n -- Date range filter on appointment datetime\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else appointment_start_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else appointment_start_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n -- Facility filter\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by display_id, appointment_id, change_number", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_outpatient_appointments_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-audit-outpatient-appointments.sql", "compiled": true, "compiled_code": "-- Sensitive Outpatient Appointment Audit Report\n-- Shows all modifications and cancellations to outpatient appointments at sensitive facilities\n-- Each row represents a change event with both current and previous appointment details\n\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n -- Change event details\n change_number as \"Change number\",\n -- Current appointment details (at time of report)\n to_char(appointment_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment date and time\",\n appointment_type as \"Appointment type\",\n clinician as \"Clinician\",\n location_group as \"Area\",\n priority as \"Priority appointment\",\n is_repeating as \"Repeating appointment\",\n -- Modification details\n created_by as \"Appointment created by\",\n modified_by as \"Appointment modified by\",\n to_char(modified_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment modified date & time\",\n is_cancelled as \"Appointment cancelled\",\n -- Previous appointment details (prior to changes)\n to_char(prev_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Previous appointment date & time\",\n prev_appointment_type as \"Previous appointment type\",\n prev_clinician as \"Previous clinician\",\n prev_location_group as \"Previous area\",\n prev_priority as \"Previous priority appointment\"\nfrom \"app\".\"reporting\".\"ds__sensitive_outpatient_appointments_audit\"\nwhere\n -- Date range filter on appointment datetime\n case\n when nullif('2025-01-01', '')::date is null then true\n else appointment_start_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else appointment_start_datetime <= nullif('2025-01-31', '')::date\n end\n -- Facility filter\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\norder by display_id, appointment_id, change_number", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-encounter-diets-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-encounter-diets-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-encounter-diets-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-encounter-diets-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-encounter-diets-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-encounter-diets-line-list"], "alias": "sensitive-encounter-diets-line-list", "checksum": {"name": "sha256", "checksum": "95f4fdba24f368145a414ed5730c489278e32077575ea0fc2c0de50db75e0e27"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.04346, "relation_name": "\"app\".\"reporting\".\"sensitive-encounter-diets-line-list\"", "raw_code": "select\r\n to_char(ed.start_datetime, '{{ var(\"date_format\") }}') as \"{{ translate_label('encounterStartDate') }}\",\r\n to_char(ed.start_datetime, '{{ var(\"time_format\") }}') as \"{{ translate_label('encounterStartTime') }}\",\r\n ed.display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n ed.patient_name as \"{{ translate_label('patientName') }}\",\r\n ed.age as \"{{ translate_label('patientAge') }}\",\r\n concat_ws(', ', ed.location_group, ed.location) as \"{{ translate_label('location') }}\",\r\n ed.diets as \"{{ translate_label('encounterDiet') }}\",\r\n ed.allergies as \"{{ translate_label('patientAllergies') }}\"\r\nfrom {{ ref('ds__sensitive_encounter_diets') }} ed\r\nwhere\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else ed.location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else ed.start_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else ed.start_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by ed.location_group, ed.location, ed.patient_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_encounter_diets", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-encounter-diets-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(ed.start_datetime, 'YYYY-MM-DD') as \"Encounter start date\",\n to_char(ed.start_datetime, 'HH24:MI') as \"Encounter start time\",\n ed.display_id as \"Patient ID\",\n ed.patient_name as \"Patient name\",\n ed.age as \"Age\",\n concat_ws(', ', ed.location_group, ed.location) as \"Location\",\n ed.diets as \"Diet\",\n ed.allergies as \"Allergies\"\nfrom \"app\".\"reporting\".\"ds__sensitive_encounter_diets\" ed\nwhere\n case\n when nullif('', '')::text is null then true\n else ed.location_group_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else ed.start_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else ed.start_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by ed.location_group, ed.location, ed.patient_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date": {"database": "app", "schema": "reporting", "name": "sensitive-encounter-summary-by-end-date", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-encounter-summary-by-end-date.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-encounter-summary-by-end-date.sql", "unique_id": "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-encounter-summary-by-end-date"], "alias": "sensitive-encounter-summary-by-end-date", "checksum": {"name": "sha256", "checksum": "3587614d4b822ee4d44c2f246a52cf2e62c9f927bcd90270ea7b62f8f7b44f98"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.0544772, "relation_name": "\"app\".\"reporting\".\"sensitive-encounter-summary-by-end-date\"", "raw_code": "{{ encounter_summary_report('end_datetime', is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "procedures", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "invoices", "package": null, "version": null}, {"name": "invoice_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_summary_report"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-encounter-summary-by-end-date.sql", "compiled": true, "compiled_code": "\n\nwith encounters_in_scope as (\n select\n e.id as encounter_id,\n e.start_datetime,\n e.end_datetime,\n e.patient_id,\n e.location_id,\n e.department_id,\n e.clinician_id,\n e.patient_billing_type_id,\n e.reason_for_encounter,\n f.id as facility_id,\n f.name as facility\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\n where\n e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n \n and e.end_datetime is not null\n \n and case\n when nullif('2024-01-01', '')::date is null then true\n else e.end_datetime >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null then true\n else e.end_datetime <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null then true\n else f.id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.patient_billing_type_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.clinician_id = nullif('', '')::text\n end\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.updated_by_id,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n clinician.display_name as clinician_name,\n actor.display_name as updated_by_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n row_number() over (\n partition by eh.encounter_id, eh.change_type\n order by eh.datetime\n ) as change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from \"app\".\"reporting\".\"encounter_history\" eh\n join encounters_in_scope eis\n on eis.encounter_id = eh.encounter_id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = eh.clinician_id\n join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\nencounter_changes as (\n select\n encounter_id,\n \n -- Location changes: tracks all location changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\n\n -- Location group changes: tracks location group changes (only when group actually changes)\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\n\n -- Department changes: tracks all department changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\n\n -- Encounter type changes: tracks encounter type progression (emergency types)\n string_agg(\n case\n when encounter_type = 'triage' then 'Triage'\n when encounter_type = 'observation' then 'Active ED care'\n when encounter_type = 'emergency' then 'Emergency short stay'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\n\n -- Encounter type changes: tracks encounter type progression (inpatient types)\n string_agg(\n case\n when encounter_type = 'admission' then 'Hospital admission'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\n\n -- Encounter type changes: tracks encounter type progression (outpatient types)\n string_agg(\n case\n when encounter_type = 'clinic' then 'Clinic'\n when encounter_type = 'imaging' then 'Imaging'\n when encounter_type = 'surveyResponse' then 'Survey response'\n when encounter_type = 'vaccination' then 'Vaccination'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\n\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\n from encounter_history_consolidated\n group by encounter_id\n),\n\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n concat(\n 'Name: ', d.name,\n ', Code: ', d.code,\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\n ', Certainty: ', ed.certainty\n ),\n E'\\n'\n order by ed.is_primary desc, ed.datetime asc\n ) as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join encounters_in_scope eis\n on eis.encounter_id = ed.encounter_id\n join \"app\".\"reporting\".\"reference_data\" d\n on d.id = ed.diagnosis_id\n group by ed.encounter_id\n),\n\nencounter_prescriptions as (\n select\n ep.encounter_id,\n string_agg(\n concat(\n 'Name: ', m.name,\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\n ', Discontinuing reason: ', p.discontinuing_reason\n ),\n '' || E'\\n' || ''\n order by p.datetime\n ) as medications\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join encounters_in_scope eis\n on eis.encounter_id = ep.encounter_id\n join \"app\".\"reporting\".\"prescriptions\" p\n on p.id = ep.prescription_id\n join \"app\".\"reporting\".\"reference_data\" m\n on m.id = p.medication_id\n group by ep.encounter_id\n),\n\nencounter_vaccinations as (\n select\n av.encounter_id,\n string_agg(\n concat(\n v.name,\n ', Label: ', sv.label,\n ', Schedule: ', sv.dose_label\n ),\n E'\\n'\n order by av.datetime\n ) as vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" av\n join encounters_in_scope eis\n on eis.encounter_id = av.encounter_id\n join \"app\".\"reporting\".\"vaccine_schedules\" sv\n on sv.id = av.scheduled_vaccine_id\n join \"app\".\"reporting\".\"reference_data\" v\n on v.id = sv.vaccine_id\n group by av.encounter_id\n),\n\nencounter_procedures as (\n select\n p.encounter_id,\n string_agg(\n concat(\n 'Name: ', proc.name,\n ', Date: ', to_char(p.date, 'YYYY-MM-DD'),\n ', Location: ', loc.name,\n ', Notes: ', p.note,\n ', Completed notes: ', p.completed_note\n ),\n E'\\n'\n order by p.date\n ) as procedures\n from \"app\".\"reporting\".\"procedures\" p\n join encounters_in_scope eis\n on eis.encounter_id = p.encounter_id\n left join \"app\".\"reporting\".\"reference_data\" proc\n on proc.id = p.procedure_type_id\n left join \"app\".\"reporting\".\"locations\" loc\n on loc.id = p.location_id\n group by p.encounter_id\n),\n\nencounter_lab_requests as (\n select\n lr.encounter_id,\n string_agg(\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\n order by lr.collected_datetime\n ) as lab_requests\n from \"app\".\"reporting\".\"lab_requests\" lr\n join encounters_in_scope eis\n on eis.encounter_id = lr.encounter_id\n left join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\n left join \"app\".\"reporting\".\"lab_test_panels\" ltp\n on ltp.id = ltpr.lab_test_panel_id\n left join \"app\".\"reporting\".\"lab_tests\" lt\n on lt.lab_request_id = lr.id\n and lr.lab_test_panel_request_id isnull\n left join \"app\".\"reporting\".\"lab_test_types\" ltt\n on ltt.id = lt.lab_test_type_id\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\n group by lr.encounter_id\n),\n\nnotes_raw as (\n select\n n.id,\n n.datetime,\n n.content,\n n.note_type_id,\n n.note_type,\n n.record_type,\n n.record_id,\n n.updated_note_id,\n n.visibility_status\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"imaging_requests\" ir\n on n.record_type = 'ImagingRequest'\n and ir.id = n.record_id\n join encounters_in_scope eis\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\n where n.record_type in ('Encounter', 'ImagingRequest')\n),\n\nencounter_notes_deduped as (\n select\n id,\n datetime,\n content,\n note_type,\n record_id,\n visibility_status,\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\n from notes_raw\n where\n record_type = 'Encounter'\n and note_type_id != 'notetype-system'\n),\n\nimaging_request_areas as (\n select\n ir.encounter_id,\n ira.imaging_request_id,\n case\n when ir.imaging_type = 'xRay' then 'X-Ray'\n when ir.imaging_type = 'ctScan' then 'CT Scan'\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\n when ir.imaging_type = 'mri' then 'MRI'\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\n when ir.imaging_type = 'mammogram' then 'Mammogram'\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\n when ir.imaging_type = 'angiogram' then 'Angiogram'\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\n when ir.imaging_type = 'stressTest' then 'Stress Test'\n else ir.imaging_type\n end as imaging_type,\n coalesce(\n string_agg(\n area.name, ', '\n order by area.name\n ),\n string_agg(case\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\n end, ', '\n order by n.datetime)\n ) as areas_to_be_imaged,\n string_agg(case\n when n.note_type_id = 'notetype-other' then n.content\n end, ','\n order by n.datetime) as notes\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join encounters_in_scope eis\n on eis.encounter_id = ir.encounter_id\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira\n on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" area\n on area.id = ira.area_id\n left join notes_raw n\n on n.record_id = ir.id\n and n.record_type = 'ImagingRequest'\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\n),\n\nencounter_imaging_requests as (\n select\n encounter_id,\n string_agg(\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\n ) as imaging_requests\n from imaging_request_areas\n group by encounter_id\n),\n\nencounter_notes as (\n select\n n.record_id as encounter_id,\n string_agg(concat(\n 'Note type: ',\n n.note_type,\n ', Content: ', n.content,\n ', Note date: ', to_char(n.datetime, 'YYYY-MM-DD HH24:MI:SS')\n ),\n E'\\n'\n order by n.datetime) as notes\n from encounter_notes_deduped n\n where n.row_number = 1\n group by n.record_id\n),\n\ninvoice_data as (\n select\n i.encounter_id,\n max(\n case\n when i.status = 'finalised'\n then to_char(i.datetime, 'YYYY-MM-DD HH24:MI:SS')\n end\n ) as invoice_finalised_datetime,\n string_agg(distinct ip.category, ', ') as invoice_product_categories\n from \"app\".\"reporting\".\"invoices\" i\n join encounters_in_scope eis\n on eis.encounter_id = i.encounter_id\n left join \"app\".\"reporting\".\"invoice_items\" ii\n on ii.invoice_id = i.id\n left join \"app\".\"reporting\".\"invoice_products\" ip\n on ip.id = ii.product_id\n group by i.encounter_id\n)\n\nselect\n p.display_id as \"Patient ID\",\n p.first_name as \"First name\",\n p.last_name as \"Last name\",\n to_char(p.date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"Age\",\n p.sex as \"Sex\",\n eth.name as \"Ethnicity\",\n bt.name as \"Billing type\",\n to_char(eis.start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(eis.end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n case\n when eis.end_datetime is not null then\n case\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\n else eis.end_datetime::date - eis.start_datetime::date\n end\n end as \"Length of stay (days)\",\n eis.facility as \"Facility\",\n ec.encounter_type_emergency as \"Emergency encounter type\",\n ec.encounter_type_inpatient as \"Inpatient encounter type\",\n ec.encounter_type_outpatient as \"Outpatient encounter type\",\n dd.name as \"Discharge disposition\",\n t.score as \"Triage category\",\n am.name as \"Arrival mode\",\n case\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\n then concat(\n lpad((\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\n + extract(hour from (t.closed_datetime - t.triage_datetime))\n )::text, 2, '0'), ':',\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\n lpad(\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\n )\n )\n end as \"Time seen following triage/Waiting time (hh:mm:ss)\",\n ec.encountering_clinician as \"Clinician\",\n c.display_name as \"Supervising clinician\",\n dp.name as \"Discharging department\",\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"Discharge date and time of Discharging department\",\n lg.name as \"Discharging area\",\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"Discharge date and time of Discharging area\",\n l.name as \"Discharging location\",\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"Discharge date and time of Discharging location\",\n ec.departments as \"Department history\",\n array_to_string(ec.department_datetimes, ', ') as \"Department history date and times\",\n ec.location_groups as \"Area history\",\n array_to_string(ec.location_group_datetimes, ', ') as \"Area history date and times\",\n ec.locations as \"Location history\",\n array_to_string(ec.location_datetimes, ', ') as \"Location history date and times\",\n eis.reason_for_encounter as \"Reason for encounter\",\n ed.diagnoses as \"Diagnoses\",\n ep.medications as \"Medications\",\n ev.vaccinations as \"Vaccinations\",\n epr.procedures as \"Procedures\",\n elr.lab_requests as \"Lab requests\",\n eir.imaging_requests as \"Imaging requests\",\n case\n when length(en.notes) > 32000\n then concat(\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\n )\n else en.notes\n end as \"Notes\",\n invd.invoice_finalised_datetime as \"invoiceFinalisedDateTime\",\n invd.invoice_product_categories as \"invoiceProductCategories\"\nfrom encounters_in_scope eis\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = eis.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = eis.location_id\njoin \"app\".\"reporting\".\"departments\" dp\n on dp.id = eis.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"users\" c\n on c.id = eis.clinician_id\njoin encounter_changes ec\n on ec.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"triages\" t\n on t.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"discharges\" d\n on d.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = eis.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" eth\n on eth.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = eis.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" am\n on am.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" dd\n on dd.id = d.disposition_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = eis.encounter_id\nleft join encounter_prescriptions ep\n on ep.encounter_id = eis.encounter_id\nleft join encounter_vaccinations ev\n on ev.encounter_id = eis.encounter_id\nleft join encounter_procedures epr\n on epr.encounter_id = eis.encounter_id\nleft join encounter_lab_requests elr\n on elr.encounter_id = eis.encounter_id\nleft join encounter_imaging_requests eir\n on eir.encounter_id = eis.encounter_id\nleft join encounter_notes en\n on en.encounter_id = eis.encounter_id\nleft join invoice_data invd\n on invd.encounter_id = eis.encounter_id\nwhere\n case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.department_ids::text [])\n end\n and case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.location_group_ids::text [])\n end\norder by eis.end_datetime desc\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date": {"database": "app", "schema": "reporting", "name": "sensitive-encounter-summary-by-start-date", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-encounter-summary-by-start-date.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-encounter-summary-by-start-date.sql", "unique_id": "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-encounter-summary-by-start-date"], "alias": "sensitive-encounter-summary-by-start-date", "checksum": {"name": "sha256", "checksum": "1956b6e18f95f9ad9bddebd0a1a27f5130d2b616e6159264427abc4636ce6efe"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.0701468, "relation_name": "\"app\".\"reporting\".\"sensitive-encounter-summary-by-start-date\"", "raw_code": "{{ encounter_summary_report('start_datetime', is_sensitive=true) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "procedures", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "invoices", "package": null, "version": null}, {"name": "invoice_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_summary_report"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-encounter-summary-by-start-date.sql", "compiled": true, "compiled_code": "\n\nwith encounters_in_scope as (\n select\n e.id as encounter_id,\n e.start_datetime,\n e.end_datetime,\n e.patient_id,\n e.location_id,\n e.department_id,\n e.clinician_id,\n e.patient_billing_type_id,\n e.reason_for_encounter,\n f.id as facility_id,\n f.name as facility\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = True\n where\n e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n \n and case\n when nullif('2024-01-01', '')::date is null then true\n else e.start_datetime >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null then true\n else e.start_datetime <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null then true\n else f.id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.patient_billing_type_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.clinician_id = nullif('', '')::text\n end\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.updated_by_id,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n clinician.display_name as clinician_name,\n actor.display_name as updated_by_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n row_number() over (\n partition by eh.encounter_id, eh.change_type\n order by eh.datetime\n ) as change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from \"app\".\"reporting\".\"encounter_history\" eh\n join encounters_in_scope eis\n on eis.encounter_id = eh.encounter_id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = eh.clinician_id\n join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\nencounter_changes as (\n select\n encounter_id,\n \n -- Location changes: tracks all location changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\n\n -- Location group changes: tracks location group changes (only when group actually changes)\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\n\n -- Department changes: tracks all department changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\n\n -- Encounter type changes: tracks encounter type progression (emergency types)\n string_agg(\n case\n when encounter_type = 'triage' then 'Triage'\n when encounter_type = 'observation' then 'Active ED care'\n when encounter_type = 'emergency' then 'Emergency short stay'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\n\n -- Encounter type changes: tracks encounter type progression (inpatient types)\n string_agg(\n case\n when encounter_type = 'admission' then 'Hospital admission'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\n\n -- Encounter type changes: tracks encounter type progression (outpatient types)\n string_agg(\n case\n when encounter_type = 'clinic' then 'Clinic'\n when encounter_type = 'imaging' then 'Imaging'\n when encounter_type = 'surveyResponse' then 'Survey response'\n when encounter_type = 'vaccination' then 'Vaccination'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\n\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\n from encounter_history_consolidated\n group by encounter_id\n),\n\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n concat(\n 'Name: ', d.name,\n ', Code: ', d.code,\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\n ', Certainty: ', ed.certainty\n ),\n E'\\n'\n order by ed.is_primary desc, ed.datetime asc\n ) as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join encounters_in_scope eis\n on eis.encounter_id = ed.encounter_id\n join \"app\".\"reporting\".\"reference_data\" d\n on d.id = ed.diagnosis_id\n group by ed.encounter_id\n),\n\nencounter_prescriptions as (\n select\n ep.encounter_id,\n string_agg(\n concat(\n 'Name: ', m.name,\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\n ', Discontinuing reason: ', p.discontinuing_reason\n ),\n '' || E'\\n' || ''\n order by p.datetime\n ) as medications\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join encounters_in_scope eis\n on eis.encounter_id = ep.encounter_id\n join \"app\".\"reporting\".\"prescriptions\" p\n on p.id = ep.prescription_id\n join \"app\".\"reporting\".\"reference_data\" m\n on m.id = p.medication_id\n group by ep.encounter_id\n),\n\nencounter_vaccinations as (\n select\n av.encounter_id,\n string_agg(\n concat(\n v.name,\n ', Label: ', sv.label,\n ', Schedule: ', sv.dose_label\n ),\n E'\\n'\n order by av.datetime\n ) as vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" av\n join encounters_in_scope eis\n on eis.encounter_id = av.encounter_id\n join \"app\".\"reporting\".\"vaccine_schedules\" sv\n on sv.id = av.scheduled_vaccine_id\n join \"app\".\"reporting\".\"reference_data\" v\n on v.id = sv.vaccine_id\n group by av.encounter_id\n),\n\nencounter_procedures as (\n select\n p.encounter_id,\n string_agg(\n concat(\n 'Name: ', proc.name,\n ', Date: ', to_char(p.date, 'YYYY-MM-DD'),\n ', Location: ', loc.name,\n ', Notes: ', p.note,\n ', Completed notes: ', p.completed_note\n ),\n E'\\n'\n order by p.date\n ) as procedures\n from \"app\".\"reporting\".\"procedures\" p\n join encounters_in_scope eis\n on eis.encounter_id = p.encounter_id\n left join \"app\".\"reporting\".\"reference_data\" proc\n on proc.id = p.procedure_type_id\n left join \"app\".\"reporting\".\"locations\" loc\n on loc.id = p.location_id\n group by p.encounter_id\n),\n\nencounter_lab_requests as (\n select\n lr.encounter_id,\n string_agg(\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\n order by lr.collected_datetime\n ) as lab_requests\n from \"app\".\"reporting\".\"lab_requests\" lr\n join encounters_in_scope eis\n on eis.encounter_id = lr.encounter_id\n left join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\n left join \"app\".\"reporting\".\"lab_test_panels\" ltp\n on ltp.id = ltpr.lab_test_panel_id\n left join \"app\".\"reporting\".\"lab_tests\" lt\n on lt.lab_request_id = lr.id\n and lr.lab_test_panel_request_id isnull\n left join \"app\".\"reporting\".\"lab_test_types\" ltt\n on ltt.id = lt.lab_test_type_id\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\n group by lr.encounter_id\n),\n\nnotes_raw as (\n select\n n.id,\n n.datetime,\n n.content,\n n.note_type_id,\n n.note_type,\n n.record_type,\n n.record_id,\n n.updated_note_id,\n n.visibility_status\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"imaging_requests\" ir\n on n.record_type = 'ImagingRequest'\n and ir.id = n.record_id\n join encounters_in_scope eis\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\n where n.record_type in ('Encounter', 'ImagingRequest')\n),\n\nencounter_notes_deduped as (\n select\n id,\n datetime,\n content,\n note_type,\n record_id,\n visibility_status,\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\n from notes_raw\n where\n record_type = 'Encounter'\n and note_type_id != 'notetype-system'\n),\n\nimaging_request_areas as (\n select\n ir.encounter_id,\n ira.imaging_request_id,\n case\n when ir.imaging_type = 'xRay' then 'X-Ray'\n when ir.imaging_type = 'ctScan' then 'CT Scan'\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\n when ir.imaging_type = 'mri' then 'MRI'\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\n when ir.imaging_type = 'mammogram' then 'Mammogram'\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\n when ir.imaging_type = 'angiogram' then 'Angiogram'\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\n when ir.imaging_type = 'stressTest' then 'Stress Test'\n else ir.imaging_type\n end as imaging_type,\n coalesce(\n string_agg(\n area.name, ', '\n order by area.name\n ),\n string_agg(case\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\n end, ', '\n order by n.datetime)\n ) as areas_to_be_imaged,\n string_agg(case\n when n.note_type_id = 'notetype-other' then n.content\n end, ','\n order by n.datetime) as notes\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join encounters_in_scope eis\n on eis.encounter_id = ir.encounter_id\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira\n on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" area\n on area.id = ira.area_id\n left join notes_raw n\n on n.record_id = ir.id\n and n.record_type = 'ImagingRequest'\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\n),\n\nencounter_imaging_requests as (\n select\n encounter_id,\n string_agg(\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\n ) as imaging_requests\n from imaging_request_areas\n group by encounter_id\n),\n\nencounter_notes as (\n select\n n.record_id as encounter_id,\n string_agg(concat(\n 'Note type: ',\n n.note_type,\n ', Content: ', n.content,\n ', Note date: ', to_char(n.datetime, 'YYYY-MM-DD HH24:MI:SS')\n ),\n E'\\n'\n order by n.datetime) as notes\n from encounter_notes_deduped n\n where n.row_number = 1\n group by n.record_id\n),\n\ninvoice_data as (\n select\n i.encounter_id,\n max(\n case\n when i.status = 'finalised'\n then to_char(i.datetime, 'YYYY-MM-DD HH24:MI:SS')\n end\n ) as invoice_finalised_datetime,\n string_agg(distinct ip.category, ', ') as invoice_product_categories\n from \"app\".\"reporting\".\"invoices\" i\n join encounters_in_scope eis\n on eis.encounter_id = i.encounter_id\n left join \"app\".\"reporting\".\"invoice_items\" ii\n on ii.invoice_id = i.id\n left join \"app\".\"reporting\".\"invoice_products\" ip\n on ip.id = ii.product_id\n group by i.encounter_id\n)\n\nselect\n p.display_id as \"Patient ID\",\n p.first_name as \"First name\",\n p.last_name as \"Last name\",\n to_char(p.date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"Age\",\n p.sex as \"Sex\",\n eth.name as \"Ethnicity\",\n bt.name as \"Billing type\",\n to_char(eis.start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(eis.end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n case\n when eis.end_datetime is not null then\n case\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\n else eis.end_datetime::date - eis.start_datetime::date\n end\n end as \"Length of stay (days)\",\n eis.facility as \"Facility\",\n ec.encounter_type_emergency as \"Emergency encounter type\",\n ec.encounter_type_inpatient as \"Inpatient encounter type\",\n ec.encounter_type_outpatient as \"Outpatient encounter type\",\n dd.name as \"Discharge disposition\",\n t.score as \"Triage category\",\n am.name as \"Arrival mode\",\n case\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\n then concat(\n lpad((\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\n + extract(hour from (t.closed_datetime - t.triage_datetime))\n )::text, 2, '0'), ':',\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\n lpad(\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\n )\n )\n end as \"Time seen following triage/Waiting time (hh:mm:ss)\",\n ec.encountering_clinician as \"Clinician\",\n c.display_name as \"Supervising clinician\",\n dp.name as \"Discharging department\",\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"Discharge date and time of Discharging department\",\n lg.name as \"Discharging area\",\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"Discharge date and time of Discharging area\",\n l.name as \"Discharging location\",\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"Discharge date and time of Discharging location\",\n ec.departments as \"Department history\",\n array_to_string(ec.department_datetimes, ', ') as \"Department history date and times\",\n ec.location_groups as \"Area history\",\n array_to_string(ec.location_group_datetimes, ', ') as \"Area history date and times\",\n ec.locations as \"Location history\",\n array_to_string(ec.location_datetimes, ', ') as \"Location history date and times\",\n eis.reason_for_encounter as \"Reason for encounter\",\n ed.diagnoses as \"Diagnoses\",\n ep.medications as \"Medications\",\n ev.vaccinations as \"Vaccinations\",\n epr.procedures as \"Procedures\",\n elr.lab_requests as \"Lab requests\",\n eir.imaging_requests as \"Imaging requests\",\n case\n when length(en.notes) > 32000\n then concat(\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\n )\n else en.notes\n end as \"Notes\",\n invd.invoice_finalised_datetime as \"invoiceFinalisedDateTime\",\n invd.invoice_product_categories as \"invoiceProductCategories\"\nfrom encounters_in_scope eis\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = eis.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = eis.location_id\njoin \"app\".\"reporting\".\"departments\" dp\n on dp.id = eis.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"users\" c\n on c.id = eis.clinician_id\njoin encounter_changes ec\n on ec.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"triages\" t\n on t.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"discharges\" d\n on d.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = eis.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" eth\n on eth.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = eis.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" am\n on am.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" dd\n on dd.id = d.disposition_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = eis.encounter_id\nleft join encounter_prescriptions ep\n on ep.encounter_id = eis.encounter_id\nleft join encounter_vaccinations ev\n on ev.encounter_id = eis.encounter_id\nleft join encounter_procedures epr\n on epr.encounter_id = eis.encounter_id\nleft join encounter_lab_requests elr\n on elr.encounter_id = eis.encounter_id\nleft join encounter_imaging_requests eir\n on eir.encounter_id = eis.encounter_id\nleft join encounter_notes en\n on en.encounter_id = eis.encounter_id\nleft join invoice_data invd\n on invd.encounter_id = eis.encounter_id\nwhere\n case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.department_ids::text [])\n end\n and case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.location_group_ids::text [])\n end\norder by eis.start_datetime desc\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-imaging-requests-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-imaging-requests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-imaging-requests-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-imaging-requests-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-imaging-requests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-imaging-requests-line-list"], "alias": "sensitive-imaging-requests-line-list", "checksum": {"name": "sha256", "checksum": "9798bf366c63bc1aa8360469ead0269b363faf319be006c65192111763fe8d50"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.0701468, "relation_name": "\"app\".\"reporting\".\"sensitive-imaging-requests-line-list\"", "raw_code": "with _translations as (\r\n {{ get_translation_lookup(prefix_key='IMAGING_TYPES') }}\r\n)\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n request_id as \"{{ translate_label('imagingRequestId') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('imagingRequestDateTime') }}\",\r\n supervising_clinician as \"{{ translate_label('imagingSupervisingClinician') }}\",\r\n requesting_clinician as \"{{ translate_label('imagingRequestingClinician') }}\",\r\n priority as \"{{ translate_label('imagingPriority') }}\",\r\n coalesce(t_imaging_type.text, imaging_type) as \"{{ translate_label('imagingType') }}\",\r\n imaging_area as \"{{ translate_label('imagingArea') }}\",\r\n status as \"{{ translate_label('imagingStatus') }}\",\r\n to_char(completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('imagingCompletedDateTime') }}\",\r\n reason_for_cancellation as \"{{ translate_label('imagingCancellationReason') }}\"\r\nfrom {{ ref('ds__sensitive_imaging_requests') }}\r\nleft join _translations t_imaging_type\r\n on t_imaging_type.string_id = '{{ get_translation_prefix(\"IMAGING_TYPES\") }}.' || imaging_type\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('requestedById') }} is null then true\r\n else requesting_clinician_id = {{ parameter('requestedById') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('imagingType') }} is null then true\r\n else imaging_type = {{ parameter('imagingType') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by requested_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "translated_strings", "package": null, "version": null}, {"name": "ds__sensitive_imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_lookup", "macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_translation_prefix", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.translated_strings", "model.tamanu_source_dbt.ds__sensitive_imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-imaging-requests-line-list.sql", "compiled": true, "compiled_code": "with _translations as (\n select\n string_id,\n max(text) filter (where language = 'default') as text\n from \"app\".\"reporting\".\"translated_strings\"\n where string_id like 'imaging.property.type.%'\n group by string_id\n)\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n request_id as \"Request ID\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Request date and time\",\n supervising_clinician as \"Supervising clinician\",\n requesting_clinician as \"Requesting clinician\",\n priority as \"Priority\",\n coalesce(t_imaging_type.text, imaging_type) as \"Imaging type\",\n imaging_area as \"Area to be imaged\",\n status as \"Status\",\n to_char(completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Completed date and time\",\n reason_for_cancellation as \"Reason for cancellation\"\nfrom \"app\".\"reporting\".\"ds__sensitive_imaging_requests\"\nleft join _translations t_imaging_type\n on t_imaging_type.string_id = 'imaging.property.type.' || imaging_type\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else requesting_clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else imaging_type = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\norder by requested_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-imaging-requests-summary": {"database": "app", "schema": "reporting", "name": "sensitive-imaging-requests-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-imaging-requests-summary.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-imaging-requests-summary.sql", "unique_id": "model.tamanu_source_dbt.sensitive-imaging-requests-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-imaging-requests-summary"], "alias": "sensitive-imaging-requests-summary", "checksum": {"name": "sha256", "checksum": "ca2bfffef6184a7ce3149b4fd16f10df7c680744547ba7a8375fd1a4dcb280bd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.0860562, "relation_name": "\"app\".\"reporting\".\"sensitive-imaging-requests-summary\"", "raw_code": "with _translations as (\r\n {{ get_translation_lookup(prefix_key='IMAGING_TYPES') }}\r\n),\r\n\r\nreporting_dates as (\r\n select date::date as date\r\n from generate_series(\r\n {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }},\r\n {{ parameter('toDate', default_value='2024-01-31', data_type='date') }},\r\n '1 day'::interval\r\n ) date\r\n)\r\n\r\nselect\r\n to_char(rd.date, '{{ var(\"date_format\") }}') as \"{{ translate_label('reportingDate') }}\",\r\n ir.facility as \"{{ translate_label('facility') }}\",\r\n ir.department as \"{{ translate_label('department') }}\",\r\n coalesce(t_imaging_type.text, ir.imaging_type) as \"{{ translate_label('imagingType') }}\",\r\n count(distinct ir.request_id) filter (where ir.requested_datetime::date = rd.date) as \"{{ translate_label('imagingTotalRequests') }}\",\r\n count(distinct ir.request_id) filter (\r\n where ir.requested_datetime::date <= rd.date\r\n and (ir.completed_datetime::date > rd.date or ir.completed_datetime is null)\r\n ) as \"{{ translate_label('imagingPendingRequests') }}\",\r\n count(distinct ir.request_id) filter (\r\n where ir.completed_datetime::date = rd.date\r\n ) as \"{{ translate_label('imagingCompletedRequests') }}\"\r\nfrom reporting_dates rd\r\nleft join {{ ref('ds__sensitive_imaging_requests') }} ir\r\n on ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\r\n and ir.requested_datetime::date <= rd.date\r\n and (ir.completed_datetime::date >= rd.date or ir.completed_datetime is null)\r\nleft join _translations t_imaging_type\r\n on t_imaging_type.string_id = '{{ get_translation_prefix(\"IMAGING_TYPES\") }}.' || ir.imaging_type\r\nwhere ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\r\n and (ir.department_id is not null or ir.imaging_type is not null)\r\n and (\r\n {{ parameter('department') }} is null or ir.department_id = {{ parameter('department') }}\r\n )\r\n and (\r\n case\r\n when {{ parameter('imagingType') }} is null then true\r\n else ir.imaging_type = {{ parameter('imagingType') }}\r\n end\r\n )\r\ngroup by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text\r\norder by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text", "doc_blocks": [], "language": "sql", "refs": [{"name": "translated_strings", "package": null, "version": null}, {"name": "ds__sensitive_imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_lookup", "macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_translation_prefix"], "nodes": ["model.tamanu_source_dbt.translated_strings", "model.tamanu_source_dbt.ds__sensitive_imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-imaging-requests-summary.sql", "compiled": true, "compiled_code": "with _translations as (\n select\n string_id,\n max(text) filter (where language = 'default') as text\n from \"app\".\"reporting\".\"translated_strings\"\n where string_id like 'imaging.property.type.%'\n group by string_id\n),\n\nreporting_dates as (\n select date::date as date\n from generate_series(\n nullif('2024-01-01', '')::date,\n nullif('2024-01-31', '')::date,\n '1 day'::interval\n ) date\n)\n\nselect\n to_char(rd.date, 'YYYY-MM-DD') as \"Date\",\n ir.facility as \"Facility\",\n ir.department as \"Department\",\n coalesce(t_imaging_type.text, ir.imaging_type) as \"Imaging type\",\n count(distinct ir.request_id) filter (where ir.requested_datetime::date = rd.date) as \"Total new requests\",\n count(distinct ir.request_id) filter (\n where ir.requested_datetime::date <= rd.date\n and (ir.completed_datetime::date > rd.date or ir.completed_datetime is null)\n ) as \"Total requests with a status of pending\",\n count(distinct ir.request_id) filter (\n where ir.completed_datetime::date = rd.date\n ) as \"Total requests completed\"\nfrom reporting_dates rd\nleft join \"app\".\"reporting\".\"ds__sensitive_imaging_requests\" ir\n on ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\n and ir.requested_datetime::date <= rd.date\n and (ir.completed_datetime::date >= rd.date or ir.completed_datetime is null)\nleft join _translations t_imaging_type\n on t_imaging_type.string_id = 'imaging.property.type.' || ir.imaging_type\nwhere ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\n and (ir.department_id is not null or ir.imaging_type is not null)\n and (\n nullif('', '')::text is null or ir.department_id = nullif('', '')::text\n )\n and (\n case\n when nullif('', '')::text is null then true\n else ir.imaging_type = nullif('', '')::text\n end\n )\ngroup by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text\norder by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-incomplete-referrals": {"database": "app", "schema": "reporting", "name": "sensitive-incomplete-referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-incomplete-referrals.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-incomplete-referrals.sql", "unique_id": "model.tamanu_source_dbt.sensitive-incomplete-referrals", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-incomplete-referrals"], "alias": "sensitive-incomplete-referrals", "checksum": {"name": "sha256", "checksum": "3d7865d95aebb04130db411f55105910af01eb118f47659ee59ca1d1627a93b8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.0860562, "relation_name": "\"app\".\"reporting\".\"sensitive-incomplete-referrals\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n diagnoses as \"{{ translate_label('diagnoses') }}\",\r\n referral_type as \"{{ translate_label('referralType') }}\",\r\n referring_doctor_name as \"{{ translate_label('referralCompletedBy') }}\",\r\n to_char(referral_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('referralDate') }}\",\r\n department as \"{{ translate_label('department') }}\"\r\nfrom {{ ref('ds__sensitive_referrals') }}\r\nwhere status in ('pending', 'cancelled')\r\n and case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else referral_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else referral_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('doctorId') }} is null then true\r\n else referring_doctor_id = {{ parameter('doctorId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\norder by referral_datetime, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_referrals", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-incomplete-referrals.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n diagnoses as \"Diagnoses\",\n referral_type as \"Referral name\",\n referring_doctor_name as \"Referring doctor\",\n to_char(referral_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Referral date\",\n department as \"Department\"\nfrom \"app\".\"reporting\".\"ds__sensitive_referrals\"\nwhere status in ('pending', 'cancelled')\n and case\n when nullif('2024-01-01', '')::date is null then true\n else referral_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else referral_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else referring_doctor_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\norder by referral_datetime, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-lab-requests-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-lab-requests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-lab-requests-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-lab-requests-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-lab-requests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-lab-requests-line-list"], "alias": "sensitive-lab-requests-line-list", "checksum": {"name": "sha256", "checksum": "8ddd812e4b6a0940223ef488e38274d9b4b61cd24b1a0ee822f00c0a85b622f4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.101717, "relation_name": "\"app\".\"reporting\".\"sensitive-lab-requests-line-list\"", "raw_code": "{{ config(tags=[\"restricted\"]) }}\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n concat_ws(', ', location_group, location) as \"{{ translate_label('location') }}\",\r\n laboratory as \"{{ translate_label('labLaboratory') }}\",\r\n request_id as \"{{ translate_label('labRequestId') }}\",\r\n status as \"{{ translate_label('labRequestStatus') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestDateTime') }}\",\r\n requested_by as \"{{ translate_label('labRequestClinician') }}\",\r\n requesting_department as \"{{ translate_label('labRequestDepartment') }}\",\r\n priority as \"{{ translate_label('labRequestPriority') }}\",\r\n lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n tests as \"{{ translate_label('labTestRequested') }}\",\r\n to_char(collected_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestSampleCollectionDateTime') }}\",\r\n collected_by as \"{{ translate_label('labRequestSampleCollectedBy') }}\",\r\n specimen_type as \"{{ translate_label('labRequestSpecimenType') }}\",\r\n site as \"{{ translate_label('labRequestSampleSite') }}\",\r\n to_char(completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestCompletedDateTime') }}\",\r\n reason_for_cancellation as \"{{ translate_label('labRequestCancellationReason') }}\"\r\nfrom {{ ref('ds__sensitive_lab_requests') }}\r\nwhere case\r\n when {{ parameter('requestedById') }} is null then true\r\n else requested_by_id = {{ parameter('requestedById') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('testCategoryId') }} is null then true\r\n else lab_test_category_id = {{ parameter('testCategoryId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by requested_datetime, last_name, first_name, tests", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_lab_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-lab-requests-line-list.sql", "compiled": true, "compiled_code": "\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n concat_ws(', ', location_group, location) as \"Location\",\n laboratory as \"Laboratory\",\n request_id as \"Request ID\",\n status as \"Status\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request date and time\",\n requested_by as \"Requesting clinician\",\n requesting_department as \"Requesting department\",\n priority as \"Priority\",\n lab_test_category as \"Test category\",\n tests as \"Test requested\",\n to_char(collected_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Sample collection date and time\",\n collected_by as \"Sample collected by\",\n specimen_type as \"Specimen type\",\n site as \"Site\",\n to_char(completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Completed date and time\",\n reason_for_cancellation as \"Reason for cancellation\"\nfrom \"app\".\"reporting\".\"ds__sensitive_lab_requests\"\nwhere case\n when nullif('', '')::text is null then true\n else requested_by_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else lab_test_category_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by requested_datetime, last_name, first_name, tests", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-lab-tests-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-lab-tests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-lab-tests-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-lab-tests-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-lab-tests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-lab-tests-line-list"], "alias": "sensitive-lab-tests-line-list", "checksum": {"name": "sha256", "checksum": "23edf7cb3baac1259b5a514543c7dffb089b485ed0a09edcd0d2e76b675545a7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.101717, "relation_name": "\"app\".\"reporting\".\"sensitive-lab-tests-line-list\"", "raw_code": "{{ config(tags=[\"restricted\"]) }}\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n requesting_department as \"{{ translate_label('requestingDepartment') }}\",\r\n concat_ws(', ', location_group, location) as \"{{ translate_label('location') }}\",\r\n lab_request_id as \"{{ translate_label('labRequestId') }}\",\r\n status as \"{{ translate_label('labRequestStatus') }}\",\r\n lab_test_panel as \"{{ translate_label('labTestPanel') }}\",\r\n lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestDateTime') }}\",\r\n requested_by as \"{{ translate_label('labRequestClinician') }}\",\r\n to_char(lab_request_published_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestPublishedDateTime') }}\",\r\n to_char(lab_test_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('labTestDate') }}\",\r\n result as \"{{ translate_label('labTestResults') }}\",\r\n verification as \"{{ translate_label('labTestVerification') }}\",\r\n lab_test_type as \"{{ translate_label('labTestType') }}\",\r\n to_char(lab_test_completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labTestCompletedDateTime') }}\"\r\nfrom {{ ref('ds__sensitive_lab_tests') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('testCategoryId') }} is null then true\r\n else lab_test_category_id = {{ parameter('testCategoryId') }}\r\n end\r\norder by requested_datetime, last_name, first_name, lab_test_panel", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_lab_tests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-lab-tests-line-list.sql", "compiled": true, "compiled_code": "\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n requesting_department as \"Requesting department\",\n concat_ws(', ', location_group, location) as \"Location\",\n lab_request_id as \"Request ID\",\n status as \"Status\",\n lab_test_panel as \"Lab test panel\",\n lab_test_category as \"Test category\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request date and time\",\n requested_by as \"Requesting clinician\",\n to_char(lab_request_published_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request published date and time\",\n to_char(lab_test_date, 'YYYY-MM-DD') as \"Lab test date\",\n result as \"Result\",\n verification as \"Verification\",\n lab_test_type as \"Lab test type\",\n to_char(lab_test_completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab test completed date and time\"\nfrom \"app\".\"reporting\".\"ds__sensitive_lab_tests\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else lab_test_category_id = nullif('', '')::text\n end\norder by requested_datetime, last_name, first_name, lab_test_panel", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-location-bookings-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-location-bookings-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-location-bookings-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-location-bookings-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-location-bookings-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-location-bookings-line-list"], "alias": "sensitive-location-bookings-line-list", "checksum": {"name": "sha256", "checksum": "c441374001bad4d3ee3efc8a8b41072211a6dfc43f50972139df654006a0e9f6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.1175923, "relation_name": "\"app\".\"reporting\".\"sensitive-location-bookings-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(booking_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('bookingStartDateTime') }}\",\r\n to_char(booking_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('bookingEndDateTime') }}\",\r\n case\r\n when extract(day from age(booking_end_datetime, booking_start_datetime)) >= 1\r\n then extract(day from age(booking_end_datetime, booking_start_datetime)) || ' nights'\r\n when extract(hour from age(booking_end_datetime, booking_start_datetime)) >= 1\r\n then extract(hour from age(booking_end_datetime, booking_start_datetime)) || ' hours'\r\n else extract(minute from age(booking_end_datetime, booking_start_datetime)) || ' minutes'\r\n end as \"{{ translate_label('bookingDuration') }}\",\r\n location_group as \"{{ translate_label('bookingLocationGroup') }}\",\r\n location as \"{{ translate_label('bookingLocation') }}\",\r\n clinician as \"{{ translate_label('bookingClinician') }}\",\r\n booking_type as \"{{ translate_label('bookingType') }}\",\r\n booking_status as \"{{ translate_label('bookingStatus') }}\"\r\nfrom {{ ref('ds__sensitive_location_bookings') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else booking_start_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else booking_end_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('bookingStatus') }} is null then true\r\n else booking_status = {{ parameter('bookingStatus') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('bookingTypeId') }} is null then true\r\n else booking_type_id = {{ parameter('bookingTypeId') }}\r\n end\r\norder by booking_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_location_bookings", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_location_bookings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-location-bookings-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n billing_type as \"Billing type\",\n to_char(booking_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Booking start date and time\",\n to_char(booking_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Booking end date and time\",\n case\n when extract(day from age(booking_end_datetime, booking_start_datetime)) >= 1\n then extract(day from age(booking_end_datetime, booking_start_datetime)) || ' nights'\n when extract(hour from age(booking_end_datetime, booking_start_datetime)) >= 1\n then extract(hour from age(booking_end_datetime, booking_start_datetime)) || ' hours'\n else extract(minute from age(booking_end_datetime, booking_start_datetime)) || ' minutes'\n end as \"Booking duration\",\n location_group as \"Area\",\n location as \"Location\",\n clinician as \"Clinician\",\n booking_type as \"Booking type\",\n booking_status as \"Booking status\"\nfrom \"app\".\"reporting\".\"ds__sensitive_location_bookings\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else booking_start_datetime >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else booking_end_datetime <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else booking_status = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else booking_type_id = nullif('', '')::text\n end\norder by booking_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-medication-dispensed-summary": {"database": "app", "schema": "reporting", "name": "sensitive-medication-dispensed-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-medication-dispensed-summary.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-medication-dispensed-summary.sql", "unique_id": "model.tamanu_source_dbt.sensitive-medication-dispensed-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-medication-dispensed-summary"], "alias": "sensitive-medication-dispensed-summary", "checksum": {"name": "sha256", "checksum": "1d4925289220857f596603693547e069527888f1672bb2dc6d0db3313a2535cd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.1649175, "relation_name": "\"app\".\"reporting\".\"sensitive-medication-dispensed-summary\"", "raw_code": "select\r\n md.medication as \"{{ translate_label('prescriptionMedication') }}\",\r\n md.medication_code as \"{{ translate_label('prescriptionMedicationCode') }}\",\r\n sum(md.quantity) as \"{{ translate_label('prescriptionQuantity') }}\"\r\nfrom {{ ref('ds__sensitive_medication_dispenses') }} md\r\nwhere\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else md.facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('medicationId') }} is null then true\r\n else md.medication_id = {{ parameter('medicationId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='timestamp') }} is null then true\r\n else md.dispensed_at\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='timestamp') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='timestamp') }} is null then true\r\n else md.dispensed_at\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='timestamp') }}\r\n end\r\ngroup by md.medication_id, md.medication, md.medication_code", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_medication_dispenses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-medication-dispensed-summary.sql", "compiled": true, "compiled_code": "select\n md.medication as \"Medication\",\n md.medication_code as \"Code\",\n sum(md.quantity) as \"Quantity\"\nfrom \"app\".\"reporting\".\"ds__sensitive_medication_dispenses\" md\nwhere\n case\n when nullif('', '')::text is null then true\n else md.facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else md.medication_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::timestamp is null then true\n else md.dispensed_at\n >= nullif('2024-01-01', '')::timestamp\n end\n and\n case\n when nullif('2024-01-31', '')::timestamp is null then true\n else md.dispensed_at\n <= nullif('2024-01-31', '')::timestamp\n end\ngroup by md.medication_id, md.medication, md.medication_code", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-outpatient-appointments-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-outpatient-appointments-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-outpatient-appointments-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-outpatient-appointments-line-list"], "alias": "sensitive-outpatient-appointments-line-list", "checksum": {"name": "sha256", "checksum": "d76c682837fc49f38b0719d9c0cca20df4da2dffd1ae687123447b11ea22ec47"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.1649175, "relation_name": "\"app\".\"reporting\".\"sensitive-outpatient-appointments-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n contact_number as \"{{ translate_label('patientContactNumber') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(appointment_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentDateTime') }}\",\r\n to_char(appointment_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentEndDateTime') }}\",\r\n appointment_type as \"{{ translate_label('appointmentType') }}\",\r\n appointment_status as \"{{ translate_label('appointmentStatus') }}\",\r\n clinician as \"{{ translate_label('appointmentClinician') }}\",\r\n location_group as \"{{ translate_label('appointmentLocationGroup') }}\",\r\n priority as \"{{ translate_label('appointmentPriority') }}\",\r\n case\r\n when schedule_id notnull then {{ get_recurrence_description('interval', 'frequency', 'days_of_week', 'nth_weekday') }}\r\n else 'No'\r\n end as \"{{ translate_label('appointmentIsRepeating') }}\",\r\n to_char(until_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('appointmentRepeatingEndDate') }}\",\r\n created_by as \"{{ translate_label('appointmentCreatedBy') }}\"\r\nfrom {{ ref('ds__sensitive_outpatient_appointments') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else appointment_start_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else appointment_start_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when coalesce({{ parameter('appointmentStatus') }}) is null then true\r\n else appointment_status in ({{ parameter('appointmentStatus') }})\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('appointmentTypeId') }} is null then true\r\n else appointment_type_id = {{ parameter('appointmentTypeId') }}\r\n end\r\norder by appointment_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_outpatient_appointments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_recurrence_description", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_outpatient_appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-outpatient-appointments-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n contact_number as \"Contact number\",\n village as \"Village\",\n billing_type as \"Billing type\",\n to_char(appointment_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment date and time\",\n to_char(appointment_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment end date and time\",\n appointment_type as \"Appointment type\",\n appointment_status as \"Appointment status\",\n clinician as \"Clinician\",\n location_group as \"Area\",\n priority as \"Priority appointment\",\n case\n when schedule_id notnull then concat(\n concat(\n case when \"interval\" = 1 then\n case frequency\n when 'WEEKLY' then 'Weekly on a '\n when 'MONTHLY' then 'Monthly on the '\n end\n else concat('Every ', \"interval\",\n case frequency\n when 'WEEKLY' then ' weeks on '\n when 'MONTHLY' then ' months on the '\n end\n )\n end\n ),\n case nth_weekday\n when -1 then 'last '\n when 1 then 'first '\n when 2 then 'second '\n when 3 then 'third '\n when 4 then 'fourth ' \n else ''\n end,\n array_to_string(\n array(select case unnest_day\n when 'MO' then 'Monday'\n when 'TU' then 'Tuesday'\n when 'WE' then 'Wednesday'\n when 'TH' then 'Thursday'\n when 'FR' then 'Friday'\n when 'SA' then 'Saturday'\n when 'SU' then 'Sunday'\n else unnest_day\n end from unnest(days_of_week) as unnest_day),\n ', '\n )\n )\n else 'No'\n end as \"Repeating appointment\",\n to_char(until_date, 'YYYY-MM-DD') as \"Repeating appointment end date\",\n created_by as \"Appointment created by\"\nfrom \"app\".\"reporting\".\"ds__sensitive_outpatient_appointments\"\nwhere case\n when nullif('2025-01-01', '')::date is null then true\n else appointment_start_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else appointment_start_datetime <= nullif('2025-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\n and\n case\n when coalesce(nullif('', '')::text) is null then true\n else appointment_status in (nullif('', '')::text)\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else appointment_type_id = nullif('', '')::text\n end\norder by appointment_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary": {"database": "app", "schema": "reporting", "name": "sensitive-patient-emergency-encounters-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-patient-emergency-encounters-summary.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-patient-emergency-encounters-summary.sql", "unique_id": "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-patient-emergency-encounters-summary"], "alias": "sensitive-patient-emergency-encounters-summary", "checksum": {"name": "sha256", "checksum": "9ceef4e6849d3e022398664afd79938ddf5cfed9f280b1b103d3a648e7ea6449"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.1809928, "relation_name": "\"app\".\"reporting\".\"sensitive-patient-emergency-encounters-summary\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n count(*) as \"{{ translate_label('triageRecordCount') }}\"\r\nfrom {{ ref('ds__sensitive_encounters_emergency') }}\r\nwhere case\r\n when {{ parameter('patientId') }} is null then true\r\n else patient_id = {{ parameter('patientId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else triage_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else triage_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\ngroup by\r\n display_id,\r\n first_name,\r\n last_name,\r\n date_of_birth,\r\n sex,\r\n village,\r\n facility\r\norder by last_name, first_name, display_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_encounters_emergency", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_encounters_emergency"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-patient-emergency-encounters-summary.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n count(*) as \"Number of triage records\"\nfrom \"app\".\"reporting\".\"ds__sensitive_encounters_emergency\"\nwhere case\n when nullif('', '')::text is null then true\n else patient_id = nullif('', '')::text\n end\n and\n case\n when nullif('2025-01-01', '')::date is null then true\n else triage_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else triage_datetime <= nullif('2025-01-31', '')::date\n end\ngroup by\n display_id,\n first_name,\n last_name,\n date_of_birth,\n sex,\n village,\n facility\norder by last_name, first_name, display_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-prescription-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-prescription-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-prescription-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-prescription-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-prescription-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-prescription-line-list"], "alias": "sensitive-prescription-line-list", "checksum": {"name": "sha256", "checksum": "8c5c206618963af331d8733870eaf77462ae6dd523c76b59e7242152596e0634"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.196747, "relation_name": "\"app\".\"reporting\".\"sensitive-prescription-line-list\"", "raw_code": "select\r\n to_char(datetime, '{{ var(\"date_format\") }}') as \"{{ translate_label('prescriptionDate') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n is_selected_for_discharge as \"{{ translate_label('prescriptionSelectedForDischarge') }}\",\r\n medication_code as \"{{ translate_label('prescriptionMedicationCode') }}\",\r\n medication as \"{{ translate_label('prescriptionMedication') }}\",\r\n route as \"{{ translate_label('prescriptionRoute') }}\",\r\n quantity as \"{{ translate_label('prescriptionQuantity') }}\",\r\n repeats as \"{{ translate_label('prescriptionRepeats') }}\",\r\n is_ongoing as \"{{ translate_label('prescriptionIsOngoing') }}\",\r\n is_prn as \"{{ translate_label('prescriptionIsPRN') }}\",\r\n is_variable_dose as \"{{ translate_label('prescriptionIsVariableDose') }}\",\r\n dose_amount as \"{{ translate_label('prescriptionDoseAmount') }}\",\r\n units as \"{{ translate_label('prescriptionUnits') }}\",\r\n frequency as \"{{ translate_label('prescriptionFrequency') }}\"\r\nfrom {{ ref('ds__sensitive_encounter_prescriptions') }}\r\nwhere\r\n case when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case when {{ parameter('facilityId') }} is null then true\r\n else {{ parameter('facilityId') }} = facility_id\r\n end\r\norder by datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_encounter_prescriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-prescription-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(datetime, 'YYYY-MM-DD') as \"Prescription date\",\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n is_selected_for_discharge as \"Prescription selected for discharge\",\n medication_code as \"Code\",\n medication as \"Medication\",\n route as \"Route\",\n quantity as \"Quantity\",\n repeats as \"Repeats\",\n is_ongoing as \"Is ongoing\",\n is_prn as \"Is PRN\",\n is_variable_dose as \"Is variable dose\",\n dose_amount as \"Dose amount\",\n units as \"Units\",\n frequency as \"Frequency\"\nfrom \"app\".\"reporting\".\"ds__sensitive_encounter_prescriptions\"\nwhere\n case when nullif('2024-01-01', '')::date is null then true\n else datetime >= nullif('2024-01-01', '')::date\n end\n and case when nullif('2024-01-31', '')::date is null then true\n else datetime <= nullif('2024-01-31', '')::date\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = facility_id\n end\norder by datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-procedures-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-procedures-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-procedures-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-procedures-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-procedures-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-procedures-line-list"], "alias": "sensitive-procedures-line-list", "checksum": {"name": "sha256", "checksum": "b36f1829612a3a21259eb4bf7839f565f10ebddda472802d9e0cc5199157018a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.196747, "relation_name": "\"app\".\"reporting\".\"sensitive-procedures-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n encounter_facility as \"{{ translate_label('facility') }}\",\r\n encounter_department as \"{{ translate_label('department') }}\",\r\n encounter_type as \"{{ translate_label('encounterType') }}\",\r\n to_char(encounter_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(encounter_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n procedure_facility as \"{{ translate_label('procedureFacility') }}\",\r\n procedure_area as \"{{ translate_label('procedureLocationGroup') }}\",\r\n procedure_location as \"{{ translate_label('procedureLocation') }}\",\r\n procedure_type as \"{{ translate_label('procedure') }}\",\r\n to_char(procedure_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('procedureDate') }}\",\r\n to_char(procedure_start_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('procedureStartDateTime') }}\",\r\n to_char(procedure_end_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('procedureEndDateTime') }}\",\r\n procedure_duration as \"{{ translate_label('procedureDuration') }}\",\r\n procedure_clinician as \"{{ translate_label('procedureClinician') }}\",\r\n procedure_anaesthetist as \"{{ translate_label('procedureAnaesthetist') }}\",\r\n procedure_assistant_anaesthetist as \"{{ translate_label('procedureAssistantAnaesthetist') }}\",\r\n is_completed as \"{{ translate_label('procedureIsCompleted') }}\",\r\n time_in as \"{{ translate_label('procedureTimeIn') }}\",\r\n time_out as \"{{ translate_label('procedureTimeOut') }}\"\r\nfrom {{ ref('ds__sensitive_procedures') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else procedure_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else procedure_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else procedure_facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else encounter_department_id = {{ parameter('departmentId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else procedure_area_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationId') }} is null then true\r\n else procedure_location_id = {{ parameter('locationId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else procedure_clinician_id = {{ parameter('clinicianId') }}\r\n end\r\norder by procedure_start_time", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_procedures", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-procedures-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n nationality as \"Nationality\",\n encounter_facility as \"Facility\",\n encounter_department as \"Department\",\n encounter_type as \"Type\",\n to_char(encounter_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(encounter_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n procedure_facility as \"Procedure facility\",\n procedure_area as \"Procedure area\",\n procedure_location as \"Procedure location\",\n procedure_type as \"Procedure\",\n to_char(procedure_date, 'YYYY-MM-DD') as \"Procedure date\",\n to_char(procedure_start_time, 'HH24:MI') as \"Procedure start (date and time)\",\n to_char(procedure_end_time, 'HH24:MI') as \"Procedure end (date and time)\",\n procedure_duration as \"Procedure duration\",\n procedure_clinician as \"Procedure clinician\",\n procedure_anaesthetist as \"Procedure anaesthetist\",\n procedure_assistant_anaesthetist as \"Procedure assistant anesthetist\",\n is_completed as \"Procedure marked as completed\",\n time_in as \"Procedure time in\",\n time_out as \"Procedure time out\"\nfrom \"app\".\"reporting\".\"ds__sensitive_procedures\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else procedure_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else procedure_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else encounter_department_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_area_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_location_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_clinician_id = nullif('', '')::text\n end\norder by procedure_start_time", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-recent-diagnoses-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-recent-diagnoses-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-recent-diagnoses-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-recent-diagnoses-line-list"], "alias": "sensitive-recent-diagnoses-line-list", "checksum": {"name": "sha256", "checksum": "5402e8bf8115b7d6b8f61caa4499a3c1e6a0ae4cab986117c28a107d1f4abd26"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.2127483, "relation_name": "\"app\".\"reporting\".\"sensitive-recent-diagnoses-line-list\"", "raw_code": "select\r\n to_char(diagnosis_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('diagnosisDateTime') }}\",\r\n diagnosis as \"{{ translate_label('diagnoses') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n contact_number as \"{{ translate_label('patientPrimaryContactNumber') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n clinician as \"{{ translate_label('encounterClinician') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n certainty as \"{{ translate_label('diagnosisCertainty') }}\",\r\n is_primary as \"{{ translate_label('diagnosisIsPrimary') }}\"\r\nfrom {{ ref('ds__sensitive_diagnoses') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else diagnosis_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else diagnosis_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case when\r\n coalesce({{ parameter('diagnosisId') }}, {{ parameter('diagnosis2Id') }}, {{ parameter('diagnosis3Id') }}, {{ parameter('diagnosis4Id') }}, {{ parameter('diagnosis5Id') }}) is null\r\n then true\r\n else diagnosis_id in (\r\n {{ parameter('diagnosisId') }},\r\n {{ parameter('diagnosis2Id') }},\r\n {{ parameter('diagnosis3Id') }},\r\n {{ parameter('diagnosis4Id') }},\r\n {{ parameter('diagnosis5Id') }}\r\n )\r\n end\r\norder by diagnosis_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_diagnoses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-recent-diagnoses-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(diagnosis_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date & time\",\n diagnosis as \"Diagnoses\",\n first_name as \"First name\",\n last_name as \"Last name\",\n display_id as \"Patient ID\",\n age as \"Age\",\n sex as \"Sex\",\n contact_number as \"Primary contact number\",\n village as \"Village\",\n clinician as \"Clinician\",\n department as \"Department\",\n certainty as \"Certainty\",\n is_primary as \"Is primary\"\nfrom \"app\".\"reporting\".\"ds__sensitive_diagnoses\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else diagnosis_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else diagnosis_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case when\n coalesce(nullif('', '')::text, nullif('', '')::text, nullif('', '')::text, nullif('', '')::text, nullif('', '')::text) is null\n then true\n else diagnosis_id in (\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text\n )\n end\norder by diagnosis_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-user-audit-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-user-audit-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-user-audit-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-user-audit-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-user-audit-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-user-audit-line-list"], "alias": "sensitive-user-audit-line-list", "checksum": {"name": "sha256", "checksum": "62232e57983103c669907e7fbd7b7c9eca38e8ace9d5bba67be44714bacc8fb5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.2127483, "relation_name": "\"app\".\"reporting\".\"sensitive-user-audit-line-list\"", "raw_code": "select\r\n user_name as \"{{ translate_label('userName') }}\",\r\n user_role as \"{{ translate_label('userRole') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n patient_category as \"{{ translate_label('patientCategory') }}\",\r\n triage_category as \"{{ translate_label('triageCategory') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(encounter_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(encounter_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n to_char(first_note_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('noteStartDateTime') }}\",\r\n to_char(last_note_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('noteEndDateTime') }}\",\r\n is_discharged as \"{{ translate_label('encounterIsDischarged') }}\",\r\n non_discharge_by_clinicians as \"{{ translate_label('encounterNonDischargeClinician') }}\"\r\nfrom {{ ref('ds__sensitive_user_audit') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else encounter_start_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else encounter_start_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else department_id = {{ parameter('departmentId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\norder by encounter_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_user_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_user_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-user-audit-line-list.sql", "compiled": true, "compiled_code": "select\n user_name as \"User name\",\n user_role as \"User role\",\n display_id as \"Patient ID\",\n patient_category as \"Patient category\",\n triage_category as \"Triage category\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(encounter_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(encounter_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n to_char(first_note_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Notes start date and time\",\n to_char(last_note_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Notes end date and time\",\n is_discharged as \"Discharges (has the patient been discharged)\",\n non_discharge_by_clinicians as \"Non-discharge by clinicians\"\nfrom \"app\".\"reporting\".\"ds__sensitive_user_audit\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else encounter_start_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else encounter_start_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else department_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\norder by encounter_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-vaccine-audit-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-vaccine-audit-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-vaccine-audit-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-vaccine-audit-line-list"], "alias": "sensitive-vaccine-audit-line-list", "checksum": {"name": "sha256", "checksum": "1fbd9918275c8bf2f15d3a762be98ce1d5eab59ecc4df73ad6fce0b9836fdd32"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.2285464, "relation_name": "\"app\".\"reporting\".\"sensitive-vaccine-audit-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n to_char(vaccination_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDate') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_brand as \"{{ translate_label('vaccineBrand') }}\",\r\n disease as \"{{ translate_label('vaccineDisease') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n given_by as \"{{ translate_label('vaccinationGivenBy') }}\",\r\n recorded_by as \"{{ translate_label('vaccinationRecordedBy') }}\",\r\n modified_by as \"{{ translate_label('vaccinationModifiedBy') }}\",\r\n to_char(updated_at, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('vaccinationModifiedDate') }}\"\r\nfrom {{ ref(\"ds__sensitive_vaccinations\") }}\r\nwhere\r\n vaccine_status in ('Recorded in error', 'Historical')\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else vaccination_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else vaccination_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('status') }} is null then true\r\n else vaccine_status = {{ parameter('status') }}\r\n end\r\norder by vaccination_date, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-vaccine-audit-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n to_char(vaccination_date, 'YYYY-MM-DD') as \"Vaccination date\",\n vaccine_name as \"Vaccine name\",\n vaccine_brand as \"If category of Other, Vaccine brand\",\n disease as \"If category of Other, Disease\",\n vaccine_status as \"Vaccine status\",\n vaccine_schedule as \"Schedule\",\n given_by as \"Given by\",\n recorded_by as \"Recorded by\",\n modified_by as \"Record modified by\",\n to_char(updated_at, 'YYYY-MM-DD HH24:MI:SS') as \"Record modification date\"\nfrom \"app\".\"reporting\".\"ds__sensitive_vaccinations\"\nwhere\n vaccine_status in ('Recorded in error', 'Historical')\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else vaccination_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else vaccination_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_status = nullif('', '')::text\n end\norder by vaccination_date, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.sensitive-vaccine-line-list": {"database": "app", "schema": "reporting", "name": "sensitive-vaccine-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\sensitive\\sensitive-vaccine-line-list.sql", "original_file_path": "models\\reports\\sql\\sensitive\\sensitive-vaccine-line-list.sql", "unique_id": "model.tamanu_source_dbt.sensitive-vaccine-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "sensitive", "sensitive-vaccine-line-list"], "alias": "sensitive-vaccine-line-list", "checksum": {"name": "sha256", "checksum": "fb33813b54ec773e71b3f27436510458c958463a8c42d0fd0fc1455a589aff79"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports", "restricted"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports", "restricted"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["restricted"]}, "created_at": 1782423651.239956, "relation_name": "\"app\".\"reporting\".\"sensitive-vaccine-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(vaccination_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDate') }}\",\r\n vaccine_category as \"{{ translate_label('vaccineCategory') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_brand as \"{{ translate_label('vaccineBrand') }}\",\r\n disease as \"{{ translate_label('vaccineDisease') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n batch as \"{{ translate_label('vaccinationBatch') }}\",\r\n given_by as \"{{ translate_label('vaccinationGivenBy') }}\",\r\n recorded_by as \"{{ translate_label('vaccinationRecordedBy') }}\",\r\n circumstances as \"{{ translate_label('vaccinationGivenElseWhereCircumstances') }}\",\r\n given_elsewhere_by as \"{{ translate_label('vaccinationGivenElsewhereCountry') }}\",\r\n not_given_clinician as \"{{ translate_label('vaccinationNotGivenClinician') }}\",\r\n not_given_reason as \"{{ translate_label('vaccinationNotGivenReason') }}\"\r\nfrom {{ ref(\"ds__sensitive_vaccinations\") }}\r\nwhere\r\n vaccine_status in ('Given', 'Not Given')\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else vaccination_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else vaccination_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\norder by vaccination_date, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__sensitive_vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__sensitive_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\sensitive\\sensitive-vaccine-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(vaccination_date, 'YYYY-MM-DD') as \"Vaccination date\",\n vaccine_category as \"Vaccine category\",\n vaccine_name as \"Vaccine name\",\n vaccine_brand as \"If category of Other, Vaccine brand\",\n disease as \"If category of Other, Disease\",\n vaccine_status as \"Vaccine status\",\n vaccine_schedule as \"Schedule\",\n batch as \"Batch\",\n given_by as \"Given by\",\n recorded_by as \"Recorded by\",\n circumstances as \"If given elsewhere, Circumstances\",\n given_elsewhere_by as \"If given elsewhere, Country\",\n not_given_clinician as \"If not given, Supervising clinician\",\n not_given_reason as \"If not given, Reason not given\"\nfrom \"app\".\"reporting\".\"ds__sensitive_vaccinations\"\nwhere\n vaccine_status in ('Given', 'Not Given')\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else vaccination_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else vaccination_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\norder by vaccination_date, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.admissions-line-list": {"database": "app", "schema": "reporting", "name": "admissions-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\admissions-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\admissions-line-list.sql", "unique_id": "model.tamanu_source_dbt.admissions-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "admissions-line-list"], "alias": "admissions-line-list", "checksum": {"name": "sha256", "checksum": "de9fe366e151f2894de1e8fa64401b03e5d61b90c25ebf45c6a00615c47e4e95"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.244538, "relation_name": "\"app\".\"reporting\".\"admissions-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n admitting_clinician as \"{{ translate_label('admittingClinician') }}\",\r\n to_char(admission_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('admissionDateTime') }}\",\r\n admission_status as \"{{ translate_label('admissionStatus') }}\",\r\n to_char(discharge_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('dischargeDateTime') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n departments as \"{{ translate_label('encounterDepartmentHistory') }}\",\r\n department_datetimes as \"{{ translate_label('encounterDepartmentHistoryDateTimes') }}\",\r\n location_groups as \"{{ translate_label('encounterLocationGroupHistory') }}\",\r\n location_group_datetimes as \"{{ translate_label('encounterLocationGroupHistoryDateTimes') }}\",\r\n locations as \"{{ translate_label('encounterLocationHistory') }}\",\r\n location_datetimes as \"{{ translate_label('encounterLocationHistoryDateTimes') }}\",\r\n primary_diagnoses as \"{{ translate_label('diagnosesPrimary') }}\",\r\n secondary_diagnoses as \"{{ translate_label('diagnosesSecondary') }}\"\r\nfrom {{ ref('ds__admissions') }}\r\nwhere\r\n case when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else admission_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else admission_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case when {{ parameter('locationGroupId') }} is null then true\r\n else {{ parameter('locationGroupId') }} = any(location_group_ids::text [])\r\n end\r\n and case when {{ parameter('facilityId') }} is null then true\r\n else {{ parameter('facilityId') }} = facility_id\r\n end\r\n and case when {{ parameter('departmentId') }} is null then true\r\n else {{ parameter('departmentId') }} = any(department_ids::text [])\r\n end\r\n and case when {{ parameter('patientBillingTypeId') }} is null then true\r\n else billing_type_id like {{ parameter('patientBillingTypeId') }}\r\n end\r\n and case when {{ parameter('clinicianId') }} is null then true\r\n else admitting_clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and case when coalesce({{ parameter('admissionStatus') }}) is null then true\r\n else admission_status in ({{ parameter('admissionStatus') }})\r\n end\r\norder by admission_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__admissions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\admissions-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n billing_type as \"Billing type\",\n admitting_clinician as \"Admitting clinician\",\n to_char(admission_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Admission date and time\",\n admission_status as \"Admission status\",\n to_char(discharge_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Discharge date and time\",\n facility as \"Facility\",\n departments as \"Department history\",\n department_datetimes as \"Department history date and times\",\n location_groups as \"Area history\",\n location_group_datetimes as \"Area history date and times\",\n locations as \"Location history\",\n location_datetimes as \"Location history date and times\",\n primary_diagnoses as \"Primary diagnoses\",\n secondary_diagnoses as \"Secondary diagnoses\"\nfrom \"app\".\"reporting\".\"ds__admissions\"\nwhere\n case when nullif('2024-01-01', '')::date is null then true\n else admission_datetime >= nullif('2024-01-01', '')::date\n end\n and case when nullif('2024-01-31', '')::date is null then true\n else admission_datetime <= nullif('2024-01-31', '')::date\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = any(location_group_ids::text [])\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = facility_id\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = any(department_ids::text [])\n end\n and case when nullif('', '')::text is null then true\n else billing_type_id like nullif('', '')::text\n end\n and case when nullif('', '')::text is null then true\n else admitting_clinician_id = nullif('', '')::text\n end\n and case when coalesce(nullif('', '')::text) is null then true\n else admission_status in (nullif('', '')::text)\n end\norder by admission_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.audit-outpatient-appointments": {"database": "app", "schema": "reporting", "name": "audit-outpatient-appointments", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\audit-outpatient-appointments.sql", "original_file_path": "models\\reports\\sql\\standard\\audit-outpatient-appointments.sql", "unique_id": "model.tamanu_source_dbt.audit-outpatient-appointments", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "audit-outpatient-appointments"], "alias": "audit-outpatient-appointments", "checksum": {"name": "sha256", "checksum": "998a8f58e2a4de09131545555e284a2fbe0ddcc1ec30eb2aac6c4c6e0013929f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.244538, "relation_name": "\"app\".\"reporting\".\"audit-outpatient-appointments\"", "raw_code": "-- Outpatient Appointment Audit Report\r\n-- Shows all modifications and cancellations to outpatient appointments\r\n-- Each row represents a change event with both current and previous appointment details\r\n\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n -- Change event details\r\n change_number as \"{{ translate_label('auditChangeNumber') }}\",\r\n -- Current appointment details (at time of report)\r\n to_char(appointment_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentDateTime') }}\",\r\n appointment_type as \"{{ translate_label('appointmentType') }}\",\r\n clinician as \"{{ translate_label('appointmentClinician') }}\",\r\n location_group as \"{{ translate_label('appointmentLocationGroup') }}\",\r\n priority as \"{{ translate_label('appointmentPriority') }}\",\r\n is_repeating as \"{{ translate_label('appointmentIsRepeating') }}\",\r\n -- Modification details\r\n created_by as \"{{ translate_label('auditCreatedBy') }}\",\r\n modified_by as \"{{ translate_label('auditModifiedBy') }}\",\r\n to_char(modified_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('auditModifiedDateTime') }}\",\r\n is_cancelled as \"{{ translate_label('appointmentIsCancelled') }}\",\r\n -- Previous appointment details (prior to changes)\r\n to_char(prev_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('auditPrevAppointmentDateTime') }}\",\r\n prev_appointment_type as \"{{ translate_label('auditPrevAppointmentType') }}\",\r\n prev_clinician as \"{{ translate_label('auditPrevClinician') }}\",\r\n prev_location_group as \"{{ translate_label('auditPrevLocationGroup') }}\",\r\n prev_priority as \"{{ translate_label('auditPrevPriority') }}\"\r\nfrom {{ ref('ds__outpatient_appointments_audit') }}\r\nwhere\r\n -- Date range filter on appointment datetime\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else appointment_start_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else appointment_start_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n -- Facility filter\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by display_id, appointment_id, change_number", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__outpatient_appointments_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__outpatient_appointments_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\audit-outpatient-appointments.sql", "compiled": true, "compiled_code": "-- Outpatient Appointment Audit Report\n-- Shows all modifications and cancellations to outpatient appointments\n-- Each row represents a change event with both current and previous appointment details\n\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n -- Change event details\n change_number as \"Change number\",\n -- Current appointment details (at time of report)\n to_char(appointment_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment date and time\",\n appointment_type as \"Appointment type\",\n clinician as \"Clinician\",\n location_group as \"Area\",\n priority as \"Priority appointment\",\n is_repeating as \"Repeating appointment\",\n -- Modification details\n created_by as \"Appointment created by\",\n modified_by as \"Appointment modified by\",\n to_char(modified_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment modified date & time\",\n is_cancelled as \"Appointment cancelled\",\n -- Previous appointment details (prior to changes)\n to_char(prev_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Previous appointment date & time\",\n prev_appointment_type as \"Previous appointment type\",\n prev_clinician as \"Previous clinician\",\n prev_location_group as \"Previous area\",\n prev_priority as \"Previous priority appointment\"\nfrom \"app\".\"reporting\".\"ds__outpatient_appointments_audit\"\nwhere\n -- Date range filter on appointment datetime\n case\n when nullif('2025-01-01', '')::date is null then true\n else appointment_start_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else appointment_start_datetime <= nullif('2025-01-31', '')::date\n end\n -- Facility filter\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\norder by display_id, appointment_id, change_number", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.audit-patient-details-edit": {"database": "app", "schema": "reporting", "name": "audit-patient-details-edit", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\audit-patient-details-edit.sql", "original_file_path": "models\\reports\\sql\\standard\\audit-patient-details-edit.sql", "unique_id": "model.tamanu_source_dbt.audit-patient-details-edit", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "audit-patient-details-edit"], "alias": "audit-patient-details-edit", "checksum": {"name": "sha256", "checksum": "245a800046fc5d89b6c85f982202bae54e5131fea335ba720e433aee712d28ba"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.2605321, "relation_name": "\"app\".\"reporting\".\"audit-patient-details-edit\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n edited_by_user as \"{{ translate_label('logChangeBy') }}\",\r\n user_email as \"{{ translate_label('userEmail') }}\",\r\n user_role as \"{{ translate_label('userRole') }}\",\r\n to_char(edited_datetime, '{{ var(\"datetime_without_seconds_format\") }}') as \"{{ translate_label('logChangeDateTime') }}\"\r\nfrom {{ ref('ds__patients_change_logs') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else edited_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else edited_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('patientId') }} is null then true\r\n else patient_id = {{ parameter('patientId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('userId') }} is null then true\r\n else edited_by_user = {{ parameter('userId') }}\r\n end\r\norder by edited_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients_change_logs", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients_change_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\audit-patient-details-edit.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n edited_by_user as \"Edited by user\",\n user_email as \"User email\",\n user_role as \"User role\",\n to_char(edited_datetime, 'YYYY-MM-DD HH24:MI') as \"Date and time edited\"\nfrom \"app\".\"reporting\".\"ds__patients_change_logs\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else edited_datetime >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else edited_datetime <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else patient_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else edited_by_user = nullif('', '')::text\n end\norder by edited_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.audit-patient-views": {"database": "app", "schema": "reporting", "name": "audit-patient-views", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\audit-patient-views.sql", "original_file_path": "models\\reports\\sql\\standard\\audit-patient-views.sql", "unique_id": "model.tamanu_source_dbt.audit-patient-views", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "audit-patient-views"], "alias": "audit-patient-views", "checksum": {"name": "sha256", "checksum": "dcb58c88b22fa205696f45b2ae749a3a790b4d39786607fd0bdaf88b7d15fad0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.2605321, "relation_name": "\"app\".\"reporting\".\"audit-patient-views\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n date_part('year', age(current_date, date_of_birth))::integer as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n viewed_by_user as \"{{ translate_label('logAccessBy') }}\",\r\n user_email as \"{{ translate_label('userEmail') }}\",\r\n user_role as \"{{ translate_label('userRole') }}\",\r\n viewed_at_facility as \"{{ translate_label('logAccessAtFacility') }}\",\r\n to_char(date_time_viewed, '{{ var(\"datetime_without_seconds_format\") }}') as \"{{ translate_label('logAccessDatetime') }}\"\r\nfrom {{ ref('ds__patients_access_logs') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else date_time_viewed >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else date_time_viewed <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('patientId') }} is null then true\r\n else patient_id = {{ parameter('patientId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('userId') }} is null then true\r\n else viewed_by_user_id = {{ parameter('userId') }}\r\n end\r\norder by date_time_viewed", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients_access_logs", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients_access_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\audit-patient-views.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(current_date, date_of_birth))::integer as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n viewed_by_user as \"Viewed by user\",\n user_email as \"User email\",\n user_role as \"User role\",\n viewed_at_facility as \"Viewed at facility\",\n to_char(date_time_viewed, 'YYYY-MM-DD HH24:MI') as \"Date and time viewed\"\nfrom \"app\".\"reporting\".\"ds__patients_access_logs\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else date_time_viewed >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else date_time_viewed <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else patient_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else viewed_by_user_id = nullif('', '')::text\n end\norder by date_time_viewed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.deceased-patients-line-list": {"database": "app", "schema": "reporting", "name": "deceased-patients-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\deceased-patients-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\deceased-patients-line-list.sql", "unique_id": "model.tamanu_source_dbt.deceased-patients-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "deceased-patients-line-list"], "alias": "deceased-patients-line-list", "checksum": {"name": "sha256", "checksum": "7acd05e86a130edc38303134452430a7f5e47ba856d4cc964fd49bb846c8879b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.277709, "relation_name": "\"app\".\"reporting\".\"deceased-patients-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n place_of_death as \"{{ translate_label('deathPlaceOfDeath') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(date_of_death, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfDeath') }}\",\r\n attending_clinician as \"{{ translate_label('deathAttendingClinician') }}\",\r\n primary_cause_condition as \"{{ translate_label('deathPrimaryCause') }}\",\r\n time_between_onset_and_death as \"{{ translate_label('deathTimeBetweenOnsetAndDeath') }}\",\r\n antecedent_cause_1 as \"{{ translate_label('deathAntecedentCause1') }}\",\r\n antecedent_cause_2 as \"{{ translate_label('deathAntecedentCause2') }}\",\r\n other_condition_1 as \"{{ translate_label('deathOtherCondition1') }}\",\r\n other_condition_2 as \"{{ translate_label('deathOtherCondition2') }}\",\r\n other_condition_3 as \"{{ translate_label('deathOtherCondition3') }}\",\r\n other_condition_4 as \"{{ translate_label('deathOtherCondition4') }}\",\r\n had_recent_surgery as \"{{ translate_label('deathHadRecentSurgery') }}\",\r\n to_char(last_surgery_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('deathLastSurgeryDate') }}\",\r\n reason_for_surgery as \"{{ translate_label('deathReasonForSurgery') }}\",\r\n manner_of_death as \"{{ translate_label('deathMannerOfDeath') }}\",\r\n to_char(external_cause_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('deathExternalCauseDate') }}\",\r\n external_cause_location as \"{{ translate_label('deathExternalCauseLocation') }}\",\r\n was_pregnant as \"{{ translate_label('deathWasPregnant') }}\",\r\n pregnancy_contributed as \"{{ translate_label('deathPregnancyContributed') }}\",\r\n was_fetal_or_infant as \"{{ translate_label('deathWasFetalOrInfant') }}\",\r\n was_stillborn as \"{{ translate_label('deathWasStillborn') }}\",\r\n birth_weight as \"{{ translate_label('birthWeight') }}\",\r\n completed_weeks_of_pregnancy as \"{{ translate_label('deathCompletedWeeksOfPregnancy') }}\",\r\n age_of_mother as \"{{ translate_label('deathAgeOfMother') }}\",\r\n condition_in_mother_affecting_fetus_or_newborn as \"{{ translate_label('deathConditionInMother') }}\",\r\n death_within_day_of_birth as \"{{ translate_label('deathWithinDayOfBirth') }}\",\r\n hours_survived_since_birth as \"{{ translate_label('deathHoursSurvivedSinceBirth') }}\"\r\nfrom {{ ref('ds__deaths') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null\r\n then true\r\n else date_of_death >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null\r\n then true\r\n else date_of_death <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case\r\n when {{ parameter('causeOfDeath') }} is null\r\n then true\r\n else primary_cause_condition_id = {{ parameter('causeOfDeath') }}\r\n end\r\n and case\r\n when {{ parameter('mannerOfDeath') }} is null\r\n then true\r\n else manner_of_death = {{ parameter('mannerOfDeath') }}\r\n end\r\n and case\r\n when {{ parameter('facilityId') }} is null\r\n then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and case\r\n when {{ parameter('antecedentCause') }} is null\r\n then true\r\n else antecedent_cause_1_id = {{ parameter('antecedentCause') }}\r\n or antecedent_cause_2_id = {{ parameter('antecedentCause') }}\r\n end\r\n and case\r\n when {{ parameter('otherContributingCondition') }} is null\r\n then true\r\n else other_condition_1_id = {{ parameter('otherContributingCondition') }}\r\n or other_condition_2_id = {{ parameter('otherContributingCondition') }}\r\n or other_condition_3_id = {{ parameter('otherContributingCondition') }}\r\n or other_condition_4_id = {{ parameter('otherContributingCondition') }}\r\n end\r\norder by date_of_death", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__deaths", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__deaths"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\deceased-patients-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n nationality as \"Nationality\",\n place_of_death as \"Place of death\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(date_of_death, 'YYYY-MM-DD') as \"Date of death\",\n attending_clinician as \"Attending clinician\",\n primary_cause_condition as \"Primary cause of death\",\n time_between_onset_and_death as \"Time between onset and death\",\n antecedent_cause_1 as \"Antecedent cause 1\",\n antecedent_cause_2 as \"Antecedent cause 2\",\n other_condition_1 as \"Other condition 1\",\n other_condition_2 as \"Other condition 2\",\n other_condition_3 as \"Other condition 3\",\n other_condition_4 as \"Other condition 4\",\n had_recent_surgery as \"Had recent surgery\",\n to_char(last_surgery_date, 'YYYY-MM-DD') as \"Last surgery date\",\n reason_for_surgery as \"Reason for surgery\",\n manner_of_death as \"Manner of death\",\n to_char(external_cause_date, 'YYYY-MM-DD') as \"External cause date\",\n external_cause_location as \"External cause location\",\n was_pregnant as \"Was pregnant\",\n pregnancy_contributed as \"Pregnancy contributed\",\n was_fetal_or_infant as \"Was fetal or infant\",\n was_stillborn as \"Was stillborn\",\n birth_weight as \"Birth weight (kg)\",\n completed_weeks_of_pregnancy as \"Completed weeks of pregnancy\",\n age_of_mother as \"Age of mother\",\n condition_in_mother_affecting_fetus_or_newborn as \"Condition in mother affecting fetus or newborn\",\n death_within_day_of_birth as \"Death within day of birth\",\n hours_survived_since_birth as \"Hours survived since birth\"\nfrom \"app\".\"reporting\".\"ds__deaths\"\nwhere case\n when nullif('2024-01-01', '')::date is null\n then true\n else date_of_death >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null\n then true\n else date_of_death <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null\n then true\n else primary_cause_condition_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null\n then true\n else manner_of_death = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null\n then true\n else facility_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null\n then true\n else antecedent_cause_1_id = nullif('', '')::text\n or antecedent_cause_2_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null\n then true\n else other_condition_1_id = nullif('', '')::text\n or other_condition_2_id = nullif('', '')::text\n or other_condition_3_id = nullif('', '')::text\n or other_condition_4_id = nullif('', '')::text\n end\norder by date_of_death", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter-diets-line-list": {"database": "app", "schema": "reporting", "name": "encounter-diets-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\encounter-diets-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\encounter-diets-line-list.sql", "unique_id": "model.tamanu_source_dbt.encounter-diets-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "encounter-diets-line-list"], "alias": "encounter-diets-line-list", "checksum": {"name": "sha256", "checksum": "d68e6db140e33c17bc47a4ef83c9326563ca922303f33d79129829f5e3e732ad"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.2891862, "relation_name": "\"app\".\"reporting\".\"encounter-diets-line-list\"", "raw_code": "select\r\n to_char(ed.start_datetime, '{{ var(\"date_format\") }}') as \"{{ translate_label('encounterStartDate') }}\",\r\n to_char(ed.start_datetime, '{{ var(\"time_format\") }}') as \"{{ translate_label('encounterStartTime') }}\",\r\n ed.display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n ed.patient_name as \"{{ translate_label('patientName') }}\",\r\n ed.age as \"{{ translate_label('patientAge') }}\",\r\n concat_ws(', ', ed.location_group, ed.location) as \"{{ translate_label('location') }}\",\r\n ed.diets as \"{{ translate_label('encounterDiet') }}\",\r\n ed.allergies as \"{{ translate_label('patientAllergies') }}\"\r\nfrom {{ ref('ds__encounter_diets') }} ed\r\nwhere\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else ed.location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else ed.start_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else ed.start_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by ed.location_group, ed.location, ed.patient_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__encounter_diets", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\encounter-diets-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(ed.start_datetime, 'YYYY-MM-DD') as \"Encounter start date\",\n to_char(ed.start_datetime, 'HH24:MI') as \"Encounter start time\",\n ed.display_id as \"Patient ID\",\n ed.patient_name as \"Patient name\",\n ed.age as \"Age\",\n concat_ws(', ', ed.location_group, ed.location) as \"Location\",\n ed.diets as \"Diet\",\n ed.allergies as \"Allergies\"\nfrom \"app\".\"reporting\".\"ds__encounter_diets\" ed\nwhere\n case\n when nullif('', '')::text is null then true\n else ed.location_group_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else ed.start_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else ed.start_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by ed.location_group, ed.location, ed.patient_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter-summary-by-end-date": {"database": "app", "schema": "reporting", "name": "encounter-summary-by-end-date", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\encounter-summary-by-end-date.sql", "original_file_path": "models\\reports\\sql\\standard\\encounter-summary-by-end-date.sql", "unique_id": "model.tamanu_source_dbt.encounter-summary-by-end-date", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "encounter-summary-by-end-date"], "alias": "encounter-summary-by-end-date", "checksum": {"name": "sha256", "checksum": "62df3860c57f0af9a6fcfe94516e4d11f7b6e2667ab79855d286761a5a99e8b7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.295199, "relation_name": "\"app\".\"reporting\".\"encounter-summary-by-end-date\"", "raw_code": "{{ encounter_summary_report('end_datetime', is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "procedures", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "invoices", "package": null, "version": null}, {"name": "invoice_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_summary_report"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\encounter-summary-by-end-date.sql", "compiled": true, "compiled_code": "\n\nwith encounters_in_scope as (\n select\n e.id as encounter_id,\n e.start_datetime,\n e.end_datetime,\n e.patient_id,\n e.location_id,\n e.department_id,\n e.clinician_id,\n e.patient_billing_type_id,\n e.reason_for_encounter,\n f.id as facility_id,\n f.name as facility\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\n where\n e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n \n and e.end_datetime is not null\n \n and case\n when nullif('2024-01-01', '')::date is null then true\n else e.end_datetime >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null then true\n else e.end_datetime <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null then true\n else f.id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.patient_billing_type_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.clinician_id = nullif('', '')::text\n end\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.updated_by_id,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n clinician.display_name as clinician_name,\n actor.display_name as updated_by_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n row_number() over (\n partition by eh.encounter_id, eh.change_type\n order by eh.datetime\n ) as change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from \"app\".\"reporting\".\"encounter_history\" eh\n join encounters_in_scope eis\n on eis.encounter_id = eh.encounter_id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = eh.clinician_id\n join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\nencounter_changes as (\n select\n encounter_id,\n \n -- Location changes: tracks all location changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\n\n -- Location group changes: tracks location group changes (only when group actually changes)\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\n\n -- Department changes: tracks all department changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\n\n -- Encounter type changes: tracks encounter type progression (emergency types)\n string_agg(\n case\n when encounter_type = 'triage' then 'Triage'\n when encounter_type = 'observation' then 'Active ED care'\n when encounter_type = 'emergency' then 'Emergency short stay'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\n\n -- Encounter type changes: tracks encounter type progression (inpatient types)\n string_agg(\n case\n when encounter_type = 'admission' then 'Hospital admission'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\n\n -- Encounter type changes: tracks encounter type progression (outpatient types)\n string_agg(\n case\n when encounter_type = 'clinic' then 'Clinic'\n when encounter_type = 'imaging' then 'Imaging'\n when encounter_type = 'surveyResponse' then 'Survey response'\n when encounter_type = 'vaccination' then 'Vaccination'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\n\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\n from encounter_history_consolidated\n group by encounter_id\n),\n\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n concat(\n 'Name: ', d.name,\n ', Code: ', d.code,\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\n ', Certainty: ', ed.certainty\n ),\n E'\\n'\n order by ed.is_primary desc, ed.datetime asc\n ) as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join encounters_in_scope eis\n on eis.encounter_id = ed.encounter_id\n join \"app\".\"reporting\".\"reference_data\" d\n on d.id = ed.diagnosis_id\n group by ed.encounter_id\n),\n\nencounter_prescriptions as (\n select\n ep.encounter_id,\n string_agg(\n concat(\n 'Name: ', m.name,\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\n ', Discontinuing reason: ', p.discontinuing_reason\n ),\n '' || E'\\n' || ''\n order by p.datetime\n ) as medications\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join encounters_in_scope eis\n on eis.encounter_id = ep.encounter_id\n join \"app\".\"reporting\".\"prescriptions\" p\n on p.id = ep.prescription_id\n join \"app\".\"reporting\".\"reference_data\" m\n on m.id = p.medication_id\n group by ep.encounter_id\n),\n\nencounter_vaccinations as (\n select\n av.encounter_id,\n string_agg(\n concat(\n v.name,\n ', Label: ', sv.label,\n ', Schedule: ', sv.dose_label\n ),\n E'\\n'\n order by av.datetime\n ) as vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" av\n join encounters_in_scope eis\n on eis.encounter_id = av.encounter_id\n join \"app\".\"reporting\".\"vaccine_schedules\" sv\n on sv.id = av.scheduled_vaccine_id\n join \"app\".\"reporting\".\"reference_data\" v\n on v.id = sv.vaccine_id\n group by av.encounter_id\n),\n\nencounter_procedures as (\n select\n p.encounter_id,\n string_agg(\n concat(\n 'Name: ', proc.name,\n ', Date: ', to_char(p.date, 'YYYY-MM-DD'),\n ', Location: ', loc.name,\n ', Notes: ', p.note,\n ', Completed notes: ', p.completed_note\n ),\n E'\\n'\n order by p.date\n ) as procedures\n from \"app\".\"reporting\".\"procedures\" p\n join encounters_in_scope eis\n on eis.encounter_id = p.encounter_id\n left join \"app\".\"reporting\".\"reference_data\" proc\n on proc.id = p.procedure_type_id\n left join \"app\".\"reporting\".\"locations\" loc\n on loc.id = p.location_id\n group by p.encounter_id\n),\n\nencounter_lab_requests as (\n select\n lr.encounter_id,\n string_agg(\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\n order by lr.collected_datetime\n ) as lab_requests\n from \"app\".\"reporting\".\"lab_requests\" lr\n join encounters_in_scope eis\n on eis.encounter_id = lr.encounter_id\n left join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\n left join \"app\".\"reporting\".\"lab_test_panels\" ltp\n on ltp.id = ltpr.lab_test_panel_id\n left join \"app\".\"reporting\".\"lab_tests\" lt\n on lt.lab_request_id = lr.id\n and lr.lab_test_panel_request_id isnull\n left join \"app\".\"reporting\".\"lab_test_types\" ltt\n on ltt.id = lt.lab_test_type_id\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\n group by lr.encounter_id\n),\n\nnotes_raw as (\n select\n n.id,\n n.datetime,\n n.content,\n n.note_type_id,\n n.note_type,\n n.record_type,\n n.record_id,\n n.updated_note_id,\n n.visibility_status\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"imaging_requests\" ir\n on n.record_type = 'ImagingRequest'\n and ir.id = n.record_id\n join encounters_in_scope eis\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\n where n.record_type in ('Encounter', 'ImagingRequest')\n),\n\nencounter_notes_deduped as (\n select\n id,\n datetime,\n content,\n note_type,\n record_id,\n visibility_status,\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\n from notes_raw\n where\n record_type = 'Encounter'\n and note_type_id != 'notetype-system'\n),\n\nimaging_request_areas as (\n select\n ir.encounter_id,\n ira.imaging_request_id,\n case\n when ir.imaging_type = 'xRay' then 'X-Ray'\n when ir.imaging_type = 'ctScan' then 'CT Scan'\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\n when ir.imaging_type = 'mri' then 'MRI'\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\n when ir.imaging_type = 'mammogram' then 'Mammogram'\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\n when ir.imaging_type = 'angiogram' then 'Angiogram'\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\n when ir.imaging_type = 'stressTest' then 'Stress Test'\n else ir.imaging_type\n end as imaging_type,\n coalesce(\n string_agg(\n area.name, ', '\n order by area.name\n ),\n string_agg(case\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\n end, ', '\n order by n.datetime)\n ) as areas_to_be_imaged,\n string_agg(case\n when n.note_type_id = 'notetype-other' then n.content\n end, ','\n order by n.datetime) as notes\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join encounters_in_scope eis\n on eis.encounter_id = ir.encounter_id\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira\n on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" area\n on area.id = ira.area_id\n left join notes_raw n\n on n.record_id = ir.id\n and n.record_type = 'ImagingRequest'\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\n),\n\nencounter_imaging_requests as (\n select\n encounter_id,\n string_agg(\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\n ) as imaging_requests\n from imaging_request_areas\n group by encounter_id\n),\n\nencounter_notes as (\n select\n n.record_id as encounter_id,\n string_agg(concat(\n 'Note type: ',\n n.note_type,\n ', Content: ', n.content,\n ', Note date: ', to_char(n.datetime, 'YYYY-MM-DD HH24:MI:SS')\n ),\n E'\\n'\n order by n.datetime) as notes\n from encounter_notes_deduped n\n where n.row_number = 1\n group by n.record_id\n),\n\ninvoice_data as (\n select\n i.encounter_id,\n max(\n case\n when i.status = 'finalised'\n then to_char(i.datetime, 'YYYY-MM-DD HH24:MI:SS')\n end\n ) as invoice_finalised_datetime,\n string_agg(distinct ip.category, ', ') as invoice_product_categories\n from \"app\".\"reporting\".\"invoices\" i\n join encounters_in_scope eis\n on eis.encounter_id = i.encounter_id\n left join \"app\".\"reporting\".\"invoice_items\" ii\n on ii.invoice_id = i.id\n left join \"app\".\"reporting\".\"invoice_products\" ip\n on ip.id = ii.product_id\n group by i.encounter_id\n)\n\nselect\n p.display_id as \"Patient ID\",\n p.first_name as \"First name\",\n p.last_name as \"Last name\",\n to_char(p.date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"Age\",\n p.sex as \"Sex\",\n eth.name as \"Ethnicity\",\n bt.name as \"Billing type\",\n to_char(eis.start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(eis.end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n case\n when eis.end_datetime is not null then\n case\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\n else eis.end_datetime::date - eis.start_datetime::date\n end\n end as \"Length of stay (days)\",\n eis.facility as \"Facility\",\n ec.encounter_type_emergency as \"Emergency encounter type\",\n ec.encounter_type_inpatient as \"Inpatient encounter type\",\n ec.encounter_type_outpatient as \"Outpatient encounter type\",\n dd.name as \"Discharge disposition\",\n t.score as \"Triage category\",\n am.name as \"Arrival mode\",\n case\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\n then concat(\n lpad((\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\n + extract(hour from (t.closed_datetime - t.triage_datetime))\n )::text, 2, '0'), ':',\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\n lpad(\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\n )\n )\n end as \"Time seen following triage/Waiting time (hh:mm:ss)\",\n ec.encountering_clinician as \"Clinician\",\n c.display_name as \"Supervising clinician\",\n dp.name as \"Discharging department\",\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"Discharge date and time of Discharging department\",\n lg.name as \"Discharging area\",\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"Discharge date and time of Discharging area\",\n l.name as \"Discharging location\",\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"Discharge date and time of Discharging location\",\n ec.departments as \"Department history\",\n array_to_string(ec.department_datetimes, ', ') as \"Department history date and times\",\n ec.location_groups as \"Area history\",\n array_to_string(ec.location_group_datetimes, ', ') as \"Area history date and times\",\n ec.locations as \"Location history\",\n array_to_string(ec.location_datetimes, ', ') as \"Location history date and times\",\n eis.reason_for_encounter as \"Reason for encounter\",\n ed.diagnoses as \"Diagnoses\",\n ep.medications as \"Medications\",\n ev.vaccinations as \"Vaccinations\",\n epr.procedures as \"Procedures\",\n elr.lab_requests as \"Lab requests\",\n eir.imaging_requests as \"Imaging requests\",\n case\n when length(en.notes) > 32000\n then concat(\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\n )\n else en.notes\n end as \"Notes\",\n invd.invoice_finalised_datetime as \"invoiceFinalisedDateTime\",\n invd.invoice_product_categories as \"invoiceProductCategories\"\nfrom encounters_in_scope eis\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = eis.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = eis.location_id\njoin \"app\".\"reporting\".\"departments\" dp\n on dp.id = eis.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"users\" c\n on c.id = eis.clinician_id\njoin encounter_changes ec\n on ec.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"triages\" t\n on t.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"discharges\" d\n on d.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = eis.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" eth\n on eth.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = eis.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" am\n on am.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" dd\n on dd.id = d.disposition_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = eis.encounter_id\nleft join encounter_prescriptions ep\n on ep.encounter_id = eis.encounter_id\nleft join encounter_vaccinations ev\n on ev.encounter_id = eis.encounter_id\nleft join encounter_procedures epr\n on epr.encounter_id = eis.encounter_id\nleft join encounter_lab_requests elr\n on elr.encounter_id = eis.encounter_id\nleft join encounter_imaging_requests eir\n on eir.encounter_id = eis.encounter_id\nleft join encounter_notes en\n on en.encounter_id = eis.encounter_id\nleft join invoice_data invd\n on invd.encounter_id = eis.encounter_id\nwhere\n case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.department_ids::text [])\n end\n and case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.location_group_ids::text [])\n end\norder by eis.end_datetime desc\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.encounter-summary-by-start-date": {"database": "app", "schema": "reporting", "name": "encounter-summary-by-start-date", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\encounter-summary-by-start-date.sql", "original_file_path": "models\\reports\\sql\\standard\\encounter-summary-by-start-date.sql", "unique_id": "model.tamanu_source_dbt.encounter-summary-by-start-date", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "encounter-summary-by-start-date"], "alias": "encounter-summary-by-start-date", "checksum": {"name": "sha256", "checksum": "8f429a30934541abdecb33b990326850c2b773b877d4d92d7f423d6c2464644d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3031888, "relation_name": "\"app\".\"reporting\".\"encounter-summary-by-start-date\"", "raw_code": "{{ encounter_summary_report('start_datetime', is_sensitive=false) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "prescriptions", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "vaccine_administrations", "package": null, "version": null}, {"name": "vaccine_schedules", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "procedures", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "lab_requests", "package": null, "version": null}, {"name": "lab_test_panel_requests", "package": null, "version": null}, {"name": "lab_test_panels", "package": null, "version": null}, {"name": "lab_tests", "package": null, "version": null}, {"name": "lab_test_types", "package": null, "version": null}, {"name": "notes", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_requests", "package": null, "version": null}, {"name": "imaging_request_areas", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "invoices", "package": null, "version": null}, {"name": "invoice_items", "package": null, "version": null}, {"name": "invoice_products", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "triages", "package": null, "version": null}, {"name": "discharges", "package": null, "version": null}, {"name": "patient_additional_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}, {"name": "reference_data", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.encounter_summary_report"], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\encounter-summary-by-start-date.sql", "compiled": true, "compiled_code": "\n\nwith encounters_in_scope as (\n select\n e.id as encounter_id,\n e.start_datetime,\n e.end_datetime,\n e.patient_id,\n e.location_id,\n e.department_id,\n e.clinician_id,\n e.patient_billing_type_id,\n e.reason_for_encounter,\n f.id as facility_id,\n f.name as facility\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and f.is_sensitive = False\n where\n e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n \n and case\n when nullif('2024-01-01', '')::date is null then true\n else e.start_datetime >= nullif('2024-01-01', '')::date\n end\n and case\n when nullif('2024-01-31', '')::date is null then true\n else e.start_datetime <= nullif('2024-01-31', '')::date\n end\n and case\n when nullif('', '')::text is null then true\n else f.id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.patient_billing_type_id = nullif('', '')::text\n end\n and case\n when nullif('', '')::text is null then true\n else e.clinician_id = nullif('', '')::text\n end\n),\n\nencounter_history_consolidated as (\n select\n eh.encounter_id,\n eh.datetime,\n eh.change_type,\n eh.updated_by_id,\n eh.clinician_id,\n eh.department_id,\n eh.location_id,\n eh.encounter_type,\n clinician.display_name as clinician_name,\n actor.display_name as updated_by_name,\n d.name as department_name,\n l.name as location_name,\n lg.id as location_group_id,\n lg.name as location_group_name,\n row_number() over (\n partition by eh.encounter_id, eh.change_type\n order by eh.datetime\n ) as change_sequence,\n lag(lg.id) over (\n partition by eh.encounter_id\n order by eh.datetime\n ) as prev_location_group_id\n from \"app\".\"reporting\".\"encounter_history\" eh\n join encounters_in_scope eis\n on eis.encounter_id = eh.encounter_id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"users\" clinician\n on clinician.id = eh.clinician_id\n join \"app\".\"reporting\".\"departments\" d\n on d.id = eh.department_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = eh.location_id\n left join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\n),\n\nencounter_changes as (\n select\n encounter_id,\n \n -- Location changes: tracks all location changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\n array_agg(\n location_id\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\n string_agg(\n location_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\n\n -- Location group changes: tracks location group changes (only when group actually changes)\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\n array_agg(\n location_group_id\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\n string_agg(\n location_group_name, ', '\n order by datetime\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\n\n -- Department changes: tracks all department changes throughout the encounter\n array_agg(\n to_char(datetime, 'YYYY-MM-DD HH24:MI:SS')\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\n array_agg(\n department_id\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\n string_agg(\n department_name, ', '\n order by datetime\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\n\n -- Encounter type changes: tracks encounter type progression (emergency types)\n string_agg(\n case\n when encounter_type = 'triage' then 'Triage'\n when encounter_type = 'observation' then 'Active ED care'\n when encounter_type = 'emergency' then 'Emergency short stay'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\n\n -- Encounter type changes: tracks encounter type progression (inpatient types)\n string_agg(\n case\n when encounter_type = 'admission' then 'Hospital admission'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\n\n -- Encounter type changes: tracks encounter type progression (outpatient types)\n string_agg(\n case\n when encounter_type = 'clinic' then 'Clinic'\n when encounter_type = 'imaging' then 'Imaging'\n when encounter_type = 'surveyResponse' then 'Survey response'\n when encounter_type = 'vaccination' then 'Vaccination'\n end, ', '\n order by datetime\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\n\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\n from encounter_history_consolidated\n group by encounter_id\n),\n\nencounter_diagnoses as (\n select\n ed.encounter_id,\n string_agg(\n concat(\n 'Name: ', d.name,\n ', Code: ', d.code,\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\n ', Certainty: ', ed.certainty\n ),\n E'\\n'\n order by ed.is_primary desc, ed.datetime asc\n ) as diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join encounters_in_scope eis\n on eis.encounter_id = ed.encounter_id\n join \"app\".\"reporting\".\"reference_data\" d\n on d.id = ed.diagnosis_id\n group by ed.encounter_id\n),\n\nencounter_prescriptions as (\n select\n ep.encounter_id,\n string_agg(\n concat(\n 'Name: ', m.name,\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\n ', Discontinuing reason: ', p.discontinuing_reason\n ),\n '' || E'\\n' || ''\n order by p.datetime\n ) as medications\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join encounters_in_scope eis\n on eis.encounter_id = ep.encounter_id\n join \"app\".\"reporting\".\"prescriptions\" p\n on p.id = ep.prescription_id\n join \"app\".\"reporting\".\"reference_data\" m\n on m.id = p.medication_id\n group by ep.encounter_id\n),\n\nencounter_vaccinations as (\n select\n av.encounter_id,\n string_agg(\n concat(\n v.name,\n ', Label: ', sv.label,\n ', Schedule: ', sv.dose_label\n ),\n E'\\n'\n order by av.datetime\n ) as vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" av\n join encounters_in_scope eis\n on eis.encounter_id = av.encounter_id\n join \"app\".\"reporting\".\"vaccine_schedules\" sv\n on sv.id = av.scheduled_vaccine_id\n join \"app\".\"reporting\".\"reference_data\" v\n on v.id = sv.vaccine_id\n group by av.encounter_id\n),\n\nencounter_procedures as (\n select\n p.encounter_id,\n string_agg(\n concat(\n 'Name: ', proc.name,\n ', Date: ', to_char(p.date, 'YYYY-MM-DD'),\n ', Location: ', loc.name,\n ', Notes: ', p.note,\n ', Completed notes: ', p.completed_note\n ),\n E'\\n'\n order by p.date\n ) as procedures\n from \"app\".\"reporting\".\"procedures\" p\n join encounters_in_scope eis\n on eis.encounter_id = p.encounter_id\n left join \"app\".\"reporting\".\"reference_data\" proc\n on proc.id = p.procedure_type_id\n left join \"app\".\"reporting\".\"locations\" loc\n on loc.id = p.location_id\n group by p.encounter_id\n),\n\nencounter_lab_requests as (\n select\n lr.encounter_id,\n string_agg(\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\n order by lr.collected_datetime\n ) as lab_requests\n from \"app\".\"reporting\".\"lab_requests\" lr\n join encounters_in_scope eis\n on eis.encounter_id = lr.encounter_id\n left join \"app\".\"reporting\".\"lab_test_panel_requests\" ltpr\n on ltpr.id = lr.lab_test_panel_request_id\n left join \"app\".\"reporting\".\"lab_test_panels\" ltp\n on ltp.id = ltpr.lab_test_panel_id\n left join \"app\".\"reporting\".\"lab_tests\" lt\n on lt.lab_request_id = lr.id\n and lr.lab_test_panel_request_id isnull\n left join \"app\".\"reporting\".\"lab_test_types\" ltt\n on ltt.id = lt.lab_test_type_id\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\n group by lr.encounter_id\n),\n\nnotes_raw as (\n select\n n.id,\n n.datetime,\n n.content,\n n.note_type_id,\n n.note_type,\n n.record_type,\n n.record_id,\n n.updated_note_id,\n n.visibility_status\n from \"app\".\"reporting\".\"notes\" n\n left join \"app\".\"reporting\".\"imaging_requests\" ir\n on n.record_type = 'ImagingRequest'\n and ir.id = n.record_id\n join encounters_in_scope eis\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\n where n.record_type in ('Encounter', 'ImagingRequest')\n),\n\nencounter_notes_deduped as (\n select\n id,\n datetime,\n content,\n note_type,\n record_id,\n visibility_status,\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\n from notes_raw\n where\n record_type = 'Encounter'\n and note_type_id != 'notetype-system'\n),\n\nimaging_request_areas as (\n select\n ir.encounter_id,\n ira.imaging_request_id,\n case\n when ir.imaging_type = 'xRay' then 'X-Ray'\n when ir.imaging_type = 'ctScan' then 'CT Scan'\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\n when ir.imaging_type = 'mri' then 'MRI'\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\n when ir.imaging_type = 'mammogram' then 'Mammogram'\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\n when ir.imaging_type = 'angiogram' then 'Angiogram'\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\n when ir.imaging_type = 'stressTest' then 'Stress Test'\n else ir.imaging_type\n end as imaging_type,\n coalesce(\n string_agg(\n area.name, ', '\n order by area.name\n ),\n string_agg(case\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\n end, ', '\n order by n.datetime)\n ) as areas_to_be_imaged,\n string_agg(case\n when n.note_type_id = 'notetype-other' then n.content\n end, ','\n order by n.datetime) as notes\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join encounters_in_scope eis\n on eis.encounter_id = ir.encounter_id\n left join \"app\".\"reporting\".\"imaging_request_areas\" ira\n on ira.imaging_request_id = ir.id\n left join \"app\".\"reporting\".\"reference_data\" area\n on area.id = ira.area_id\n left join notes_raw n\n on n.record_id = ir.id\n and n.record_type = 'ImagingRequest'\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\n),\n\nencounter_imaging_requests as (\n select\n encounter_id,\n string_agg(\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\n ) as imaging_requests\n from imaging_request_areas\n group by encounter_id\n),\n\nencounter_notes as (\n select\n n.record_id as encounter_id,\n string_agg(concat(\n 'Note type: ',\n n.note_type,\n ', Content: ', n.content,\n ', Note date: ', to_char(n.datetime, 'YYYY-MM-DD HH24:MI:SS')\n ),\n E'\\n'\n order by n.datetime) as notes\n from encounter_notes_deduped n\n where n.row_number = 1\n group by n.record_id\n),\n\ninvoice_data as (\n select\n i.encounter_id,\n max(\n case\n when i.status = 'finalised'\n then to_char(i.datetime, 'YYYY-MM-DD HH24:MI:SS')\n end\n ) as invoice_finalised_datetime,\n string_agg(distinct ip.category, ', ') as invoice_product_categories\n from \"app\".\"reporting\".\"invoices\" i\n join encounters_in_scope eis\n on eis.encounter_id = i.encounter_id\n left join \"app\".\"reporting\".\"invoice_items\" ii\n on ii.invoice_id = i.id\n left join \"app\".\"reporting\".\"invoice_products\" ip\n on ip.id = ii.product_id\n group by i.encounter_id\n)\n\nselect\n p.display_id as \"Patient ID\",\n p.first_name as \"First name\",\n p.last_name as \"Last name\",\n to_char(p.date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"Age\",\n p.sex as \"Sex\",\n eth.name as \"Ethnicity\",\n bt.name as \"Billing type\",\n to_char(eis.start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(eis.end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n case\n when eis.end_datetime is not null then\n case\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\n else eis.end_datetime::date - eis.start_datetime::date\n end\n end as \"Length of stay (days)\",\n eis.facility as \"Facility\",\n ec.encounter_type_emergency as \"Emergency encounter type\",\n ec.encounter_type_inpatient as \"Inpatient encounter type\",\n ec.encounter_type_outpatient as \"Outpatient encounter type\",\n dd.name as \"Discharge disposition\",\n t.score as \"Triage category\",\n am.name as \"Arrival mode\",\n case\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\n then concat(\n lpad((\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\n + extract(hour from (t.closed_datetime - t.triage_datetime))\n )::text, 2, '0'), ':',\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\n lpad(\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\n )\n )\n end as \"Time seen following triage/Waiting time (hh:mm:ss)\",\n ec.encountering_clinician as \"Clinician\",\n c.display_name as \"Supervising clinician\",\n dp.name as \"Discharging department\",\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"Discharge date and time of Discharging department\",\n lg.name as \"Discharging area\",\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"Discharge date and time of Discharging area\",\n l.name as \"Discharging location\",\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"Discharge date and time of Discharging location\",\n ec.departments as \"Department history\",\n array_to_string(ec.department_datetimes, ', ') as \"Department history date and times\",\n ec.location_groups as \"Area history\",\n array_to_string(ec.location_group_datetimes, ', ') as \"Area history date and times\",\n ec.locations as \"Location history\",\n array_to_string(ec.location_datetimes, ', ') as \"Location history date and times\",\n eis.reason_for_encounter as \"Reason for encounter\",\n ed.diagnoses as \"Diagnoses\",\n ep.medications as \"Medications\",\n ev.vaccinations as \"Vaccinations\",\n epr.procedures as \"Procedures\",\n elr.lab_requests as \"Lab requests\",\n eir.imaging_requests as \"Imaging requests\",\n case\n when length(en.notes) > 32000\n then concat(\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\n )\n else en.notes\n end as \"Notes\",\n invd.invoice_finalised_datetime as \"invoiceFinalisedDateTime\",\n invd.invoice_product_categories as \"invoiceProductCategories\"\nfrom encounters_in_scope eis\njoin \"app\".\"reporting\".\"patients\" p\n on p.id = eis.patient_id\njoin \"app\".\"reporting\".\"locations\" l\n on l.id = eis.location_id\njoin \"app\".\"reporting\".\"departments\" dp\n on dp.id = eis.department_id\nleft join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = l.location_group_id\nleft join \"app\".\"reporting\".\"users\" c\n on c.id = eis.clinician_id\njoin encounter_changes ec\n on ec.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"triages\" t\n on t.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"discharges\" d\n on d.encounter_id = eis.encounter_id\nleft join \"app\".\"reporting\".\"patient_additional_data\" pad\n on pad.patient_id = eis.patient_id\nleft join \"app\".\"reporting\".\"reference_data\" eth\n on eth.id = pad.ethnicity_id\nleft join \"app\".\"reporting\".\"reference_data\" bt\n on bt.id = eis.patient_billing_type_id\nleft join \"app\".\"reporting\".\"reference_data\" am\n on am.id = t.arrival_mode_id\nleft join \"app\".\"reporting\".\"reference_data\" dd\n on dd.id = d.disposition_id\nleft join encounter_diagnoses ed\n on ed.encounter_id = eis.encounter_id\nleft join encounter_prescriptions ep\n on ep.encounter_id = eis.encounter_id\nleft join encounter_vaccinations ev\n on ev.encounter_id = eis.encounter_id\nleft join encounter_procedures epr\n on epr.encounter_id = eis.encounter_id\nleft join encounter_lab_requests elr\n on elr.encounter_id = eis.encounter_id\nleft join encounter_imaging_requests eir\n on eir.encounter_id = eis.encounter_id\nleft join encounter_notes en\n on en.encounter_id = eis.encounter_id\nleft join invoice_data invd\n on invd.encounter_id = eis.encounter_id\nwhere\n case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.department_ids::text [])\n end\n and case\n when nullif('', '')::text is null then true\n else nullif('', '')::text = any(ec.location_group_ids::text [])\n end\norder by eis.start_datetime desc\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.hospital-admissions-by-area-summary": {"database": "app", "schema": "reporting", "name": "hospital-admissions-by-area-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\hospital-admissions-by-area-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\hospital-admissions-by-area-summary.sql", "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-area-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "hospital-admissions-by-area-summary"], "alias": "hospital-admissions-by-area-summary", "checksum": {"name": "sha256", "checksum": "743a7e78daf2773b27026299101bbb5a750753d4901a09a0f5c7bc8a94e8358f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.31005, "relation_name": "\"app\".\"reporting\".\"hospital-admissions-by-area-summary\"", "raw_code": "with reporting_months as (\r\n select month::date\r\n from generate_series(\r\n concat(left( {{ parameter('fromDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n concat(left( {{ parameter('toDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n '1 month'::interval\r\n ) month\r\n),\r\n\r\narea_capacity as (\r\n select\r\n l.location_group_id,\r\n sum(l.max_occupancy::numeric) as capacity\r\n from {{ ref('locations') }} l\r\n group by l.location_group_id\r\n),\r\n\r\narea_summary as (\r\n select\r\n rm.month,\r\n alh.facility_id,\r\n alh.facility,\r\n alh.location_group_id,\r\n alh.location_group,\r\n lg.capacity,\r\n sum(\r\n case when alh.end_datetime::date = alh.start_datetime::date then 1 else\r\n (least(\r\n coalesce(alh.end_datetime, current_date)::date,\r\n (rm.month + '1 month'::interval)::date\r\n ) - greatest(alh.start_datetime::date, rm.month))\r\n end\r\n )::numeric as occupancy,\r\n count(*) filter (where alh.admission and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as admissions,\r\n count(*) filter (where alh.discharge and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as discharges,\r\n count(*) filter (where alh.death and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as deaths,\r\n count(*) filter (where alh.transfer_in and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_ins,\r\n count(*) filter (where alh.transfer_out and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_outs,\r\n round(avg(alh.length_of_stay) filter (where alh.end_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)), 1) as avg_length_of_stay\r\n from reporting_months rm\r\n join {{ ref('int__admission_history_location') }} alh\r\n on alh.start_datetime::date <= (rm.month + '1 month'::interval - '1 day'::interval)\r\n and (alh.end_datetime::date is null or alh.end_datetime::date >= rm.month)\r\n join area_capacity lg on lg.location_group_id = alh.location_group_id\r\n where rm.month <= current_date\r\n group by\r\n rm.month,\r\n alh.facility_id,\r\n alh.facility,\r\n alh.location_group_id,\r\n alh.location_group,\r\n lg.capacity\r\n)\r\n\r\nselect\r\n to_char(lg.month, '{{ var(\"yearmonth_format\") }}') as \"{{ translate_label('reportingMonth') }}\",\r\n lg.facility as \"{{ translate_label('facility') }}\",\r\n lg.location_group as \"{{ translate_label('locationGroup') }}\",\r\n coalesce(lg.admissions, 0) as \"{{ translate_label('hospitalAdmissionCount') }}\",\r\n coalesce(lg.discharges, 0) as \"{{ translate_label('hospitalDischargeCount') }}\",\r\n coalesce(lg.deaths, 0) as \"{{ translate_label('hospitalDeathCount') }}\",\r\n coalesce(lg.transfer_ins, 0) as \"{{ translate_label('hospitalTransfersIntoLocationCount') }}\",\r\n coalesce(lg.transfer_outs, 0) as \"{{ translate_label('hospitalTransfersOutOfLocationCount') }}\",\r\n coalesce(lg.avg_length_of_stay, 0) as \"{{ translate_label('hospitalAverageLengthOfStay') }}\",\r\n coalesce(lg.occupancy, 0) as \"{{ translate_label('hospitalPatientDayCount') }}\",\r\n case\r\n when lg.occupancy notnull and lg.capacity notnull\r\n then\r\n concat(\r\n round(\r\n lg.occupancy / (\r\n lg.capacity * case\r\n when lg.month > (current_date - '1 month'::interval)\r\n then (current_date - lg.month) + 1\r\n else (lg.month + '1 month'::interval)::date - lg.month\r\n end\r\n ) * 100, 1\r\n )::text, '%'\r\n )\r\n else 'N/A'\r\n end as \"{{ translate_label('hospitalBedOccupancyPercent') }}\"\r\nfrom area_summary lg\r\nwhere\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else lg.location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\norder by lg.month, lg.facility, lg.location_group", "doc_blocks": [], "language": "sql", "refs": [{"name": "locations", "package": null, "version": null}, {"name": "int__admission_history_location", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.int__admission_history_location"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\hospital-admissions-by-area-summary.sql", "compiled": true, "compiled_code": "with __dbt__cte__int__admission_history_location as (\nwith admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)\n), reporting_months as (\n select month::date\n from generate_series(\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n '1 month'::interval\n ) month\n),\n\narea_capacity as (\n select\n l.location_group_id,\n sum(l.max_occupancy::numeric) as capacity\n from \"app\".\"reporting\".\"locations\" l\n group by l.location_group_id\n),\n\narea_summary as (\n select\n rm.month,\n alh.facility_id,\n alh.facility,\n alh.location_group_id,\n alh.location_group,\n lg.capacity,\n sum(\n case when alh.end_datetime::date = alh.start_datetime::date then 1 else\n (least(\n coalesce(alh.end_datetime, current_date)::date,\n (rm.month + '1 month'::interval)::date\n ) - greatest(alh.start_datetime::date, rm.month))\n end\n )::numeric as occupancy,\n count(*) filter (where alh.admission and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as admissions,\n count(*) filter (where alh.discharge and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as discharges,\n count(*) filter (where alh.death and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as deaths,\n count(*) filter (where alh.transfer_in and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_ins,\n count(*) filter (where alh.transfer_out and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_outs,\n round(avg(alh.length_of_stay) filter (where alh.end_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)), 1) as avg_length_of_stay\n from reporting_months rm\n join __dbt__cte__int__admission_history_location alh\n on alh.start_datetime::date <= (rm.month + '1 month'::interval - '1 day'::interval)\n and (alh.end_datetime::date is null or alh.end_datetime::date >= rm.month)\n join area_capacity lg on lg.location_group_id = alh.location_group_id\n where rm.month <= current_date\n group by\n rm.month,\n alh.facility_id,\n alh.facility,\n alh.location_group_id,\n alh.location_group,\n lg.capacity\n)\n\nselect\n to_char(lg.month, 'YYYY-MM') as \"Month\",\n lg.facility as \"Facility\",\n lg.location_group as \"Area\",\n coalesce(lg.admissions, 0) as \"Number of admissions\",\n coalesce(lg.discharges, 0) as \"Number of discharges\",\n coalesce(lg.deaths, 0) as \"Number of deaths\",\n coalesce(lg.transfer_ins, 0) as \"Number of transfers into location\",\n coalesce(lg.transfer_outs, 0) as \"Number of transfers out of location\",\n coalesce(lg.avg_length_of_stay, 0) as \"Average length of stay\",\n coalesce(lg.occupancy, 0) as \"Number of patient days\",\n case\n when lg.occupancy notnull and lg.capacity notnull\n then\n concat(\n round(\n lg.occupancy / (\n lg.capacity * case\n when lg.month > (current_date - '1 month'::interval)\n then (current_date - lg.month) + 1\n else (lg.month + '1 month'::interval)::date - lg.month\n end\n ) * 100, 1\n )::text, '%'\n )\n else 'N/A'\n end as \"Bed occupancy (%)\"\nfrom area_summary lg\nwhere\n case\n when nullif('', '')::text is null then true\n else lg.location_group_id = nullif('', '')::text\n end\norder by lg.month, lg.facility, lg.location_group", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.tamanu_source_dbt.int__admission_history_location", "sql": " __dbt__cte__int__admission_history_location as (\nwith admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.hospital-admissions-by-department-summary": {"database": "app", "schema": "reporting", "name": "hospital-admissions-by-department-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\hospital-admissions-by-department-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\hospital-admissions-by-department-summary.sql", "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-department-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "hospital-admissions-by-department-summary"], "alias": "hospital-admissions-by-department-summary", "checksum": {"name": "sha256", "checksum": "feff1ba4b1606da0bdb6941b7cd83c56f3db431befbd002e002f772443eb3ae1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.31005, "relation_name": "\"app\".\"reporting\".\"hospital-admissions-by-department-summary\"", "raw_code": "with reporting_months as (\r\n select month::date\r\n from generate_series(\r\n concat(left( {{ parameter('fromDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n concat(left( {{ parameter('toDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n '1 month'::interval\r\n ) month\r\n)\r\n\r\nselect\r\n to_char(rm.month, '{{ var(\"yearmonth_format\") }}') as \"{{ translate_label('reportingMonth') }}\",\r\n adh.facility as \"{{ translate_label('facility') }}\",\r\n adh.department as \"{{ translate_label('department') }}\",\r\n count(*) filter (where adh.admission) as \"{{ translate_label('hospitalAdmissionCount') }}\",\r\n count(*) filter (where adh.discharge) as \"{{ translate_label('hospitalDischargeCount') }}\",\r\n count(*) filter (where adh.death) as \"{{ translate_label('hospitalDeathCount') }}\",\r\n count(*) filter (where adh.transfer_in) as \"{{ translate_label('hospitalTransfersIntoDepartmentCount') }}\",\r\n count(*) filter (where adh.transfer_out) as \"{{ translate_label('hospitalTransfersOutOfDepartmentCount') }}\",\r\n round(avg(adh.length_of_stay), 1) as \"{{ translate_label('hospitalAverageLengthOfStay') }}\"\r\nfrom reporting_months rm\r\nleft join {{ ref('int__admission_history_department') }} adh\r\n on adh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)\r\nwhere adh.facility_id notnull\r\n and case\r\n when {{ parameter('departmentId') }} is null then true\r\n else adh.department_id = {{ parameter('departmentId') }}\r\n end\r\ngroup by\r\n rm.month,\r\n adh.facility_id,\r\n adh.facility,\r\n adh.department_id,\r\n adh.department\r\norder by rm.month, adh.facility, adh.department", "doc_blocks": [], "language": "sql", "refs": [{"name": "int__admission_history_department", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.int__admission_history_department"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\hospital-admissions-by-department-summary.sql", "compiled": true, "compiled_code": "with __dbt__cte__int__admission_history_department as (\nwith admission_department_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.department_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['department', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n dl.encounter_id,\n dl.department_id,\n d.name as department,\n d.facility_id,\n f.name as facility,\n dl.start_datetime,\n coalesce(lead(dl.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date < 1 then 1\n else coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date\n end as length_of_stay,\n coalesce(dl.type = 'admission', false) as admission,\n coalesce(lead(dl.department_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(dl.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(dl.department_id) over w notnull, false) as transfer_out,\n coalesce(lead(dl.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_department_log dl\njoin \"app\".\"reporting\".\"encounters\" e on e.id = dl.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = dl.department_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nwindow w as (\n partition by encounter_id\n order by dl.start_datetime\n)\n), reporting_months as (\n select month::date\n from generate_series(\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n '1 month'::interval\n ) month\n)\n\nselect\n to_char(rm.month, 'YYYY-MM') as \"Month\",\n adh.facility as \"Facility\",\n adh.department as \"Department\",\n count(*) filter (where adh.admission) as \"Number of admissions\",\n count(*) filter (where adh.discharge) as \"Number of discharges\",\n count(*) filter (where adh.death) as \"Number of deaths\",\n count(*) filter (where adh.transfer_in) as \"Number of transfers into department\",\n count(*) filter (where adh.transfer_out) as \"Number of transfers out of department\",\n round(avg(adh.length_of_stay), 1) as \"Average length of stay\"\nfrom reporting_months rm\nleft join __dbt__cte__int__admission_history_department adh\n on adh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)\nwhere adh.facility_id notnull\n and case\n when nullif('', '')::text is null then true\n else adh.department_id = nullif('', '')::text\n end\ngroup by\n rm.month,\n adh.facility_id,\n adh.facility,\n adh.department_id,\n adh.department\norder by rm.month, adh.facility, adh.department", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.tamanu_source_dbt.int__admission_history_department", "sql": " __dbt__cte__int__admission_history_department as (\nwith admission_department_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.department_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['department', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n dl.encounter_id,\n dl.department_id,\n d.name as department,\n d.facility_id,\n f.name as facility,\n dl.start_datetime,\n coalesce(lead(dl.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date < 1 then 1\n else coalesce(lead(dl.start_datetime::date) over w, e.end_datetime::date) - dl.start_datetime::date\n end as length_of_stay,\n coalesce(dl.type = 'admission', false) as admission,\n coalesce(lead(dl.department_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(dl.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(dl.department_id) over w notnull, false) as transfer_out,\n coalesce(lead(dl.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_department_log dl\njoin \"app\".\"reporting\".\"encounters\" e on e.id = dl.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"departments\" d on d.id = dl.department_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nwindow w as (\n partition by encounter_id\n order by dl.start_datetime\n)\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.hospital-admissions-by-location-summary": {"database": "app", "schema": "reporting", "name": "hospital-admissions-by-location-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\hospital-admissions-by-location-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\hospital-admissions-by-location-summary.sql", "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-location-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "hospital-admissions-by-location-summary"], "alias": "hospital-admissions-by-location-summary", "checksum": {"name": "sha256", "checksum": "76ad413de516863e71534fa55cdaf4605eeb08ee4247aca23cde66a1ecdcc5cc"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3211205, "relation_name": "\"app\".\"reporting\".\"hospital-admissions-by-location-summary\"", "raw_code": "with reporting_months as (\r\n select month::date\r\n from generate_series(\r\n concat(left( {{ parameter('fromDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n concat(left( {{ parameter('toDate', default_value='2024-01-01', data_type='text') }}, 7), '-01')::date,\r\n '1 month'::interval\r\n ) month\r\n),\r\n\r\nlocation_summary as (\r\n select\r\n rm.month,\r\n alh.facility_id,\r\n alh.facility,\r\n alh.location_id,\r\n alh.location,\r\n alh.location_group_id,\r\n alh.location_group,\r\n l.max_occupancy as capacity,\r\n sum(\r\n case when alh.end_datetime::date = alh.start_datetime::date then 1 else\r\n (least(\r\n coalesce(alh.end_datetime, current_date)::date,\r\n (rm.month + '1 month'::interval)::date\r\n ) - greatest(alh.start_datetime::date, rm.month))\r\n end\r\n )::numeric as occupancy,\r\n count(*) filter (where alh.admission and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as admissions,\r\n count(*) filter (where alh.discharge and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as discharges,\r\n count(*) filter (where alh.death and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as deaths,\r\n count(*) filter (where alh.transfer_in and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_ins,\r\n count(*) filter (where alh.transfer_out and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_outs,\r\n round(avg(alh.length_of_stay) filter (where alh.end_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)), 1) as avg_length_of_stay\r\n from reporting_months rm\r\n join {{ ref('int__admission_history_location') }} alh\r\n on alh.start_datetime::date <= (rm.month + '1 month'::interval - '1 day'::interval)\r\n and (alh.end_datetime::date is null or alh.end_datetime::date >= rm.month)\r\n join {{ ref('locations') }} l on l.id = alh.location_id\r\n where rm.month <= current_date\r\n group by\r\n rm.month,\r\n alh.facility_id,\r\n alh.facility,\r\n alh.location_id,\r\n alh.location,\r\n alh.location_group_id,\r\n alh.location_group,\r\n l.max_occupancy\r\n)\r\n\r\nselect\r\n to_char(ls.month, '{{ var(\"yearmonth_format\") }}') as \"{{ translate_label('reportingMonth') }}\",\r\n ls.facility as \"{{ translate_label('facility') }}\",\r\n ls.location_group as \"{{ translate_label('locationGroup') }}\",\r\n ls.location as \"{{ translate_label('location') }}\",\r\n coalesce(ls.admissions, 0) as \"{{ translate_label('hospitalAdmissionCount') }}\",\r\n coalesce(ls.discharges, 0) as \"{{ translate_label('hospitalDischargeCount') }}\",\r\n coalesce(ls.deaths, 0) as \"{{ translate_label('hospitalDeathCount') }}\",\r\n coalesce(ls.transfer_ins, 0) as \"{{ translate_label('hospitalTransfersIntoLocationCount') }}\",\r\n coalesce(ls.transfer_outs, 0) as \"{{ translate_label('hospitalTransfersOutOfLocationCount') }}\",\r\n coalesce(ls.avg_length_of_stay, 0) as \"{{ translate_label('hospitalAverageLengthOfStay') }}\",\r\n coalesce(ls.occupancy, 0) as \"{{ translate_label('hospitalPatientDayCount') }}\",\r\n case\r\n when ls.occupancy notnull and ls.capacity notnull\r\n then\r\n concat(\r\n round(\r\n ls.occupancy / (\r\n ls.capacity * case\r\n when ls.month > (current_date - '1 month'::interval)\r\n then current_date - ls.month\r\n else (ls.month + '1 month'::interval)::date - ls.month\r\n end\r\n ) * 100, 1\r\n )::text, '%'\r\n )\r\n else 'N/A'\r\n end as \"{{ translate_label('hospitalBedOccupancyPercent') }}\"\r\nfrom location_summary ls\r\nwhere\r\n case\r\n when {{ parameter('locationId') }} is null then true\r\n else ls.location_id = {{ parameter('locationId') }}\r\n end\r\norder by ls.month, ls.facility, ls.location_group, ls.location", "doc_blocks": [], "language": "sql", "refs": [{"name": "int__admission_history_location", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\hospital-admissions-by-location-summary.sql", "compiled": true, "compiled_code": "with __dbt__cte__int__admission_history_location as (\nwith admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)\n), reporting_months as (\n select month::date\n from generate_series(\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n concat(left( nullif('2024-01-01', '')::text, 7), '-01')::date,\n '1 month'::interval\n ) month\n),\n\nlocation_summary as (\n select\n rm.month,\n alh.facility_id,\n alh.facility,\n alh.location_id,\n alh.location,\n alh.location_group_id,\n alh.location_group,\n l.max_occupancy as capacity,\n sum(\n case when alh.end_datetime::date = alh.start_datetime::date then 1 else\n (least(\n coalesce(alh.end_datetime, current_date)::date,\n (rm.month + '1 month'::interval)::date\n ) - greatest(alh.start_datetime::date, rm.month))\n end\n )::numeric as occupancy,\n count(*) filter (where alh.admission and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as admissions,\n count(*) filter (where alh.discharge and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as discharges,\n count(*) filter (where alh.death and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as deaths,\n count(*) filter (where alh.transfer_in and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_ins,\n count(*) filter (where alh.transfer_out and alh.start_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)) as transfer_outs,\n round(avg(alh.length_of_stay) filter (where alh.end_datetime::date between rm.month and (rm.month + '1 month'::interval - '1 day'::interval)), 1) as avg_length_of_stay\n from reporting_months rm\n join __dbt__cte__int__admission_history_location alh\n on alh.start_datetime::date <= (rm.month + '1 month'::interval - '1 day'::interval)\n and (alh.end_datetime::date is null or alh.end_datetime::date >= rm.month)\n join \"app\".\"reporting\".\"locations\" l on l.id = alh.location_id\n where rm.month <= current_date\n group by\n rm.month,\n alh.facility_id,\n alh.facility,\n alh.location_id,\n alh.location,\n alh.location_group_id,\n alh.location_group,\n l.max_occupancy\n)\n\nselect\n to_char(ls.month, 'YYYY-MM') as \"Month\",\n ls.facility as \"Facility\",\n ls.location_group as \"Area\",\n ls.location as \"Location\",\n coalesce(ls.admissions, 0) as \"Number of admissions\",\n coalesce(ls.discharges, 0) as \"Number of discharges\",\n coalesce(ls.deaths, 0) as \"Number of deaths\",\n coalesce(ls.transfer_ins, 0) as \"Number of transfers into location\",\n coalesce(ls.transfer_outs, 0) as \"Number of transfers out of location\",\n coalesce(ls.avg_length_of_stay, 0) as \"Average length of stay\",\n coalesce(ls.occupancy, 0) as \"Number of patient days\",\n case\n when ls.occupancy notnull and ls.capacity notnull\n then\n concat(\n round(\n ls.occupancy / (\n ls.capacity * case\n when ls.month > (current_date - '1 month'::interval)\n then current_date - ls.month\n else (ls.month + '1 month'::interval)::date - ls.month\n end\n ) * 100, 1\n )::text, '%'\n )\n else 'N/A'\n end as \"Bed occupancy (%)\"\nfrom location_summary ls\nwhere\n case\n when nullif('', '')::text is null then true\n else ls.location_id = nullif('', '')::text\n end\norder by ls.month, ls.facility, ls.location_group, ls.location", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.tamanu_source_dbt.int__admission_history_location", "sql": " __dbt__cte__int__admission_history_location as (\nwith admission_location_log as (\n select\n eh.id,\n eh.encounter_id,\n eh.datetime as start_datetime,\n eh.location_id,\n case\n when eh.change_type is null or 'encounter_type' = any(eh.change_type) then 'admission'\n else 'transfer-in'\n end as type\n from \"app\".\"reporting\".\"encounter_history\" eh\n where (eh.change_type isnull or eh.change_type && array['location', 'encounter_type'])\n and eh.encounter_type = 'admission'\n)\n\nselect\n ll.encounter_id,\n l.location_group_id,\n lg.name as location_group,\n ll.location_id,\n l.name as location,\n l.facility_id,\n f.name as facility,\n ll.start_datetime,\n coalesce(lead(ll.start_datetime) over w, e.end_datetime) as end_datetime,\n case\n when coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date < 1 then 1\n else coalesce(lead(ll.start_datetime::date) over w, e.end_datetime::date) - ll.start_datetime::date\n end as length_of_stay,\n coalesce(ll.type = 'admission', false) as admission,\n coalesce(lead(ll.location_id) over w isnull and e.end_datetime notnull, false) as discharge,\n coalesce(ll.type = 'transfer-in', false) as transfer_in,\n coalesce(lead(ll.location_id) over w notnull, false) as transfer_out,\n coalesce(lead(ll.start_datetime) over w isnull and e.end_datetime::date = p.date_of_death, false) as death\nfrom admission_location_log ll\njoin \"app\".\"reporting\".\"encounters\" e on e.id = ll.encounter_id\njoin \"app\".\"reporting\".\"patients\" p on p.id = e.patient_id\njoin \"app\".\"reporting\".\"locations\" l on l.id = ll.location_id\njoin \"app\".\"reporting\".\"location_groups\" lg on lg.id = l.location_group_id\njoin \"app\".\"reporting\".\"facilities\" f on f.id = l.facility_id\nwindow w as (\n partition by ll.encounter_id\n order by ll.start_datetime\n)\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging-requests-line-list": {"database": "app", "schema": "reporting", "name": "imaging-requests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\imaging-requests-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\imaging-requests-line-list.sql", "unique_id": "model.tamanu_source_dbt.imaging-requests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "imaging-requests-line-list"], "alias": "imaging-requests-line-list", "checksum": {"name": "sha256", "checksum": "e62981e2d1c14d7f052d8899d5b8e8d26d7a24bcef01181ae0de2d9f96d65938"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3211205, "relation_name": "\"app\".\"reporting\".\"imaging-requests-line-list\"", "raw_code": "with _translations as (\r\n {{ get_translation_lookup(prefix_key='IMAGING_TYPES') }}\r\n)\r\nselect\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n request_id as \"{{ translate_label('imagingRequestId') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('imagingRequestDateTime') }}\",\r\n supervising_clinician as \"{{ translate_label('imagingSupervisingClinician') }}\",\r\n requesting_clinician as \"{{ translate_label('imagingRequestingClinician') }}\",\r\n priority as \"{{ translate_label('imagingPriority') }}\",\r\n coalesce(t_imaging_type.text, imaging_type) as \"{{ translate_label('imagingType') }}\",\r\n imaging_area as \"{{ translate_label('imagingArea') }}\",\r\n status as \"{{ translate_label('imagingStatus') }}\",\r\n to_char(completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('imagingCompletedDateTime') }}\",\r\n reason_for_cancellation as \"{{ translate_label('imagingCancellationReason') }}\"\r\nfrom {{ ref('ds__imaging_requests') }}\r\nleft join _translations t_imaging_type\r\n on t_imaging_type.string_id = '{{ get_translation_prefix(\"IMAGING_TYPES\") }}.' || imaging_type\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('requestedById') }} is null then true\r\n else requesting_clinician_id = {{ parameter('requestedById') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('imagingType') }} is null then true\r\n else imaging_type = {{ parameter('imagingType') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by requested_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "translated_strings", "package": null, "version": null}, {"name": "ds__imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_lookup", "macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_translation_prefix", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.translated_strings", "model.tamanu_source_dbt.ds__imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\imaging-requests-line-list.sql", "compiled": true, "compiled_code": "with _translations as (\n select\n string_id,\n max(text) filter (where language = 'default') as text\n from \"app\".\"reporting\".\"translated_strings\"\n where string_id like 'imaging.property.type.%'\n group by string_id\n)\nselect\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n request_id as \"Request ID\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Request date and time\",\n supervising_clinician as \"Supervising clinician\",\n requesting_clinician as \"Requesting clinician\",\n priority as \"Priority\",\n coalesce(t_imaging_type.text, imaging_type) as \"Imaging type\",\n imaging_area as \"Area to be imaged\",\n status as \"Status\",\n to_char(completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Completed date and time\",\n reason_for_cancellation as \"Reason for cancellation\"\nfrom \"app\".\"reporting\".\"ds__imaging_requests\"\nleft join _translations t_imaging_type\n on t_imaging_type.string_id = 'imaging.property.type.' || imaging_type\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else requesting_clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else imaging_type = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\norder by requested_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.imaging-requests-summary": {"database": "app", "schema": "reporting", "name": "imaging-requests-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\imaging-requests-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\imaging-requests-summary.sql", "unique_id": "model.tamanu_source_dbt.imaging-requests-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "imaging-requests-summary"], "alias": "imaging-requests-summary", "checksum": {"name": "sha256", "checksum": "2e75c5ceb25d8d593c314ce6817f5583f54013bb69f204f34beb87ff114258b6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3361483, "relation_name": "\"app\".\"reporting\".\"imaging-requests-summary\"", "raw_code": "with _translations as (\r\n {{ get_translation_lookup(prefix_key='IMAGING_TYPES') }}\r\n),\r\n\r\nreporting_dates as (\r\n select date::date as date\r\n from generate_series(\r\n {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }},\r\n {{ parameter('toDate', default_value='2024-01-31', data_type='date') }},\r\n '1 day'::interval\r\n ) date\r\n)\r\n\r\nselect\r\n to_char(rd.date, '{{ var(\"date_format\") }}') as \"{{ translate_label('reportingDate') }}\",\r\n ir.facility as \"{{ translate_label('facility') }}\",\r\n ir.department as \"{{ translate_label('department') }}\",\r\n coalesce(t_imaging_type.text, ir.imaging_type) as \"{{ translate_label('imagingType') }}\",\r\n count(distinct ir.request_id) filter (where ir.requested_datetime::date = rd.date) as \"{{ translate_label('imagingTotalRequests') }}\",\r\n count(distinct ir.request_id) filter (\r\n where ir.requested_datetime::date <= rd.date\r\n and (ir.completed_datetime::date > rd.date or ir.completed_datetime is null)\r\n ) as \"{{ translate_label('imagingPendingRequests') }}\",\r\n count(distinct ir.request_id) filter (\r\n where ir.completed_datetime::date = rd.date\r\n ) as \"{{ translate_label('imagingCompletedRequests') }}\"\r\nfrom reporting_dates rd\r\nleft join {{ ref('ds__imaging_requests') }} ir\r\n on ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\r\n and ir.requested_datetime::date <= rd.date\r\n and (ir.completed_datetime::date >= rd.date or ir.completed_datetime is null)\r\nleft join _translations t_imaging_type\r\n on t_imaging_type.string_id = '{{ get_translation_prefix(\"IMAGING_TYPES\") }}.' || ir.imaging_type\r\nwhere ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\r\n and (ir.department_id is not null or ir.imaging_type is not null)\r\n and (\r\n {{ parameter('department') }} is null or ir.department_id = {{ parameter('department') }}\r\n )\r\n and (\r\n case\r\n when {{ parameter('imagingType') }} is null then true\r\n else ir.imaging_type = {{ parameter('imagingType') }}\r\n end\r\n )\r\ngroup by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text\r\norder by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text", "doc_blocks": [], "language": "sql", "refs": [{"name": "translated_strings", "package": null, "version": null}, {"name": "ds__imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_lookup", "macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_translation_prefix"], "nodes": ["model.tamanu_source_dbt.translated_strings", "model.tamanu_source_dbt.ds__imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\imaging-requests-summary.sql", "compiled": true, "compiled_code": "with _translations as (\n select\n string_id,\n max(text) filter (where language = 'default') as text\n from \"app\".\"reporting\".\"translated_strings\"\n where string_id like 'imaging.property.type.%'\n group by string_id\n),\n\nreporting_dates as (\n select date::date as date\n from generate_series(\n nullif('2024-01-01', '')::date,\n nullif('2024-01-31', '')::date,\n '1 day'::interval\n ) date\n)\n\nselect\n to_char(rd.date, 'YYYY-MM-DD') as \"Date\",\n ir.facility as \"Facility\",\n ir.department as \"Department\",\n coalesce(t_imaging_type.text, ir.imaging_type) as \"Imaging type\",\n count(distinct ir.request_id) filter (where ir.requested_datetime::date = rd.date) as \"Total new requests\",\n count(distinct ir.request_id) filter (\n where ir.requested_datetime::date <= rd.date\n and (ir.completed_datetime::date > rd.date or ir.completed_datetime is null)\n ) as \"Total requests with a status of pending\",\n count(distinct ir.request_id) filter (\n where ir.completed_datetime::date = rd.date\n ) as \"Total requests completed\"\nfrom reporting_dates rd\nleft join \"app\".\"reporting\".\"ds__imaging_requests\" ir\n on ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\n and ir.requested_datetime::date <= rd.date\n and (ir.completed_datetime::date >= rd.date or ir.completed_datetime is null)\nleft join _translations t_imaging_type\n on t_imaging_type.string_id = 'imaging.property.type.' || ir.imaging_type\nwhere ir.status_id not in ('cancelled', 'deleted', 'entered_in_error')\n and (ir.department_id is not null or ir.imaging_type is not null)\n and (\n nullif('', '')::text is null or ir.department_id = nullif('', '')::text\n )\n and (\n case\n when nullif('', '')::text is null then true\n else ir.imaging_type = nullif('', '')::text\n end\n )\ngroup by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text\norder by rd.date, ir.facility, ir.facility_id, ir.department, ir.department_id, ir.imaging_type, t_imaging_type.text", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.incomplete-referrals": {"database": "app", "schema": "reporting", "name": "incomplete-referrals", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\incomplete-referrals.sql", "original_file_path": "models\\reports\\sql\\standard\\incomplete-referrals.sql", "unique_id": "model.tamanu_source_dbt.incomplete-referrals", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "incomplete-referrals"], "alias": "incomplete-referrals", "checksum": {"name": "sha256", "checksum": "8b006cf94e21b00580865275aeec2c17fdfc4ca55e6126f2b23356c73eb8d27f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.340278, "relation_name": "\"app\".\"reporting\".\"incomplete-referrals\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n diagnoses as \"{{ translate_label('diagnoses') }}\",\r\n referral_type as \"{{ translate_label('referralType') }}\",\r\n referring_doctor_name as \"{{ translate_label('referralCompletedBy') }}\",\r\n to_char(referral_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('referralDate') }}\",\r\n department as \"{{ translate_label('department') }}\"\r\nfrom {{ ref('ds__referrals') }}\r\nwhere status in ('pending', 'cancelled')\r\n and case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else referral_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else referral_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('doctorId') }} is null then true\r\n else referring_doctor_id = {{ parameter('doctorId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\norder by referral_datetime, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__referrals", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\incomplete-referrals.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n diagnoses as \"Diagnoses\",\n referral_type as \"Referral name\",\n referring_doctor_name as \"Referring doctor\",\n to_char(referral_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Referral date\",\n department as \"Department\"\nfrom \"app\".\"reporting\".\"ds__referrals\"\nwhere status in ('pending', 'cancelled')\n and case\n when nullif('2024-01-01', '')::date is null then true\n else referral_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else referral_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else referring_doctor_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\norder by referral_datetime, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.invoice-products-summary": {"database": "app", "schema": "reporting", "name": "invoice-products-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\invoice-products-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\invoice-products-summary.sql", "unique_id": "model.tamanu_source_dbt.invoice-products-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "invoice-products-summary"], "alias": "invoice-products-summary", "checksum": {"name": "sha256", "checksum": "5d47c836b0014a7f331b1456d747cc366c6bf04a985f81dca5ea58c4993a39e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.340278, "relation_name": "\"app\".\"reporting\".\"invoice-products-summary\"", "raw_code": "{%- set price_lists_query %}\r\n select name\r\n from {{ ref('invoice_price_lists') }}\r\n order by name\r\n{%- endset %}\r\n\r\n{%- set insurance_plans_query %}\r\n select name\r\n from {{ ref('invoice_insurance_plans') }}\r\n order by name\r\n{%- endset %}\r\n\r\n{%- if execute %}\r\n {%- set price_list_names = run_query(price_lists_query).columns[0].values() %}\r\n {%- set insurance_plan_names = run_query(insurance_plans_query).columns[0].values() %}\r\n{%- else %}\r\n {%- set price_list_names = [] %}\r\n {%- set insurance_plan_names = [] %}\r\n{%- endif %}\r\n\r\nselect\r\n id as \"{{ translate_label('invoiceProductId') }}\",\r\n name as \"{{ translate_label('invoiceProductName') }}\",\r\n insurable as \"{{ translate_label('invoiceProductInsurable') }}\",\r\n category as \"{{ translate_label('invoiceProductCategory') }}\",\r\n source_record_id as \"{{ translate_label('invoiceProductCategoryId') }}\",\r\n visibility_status as \"{{ translate_label('invoiceProductVisibilityStatus') }}\",\r\n external_code as \"{{ translate_label('invoiceProductLabExternalCode') }}\"\r\n {%- for name in price_list_names %}\r\n , \"Price: {{ name }}\"\r\n {%- endfor %}\r\n {%- for name in insurance_plan_names %}\r\n , \"Insurance: {{ name }}\"\r\n {%- endfor %}\r\nfrom {{ ref('ds__invoice_products') }}\r\norder by name", "doc_blocks": [], "language": "sql", "refs": [{"name": "invoice_price_lists", "package": null, "version": null}, {"name": "invoice_insurance_plans", "package": null, "version": null}, {"name": "ds__invoice_products", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.dbt.run_query"], "nodes": ["model.tamanu_source_dbt.invoice_price_lists", "model.tamanu_source_dbt.invoice_insurance_plans", "model.tamanu_source_dbt.ds__invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\invoice-products-summary.sql", "compiled": true, "compiled_code": "\n\nselect\n id as \"ID\",\n name as \"Product name\",\n insurable as \"Insurable\",\n category as \"Category\",\n source_record_id as \"Category ID\",\n visibility_status as \"Visibility status\",\n external_code as \"Lab external code\"\nfrom \"app\".\"reporting\".\"ds__invoice_products\"\norder by name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab-requests-line-list": {"database": "app", "schema": "reporting", "name": "lab-requests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\lab-requests-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\lab-requests-line-list.sql", "unique_id": "model.tamanu_source_dbt.lab-requests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "lab-requests-line-list"], "alias": "lab-requests-line-list", "checksum": {"name": "sha256", "checksum": "6b1963a9204df4bd11a19e26b42caf97f98579694e37710ecd67175a935fbb0d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3518257, "relation_name": "\"app\".\"reporting\".\"lab-requests-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n concat_ws(', ', location_group, location) as \"{{ translate_label('location') }}\",\r\n laboratory as \"{{ translate_label('labLaboratory') }}\",\r\n request_id as \"{{ translate_label('labRequestId') }}\",\r\n status as \"{{ translate_label('labRequestStatus') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestDateTime') }}\",\r\n requested_by as \"{{ translate_label('labRequestClinician') }}\",\r\n requesting_department as \"{{ translate_label('labRequestDepartment') }}\",\r\n priority as \"{{ translate_label('labRequestPriority') }}\",\r\n lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n tests as \"{{ translate_label('labTestRequested') }}\",\r\n to_char(collected_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestSampleCollectionDateTime') }}\",\r\n collected_by as \"{{ translate_label('labRequestSampleCollectedBy') }}\",\r\n specimen_type as \"{{ translate_label('labRequestSpecimenType') }}\",\r\n site as \"{{ translate_label('labRequestSampleSite') }}\",\r\n to_char(completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestCompletedDateTime') }}\",\r\n reason_for_cancellation as \"{{ translate_label('labRequestCancellationReason') }}\"\r\nfrom {{ ref('ds__lab_requests') }}\r\nwhere case\r\n when {{ parameter('requestedById') }} is null then true\r\n else requested_by_id = {{ parameter('requestedById') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('testCategoryId') }} is null then true\r\n else lab_test_category_id = {{ parameter('testCategoryId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by requested_datetime, last_name, first_name, tests", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__lab_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\lab-requests-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n concat_ws(', ', location_group, location) as \"Location\",\n laboratory as \"Laboratory\",\n request_id as \"Request ID\",\n status as \"Status\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request date and time\",\n requested_by as \"Requesting clinician\",\n requesting_department as \"Requesting department\",\n priority as \"Priority\",\n lab_test_category as \"Test category\",\n tests as \"Test requested\",\n to_char(collected_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Sample collection date and time\",\n collected_by as \"Sample collected by\",\n specimen_type as \"Specimen type\",\n site as \"Site\",\n to_char(completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Completed date and time\",\n reason_for_cancellation as \"Reason for cancellation\"\nfrom \"app\".\"reporting\".\"ds__lab_requests\"\nwhere case\n when nullif('', '')::text is null then true\n else requested_by_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else lab_test_category_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by requested_datetime, last_name, first_name, tests", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab-requests-summary": {"database": "app", "schema": "reporting", "name": "lab-requests-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\lab-requests-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\lab-requests-summary.sql", "unique_id": "model.tamanu_source_dbt.lab-requests-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "lab-requests-summary"], "alias": "lab-requests-summary", "checksum": {"name": "sha256", "checksum": "eb4d3c6ac6112d8a5c2fd7912437e01fea9086ab0e06c739dfefeadc15f83527"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3518257, "relation_name": "\"app\".\"reporting\".\"lab-requests-summary\"", "raw_code": "with reporting_dates as (\r\n select date::date as reporting_date\r\n from generate_series(\r\n {{ parameter('fromDate', default_value='2024-01-01', data_type='text') }}::date,\r\n {{ parameter('toDate', default_value='2024-01-01', data_type='text') }}::date,\r\n '1 day'::interval\r\n ) date\r\n)\r\n\r\nselect\r\n to_char(rd.reporting_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('reportingDate') }}\",\r\n lrh.facility as \"{{ translate_label('facility') }}\",\r\n lrh.department as \"{{ translate_label('department') }}\",\r\n lrh.lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n count(distinct case\r\n when rd.reporting_date = lrh.requested_date\r\n then lrh.request_id\r\n end) as \"{{ translate_label('labRequestNewCount') }}\",\r\n count(case\r\n when lrh.status = 'results_pending'\r\n then 1\r\n end) as \"{{ translate_label('labRequestPendingCount') }}\",\r\n count(case\r\n when lrh.status = 'published'\r\n then 1\r\n end) as \"{{ translate_label('labRequestPublishedCount') }}\"\r\nfrom reporting_dates rd\r\njoin {{ ref('int__lab_requests_history') }} lrh\r\n on lrh.status_start_date <= rd.reporting_date\r\n and lrh.status_end_date >= rd.reporting_date\r\nwhere case\r\n when {{ parameter('departmentId', default_value='null', data_type='text') }} is null\r\n then true\r\n else lrh.department_id = {{ parameter('departmentId', default_value='null', data_type='text') }}\r\n end\r\n and case\r\n when {{ parameter('facilityId', default_value='null', data_type='text') }} is null\r\n then true\r\n else lrh.facility_id = {{ parameter('facilityId', default_value='null', data_type='text') }}\r\n end\r\n and case\r\n when {{ parameter('labTestCategoryId', default_value='null', data_type='text') }} is null\r\n then true\r\n else lrh.lab_test_category_id = {{ parameter('labTestCategoryId', default_value='null', data_type='text') }}\r\n end\r\ngroup by\r\n rd.reporting_date,\r\n lrh.facility,\r\n lrh.department,\r\n lrh.lab_test_category\r\nhaving count(case\r\n when rd.reporting_date = lrh.requested_date\r\n or lrh.status in ('results_pending', 'published')\r\n then 1\r\n end) > 0", "doc_blocks": [], "language": "sql", "refs": [{"name": "int__lab_requests_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.int__lab_requests_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\lab-requests-summary.sql", "compiled": true, "compiled_code": "with __dbt__cte__int__lab_requests_history as (\nselect distinct on (lr.id, coalesce(lrl.status, lr.status))\n lr.id as request_id,\n lr.requested_datetime::date as requested_date,\n lr.encounter_id,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n ltc.id as lab_test_category_id,\n ltc.name as lab_test_category,\n coalesce(lrl.status, lr.status) as status,\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date as status_start_date,\n case\n when coalesce(lrl.status, lr.status) = 'published'\n then\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n when lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w is not null\n then\n case\n when coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n = (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n then (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n else (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w - interval '1 day')::date\n end\n else current_date\n end as status_end_date\nfrom \"app\".\"reporting\".\"lab_requests\" lr\nleft join \"app\".\"reporting\".\"lab_request_logs\" lrl on lrl.lab_request_id = lr.id\nleft join \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = coalesce(lr.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" ltc on ltc.id = lr.lab_test_category_id\nwhere lr.status not in ('deleted', 'cancelled', 'entered-in-error')\nwindow\n w as (\n partition by lr.id\n order by coalesce(lrl.updated_datetime, lr.updated_datetime)\n )\norder by lr.id, coalesce(lrl.status, lr.status)\n), reporting_dates as (\n select date::date as reporting_date\n from generate_series(\n nullif('2024-01-01', '')::text::date,\n nullif('2024-01-01', '')::text::date,\n '1 day'::interval\n ) date\n)\n\nselect\n to_char(rd.reporting_date, 'YYYY-MM-DD') as \"Date\",\n lrh.facility as \"Facility\",\n lrh.department as \"Department\",\n lrh.lab_test_category as \"Test category\",\n count(distinct case\n when rd.reporting_date = lrh.requested_date\n then lrh.request_id\n end) as \"Total new requests\",\n count(case\n when lrh.status = 'results_pending'\n then 1\n end) as \"Total requests with a status of results pending\",\n count(case\n when lrh.status = 'published'\n then 1\n end) as \"Total requests published\"\nfrom reporting_dates rd\njoin __dbt__cte__int__lab_requests_history lrh\n on lrh.status_start_date <= rd.reporting_date\n and lrh.status_end_date >= rd.reporting_date\nwhere case\n when nullif('null', '')::text is null\n then true\n else lrh.department_id = nullif('null', '')::text\n end\n and case\n when nullif('null', '')::text is null\n then true\n else lrh.facility_id = nullif('null', '')::text\n end\n and case\n when nullif('null', '')::text is null\n then true\n else lrh.lab_test_category_id = nullif('null', '')::text\n end\ngroup by\n rd.reporting_date,\n lrh.facility,\n lrh.department,\n lrh.lab_test_category\nhaving count(case\n when rd.reporting_date = lrh.requested_date\n or lrh.status in ('results_pending', 'published')\n then 1\n end) > 0", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.tamanu_source_dbt.int__lab_requests_history", "sql": " __dbt__cte__int__lab_requests_history as (\nselect distinct on (lr.id, coalesce(lrl.status, lr.status))\n lr.id as request_id,\n lr.requested_datetime::date as requested_date,\n lr.encounter_id,\n f.id as facility_id,\n f.name as facility,\n d.id as department_id,\n d.name as department,\n ltc.id as lab_test_category_id,\n ltc.name as lab_test_category,\n coalesce(lrl.status, lr.status) as status,\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date as status_start_date,\n case\n when coalesce(lrl.status, lr.status) = 'published'\n then\n coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n when lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w is not null\n then\n case\n when coalesce(lrl.updated_datetime, lr.updated_datetime)::date\n = (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n then (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w)::date\n else (lead(coalesce(lrl.updated_datetime, lr.updated_datetime)) over w - interval '1 day')::date\n end\n else current_date\n end as status_end_date\nfrom \"app\".\"reporting\".\"lab_requests\" lr\nleft join \"app\".\"reporting\".\"lab_request_logs\" lrl on lrl.lab_request_id = lr.id\nleft join \"app\".\"reporting\".\"encounters\" e on e.id = lr.encounter_id\nleft join \"app\".\"reporting\".\"departments\" d on d.id = coalesce(lr.department_id, e.department_id)\nleft join \"app\".\"reporting\".\"facilities\" f on f.id = d.facility_id\nleft join \"app\".\"reporting\".\"reference_data\" ltc on ltc.id = lr.lab_test_category_id\nwhere lr.status not in ('deleted', 'cancelled', 'entered-in-error')\nwindow\n w as (\n partition by lr.id\n order by coalesce(lrl.updated_datetime, lr.updated_datetime)\n )\norder by lr.id, coalesce(lrl.status, lr.status)\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.lab-tests-line-list": {"database": "app", "schema": "reporting", "name": "lab-tests-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\lab-tests-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\lab-tests-line-list.sql", "unique_id": "model.tamanu_source_dbt.lab-tests-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "lab-tests-line-list"], "alias": "lab-tests-line-list", "checksum": {"name": "sha256", "checksum": "9617dcd125ac62096f404e068b6c6909cca8497031d5879b718ed0ef7af0d639"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3677325, "relation_name": "\"app\".\"reporting\".\"lab-tests-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n requesting_department as \"{{ translate_label('requestingDepartment') }}\",\r\n concat_ws(', ', location_group, location) as \"{{ translate_label('location') }}\",\r\n lab_request_id as \"{{ translate_label('labRequestId') }}\",\r\n status as \"{{ translate_label('labRequestStatus') }}\",\r\n lab_test_panel as \"{{ translate_label('labTestPanel') }}\",\r\n lab_test_category as \"{{ translate_label('labTestCategory') }}\",\r\n to_char(requested_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestDateTime') }}\",\r\n requested_by as \"{{ translate_label('labRequestClinician') }}\",\r\n to_char(lab_request_published_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labRequestPublishedDateTime') }}\",\r\n to_char(lab_test_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('labTestDate') }}\",\r\n result as \"{{ translate_label('labTestResults') }}\",\r\n verification as \"{{ translate_label('labTestVerification') }}\",\r\n lab_test_type as \"{{ translate_label('labTestType') }}\",\r\n to_char(lab_test_completed_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('labTestCompletedDateTime') }}\"\r\nfrom {{ ref('ds__lab_tests') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else requested_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else requested_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('statusId') }} is null then true\r\n else status_id = {{ parameter('statusId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('testCategoryId') }} is null then true\r\n else lab_test_category_id = {{ parameter('testCategoryId') }}\r\n end\r\norder by\r\n requested_datetime,\r\n lab_test_panel,\r\n lab_request_published_datetime,\r\n lab_test_completed_datetime,\r\n lab_test_type", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__lab_tests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\lab-tests-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n requesting_department as \"Requesting department\",\n concat_ws(', ', location_group, location) as \"Location\",\n lab_request_id as \"Request ID\",\n status as \"Status\",\n lab_test_panel as \"Lab test panel\",\n lab_test_category as \"Test category\",\n to_char(requested_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request date and time\",\n requested_by as \"Requesting clinician\",\n to_char(lab_request_published_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab request published date and time\",\n to_char(lab_test_date, 'YYYY-MM-DD') as \"Lab test date\",\n result as \"Result\",\n verification as \"Verification\",\n lab_test_type as \"Lab test type\",\n to_char(lab_test_completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Lab test completed date and time\"\nfrom \"app\".\"reporting\".\"ds__lab_tests\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else requested_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else requested_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else status_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else lab_test_category_id = nullif('', '')::text\n end\norder by\n requested_datetime,\n lab_test_panel,\n lab_request_published_datetime,\n lab_test_completed_datetime,\n lab_test_type", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.location-bookings-line-list": {"database": "app", "schema": "reporting", "name": "location-bookings-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\location-bookings-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\location-bookings-line-list.sql", "unique_id": "model.tamanu_source_dbt.location-bookings-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "location-bookings-line-list"], "alias": "location-bookings-line-list", "checksum": {"name": "sha256", "checksum": "f10e8ff347e1817445ea46235f7547e890ac7b5d25ace2c9768d404654b98a21"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3677325, "relation_name": "\"app\".\"reporting\".\"location-bookings-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(booking_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('bookingStartDateTime') }}\",\r\n to_char(booking_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('bookingEndDateTime') }}\",\r\n case\r\n when extract(day from age(booking_end_datetime, booking_start_datetime)) >= 1\r\n then extract(day from age(booking_end_datetime, booking_start_datetime)) || ' nights'\r\n when extract(hour from age(booking_end_datetime, booking_start_datetime)) >= 1\r\n then extract(hour from age(booking_end_datetime, booking_start_datetime)) || ' hours'\r\n else extract(minute from age(booking_end_datetime, booking_start_datetime)) || ' minutes'\r\n end as \"{{ translate_label('bookingDuration') }}\",\r\n location_group as \"{{ translate_label('bookingLocationGroup') }}\",\r\n location as \"{{ translate_label('bookingLocation') }}\",\r\n clinician as \"{{ translate_label('bookingClinician') }}\",\r\n booking_type as \"{{ translate_label('bookingType') }}\",\r\n booking_status as \"{{ translate_label('bookingStatus') }}\"\r\nfrom {{ ref('ds__location_bookings') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else booking_start_datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else booking_end_datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('bookingStatus') }} is null then true\r\n else booking_status = {{ parameter('bookingStatus') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('bookingTypeId') }} is null then true\r\n else booking_type_id = {{ parameter('bookingTypeId') }}\r\n end\r\norder by booking_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__location_bookings", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__location_bookings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\location-bookings-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n billing_type as \"Billing type\",\n to_char(booking_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Booking start date and time\",\n to_char(booking_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Booking end date and time\",\n case\n when extract(day from age(booking_end_datetime, booking_start_datetime)) >= 1\n then extract(day from age(booking_end_datetime, booking_start_datetime)) || ' nights'\n when extract(hour from age(booking_end_datetime, booking_start_datetime)) >= 1\n then extract(hour from age(booking_end_datetime, booking_start_datetime)) || ' hours'\n else extract(minute from age(booking_end_datetime, booking_start_datetime)) || ' minutes'\n end as \"Booking duration\",\n location_group as \"Area\",\n location as \"Location\",\n clinician as \"Clinician\",\n booking_type as \"Booking type\",\n booking_status as \"Booking status\"\nfrom \"app\".\"reporting\".\"ds__location_bookings\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else booking_start_datetime >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else booking_end_datetime <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else booking_status = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else booking_type_id = nullif('', '')::text\n end\norder by booking_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.medication-dispensed-summary": {"database": "app", "schema": "reporting", "name": "medication-dispensed-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\medication-dispensed-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\medication-dispensed-summary.sql", "unique_id": "model.tamanu_source_dbt.medication-dispensed-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "medication-dispensed-summary"], "alias": "medication-dispensed-summary", "checksum": {"name": "sha256", "checksum": "65a110c47ead91b1c12f8d960856a523d76fbf85528b573eec5bf77aea64b03b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3834848, "relation_name": "\"app\".\"reporting\".\"medication-dispensed-summary\"", "raw_code": "select\r\n md.medication as \"{{ translate_label('prescriptionMedication') }}\",\r\n md.medication_code as \"{{ translate_label('prescriptionMedicationCode') }}\",\r\n sum(md.quantity) as \"{{ translate_label('prescriptionQuantity') }}\"\r\nfrom {{ ref('ds__medication_dispenses') }} md\r\nwhere\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else md.facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('medicationId') }} is null then true\r\n else md.medication_id = {{ parameter('medicationId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='timestamp') }} is null then true\r\n else md.dispensed_at\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='timestamp') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='timestamp') }} is null then true\r\n else md.dispensed_at\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='timestamp') }}\r\n end\r\ngroup by md.medication_id, md.medication, md.medication_code", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__medication_dispenses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\medication-dispensed-summary.sql", "compiled": true, "compiled_code": "select\n md.medication as \"Medication\",\n md.medication_code as \"Code\",\n sum(md.quantity) as \"Quantity\"\nfrom \"app\".\"reporting\".\"ds__medication_dispenses\" md\nwhere\n case\n when nullif('', '')::text is null then true\n else md.facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else md.medication_id = nullif('', '')::text\n end\n and\n case\n when nullif('2024-01-01', '')::timestamp is null then true\n else md.dispensed_at\n >= nullif('2024-01-01', '')::timestamp\n end\n and\n case\n when nullif('2024-01-31', '')::timestamp is null then true\n else md.dispensed_at\n <= nullif('2024-01-31', '')::timestamp\n end\ngroup by md.medication_id, md.medication, md.medication_code", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.ongoing-conditions-line-list": {"database": "app", "schema": "reporting", "name": "ongoing-conditions-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\ongoing-conditions-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\ongoing-conditions-line-list.sql", "unique_id": "model.tamanu_source_dbt.ongoing-conditions-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "ongoing-conditions-line-list"], "alias": "ongoing-conditions-line-list", "checksum": {"name": "sha256", "checksum": "1687de0806192a341d1656c9f06ccdc2c858b21ca2504ec03cfbe18653fa1e91"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.3834848, "relation_name": "\"app\".\"reporting\".\"ongoing-conditions-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n condition as \"{{ translate_label('conditionOngoing') }}\",\r\n to_char(recorded_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('conditionRecordedDate') }}\",\r\n clinician as \"{{ translate_label('conditionRecordedBy') }}\",\r\n to_char(date_resolved, '{{ var(\"date_format\") }}') as \"{{ translate_label('conditionResolvedDate') }}\",\r\n clinician_resolving as \"{{ translate_label('conditionResolvedBy') }}\"\r\nfrom {{ ref('ds__ongoing_conditions') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else recorded_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else recorded_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by recorded_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__ongoing_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__ongoing_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\ongoing-conditions-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n condition as \"Ongoing condition\",\n to_char(recorded_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date recorded\",\n clinician as \"Clinician\",\n to_char(date_resolved, 'YYYY-MM-DD') as \"Date resolved\",\n clinician_resolving as \"Clinician confirming resolution\"\nfrom \"app\".\"reporting\".\"ds__ongoing_conditions\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else recorded_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else recorded_datetime\n <= nullif('2024-01-31', '')::date\n end\norder by recorded_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.outpatient-appointments-line-list": {"database": "app", "schema": "reporting", "name": "outpatient-appointments-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\outpatient-appointments-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\outpatient-appointments-line-list.sql", "unique_id": "model.tamanu_source_dbt.outpatient-appointments-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "outpatient-appointments-line-list"], "alias": "outpatient-appointments-line-list", "checksum": {"name": "sha256", "checksum": "5500b7bfc6108c9c2de4621849e0d34c7bcbd866bafd16e8cf130d81bc03ebf7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.399405, "relation_name": "\"app\".\"reporting\".\"outpatient-appointments-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n contact_number as \"{{ translate_label('patientContactNumber') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n billing_type as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(appointment_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentDateTime') }}\",\r\n to_char(appointment_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('appointmentEndDateTime') }}\",\r\n appointment_type as \"{{ translate_label('appointmentType') }}\",\r\n appointment_status as \"{{ translate_label('appointmentStatus') }}\",\r\n clinician as \"{{ translate_label('appointmentClinician') }}\",\r\n location_group as \"{{ translate_label('appointmentLocationGroup') }}\",\r\n priority as \"{{ translate_label('appointmentPriority') }}\",\r\n case\r\n when schedule_id notnull then {{ get_recurrence_description('interval', 'frequency', 'days_of_week', 'nth_weekday') }}\r\n else 'No'\r\n end as \"{{ translate_label('appointmentIsRepeating') }}\",\r\n to_char(until_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('appointmentRepeatingEndDate') }}\",\r\n created_by as \"{{ translate_label('appointmentCreatedBy') }}\"\r\nfrom {{ ref('ds__outpatient_appointments') }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else appointment_start_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else appointment_start_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when coalesce({{ parameter('appointmentStatus') }}) is null then true\r\n else appointment_status in ({{ parameter('appointmentStatus') }})\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('appointmentTypeId') }} is null then true\r\n else appointment_type_id = {{ parameter('appointmentTypeId') }}\r\n end\r\norder by appointment_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__outpatient_appointments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.get_recurrence_description", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__outpatient_appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\outpatient-appointments-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n contact_number as \"Contact number\",\n village as \"Village\",\n billing_type as \"Billing type\",\n to_char(appointment_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment date and time\",\n to_char(appointment_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Appointment end date and time\",\n appointment_type as \"Appointment type\",\n appointment_status as \"Appointment status\",\n clinician as \"Clinician\",\n location_group as \"Area\",\n priority as \"Priority appointment\",\n case\n when schedule_id notnull then concat(\n concat(\n case when \"interval\" = 1 then\n case frequency\n when 'WEEKLY' then 'Weekly on a '\n when 'MONTHLY' then 'Monthly on the '\n end\n else concat('Every ', \"interval\",\n case frequency\n when 'WEEKLY' then ' weeks on '\n when 'MONTHLY' then ' months on the '\n end\n )\n end\n ),\n case nth_weekday\n when -1 then 'last '\n when 1 then 'first '\n when 2 then 'second '\n when 3 then 'third '\n when 4 then 'fourth ' \n else ''\n end,\n array_to_string(\n array(select case unnest_day\n when 'MO' then 'Monday'\n when 'TU' then 'Tuesday'\n when 'WE' then 'Wednesday'\n when 'TH' then 'Thursday'\n when 'FR' then 'Friday'\n when 'SA' then 'Saturday'\n when 'SU' then 'Sunday'\n else unnest_day\n end from unnest(days_of_week) as unnest_day),\n ', '\n )\n )\n else 'No'\n end as \"Repeating appointment\",\n to_char(until_date, 'YYYY-MM-DD') as \"Repeating appointment end date\",\n created_by as \"Appointment created by\"\nfrom \"app\".\"reporting\".\"ds__outpatient_appointments\"\nwhere case\n when nullif('2025-01-01', '')::date is null then true\n else appointment_start_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else appointment_start_datetime <= nullif('2025-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\n and\n case\n when coalesce(nullif('', '')::text) is null then true\n else appointment_status in (nullif('', '')::text)\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else appointment_type_id = nullif('', '')::text\n end\norder by appointment_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.patient-emergency-encounters-summary": {"database": "app", "schema": "reporting", "name": "patient-emergency-encounters-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\patient-emergency-encounters-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\patient-emergency-encounters-summary.sql", "unique_id": "model.tamanu_source_dbt.patient-emergency-encounters-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "patient-emergency-encounters-summary"], "alias": "patient-emergency-encounters-summary", "checksum": {"name": "sha256", "checksum": "b64149c4356fa28a51a69a80fb0e492614667acb241e6ec0dbc7ff02939c3c44"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.399405, "relation_name": "\"app\".\"reporting\".\"patient-emergency-encounters-summary\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n count(*) as \"{{ translate_label('triageRecordCount') }}\"\r\nfrom {{ ref('ds__encounters_emergency') }}\r\nwhere case\r\n when {{ parameter('patientId') }} is null then true\r\n else patient_id = {{ parameter('patientId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else triage_datetime >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else triage_datetime <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\ngroup by\r\n display_id,\r\n first_name,\r\n last_name,\r\n date_of_birth,\r\n sex,\r\n village,\r\n facility\r\norder by last_name, first_name, display_id", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__encounters_emergency", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__encounters_emergency"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\patient-emergency-encounters-summary.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n count(*) as \"Number of triage records\"\nfrom \"app\".\"reporting\".\"ds__encounters_emergency\"\nwhere case\n when nullif('', '')::text is null then true\n else patient_id = nullif('', '')::text\n end\n and\n case\n when nullif('2025-01-01', '')::date is null then true\n else triage_datetime >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else triage_datetime <= nullif('2025-01-31', '')::date\n end\ngroup by\n display_id,\n first_name,\n last_name,\n date_of_birth,\n sex,\n village,\n facility\norder by last_name, first_name, display_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.prescription-line-list": {"database": "app", "schema": "reporting", "name": "prescription-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\prescription-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\prescription-line-list.sql", "unique_id": "model.tamanu_source_dbt.prescription-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "prescription-line-list"], "alias": "prescription-line-list", "checksum": {"name": "sha256", "checksum": "25c01094972ed91c1f4ca2fe5df9f819a92bf85dff51b5117ba4bec1c50e90a9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4152634, "relation_name": "\"app\".\"reporting\".\"prescription-line-list\"", "raw_code": "select\r\n to_char(datetime, '{{ var(\"date_format\") }}') as \"{{ translate_label('prescriptionDate') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n is_selected_for_discharge as \"{{ translate_label('prescriptionSelectedForDischarge') }}\",\r\n medication_code as \"{{ translate_label('prescriptionMedicationCode') }}\",\r\n medication as \"{{ translate_label('prescriptionMedication') }}\",\r\n route as \"{{ translate_label('prescriptionRoute') }}\",\r\n quantity as \"{{ translate_label('prescriptionQuantity') }}\",\r\n repeats as \"{{ translate_label('prescriptionRepeats') }}\",\r\n is_ongoing as \"{{ translate_label('prescriptionIsOngoing') }}\",\r\n is_prn as \"{{ translate_label('prescriptionIsPRN') }}\",\r\n is_variable_dose as \"{{ translate_label('prescriptionIsVariableDose') }}\",\r\n dose_amount as \"{{ translate_label('prescriptionDoseAmount') }}\",\r\n units as \"{{ translate_label('prescriptionUnits') }}\",\r\n frequency as \"{{ translate_label('prescriptionFrequency') }}\"\r\nfrom {{ ref('ds__encounter_prescriptions') }}\r\nwhere\r\n case when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else datetime >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else datetime <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case when {{ parameter('facilityId') }} is null then true\r\n else {{ parameter('facilityId') }} = facility_id\r\n end\r\norder by datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__encounter_prescriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\prescription-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(datetime, 'YYYY-MM-DD') as \"Prescription date\",\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n is_selected_for_discharge as \"Prescription selected for discharge\",\n medication_code as \"Code\",\n medication as \"Medication\",\n route as \"Route\",\n quantity as \"Quantity\",\n repeats as \"Repeats\",\n is_ongoing as \"Is ongoing\",\n is_prn as \"Is PRN\",\n is_variable_dose as \"Is variable dose\",\n dose_amount as \"Dose amount\",\n units as \"Units\",\n frequency as \"Frequency\"\nfrom \"app\".\"reporting\".\"ds__encounter_prescriptions\"\nwhere\n case when nullif('2024-01-01', '')::date is null then true\n else datetime >= nullif('2024-01-01', '')::date\n end\n and case when nullif('2024-01-31', '')::date is null then true\n else datetime <= nullif('2024-01-31', '')::date\n end\n and case when nullif('', '')::text is null then true\n else nullif('', '')::text = facility_id\n end\norder by datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.procedures-line-list": {"database": "app", "schema": "reporting", "name": "procedures-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\procedures-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\procedures-line-list.sql", "unique_id": "model.tamanu_source_dbt.procedures-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "procedures-line-list"], "alias": "procedures-line-list", "checksum": {"name": "sha256", "checksum": "a8f217b6746c372235243072888e01118e7dc27bf3f076aa61e1868d1e501319"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4152634, "relation_name": "\"app\".\"reporting\".\"procedures-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n encounter_facility as \"{{ translate_label('facility') }}\",\r\n encounter_department as \"{{ translate_label('department') }}\",\r\n encounter_type as \"{{ translate_label('encounterType') }}\",\r\n to_char(encounter_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(encounter_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n procedure_facility as \"{{ translate_label('procedureFacility') }}\",\r\n procedure_area as \"{{ translate_label('procedureLocationGroup') }}\",\r\n procedure_location as \"{{ translate_label('procedureLocation') }}\",\r\n procedure_type as \"{{ translate_label('procedure') }}\",\r\n to_char(procedure_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('procedureDate') }}\",\r\n to_char(procedure_start_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('procedureStartDateTime') }}\",\r\n to_char(procedure_end_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('procedureEndDateTime') }}\",\r\n procedure_duration as \"{{ translate_label('procedureDuration') }}\",\r\n procedure_clinician as \"{{ translate_label('procedureClinician') }}\",\r\n procedure_anaesthetist as \"{{ translate_label('procedureAnaesthetist') }}\",\r\n procedure_assistant_anaesthetist as \"{{ translate_label('procedureAssistantAnaesthetist') }}\",\r\n is_completed as \"{{ translate_label('procedureIsCompleted') }}\",\r\n time_in as \"{{ translate_label('procedureTimeIn') }}\",\r\n time_out as \"{{ translate_label('procedureTimeOut') }}\"\r\nfrom {{ ref('ds__procedures') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else procedure_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else procedure_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else procedure_facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else encounter_department_id = {{ parameter('departmentId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else procedure_area_id = {{ parameter('locationGroupId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationId') }} is null then true\r\n else procedure_location_id = {{ parameter('locationId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else procedure_clinician_id = {{ parameter('clinicianId') }}\r\n end\r\norder by procedure_start_time", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__procedures", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\procedures-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n nationality as \"Nationality\",\n encounter_facility as \"Facility\",\n encounter_department as \"Department\",\n encounter_type as \"Type\",\n to_char(encounter_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(encounter_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n procedure_facility as \"Procedure facility\",\n procedure_area as \"Procedure area\",\n procedure_location as \"Procedure location\",\n procedure_type as \"Procedure\",\n to_char(procedure_date, 'YYYY-MM-DD') as \"Procedure date\",\n to_char(procedure_start_time, 'HH24:MI') as \"Procedure start (date and time)\",\n to_char(procedure_end_time, 'HH24:MI') as \"Procedure end (date and time)\",\n procedure_duration as \"Procedure duration\",\n procedure_clinician as \"Procedure clinician\",\n procedure_anaesthetist as \"Procedure anaesthetist\",\n procedure_assistant_anaesthetist as \"Procedure assistant anesthetist\",\n is_completed as \"Procedure marked as completed\",\n time_in as \"Procedure time in\",\n time_out as \"Procedure time out\"\nfrom \"app\".\"reporting\".\"ds__procedures\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else procedure_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else procedure_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else encounter_department_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_area_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_location_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else procedure_clinician_id = nullif('', '')::text\n end\norder by procedure_start_time", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program-registry-line-list": {"database": "app", "schema": "reporting", "name": "program-registry-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\program-registry-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\program-registry-line-list.sql", "unique_id": "model.tamanu_source_dbt.program-registry-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "program-registry-line-list"], "alias": "program-registry-line-list", "checksum": {"name": "sha256", "checksum": "52921a50021eb54514b007b4dc64b345df4cc59288c8ff6fe3e91711fe9c39d8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4311662, "relation_name": "\"app\".\"reporting\".\"program-registry-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n registering_facility as \"{{ translate_label('registryRegisteringFacility') }}\",\r\n subdivision as \"{{ translate_label('patientSubDivision') }}\",\r\n division as \"{{ translate_label('patientDivision') }}\",\r\n registered_by as \"{{ translate_label('registryRegisteredBy') }}\",\r\n currently_at as \"{{ translate_label('registryCurrentlyAt') }}\",\r\n related_conditions as \"{{ translate_label('registryConditions') }}\",\r\n related_condition_categories as \"{{ translate_label('registryConditionCategories') }}\",\r\n clinical_status as \"{{ translate_label('registryClinicalStatus') }}\",\r\n to_char(registration_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('registryRegisteredDate') }}\"\r\nfrom {{ ref('ds__patient_program_registrations') }}\r\nwhere registration_status = 'active'\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else registration_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else registration_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('registryId') }} is null then true\r\n else program_registry_id = {{ parameter('registryId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('subdivisionId') }} is null then true\r\n else subdivision_id = {{ parameter('subdivisionId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('divisionId') }} is null then true\r\n else division_id = {{ parameter('divisionId') }}\r\n end\r\norder by registration_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patient_program_registrations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\program-registry-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n registering_facility as \"Registering facility\",\n subdivision as \"Sub-division\",\n division as \"Division\",\n registered_by as \"Registered by\",\n currently_at as \"Currently at\",\n related_conditions as \"Related conditions\",\n related_condition_categories as \"Related condition categories\",\n clinical_status as \"Status\",\n to_char(registration_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date of registration\"\nfrom \"app\".\"reporting\".\"ds__patient_program_registrations\"\nwhere registration_status = 'active'\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else registration_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else registration_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else program_registry_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else subdivision_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else division_id = nullif('', '')::text\n end\norder by registration_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.program-registry-removed-patients-line-list": {"database": "app", "schema": "reporting", "name": "program-registry-removed-patients-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\program-registry-removed-patients-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\program-registry-removed-patients-line-list.sql", "unique_id": "model.tamanu_source_dbt.program-registry-removed-patients-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "program-registry-removed-patients-line-list"], "alias": "program-registry-removed-patients-line-list", "checksum": {"name": "sha256", "checksum": "382958e536e1de88a622be873ec1ace0ccb6a6b22104d8e441b4ed828094e4ef"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4402058, "relation_name": "\"app\".\"reporting\".\"program-registry-removed-patients-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n registering_facility as \"{{ translate_label('registryRegisteringFacility') }}\",\r\n registered_by as \"{{ translate_label('registryRegisteredBy') }}\",\r\n currently_at as \"{{ translate_label('registryCurrentlyAt') }}\",\r\n related_conditions as \"{{ translate_label('registryConditions') }}\",\r\n related_condition_categories as \"{{ translate_label('registryConditionCategories') }}\",\r\n clinical_status as \"{{ translate_label('registryClinicalStatus') }}\",\r\n to_char(registration_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('registryRegisteredDate') }}\",\r\n to_char(deactivated_datetime::date, '{{ var(\"date_format\") }}') as \"{{ translate_label('registryDeactivatedDate') }}\",\r\n deactivated_by as \"{{ translate_label('registryDeactivatedBy') }}\"\r\nfrom {{ ref('ds__patient_program_registrations') }}\r\nwhere registration_status != 'active'\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }} is null then true\r\n else deactivated_datetime\r\n >= {{ parameter('fromDate', default_value='2025-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2025-01-31', data_type='date') }} is null then true\r\n else deactivated_datetime\r\n <= {{ parameter('toDate', default_value='2025-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('registryId') }} is null then true\r\n else program_registry_id = {{ parameter('registryId') }}\r\n end\r\norder by deactivated_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patient_program_registrations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\program-registry-removed-patients-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n village as \"Village\",\n registering_facility as \"Registering facility\",\n registered_by as \"Registered by\",\n currently_at as \"Currently at\",\n related_conditions as \"Related conditions\",\n related_condition_categories as \"Related condition categories\",\n clinical_status as \"Status\",\n to_char(registration_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date of registration\",\n to_char(deactivated_datetime::date, 'YYYY-MM-DD') as \"Date of deactivation\",\n deactivated_by as \"Deactivated by\"\nfrom \"app\".\"reporting\".\"ds__patient_program_registrations\"\nwhere registration_status != 'active'\n and\n case\n when nullif('2025-01-01', '')::date is null then true\n else deactivated_datetime\n >= nullif('2025-01-01', '')::date\n end\n and\n case\n when nullif('2025-01-31', '')::date is null then true\n else deactivated_datetime\n <= nullif('2025-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else program_registry_id = nullif('', '')::text\n end\norder by deactivated_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.recent-diagnoses-line-list": {"database": "app", "schema": "reporting", "name": "recent-diagnoses-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\recent-diagnoses-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\recent-diagnoses-line-list.sql", "unique_id": "model.tamanu_source_dbt.recent-diagnoses-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "recent-diagnoses-line-list"], "alias": "recent-diagnoses-line-list", "checksum": {"name": "sha256", "checksum": "435d94e50d8519502b673b26e18653a190bef7b147294bc7072067bc9907083e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4472396, "relation_name": "\"app\".\"reporting\".\"recent-diagnoses-line-list\"", "raw_code": "select\r\n to_char(diagnosis_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('diagnosisDateTime') }}\",\r\n diagnosis as \"{{ translate_label('diagnoses') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n contact_number as \"{{ translate_label('patientPrimaryContactNumber') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n clinician as \"{{ translate_label('encounterClinician') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n certainty as \"{{ translate_label('diagnosisCertainty') }}\",\r\n is_primary as \"{{ translate_label('diagnosisIsPrimary') }}\"\r\nfrom {{ ref('ds__diagnoses') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else diagnosis_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else diagnosis_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('clinicianId') }} is null then true\r\n else clinician_id = {{ parameter('clinicianId') }}\r\n end\r\n and\r\n case when\r\n coalesce({{ parameter('diagnosisId') }}, {{ parameter('diagnosis2Id') }}, {{ parameter('diagnosis3Id') }}, {{ parameter('diagnosis4Id') }}, {{ parameter('diagnosis5Id') }}) is null\r\n then true\r\n else diagnosis_id in (\r\n {{ parameter('diagnosisId') }},\r\n {{ parameter('diagnosis2Id') }},\r\n {{ parameter('diagnosis3Id') }},\r\n {{ parameter('diagnosis4Id') }},\r\n {{ parameter('diagnosis5Id') }}\r\n )\r\n end\r\norder by diagnosis_datetime desc", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__diagnoses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\recent-diagnoses-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(diagnosis_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Date & time\",\n diagnosis as \"Diagnoses\",\n first_name as \"First name\",\n last_name as \"Last name\",\n display_id as \"Patient ID\",\n age as \"Age\",\n sex as \"Sex\",\n contact_number as \"Primary contact number\",\n village as \"Village\",\n clinician as \"Clinician\",\n department as \"Department\",\n certainty as \"Certainty\",\n is_primary as \"Is primary\"\nfrom \"app\".\"reporting\".\"ds__diagnoses\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else diagnosis_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else diagnosis_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else clinician_id = nullif('', '')::text\n end\n and\n case when\n coalesce(nullif('', '')::text, nullif('', '')::text, nullif('', '')::text, nullif('', '')::text, nullif('', '')::text) is null\n then true\n else diagnosis_id in (\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text,\n nullif('', '')::text\n )\n end\norder by diagnosis_datetime desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.registered-births-line-list": {"database": "app", "schema": "reporting", "name": "registered-births-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\registered-births-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\registered-births-line-list.sql", "unique_id": "model.tamanu_source_dbt.registered-births-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "registered-births-line-list"], "alias": "registered-births-line-list", "checksum": {"name": "sha256", "checksum": "5b9604be523ab8c8e5a9927007b8252dec6da785002cf3e4af05072e6f27495e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4472396, "relation_name": "\"app\".\"reporting\".\"registered-births-line-list\"", "raw_code": "select\r\n to_char(registration_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('birthRegisteredDateTime') }}\",\r\n registered_by as \"{{ translate_label('birthRegisteredBy') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n ethnicity as \"{{ translate_label('patientEthnicity') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n mother as \"{{ translate_label('patientMother') }}\",\r\n father as \"{{ translate_label('patientFather') }}\",\r\n to_char(birth_time, '{{ var(\"time_format\") }}') as \"{{ translate_label('birthTimeOfBirth') }}\",\r\n gestational_age_estimate as \"{{ translate_label('birthGestationalAgeEstimate') }}\",\r\n registered_birth_place as \"{{ translate_label('patientPlaceOfBirth') }}\",\r\n birth_facility as \"{{ translate_label('birthFacility') }}\",\r\n attendant_at_birth as \"{{ translate_label('birthAttendantType') }}\",\r\n name_of_attendant_at_birth as \"{{ translate_label('birthAttendant') }}\",\r\n birth_delivery_type as \"{{ translate_label('birthDeliveryType') }}\",\r\n birth_type as \"{{ translate_label('birthType') }}\",\r\n birth_weight as \"{{ translate_label('birthWeight') }}\",\r\n birth_length as \"{{ translate_label('birthLength') }}\",\r\n apgar_score_one_minute as \"{{ translate_label('birthApgarScoreOneMinute') }}\",\r\n apgar_score_five_minutes as \"{{ translate_label('birthApgarScoreFiveMinutes') }}\",\r\n apgar_score_ten_minutes as \"{{ translate_label('birthApgarScoreTenMinutes') }}\"\r\nfrom {{ ref(\"ds__births\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else date_of_birth >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else date_of_birth <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else birth_facility_id = {{ parameter('facilityId') }}\r\n end\r\norder by date_of_birth, birth_time", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__births", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__births"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\registered-births-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(registration_date, 'YYYY-MM-DD') as \"Registration date\",\n registered_by as \"Registered by\",\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n sex as \"Sex\",\n ethnicity as \"Ethnicity\",\n nationality as \"Nationality\",\n village as \"Village\",\n mother as \"Mother\",\n father as \"Father\",\n to_char(birth_time, 'HH24:MI') as \"Time of birth\",\n gestational_age_estimate as \"Gestational age (weeks)\",\n registered_birth_place as \"Place of birth\",\n birth_facility as \"Name of health facility (if selected)\",\n attendant_at_birth as \"Attendant at birth\",\n name_of_attendant_at_birth as \"Name of attendant\",\n birth_delivery_type as \"Delivery type\",\n birth_type as \"Single/Plural birth\",\n birth_weight as \"Birth weight (kg)\",\n birth_length as \"Birth length (cm)\",\n apgar_score_one_minute as \"Apgar score at 1 min\",\n apgar_score_five_minutes as \"Apgar score at 5 min\",\n apgar_score_ten_minutes as \"Apgar score at 10 min\"\nfrom \"app\".\"reporting\".\"ds__births\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else date_of_birth >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else date_of_birth <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else birth_facility_id = nullif('', '')::text\n end\norder by date_of_birth, birth_time", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.registered-patients-by-dob-line-list": {"database": "app", "schema": "reporting", "name": "registered-patients-by-dob-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\registered-patients-by-dob-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\registered-patients-by-dob-line-list.sql", "unique_id": "model.tamanu_source_dbt.registered-patients-by-dob-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "registered-patients-by-dob-line-list"], "alias": "registered-patients-by-dob-line-list", "checksum": {"name": "sha256", "checksum": "cf39873c1fc9f6a0a76587011922808df503e6f1e2f522082b6edd364b8b722b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4631984, "relation_name": "\"app\".\"reporting\".\"registered-patients-by-dob-line-list\"", "raw_code": "select\r\n to_char(registration_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientRegistrationDate') }}\",\r\n registered_by as \"{{ translate_label('patientRegisteredBy') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n middle_name as \"{{ translate_label('patientMiddleName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n cultural_name as \"{{ translate_label('patientCulturalName') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n registration_type as \"{{ translate_label('patientRegistrationType') }}\",\r\n birth_certificate as \"{{ translate_label('patientBirthCertificate') }}\",\r\n driving_license as \"{{ translate_label('patientDrivingLicense') }}\",\r\n passport as \"{{ translate_label('patientPassport') }}\",\r\n blood_type as \"{{ translate_label('patientBloodType') }}\",\r\n title as \"{{ translate_label('patientTitle') }}\",\r\n marital_status as \"{{ translate_label('patientMaritalStatus') }}\",\r\n primary_contact_number as \"{{ translate_label('patientPrimaryContactNumber') }}\", -- noqa:disable=LT05\r\n secondary_contact_number as \"{{ translate_label('patientSecondaryContactNumber') }}\", -- noqa:disable=LT05\r\n country_of_birth as \"{{ translate_label('patientCountryOfBirth') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n ethnicity as \"{{ translate_label('patientEthnicity') }}\",\r\n occupation as \"{{ translate_label('patientOccupation') }}\",\r\n religion as \"{{ translate_label('patientReligion') }}\",\r\n patient_billing_type as \"{{ translate_label('patientBillingType') }}\"\r\nfrom {{ ref(\"ds__patients\") }}\r\nwhere case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else date_of_birth >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else date_of_birth <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by date_of_birth, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\registered-patients-by-dob-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(registration_date, 'YYYY-MM-DD') as \"Registration date\",\n registered_by as \"Registered by\",\n first_name as \"First name\",\n middle_name as \"Middle name\",\n last_name as \"Last name\",\n cultural_name as \"Cultural name\",\n display_id as \"Patient ID\",\n sex as \"Sex\",\n village as \"Village\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n registration_type as \"Registration type\",\n birth_certificate as \"Birth certificate\",\n driving_license as \"Driving license\",\n passport as \"Passport\",\n blood_type as \"Blood type\",\n title as \"Title\",\n marital_status as \"Marital status\",\n primary_contact_number as \"Primary contact number\", -- noqa:disable=LT05\n secondary_contact_number as \"Secondary contact number\", -- noqa:disable=LT05\n country_of_birth as \"Country of birth\",\n nationality as \"Nationality\",\n ethnicity as \"Ethnicity\",\n occupation as \"Occupation\",\n religion as \"Religion\",\n patient_billing_type as \"Billing type\"\nfrom \"app\".\"reporting\".\"ds__patients\"\nwhere case\n when nullif('2024-01-01', '')::date is null then true\n else date_of_birth >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else date_of_birth <= nullif('2024-01-31', '')::date\n end\norder by date_of_birth, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.registered-patients-daily-summary": {"database": "app", "schema": "reporting", "name": "registered-patients-daily-summary", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\registered-patients-daily-summary.sql", "original_file_path": "models\\reports\\sql\\standard\\registered-patients-daily-summary.sql", "unique_id": "model.tamanu_source_dbt.registered-patients-daily-summary", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "registered-patients-daily-summary"], "alias": "registered-patients-daily-summary", "checksum": {"name": "sha256", "checksum": "7d3032f5d17623bf33e3fcb5c17d6c71c0fcc95b4bf6c2a92fadbf0674880a1d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4631984, "relation_name": "\"app\".\"reporting\".\"registered-patients-daily-summary\"", "raw_code": "select\r\n to_char(registration_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientRegistrationDate') }}\",\r\n count(\r\n case when sex = 'Male' then 1 end\r\n ) as \"{{ translate_label('patientMaleCount') }}\",\r\n count(\r\n case when sex = 'Female' then 1 end\r\n ) as \"{{ translate_label('patientFemaleCount') }}\"\r\nfrom {{ ref(\"ds__patients\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else registration_date >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else registration_date <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\ngroup by registration_date", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\registered-patients-daily-summary.sql", "compiled": true, "compiled_code": "select\n to_char(registration_date, 'YYYY-MM-DD') as \"Registration date\",\n count(\n case when sex = 'Male' then 1 end\n ) as \"Total patients (male)\",\n count(\n case when sex = 'Female' then 1 end\n ) as \"Total patients (female)\"\nfrom \"app\".\"reporting\".\"ds__patients\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else registration_date >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else registration_date <= nullif('2024-01-31', '')::date\n end\ngroup by registration_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.registered-patients-line-list": {"database": "app", "schema": "reporting", "name": "registered-patients-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\registered-patients-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\registered-patients-line-list.sql", "unique_id": "model.tamanu_source_dbt.registered-patients-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "registered-patients-line-list"], "alias": "registered-patients-line-list", "checksum": {"name": "sha256", "checksum": "154918e6a44ae56338f8800ce4f1f6f13559b7078a799f0390a3128ae81d1182"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4631984, "relation_name": "\"app\".\"reporting\".\"registered-patients-line-list\"", "raw_code": "select\r\n to_char(registration_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientRegistrationDate') }}\",\r\n registered_by as \"{{ translate_label('patientRegisteredBy') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n middle_name as \"{{ translate_label('patientMiddleName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n cultural_name as \"{{ translate_label('patientCulturalName') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n birth_certificate as \"{{ translate_label('patientBirthCertificate') }}\",\r\n driving_license as \"{{ translate_label('patientDrivingLicense') }}\",\r\n passport as \"{{ translate_label('patientPassport') }}\",\r\n blood_type as \"{{ translate_label('patientBloodType') }}\",\r\n title as \"{{ translate_label('patientTitle') }}\",\r\n marital_status as \"{{ translate_label('patientMaritalStatus') }}\",\r\n primary_contact_number as \"{{ translate_label('patientPrimaryContactNumber') }}\", -- noqa:disable=LT05\r\n secondary_contact_number as \"{{ translate_label('patientSecondaryContactNumber') }}\", -- noqa:disable=LT05\r\n country_of_birth as \"{{ translate_label('patientCountryOfBirth') }}\",\r\n nationality as \"{{ translate_label('patientNationality') }}\",\r\n ethnicity as \"{{ translate_label('patientEthnicity') }}\",\r\n occupation as \"{{ translate_label('patientOccupation') }}\",\r\n religion as \"{{ translate_label('patientReligion') }}\",\r\n patient_billing_type as \"{{ translate_label('patientBillingType') }}\"\r\nfrom {{ ref(\"ds__patients\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else registration_date >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else registration_date <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\norder by registration_date", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patients", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\registered-patients-line-list.sql", "compiled": true, "compiled_code": "select\n to_char(registration_date, 'YYYY-MM-DD') as \"Registration date\",\n registered_by as \"Registered by\",\n first_name as \"First name\",\n middle_name as \"Middle name\",\n last_name as \"Last name\",\n cultural_name as \"Cultural name\",\n display_id as \"Patient ID\",\n sex as \"Sex\",\n village as \"Village\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n birth_certificate as \"Birth certificate\",\n driving_license as \"Driving license\",\n passport as \"Passport\",\n blood_type as \"Blood type\",\n title as \"Title\",\n marital_status as \"Marital status\",\n primary_contact_number as \"Primary contact number\", -- noqa:disable=LT05\n secondary_contact_number as \"Secondary contact number\", -- noqa:disable=LT05\n country_of_birth as \"Country of birth\",\n nationality as \"Nationality\",\n ethnicity as \"Ethnicity\",\n occupation as \"Occupation\",\n religion as \"Religion\",\n patient_billing_type as \"Billing type\"\nfrom \"app\".\"reporting\".\"ds__patients\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else registration_date >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else registration_date <= nullif('2024-01-31', '')::date\n end\norder by registration_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.upcoming-vaccinations-line-list": {"database": "app", "schema": "reporting", "name": "upcoming-vaccinations-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\upcoming-vaccinations-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\upcoming-vaccinations-line-list.sql", "unique_id": "model.tamanu_source_dbt.upcoming-vaccinations-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "upcoming-vaccinations-line-list"], "alias": "upcoming-vaccinations-line-list", "checksum": {"name": "sha256", "checksum": "77ab59d5f067cd4bafb635437e135e1e3d47d06bfc4344684cb2fedf32c63515"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4789193, "relation_name": "\"app\".\"reporting\".\"upcoming-vaccinations-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n to_char(due_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDueDate') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\"\r\nfrom {{ ref(\"ds__patient_vaccinations_upcoming\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else date_of_birth >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else date_of_birth <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('status') }} is null then true\r\n else vaccine_status = {{ parameter('status') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\norder by due_date, last_name, first_name, vaccine_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__patient_vaccinations_upcoming", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__patient_vaccinations_upcoming"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\upcoming-vaccinations-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n village as \"Village\",\n age as \"Age\",\n sex as \"Sex\",\n to_char(due_date, 'YYYY-MM-DD') as \"Vaccination due date\",\n vaccine_name as \"Vaccine name\",\n vaccine_schedule as \"Schedule\",\n vaccine_status as \"Vaccine status\"\nfrom \"app\".\"reporting\".\"ds__patient_vaccinations_upcoming\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else date_of_birth >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else date_of_birth <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_status = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\norder by due_date, last_name, first_name, vaccine_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.usage-quality-metrics-patient-details": {"database": "app", "schema": "reporting", "name": "usage-quality-metrics-patient-details", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\usage-quality-metrics-patient-details.sql", "original_file_path": "models\\reports\\sql\\standard\\usage-quality-metrics-patient-details.sql", "unique_id": "model.tamanu_source_dbt.usage-quality-metrics-patient-details", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "usage-quality-metrics-patient-details"], "alias": "usage-quality-metrics-patient-details", "checksum": {"name": "sha256", "checksum": "89601d74e18959b0d3a9a8127f4f88ce8a48db0e093d4779ae5aaee8a112db1a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4789193, "relation_name": "\"app\".\"reporting\".\"usage-quality-metrics-patient-details\"", "raw_code": "select\r\n total_patients as \"{{ translate_label('patientTotal') }}\",\r\n total_patients_with_incomplete_name as \"{{ translate_label('patientTotalWithIncompleteName') }}\",\r\n total_patients_with_missing_dob as \"{{ translate_label('patientTotalWithMissingDateOfBirth') }}\",\r\n total_patients_with_invalid_dob as \"{{ translate_label('patientTotalWithInvalidDateOfBirth') }}\",\r\n total_patients_with_missing_location as \"{{ translate_label('patientTotalWithMissingLocation') }}\",\r\n total_patients_with_missing_contact as \"{{ translate_label('patientTotalWithMissingContact') }}\",\r\n total_patients_merged as \"{{ translate_label('patientTotalMerged') }}\"\r\nfrom {{ ref(\"ds__usage_quality_metrics_patient_details\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__usage_quality_metrics_patient_details", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label"], "nodes": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\usage-quality-metrics-patient-details.sql", "compiled": true, "compiled_code": "select\n total_patients as \"Total patients\",\n total_patients_with_incomplete_name as \"Total patients with incomplete name\",\n total_patients_with_missing_dob as \"Total patients with missing date of birth\",\n total_patients_with_invalid_dob as \"Total patients with invalid date of birth\",\n total_patients_with_missing_location as \"Total patients with missing location\",\n total_patients_with_missing_contact as \"Total patients with missing contact\",\n total_patients_merged as \"Total patients merged\"\nfrom \"app\".\"reporting\".\"ds__usage_quality_metrics_patient_details\"", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations": {"database": "app", "schema": "reporting", "name": "usage-quality-metrics-patient-registrations", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\usage-quality-metrics-patient-registrations.sql", "original_file_path": "models\\reports\\sql\\standard\\usage-quality-metrics-patient-registrations.sql", "unique_id": "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "usage-quality-metrics-patient-registrations"], "alias": "usage-quality-metrics-patient-registrations", "checksum": {"name": "sha256", "checksum": "e5188b8a82a43eb74feb139fe9a29eecff799d6cd4605f194d2465bbc59fd967"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4948938, "relation_name": "\"app\".\"reporting\".\"usage-quality-metrics-patient-registrations\"", "raw_code": "select\r\n registration_date as \"{{ translate_label('patientRegistrationDate') }}\",\r\n total_patient_registrations as \"{{ translate_label('patientTotalPatientRegistrations') }}\",\r\n total_birth_registrations as \"{{ translate_label('patientTotalBirthRegistrations') }}\",\r\n total_incorrect_registrations_for_patient_under_6mth as \"{{ translate_label('patientTotalIncorrectRegistrationsForAgedUnder6Months') }}\"\r\nfrom {{ ref(\"ds__usage_quality_metrics_patient_registrations\") }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else registration_date >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else registration_date <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__usage_quality_metrics_patient_registrations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\usage-quality-metrics-patient-registrations.sql", "compiled": true, "compiled_code": "select\n registration_date as \"Registration date\",\n total_patient_registrations as \"Total patient registrations\",\n total_birth_registrations as \"Total birth registrations\",\n total_incorrect_registrations_for_patient_under_6mth as \"Total incorrect registrations for aged under 6 months\"\nfrom \"app\".\"reporting\".\"ds__usage_quality_metrics_patient_registrations\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else registration_date >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else registration_date <= nullif('2024-01-31', '')::date\n end", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.user-audit-line-list": {"database": "app", "schema": "reporting", "name": "user-audit-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\user-audit-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\user-audit-line-list.sql", "unique_id": "model.tamanu_source_dbt.user-audit-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "user-audit-line-list"], "alias": "user-audit-line-list", "checksum": {"name": "sha256", "checksum": "244ac39ab43145a9160c972340e0de7ab4f98576df81920ed0d14ac8de4d6d45"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.4948938, "relation_name": "\"app\".\"reporting\".\"user-audit-line-list\"", "raw_code": "select\r\n user_name as \"{{ translate_label('userName') }}\",\r\n user_role as \"{{ translate_label('userRole') }}\",\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n patient_category as \"{{ translate_label('patientCategory') }}\",\r\n triage_category as \"{{ translate_label('triageCategory') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(encounter_start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(encounter_end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n to_char(first_note_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('noteStartDateTime') }}\",\r\n to_char(last_note_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('noteEndDateTime') }}\",\r\n is_discharged as \"{{ translate_label('encounterIsDischarged') }}\",\r\n non_discharge_by_clinicians as \"{{ translate_label('encounterNonDischargeClinician') }}\"\r\nfrom {{ ref('ds__user_audit') }}\r\nwhere\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else encounter_start_datetime\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else encounter_start_datetime\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else department_id = {{ parameter('departmentId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else location_group_id = {{ parameter('locationGroupId') }}\r\n end\r\norder by encounter_start_datetime", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__user_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__user_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\user-audit-line-list.sql", "compiled": true, "compiled_code": "select\n user_name as \"User name\",\n user_role as \"User role\",\n display_id as \"Patient ID\",\n patient_category as \"Patient category\",\n triage_category as \"Triage category\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(encounter_start_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter start date and time\",\n to_char(encounter_end_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Encounter end date and time\",\n to_char(first_note_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Notes start date and time\",\n to_char(last_note_datetime, 'YYYY-MM-DD HH24:MI:SS') as \"Notes end date and time\",\n is_discharged as \"Discharges (has the patient been discharged)\",\n non_discharge_by_clinicians as \"Non-discharge by clinicians\"\nfrom \"app\".\"reporting\".\"ds__user_audit\"\nwhere\n case\n when nullif('2024-01-01', '')::date is null then true\n else encounter_start_datetime\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else encounter_start_datetime\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else department_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else location_group_id = nullif('', '')::text\n end\norder by encounter_start_datetime", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine-audit-line-list": {"database": "app", "schema": "reporting", "name": "vaccine-audit-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\vaccine-audit-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\vaccine-audit-line-list.sql", "unique_id": "model.tamanu_source_dbt.vaccine-audit-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "vaccine-audit-line-list"], "alias": "vaccine-audit-line-list", "checksum": {"name": "sha256", "checksum": "543890829e39869f611088dbd1073f3ecd0a2afeaea4c4ca539ce3bdfe4f0193"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.5109434, "relation_name": "\"app\".\"reporting\".\"vaccine-audit-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n to_char(vaccination_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDate') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_brand as \"{{ translate_label('vaccineBrand') }}\",\r\n disease as \"{{ translate_label('vaccineDisease') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n given_by as \"{{ translate_label('vaccinationGivenBy') }}\",\r\n recorded_by as \"{{ translate_label('vaccinationRecordedBy') }}\",\r\n modified_by as \"{{ translate_label('vaccinationModifiedBy') }}\",\r\n to_char(updated_at, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('vaccinationModifiedDate') }}\"\r\nfrom {{ ref(\"ds__vaccinations\") }}\r\nwhere\r\n vaccine_status in ('Recorded in error', 'Historical')\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else vaccination_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else vaccination_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('status') }} is null then true\r\n else vaccine_status = {{ parameter('status') }}\r\n end\r\norder by vaccination_date, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\vaccine-audit-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n to_char(vaccination_date, 'YYYY-MM-DD') as \"Vaccination date\",\n vaccine_name as \"Vaccine name\",\n vaccine_brand as \"If category of Other, Vaccine brand\",\n disease as \"If category of Other, Disease\",\n vaccine_status as \"Vaccine status\",\n vaccine_schedule as \"Schedule\",\n given_by as \"Given by\",\n recorded_by as \"Recorded by\",\n modified_by as \"Record modified by\",\n to_char(updated_at, 'YYYY-MM-DD HH24:MI:SS') as \"Record modification date\"\nfrom \"app\".\"reporting\".\"ds__vaccinations\"\nwhere\n vaccine_status in ('Recorded in error', 'Historical')\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else vaccination_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else vaccination_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_status = nullif('', '')::text\n end\norder by vaccination_date, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.tamanu_source_dbt.vaccine-line-list": {"database": "app", "schema": "reporting", "name": "vaccine-line-list", "resource_type": "model", "package_name": "tamanu_source_dbt", "path": "reports\\sql\\standard\\vaccine-line-list.sql", "original_file_path": "models\\reports\\sql\\standard\\vaccine-line-list.sql", "unique_id": "model.tamanu_source_dbt.vaccine-line-list", "fqn": ["tamanu_source_dbt", "reports", "sql", "standard", "vaccine-line-list"], "alias": "vaccine-line-list", "checksum": {"name": "sha256", "checksum": "381751f5880c4c39ed7abcb8d931cd66c97372c48e6b6b3955f5bd26222adbee"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["reports"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": ["reports"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "tags": ["reports"]}, "created_at": 1782423651.5109434, "relation_name": "\"app\".\"reporting\".\"vaccine-line-list\"", "raw_code": "select\r\n display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n first_name as \"{{ translate_label('patientFirstName') }}\",\r\n last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n age as \"{{ translate_label('patientAge') }}\",\r\n sex as \"{{ translate_label('patientSex') }}\",\r\n village as \"{{ translate_label('patientVillage') }}\",\r\n facility as \"{{ translate_label('facility') }}\",\r\n department as \"{{ translate_label('department') }}\",\r\n location_group as \"{{ translate_label('locationGroup') }}\",\r\n location as \"{{ translate_label('location') }}\",\r\n to_char(vaccination_date, '{{ var(\"date_format\") }}') as \"{{ translate_label('vaccinationDate') }}\",\r\n vaccine_category as \"{{ translate_label('vaccineCategory') }}\",\r\n vaccine_name as \"{{ translate_label('vaccineName') }}\",\r\n vaccine_brand as \"{{ translate_label('vaccineBrand') }}\",\r\n disease as \"{{ translate_label('vaccineDisease') }}\",\r\n vaccine_status as \"{{ translate_label('vaccinationStatus') }}\",\r\n vaccine_schedule as \"{{ translate_label('vaccineSchedule') }}\",\r\n batch as \"{{ translate_label('vaccinationBatch') }}\",\r\n given_by as \"{{ translate_label('vaccinationGivenBy') }}\",\r\n recorded_by as \"{{ translate_label('vaccinationRecordedBy') }}\",\r\n circumstances as \"{{ translate_label('vaccinationGivenElseWhereCircumstances') }}\",\r\n given_elsewhere_by as \"{{ translate_label('vaccinationGivenElsewhereCountry') }}\",\r\n not_given_clinician as \"{{ translate_label('vaccinationNotGivenClinician') }}\",\r\n not_given_reason as \"{{ translate_label('vaccinationNotGivenReason') }}\"\r\nfrom {{ ref(\"ds__vaccinations\") }}\r\nwhere\r\n vaccine_status in ('Given', 'Not Given')\r\n and\r\n case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else vaccination_date\r\n >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else vaccination_date\r\n <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('villageId') }} is null then true\r\n else village_id = {{ parameter('villageId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('facilityId') }} is null then true\r\n else facility_id = {{ parameter('facilityId') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('category') }} is null then true\r\n else vaccine_category = {{ parameter('category') }}\r\n end\r\n and\r\n case\r\n when {{ parameter('vaccine') }} is null then true\r\n else vaccine_name = {{ parameter('vaccine') }}\r\n end\r\norder by vaccination_date, last_name, first_name", "doc_blocks": [], "language": "sql", "refs": [{"name": "ds__vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.tamanu_source_dbt.translate_label", "macro.tamanu_source_dbt.parameter"], "nodes": ["model.tamanu_source_dbt.ds__vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\reports\\sql\\standard\\vaccine-line-list.sql", "compiled": true, "compiled_code": "select\n display_id as \"Patient ID\",\n first_name as \"First name\",\n last_name as \"Last name\",\n to_char(date_of_birth, 'YYYY-MM-DD') as \"Date of birth\",\n age as \"Age\",\n sex as \"Sex\",\n village as \"Village\",\n facility as \"Facility\",\n department as \"Department\",\n location_group as \"Area\",\n location as \"Location\",\n to_char(vaccination_date, 'YYYY-MM-DD') as \"Vaccination date\",\n vaccine_category as \"Vaccine category\",\n vaccine_name as \"Vaccine name\",\n vaccine_brand as \"If category of Other, Vaccine brand\",\n disease as \"If category of Other, Disease\",\n vaccine_status as \"Vaccine status\",\n vaccine_schedule as \"Schedule\",\n batch as \"Batch\",\n given_by as \"Given by\",\n recorded_by as \"Recorded by\",\n circumstances as \"If given elsewhere, Circumstances\",\n given_elsewhere_by as \"If given elsewhere, Country\",\n not_given_clinician as \"If not given, Supervising clinician\",\n not_given_reason as \"If not given, Reason not given\"\nfrom \"app\".\"reporting\".\"ds__vaccinations\"\nwhere\n vaccine_status in ('Given', 'Not Given')\n and\n case\n when nullif('2024-01-01', '')::date is null then true\n else vaccination_date\n >= nullif('2024-01-01', '')::date\n end\n and\n case\n when nullif('2024-01-31', '')::date is null then true\n else vaccination_date\n <= nullif('2024-01-31', '')::date\n end\n and\n case\n when nullif('', '')::text is null then true\n else village_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else facility_id = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_category = nullif('', '')::text\n end\n and\n case\n when nullif('', '')::text is null then true\n else vaccine_name = nullif('', '')::text\n end\norder by vaccination_date, last_name, first_name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.tamanu_source_dbt.logical__ds__admissions": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__admissions", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__admissions.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__admissions.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__admissions", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__admissions"], "alias": "logical__ds__admissions", "checksum": {"name": "sha256", "checksum": "6cbc32741ad544b52471e759e543e9e6124749a6ebd67b9ae6f66c3a12cfe103"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.5925946, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_admissions\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n and e.encounter_type = 'admission'\r\n),\r\ndataset as (\r\n select count(*) as total_admissions\r\n from {{ ref('ds__admissions') }}\r\n)\r\nselect base.total_admissions as base_total_admissions,\r\n dataset.total_admissions as dataset_total_admissions\r\nfrom base\r\njoin dataset on dataset.total_admissions != base.total_admissions", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__admissions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__admissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__admissions.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_admissions\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n and e.encounter_type = 'admission'\n),\ndataset as (\n select count(*) as total_admissions\n from \"app\".\"reporting\".\"ds__admissions\"\n)\nselect base.total_admissions as base_total_admissions,\n dataset.total_admissions as dataset_total_admissions\nfrom base\njoin dataset on dataset.total_admissions != base.total_admissions", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__diagnoses": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__diagnoses", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__diagnoses.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__diagnoses.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__diagnoses", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__diagnoses"], "alias": "logical__ds__diagnoses", "checksum": {"name": "sha256", "checksum": "1381d6a4641a4f7b37a57396787d4c2d1409acd59229ef66cc430655a9d094d2"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.5995991, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_diagnoses\r\n from {{ ref('encounter_diagnoses') }} ed\r\n join {{ ref('encounters') }} e\r\n on e.id = ed.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_diagnoses\r\n from {{ ref('ds__diagnoses') }}\r\n)\r\nselect base.total_diagnoses as base_total_diagnoses,\r\n dataset.total_diagnoses as dataset_total_diagnoses\r\nfrom base\r\njoin dataset on dataset.total_diagnoses != base.total_diagnoses", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__diagnoses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__diagnoses.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_diagnoses\n from \"app\".\"reporting\".\"encounter_diagnoses\" ed\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = ed.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_diagnoses\n from \"app\".\"reporting\".\"ds__diagnoses\"\n)\nselect base.total_diagnoses as base_total_diagnoses,\n dataset.total_diagnoses as dataset_total_diagnoses\nfrom base\njoin dataset on dataset.total_diagnoses != base.total_diagnoses", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__encounters_emergency": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__encounters_emergency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__encounters_emergency.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__encounters_emergency.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__encounters_emergency", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__encounters_emergency"], "alias": "logical__ds__encounters_emergency", "checksum": {"name": "sha256", "checksum": "7029453522360970b2fdf3f42b90de15515e07ad20e9705fb2b9e8372a661dc1"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.601599, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_encounters\r\n from {{ ref('triages') }} t\r\n),\r\ndataset as (\r\n select count(*) as total_encounters\r\n from {{ ref('ds__encounters_emergency') }}\r\n)\r\nselect base.total_encounters as base_total_encounters,\r\n dataset.total_encounters as dataset_total_encounters\r\nfrom base\r\njoin dataset on dataset.total_encounters != base.total_encounters", "doc_blocks": [], "language": "sql", "refs": [{"name": "triages", "package": null, "version": null}, {"name": "ds__encounters_emergency", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.ds__encounters_emergency"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__encounters_emergency.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"triages\" t\n),\ndataset as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"ds__encounters_emergency\"\n)\nselect base.total_encounters as base_total_encounters,\n dataset.total_encounters as dataset_total_encounters\nfrom base\njoin dataset on dataset.total_encounters != base.total_encounters", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__encounter_diets": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__encounter_diets", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__encounter_diets.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__encounter_diets.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__encounter_diets", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__encounter_diets"], "alias": "logical__ds__encounter_diets", "checksum": {"name": "sha256", "checksum": "ed17631c77c982faf8016e5ad23d72c6a63e27fb44ef6d9821b3b605cb1d6f18"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6045892, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_patients\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and not f.is_sensitive\r\n where e.end_datetime is null\r\n),\r\ndataset as (\r\n select count(*) as total_patients\r\n from {{ ref('ds__encounter_diets') }}\r\n)\r\nselect base.total_patients as base_total_patients,\r\n dataset.total_patients as dataset_total_patients\r\nfrom base\r\njoin dataset on dataset.total_patients != base.total_patients", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__encounter_diets", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__encounter_diets.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_patients\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n and not f.is_sensitive\n where e.end_datetime is null\n),\ndataset as (\n select count(*) as total_patients\n from \"app\".\"reporting\".\"ds__encounter_diets\"\n)\nselect base.total_patients as base_total_patients,\n dataset.total_patients as dataset_total_patients\nfrom base\njoin dataset on dataset.total_patients != base.total_patients", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__encounter_prescriptions": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__encounter_prescriptions", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__encounter_prescriptions.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__encounter_prescriptions.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__encounter_prescriptions", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__encounter_prescriptions"], "alias": "logical__ds__encounter_prescriptions", "checksum": {"name": "sha256", "checksum": "a6597408683d2ffa8c3d6559e116433daf61d1fc127f0540f6257c4c2fdebe7f"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6066117, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_prescriptions\r\n from {{ ref('encounter_prescriptions') }} ep\r\n join {{ ref('encounters') }} e\r\n on e.id = ep.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_prescriptions\r\n from {{ ref('ds__encounter_prescriptions') }}\r\n)\r\nselect base.total_prescriptions as base_total_prescriptions,\r\n dataset.total_prescriptions as dataset_total_prescriptions\r\nfrom base\r\njoin dataset on dataset.total_prescriptions != base.total_prescriptions", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_prescriptions", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__encounter_prescriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__encounter_prescriptions.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_prescriptions\n from \"app\".\"reporting\".\"encounter_prescriptions\" ep\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = ep.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_prescriptions\n from \"app\".\"reporting\".\"ds__encounter_prescriptions\"\n)\nselect base.total_prescriptions as base_total_prescriptions,\n dataset.total_prescriptions as dataset_total_prescriptions\nfrom base\njoin dataset on dataset.total_prescriptions != base.total_prescriptions", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__imaging_requests": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__imaging_requests", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__imaging_requests.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__imaging_requests.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__imaging_requests", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__imaging_requests"], "alias": "logical__ds__imaging_requests", "checksum": {"name": "sha256", "checksum": "633ba58f9aedb9e6b0edb80aaab073beab450a917577d0039df300c1a560e1ea"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6097093, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_requests\r\n from {{ ref('imaging_requests') }} ir\r\n join {{ ref('encounters') }} e\r\n on e.id = ir.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_requests\r\n from {{ ref('ds__imaging_requests') }}\r\n)\r\nselect base.total_requests as base_total_requests,\r\n dataset.total_requests as dataset_total_requests\r\nfrom base\r\njoin dataset on dataset.total_requests != base.total_requests", "doc_blocks": [], "language": "sql", "refs": [{"name": "imaging_requests", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__imaging_requests", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__imaging_requests.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_requests\n from \"app\".\"reporting\".\"imaging_requests\" ir\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = ir.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_requests\n from \"app\".\"reporting\".\"ds__imaging_requests\"\n)\nselect base.total_requests as base_total_requests,\n dataset.total_requests as dataset_total_requests\nfrom base\njoin dataset on dataset.total_requests != base.total_requests", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__location_bookings": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__location_bookings", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__location_bookings.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__location_bookings.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__location_bookings", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__location_bookings"], "alias": "logical__ds__location_bookings", "checksum": {"name": "sha256", "checksum": "0e99e681b6099a1bbc0137f63936ff78d5600ef1d512fcf99818032025087f7f"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6117709, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_bookings\r\n from {{ ref('location_bookings') }} lb\r\n join {{ ref('locations') }} l\r\n on l.id = lb.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_bookings\r\n from {{ ref('ds__location_bookings') }}\r\n)\r\nselect base.total_bookings as base_total_bookings,\r\n dataset.total_bookings as dataset_total_bookings\r\nfrom base\r\njoin dataset on dataset.total_bookings != base.total_bookings", "doc_blocks": [], "language": "sql", "refs": [{"name": "location_bookings", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__location_bookings", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__location_bookings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__location_bookings.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_bookings\n from \"app\".\"reporting\".\"location_bookings\" lb\n join \"app\".\"reporting\".\"locations\" l\n on l.id = lb.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_bookings\n from \"app\".\"reporting\".\"ds__location_bookings\"\n)\nselect base.total_bookings as base_total_bookings,\n dataset.total_bookings as dataset_total_bookings\nfrom base\njoin dataset on dataset.total_bookings != base.total_bookings", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__outpatient_appointments": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__outpatient_appointments", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__outpatient_appointments.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__outpatient_appointments.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__outpatient_appointments", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__outpatient_appointments"], "alias": "logical__ds__outpatient_appointments", "checksum": {"name": "sha256", "checksum": "08ecc89f114270604ad3507df8701de315b3e307d2a0219b1948f8f37dddbc40"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6148632, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_appointments\r\n from {{ ref('outpatient_appointments') }} lb\r\n join {{ ref('location_groups') }} lg\r\n on lg.id = lb.location_group_id\r\n join {{ ref('facilities') }} f\r\n on f.id = lg.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_appointments\r\n from {{ ref('ds__outpatient_appointments') }}\r\n)\r\nselect base.total_appointments as base_total_appointments,\r\n dataset.total_appointments as dataset_total_appointments\r\nfrom base\r\njoin dataset on dataset.total_appointments != base.total_appointments", "doc_blocks": [], "language": "sql", "refs": [{"name": "outpatient_appointments", "package": null, "version": null}, {"name": "location_groups", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__outpatient_appointments", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__outpatient_appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__outpatient_appointments.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_appointments\n from \"app\".\"reporting\".\"outpatient_appointments\" lb\n join \"app\".\"reporting\".\"location_groups\" lg\n on lg.id = lb.location_group_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = lg.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_appointments\n from \"app\".\"reporting\".\"ds__outpatient_appointments\"\n)\nselect base.total_appointments as base_total_appointments,\n dataset.total_appointments as dataset_total_appointments\nfrom base\njoin dataset on dataset.total_appointments != base.total_appointments", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__procedures": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__procedures", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__procedures.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__procedures.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__procedures", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__procedures"], "alias": "logical__ds__procedures", "checksum": {"name": "sha256", "checksum": "6133c8017cc8d84871beecc16a0d5947e68ece261a422bf6478a49b9ae8e5115"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6148632, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_procedures\r\n from {{ ref('procedures') }} p\r\n join {{ ref('encounters') }} e\r\n on e.id = p.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_procedures\r\n from {{ ref('ds__procedures') }}\r\n)\r\nselect base.total_procedures as base_total_procedures,\r\n dataset.total_procedures as dataset_total_procedures\r\nfrom base\r\njoin dataset on dataset.total_procedures != base.total_procedures", "doc_blocks": [], "language": "sql", "refs": [{"name": "procedures", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__procedures", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__procedures.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_procedures\n from \"app\".\"reporting\".\"procedures\" p\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = p.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_procedures\n from \"app\".\"reporting\".\"ds__procedures\"\n)\nselect base.total_procedures as base_total_procedures,\n dataset.total_procedures as dataset_total_procedures\nfrom base\njoin dataset on dataset.total_procedures != base.total_procedures", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__referrals": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__referrals", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__referrals.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__referrals.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__referrals", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__referrals"], "alias": "logical__ds__referrals", "checksum": {"name": "sha256", "checksum": "07cbc168b774759b131a766cddbe358b938c315f4f9dab3a0fd788764f29591d"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6148632, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_referrals\r\n from {{ ref('referrals') }} r\r\n join {{ ref('encounters') }} e\r\n on e.id = r.initiating_encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_referrals\r\n from {{ ref('ds__referrals') }}\r\n)\r\nselect base.total_referrals as base_total_referrals,\r\n dataset.total_referrals as dataset_total_referrals\r\nfrom base\r\njoin dataset on dataset.total_referrals != base.total_referrals", "doc_blocks": [], "language": "sql", "refs": [{"name": "referrals", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__referrals", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__referrals.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_referrals\n from \"app\".\"reporting\".\"referrals\" r\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = r.initiating_encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_referrals\n from \"app\".\"reporting\".\"ds__referrals\"\n)\nselect base.total_referrals as base_total_referrals,\n dataset.total_referrals as dataset_total_referrals\nfrom base\njoin dataset on dataset.total_referrals != base.total_referrals", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__user_audit": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__user_audit", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__user_audit.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__user_audit.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__user_audit", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__user_audit"], "alias": "logical__ds__user_audit", "checksum": {"name": "sha256", "checksum": "3cab73cd866b58cd073298de9fe9b8865af225121e4c76b32415d0eee9fd3b9b"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6203816, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_encounters\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_encounters\r\n from {{ ref('ds__user_audit') }}\r\n)\r\nselect base.total_encounters as base_total_encounters,\r\n dataset.total_encounters as dataset_total_encounters\r\nfrom base\r\njoin dataset on dataset.total_encounters != base.total_encounters", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__user_audit", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__user_audit"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__user_audit.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"ds__user_audit\"\n)\nselect base.total_encounters as base_total_encounters,\n dataset.total_encounters as dataset_total_encounters\nfrom base\njoin dataset on dataset.total_encounters != base.total_encounters", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__ds__vaccinations": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__ds__vaccinations", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__ds__vaccinations.sql", "original_file_path": "tests\\logical_integrity\\logical__ds__vaccinations.sql", "unique_id": "test.tamanu_source_dbt.logical__ds__vaccinations", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__ds__vaccinations"], "alias": "logical__ds__vaccinations", "checksum": {"name": "sha256", "checksum": "3e4d109462ca7d37c1e3afe0ed4206eaef030bb05e9bbb613058d1268f6bbd74"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6203816, "relation_name": null, "raw_code": "with base as (\r\n select count(*) as total_vaccinations\r\n from {{ ref('vaccine_administrations') }} va\r\n join {{ ref('encounters') }} e\r\n on e.id = va.encounter_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n where not f.is_sensitive\r\n),\r\ndataset as (\r\n select count(*) as total_vaccinations\r\n from {{ ref('ds__vaccinations') }}\r\n)\r\nselect base.total_vaccinations as base_total_vaccinations,\r\n dataset.total_vaccinations as dataset_total_vaccinations\r\nfrom base\r\njoin dataset on dataset.total_vaccinations != base.total_vaccinations", "doc_blocks": [], "language": "sql", "refs": [{"name": "vaccine_administrations", "package": null, "version": null}, {"name": "encounters", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "ds__vaccinations", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.ds__vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__ds__vaccinations.sql", "compiled": true, "compiled_code": "with base as (\n select count(*) as total_vaccinations\n from \"app\".\"reporting\".\"vaccine_administrations\" va\n join \"app\".\"reporting\".\"encounters\" e\n on e.id = va.encounter_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n where not f.is_sensitive\n),\ndataset as (\n select count(*) as total_vaccinations\n from \"app\".\"reporting\".\"ds__vaccinations\"\n)\nselect base.total_vaccinations as base_total_vaccinations,\n dataset.total_vaccinations as dataset_total_vaccinations\nfrom base\njoin dataset on dataset.total_vaccinations != base.total_vaccinations", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__encounter_summary_by_end_date": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__encounter_summary_by_end_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__encounter_summary_by_end_date.sql", "original_file_path": "tests\\logical_integrity\\logical__encounter_summary_by_end_date.sql", "unique_id": "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__encounter_summary_by_end_date"], "alias": "logical__encounter_summary_by_end_date", "checksum": {"name": "sha256", "checksum": "aa3c486e972ccccf3163cbf42c9e4ca6f2b0816d6cce556871247935d68cff3f"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6203816, "relation_name": null, "raw_code": "with base as (\r\n select count(distinct e.id) as total_encounters\r\n from {{ ref('encounters') }} e\r\n join {{ ref('encounter_history') }} eh\r\n on eh.encounter_id = e.id\r\n join {{ ref('users') }} actor\r\n on actor.id = eh.updated_by_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n join {{ ref('departments') }} dp\r\n on dp.id = e.department_id\r\n join {{ ref('patients') }} p\r\n on p.id = e.patient_id\r\n where not f.is_sensitive\r\n and e.end_datetime is not null\r\n and e.end_datetime >= '2024-01-01'::date\r\n and e.end_datetime <= '2024-01-31'::date\r\n and e.patient_id != '{{ var(\"test_patient\") }}'\r\n),\r\nreport as (\r\n select count(*) as total_encounters\r\n from {{ ref('encounter-summary-by-end-date') }}\r\n)\r\nselect\r\n base.total_encounters as base_total_encounters,\r\n report.total_encounters as report_total_encounters\r\nfrom base\r\njoin report on report.total_encounters != base.total_encounters", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "encounter-summary-by-end-date", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.encounter-summary-by-end-date"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__encounter_summary_by_end_date.sql", "compiled": true, "compiled_code": "with base as (\n select count(distinct e.id) as total_encounters\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = e.id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n join \"app\".\"reporting\".\"departments\" dp\n on dp.id = e.department_id\n join \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\n where not f.is_sensitive\n and e.end_datetime is not null\n and e.end_datetime >= '2024-01-01'::date\n and e.end_datetime <= '2024-01-31'::date\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n),\nreport as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"encounter-summary-by-end-date\"\n)\nselect\n base.total_encounters as base_total_encounters,\n report.total_encounters as report_total_encounters\nfrom base\njoin report on report.total_encounters != base.total_encounters", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.logical__encounter_summary_by_start_date": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "logical__encounter_summary_by_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "logical_integrity\\logical__encounter_summary_by_start_date.sql", "original_file_path": "tests\\logical_integrity\\logical__encounter_summary_by_start_date.sql", "unique_id": "test.tamanu_source_dbt.logical__encounter_summary_by_start_date", "fqn": ["tamanu_source_dbt", "logical_integrity", "logical__encounter_summary_by_start_date"], "alias": "logical__encounter_summary_by_start_date", "checksum": {"name": "sha256", "checksum": "f3672b8efce772e301002ca59fa84aaab2525464e1b62d992073f75dab414482"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6203816, "relation_name": null, "raw_code": "with base as (\r\n select count(distinct e.id) as total_encounters\r\n from {{ ref('encounters') }} e\r\n join {{ ref('encounter_history') }} eh\r\n on eh.encounter_id = e.id\r\n join {{ ref('users') }} actor\r\n on actor.id = eh.updated_by_id\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n join {{ ref('departments') }} dp\r\n on dp.id = e.department_id\r\n join {{ ref('patients') }} p\r\n on p.id = e.patient_id\r\n where not f.is_sensitive\r\n and e.start_datetime >= '2024-01-01'::date\r\n and e.start_datetime <= '2024-01-31'::date\r\n and e.patient_id != '{{ var(\"test_patient\") }}'\r\n),\r\nreport as (\r\n select count(*) as total_encounters\r\n from {{ ref('encounter-summary-by-start-date') }}\r\n)\r\nselect\r\n base.total_encounters as base_total_encounters,\r\n report.total_encounters as report_total_encounters\r\nfrom base\r\njoin report on report.total_encounters != base.total_encounters", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounters", "package": null, "version": null}, {"name": "encounter_history", "package": null, "version": null}, {"name": "users", "package": null, "version": null}, {"name": "locations", "package": null, "version": null}, {"name": "facilities", "package": null, "version": null}, {"name": "departments", "package": null, "version": null}, {"name": "patients", "package": null, "version": null}, {"name": "encounter-summary-by-start-date", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.encounter-summary-by-start-date"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\logical_integrity\\logical__encounter_summary_by_start_date.sql", "compiled": true, "compiled_code": "with base as (\n select count(distinct e.id) as total_encounters\n from \"app\".\"reporting\".\"encounters\" e\n join \"app\".\"reporting\".\"encounter_history\" eh\n on eh.encounter_id = e.id\n join \"app\".\"reporting\".\"users\" actor\n on actor.id = eh.updated_by_id\n join \"app\".\"reporting\".\"locations\" l\n on l.id = e.location_id\n join \"app\".\"reporting\".\"facilities\" f\n on f.id = l.facility_id\n join \"app\".\"reporting\".\"departments\" dp\n on dp.id = e.department_id\n join \"app\".\"reporting\".\"patients\" p\n on p.id = e.patient_id\n where not f.is_sensitive\n and e.start_datetime >= '2024-01-01'::date\n and e.start_datetime <= '2024-01-31'::date\n and e.patient_id != 'h1627394-3778-4c31-a510-9fcb88efdbf3'\n),\nreport as (\n select count(*) as total_encounters\n from \"app\".\"reporting\".\"encounter-summary-by-start-date\"\n)\nselect\n base.total_encounters as base_total_encounters,\n report.total_encounters as report_total_encounters\nfrom base\njoin report on report.total_encounters != base.total_encounters", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.assert__metric_definitions__disaggregations": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "assert__metric_definitions__disaggregations", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source\\assert__metric_definitions__disaggregations.sql", "original_file_path": "tests\\source\\assert__metric_definitions__disaggregations.sql", "unique_id": "test.tamanu_source_dbt.assert__metric_definitions__disaggregations", "fqn": ["tamanu_source_dbt", "source", "assert__metric_definitions__disaggregations"], "alias": "assert__metric_definitions__disaggregations", "checksum": {"name": "sha256", "checksum": "78791500ff5cee27f9d05c99025684e81ccb2c688f14f1dbfdf4621459be657c"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6203816, "relation_name": null, "raw_code": "select\r\n md.metric_id,\r\n trim(d) as offending_disaggregation\r\nfrom {{ ref('metric_definitions') }} md\r\ncross join lateral unnest(string_to_array(md.disaggregations, ',')) as t(d)\r\nwhere trim(d) not in ('age_group', 'sex', 'facility_id', 'dhis_ncd_category')", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\source\\assert__metric_definitions__disaggregations.sql", "compiled": true, "compiled_code": "select\n md.metric_id,\n trim(d) as offending_disaggregation\nfrom \"app\".\"reporting\".\"metric_definitions\" md\ncross join lateral unnest(string_to_array(md.disaggregations, ',')) as t(d)\nwhere trim(d) not in ('age_group', 'sex', 'facility_id', 'dhis_ncd_category')", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.assert__patients__village_id": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "assert__patients__village_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source\\assert__patients__village_id.sql", "original_file_path": "tests\\source\\assert__patients__village_id.sql", "unique_id": "test.tamanu_source_dbt.assert__patients__village_id", "fqn": ["tamanu_source_dbt", "source", "assert__patients__village_id"], "alias": "assert__patients__village_id", "checksum": {"name": "sha256", "checksum": "94296d5b9ffcdc806f24dca745552981af5777095ed9b40db780b85d3c8c45cc"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6361592, "relation_name": null, "raw_code": "select rd.id\r\nfrom {{ source(\"tamanu\", \"patients\") }} p\r\nleft join {{ source(\"tamanu\", \"reference_data\") }} rd on rd.id = p.village_id\r\nwhere p.village_id is not null\r\n and rd.id is null", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\source\\assert__patients__village_id.sql", "compiled": true, "compiled_code": "select rd.id\nfrom \"app\".\"public\".\"patients\" p\nleft join \"app\".\"public\".\"reference_data\" rd on rd.id = p.village_id\nwhere p.village_id is not null\n and rd.id is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "assert__scheduled_vaccines__weeks_due", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source\\assert__scheduled_vaccines__weeks_due.sql", "original_file_path": "tests\\source\\assert__scheduled_vaccines__weeks_due.sql", "unique_id": "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due", "fqn": ["tamanu_source_dbt", "source", "assert__scheduled_vaccines__weeks_due"], "alias": "assert__scheduled_vaccines__weeks_due", "checksum": {"name": "sha256", "checksum": "0f5d5d8362f4e9402018786e77c42bb2c38c6491b4a2ea2754a7d9ff3317743c"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6361592, "relation_name": null, "raw_code": "select\r\n category,\r\n vaccine_id\r\nfrom {{ source(\"tamanu\", \"scheduled_vaccines\") }}\r\nwhere weeks_from_birth_due notnull\r\n and index != 1\r\n and visibility_status = 'current'\r\ngroup by\r\n category,\r\n vaccine_id\r\n\r\nunion\r\n\r\nselect\r\n category,\r\n vaccine_id\r\nfrom {{ source(\"tamanu\", \"scheduled_vaccines\") }}\r\nwhere weeks_from_last_vaccination_due notnull\r\n and index = 1\r\n and visibility_status = 'current'\r\ngroup by\r\n category,\r\n vaccine_id", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"], ["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\source\\assert__scheduled_vaccines__weeks_due.sql", "compiled": true, "compiled_code": "select\n category,\n vaccine_id\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere weeks_from_birth_due notnull\n and index != 1\n and visibility_status = 'current'\ngroup by\n category,\n vaccine_id\n\nunion\n\nselect\n category,\n vaccine_id\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere weeks_from_last_vaccination_due notnull\n and index = 1\n and visibility_status = 'current'\ngroup by\n category,\n vaccine_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.tamanu_source_dbt.assert__users__role": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "assert__users__role", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source\\assert__users__role.sql", "original_file_path": "tests\\source\\assert__users__role.sql", "unique_id": "test.tamanu_source_dbt.assert__users__role", "fqn": ["tamanu_source_dbt", "source", "assert__users__role"], "alias": "assert__users__role", "checksum": {"name": "sha256", "checksum": "913180135f0df2269cfc10b274a164b1e4708ad471ab536a7f6ab057c3ffa3f0"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.6404722, "relation_name": null, "raw_code": "select u.role\r\nfrom {{ source(\"tamanu\", \"users\") }} u\r\nleft join {{ source(\"tamanu\", \"roles\") }} r on r.id = u.role\r\nwhere r.id is null\r\n and u.role not in ('admin', 'base', 'practitioner', 'system')", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\tests\\source\\assert__users__role.sql", "compiled": true, "compiled_code": "select u.role\nfrom \"app\".\"public\".\"users\" u\nleft join \"app\".\"public\".\"roles\" r on r.id = u.role\nwhere r.id is null\n and u.role not in ('admin', 'base', 'practitioner', 'system')", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "seed.tamanu_source_dbt.metric_definitions": {"database": "app", "schema": "reporting", "name": "metric_definitions", "resource_type": "seed", "package_name": "tamanu_source_dbt", "path": "metric_definitions.csv", "original_file_path": "seeds\\metric_definitions.csv", "unique_id": "seed.tamanu_source_dbt.metric_definitions", "fqn": ["tamanu_source_dbt", "metric_definitions"], "alias": "metric_definitions", "checksum": {"name": "sha256", "checksum": "6c392d7de33cabd5d508af21ac36c0163dfa2691321db67e6b88a9d6d991b216"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"owner": "bes-maui", "domain": "clinical", "pii": false, "classification": "internal"}, "group": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"metric_id": "text", "kind": "text", "name": "text", "description": "text", "numerator_description": "text", "denominator_description": "text", "data_source": "text", "definition_source": "text", "definition_source_code": "text", "definition_rationale": "text", "unit": "text", "subject_grain": "text", "disaggregations": "text", "variant_of": "text", "owner": "text", "status": "text", "spec_path": "text"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "Canonical registry of `metric__` indicators and `der__` derived elements\nderived from Tamanu data. Consumed by every deployment that depends on\nthis package \u2014 deployments inherit the catalogue automatically via\n`ref('metric_definitions')` without redeclaring anything.\n\nEach row defines one indicator: identifier, plain-English description,\nnumerator/denominator, source standard, output shape (subject grain,\ndisaggregations, unit), and lifecycle status. Definitions here are the\nsingle source of truth \u2014 implementation overrides (a deployment uses a\ndifferent upstream survey for the same metric) are invisible at this\nlayer; only definition variances (different rules, different numbers) are\nflagged, via `variant_of` on a deployment-specific extension seed at\n`tamanu-dbt-/seeds/metric_definitions_.csv`.\n\nSchema per Maui data architecture D5\n(`.maui/knowledge/architecture/data-architecture/decisions.md`).\nStatus lifecycle: `draft` \u2192 `approved` \u2192 `deprecated`. PR review checks\nthat the corresponding `metric__` model output matches the registered\nshape (disaggregations, subject_grain, unit) before a row promotes from\n`draft` to `approved`.\n", "columns": {"metric_id": {"name": "metric_id", "description": "Globally unique, snake-case identifier. Matches the `metric__` model name suffix or `der__` cohort id. Stable across releases \u2014 never reused.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "kind": {"name": "kind", "description": "Artefact kind \u2014 `metric`, `cohort`, `condition_era`, `drug_era`, `dose_era`, or `episode`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Human-readable label shown in catalogues and dashboards.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Plain-English description of what the artefact measures.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "numerator_description": {"name": "numerator_description", "description": "Numerator in words. Metrics only \u2014 NULL for `der__` rows.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "denominator_description": {"name": "denominator_description", "description": "Denominator in words. Metrics only \u2014 NULL for count metrics and for `der__` rows.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "data_source": {"name": "data_source", "description": "Source system the artefact derives from (`tamanu`, `msupply`, `senaite`, `weather`).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "definition_source": {"name": "definition_source", "description": "Where the definition comes from \u2014 external standard name (e.g. `WHO_SMART_HIV`, `WHO_CORE_100`, `WHO_PEN`, `SDG`, `DHIS2_HDT`, `MANA`, `GLOBAL_FUND`, `OHDSI`, `IYCF`, `MSF`) or `BES` for internal definitions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "definition_source_code": {"name": "definition_source_code", "description": "External standard's own identifier for the indicator (e.g. WHO DAK indicator code, SDG code, DHIS2 data element code). NULL for `BES` definitions and standards without a structured code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "definition_rationale": {"name": "definition_rationale", "description": "Short justification \u2014 for external standards, why this one over others; for `BES`/`MSF`, why an internal definition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "unit": {"name": "unit", "description": "Unit of measure (`count`, `percentage`, `rate_per_1000`). Metrics only \u2014 NULL for non-metric kinds.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "subject_grain": {"name": "subject_grain", "description": "Grain of `subject_id` in the metric output \u2014 `patient`, `encounter`, `facility`, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "disaggregations": {"name": "disaggregations", "description": "Comma-separated list of disaggregation column names the artefact produces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "variant_of": {"name": "variant_of", "description": "Parent `metric_id` if this row is a deployment-specific definition variant; else NULL. Metrics only.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner": {"name": "owner", "description": "Team or individual responsible for the artefact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Lifecycle status \u2014 `draft`, `approved`, or `deprecated`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "spec_path": {"name": "spec_path", "description": "Repo-relative path to the SDD spec for this artefact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {"owner": "bes-maui", "domain": "clinical", "pii": false, "classification": "internal"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tamanu_source_dbt://seeds\\metric_definitions.yml", "build_path": null, "unrendered_config": {"meta": {"owner": "bes-maui", "domain": "clinical", "pii": false, "classification": "internal"}, "column_types": {"metric_id": "text", "kind": "text", "name": "text", "description": "text", "numerator_description": "text", "denominator_description": "text", "data_source": "text", "definition_source": "text", "definition_source_code": "text", "definition_rationale": "text", "unit": "text", "subject_grain": "text", "disaggregations": "text", "variant_of": "text", "owner": "text", "status": "text", "spec_path": "text"}}, "created_at": 1782423651.794209, "relation_name": "\"app\".\"reporting\".\"metric_definitions\"", "raw_code": "", "doc_blocks": [], "root_path": "C:\\Users\\julia\\Documents\\GitHub\\tamanu-source-dbt", "depends_on": {"macros": []}}, "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_metric_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_metric_id.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_metric_id"], "alias": "not_null_metric_definitions_metric_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.8425367, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_metric_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect metric_id\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere metric_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "metric_id", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "metric_id", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "unique_metric_definitions_metric_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "unique_metric_definitions_metric_id.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13", "fqn": ["tamanu_source_dbt", "unique_metric_definitions_metric_id"], "alias": "unique_metric_definitions_metric_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.8425367, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\unique_metric_definitions_metric_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n metric_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere metric_id is not null\ngroup by metric_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "metric_id", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "unique", "kwargs": {"column_name": "metric_id", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_kind", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_kind.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_kind"], "alias": "not_null_metric_definitions_kind", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.8425367, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_kind.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect kind\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere kind is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "kind", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "kind", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_df924eba44c45a8608483602f26072d9.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode"], "alias": "accepted_values_metric_definit_df924eba44c45a8608483602f26072d9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_df924eba44c45a8608483602f26072d9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_df924eba44c45a8608483602f26072d9"}, "created_at": 1782423651.85363, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_df924eba44c45a8608483602f26072d9\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_df924eba44c45a8608483602f26072d9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n kind as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by kind\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'metric','cohort','condition_era','drug_era','dose_era','episode'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "kind", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["metric", "cohort", "condition_era", "drug_era", "dose_era", "episode"], "column_name": "kind", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_name.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_name"], "alias": "not_null_metric_definitions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.8691497, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_description", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_description.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_description"], "alias": "not_null_metric_definitions_description", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.870192, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_description.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect description\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere description is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "description", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "description", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_data_source", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_data_source.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_data_source"], "alias": "not_null_metric_definitions_data_source", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.870192, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_data_source.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect data_source\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere data_source is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data_source", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "data_source", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather"], "alias": "accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1"}, "created_at": 1782423651.8716037, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_8091b4c500dc7ba4b7d5ab488c44dbe1.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n data_source as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by data_source\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'tamanu','msupply','senaite','weather'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data_source", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["tamanu", "msupply", "senaite", "weather"], "column_name": "data_source", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_definition_source", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_definition_source.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_definition_source"], "alias": "not_null_metric_definitions_definition_source", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.8760114, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_definition_source.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect definition_source\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere definition_source is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "definition_source", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "definition_source", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES"], "alias": "accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f"}, "created_at": 1782423651.8760114, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_35cd0ccc7b8c1e6d861f024a9753374f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n definition_source as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by definition_source\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'WHO_SMART_HIV','WHO_CORE_100','WHO_PEN','SDG','DHIS2_HDT','MANA','GLOBAL_FUND','OHDSI','IYCF','MSF','BES'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "definition_source", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["WHO_SMART_HIV", "WHO_CORE_100", "WHO_PEN", "SDG", "DHIS2_HDT", "MANA", "GLOBAL_FUND", "OHDSI", "IYCF", "MSF", "BES"], "column_name": "definition_source", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_unit__count__percentage__rate_per_1000", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_unit__count__percentage__rate_per_1000"], "alias": "accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3"}, "created_at": 1782423651.8760114, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_482db7c0d2c2450eea6af15602293ad3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n unit as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by unit\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'count','percentage','rate_per_1000'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unit", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["count", "percentage", "rate_per_1000"], "column_name": "unit", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_subject_grain", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_subject_grain.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_subject_grain"], "alias": "not_null_metric_definitions_subject_grain", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.8760114, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_subject_grain.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect subject_grain\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere subject_grain is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "subject_grain", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "subject_grain", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a", "fqn": ["tamanu_source_dbt", "relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_"], "alias": "relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332"}, "created_at": 1782423651.8760114, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}, {"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\relationships_metric_definitio_9e45f21b8e624e0b83b1987f46e6b332.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select variant_of as from_field\n from \"app\".\"reporting\".\"metric_definitions\"\n where variant_of is not null\n),\n\nparent as (\n select metric_id as to_field\n from \"app\".\"reporting\".\"metric_definitions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "variant_of", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('metric_definitions')", "field": "metric_id", "column_name": "variant_of", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_owner", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_owner.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_owner"], "alias": "not_null_metric_definitions_owner", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.8883708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_owner.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect owner\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere owner is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "owner", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "owner", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_status.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_status"], "alias": "not_null_metric_definitions_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.8883708, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "accepted_values_metric_definitions_status__draft__approved__deprecated", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852", "fqn": ["tamanu_source_dbt", "accepted_values_metric_definitions_status__draft__approved__deprecated"], "alias": "accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b"}, "created_at": 1782423651.8883708, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\accepted_values_metric_definit_92e19d1c4084c09708fcafafef2ce09b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"reporting\".\"metric_definitions\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'draft','approved','deprecated'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["draft", "approved", "deprecated"], "column_name": "status", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "not_null_metric_definitions_spec_path", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "not_null_metric_definitions_spec_path.sql", "original_file_path": "seeds\\metric_definitions.yml", "unique_id": "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f", "fqn": ["tamanu_source_dbt", "not_null_metric_definitions_spec_path"], "alias": "not_null_metric_definitions_spec_path", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423651.8931875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "metric_definitions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.tamanu_source_dbt.metric_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\seeds\\metric_definitions.yml\\not_null_metric_definitions_spec_path.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect spec_path\nfrom \"app\".\"reporting\".\"metric_definitions\"\nwhere spec_path is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "spec_path", "file_key_name": "seeds.metric_definitions", "attached_node": "seed.tamanu_source_dbt.metric_definitions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "spec_path", "model": "{{ get_where_subquery(ref('metric_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8.sql", "original_file_path": "models\\bases\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc", "fqn": ["tamanu_source_dbt", "bases", "dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error"], "alias": "dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8"}, "created_at": 1782423651.94056, "relation_name": null, "raw_code": "{{ dbt_utils.test_not_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "encounter_diagnoses", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_not_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.tamanu_source_dbt.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\bases\\encounter_diagnoses.yml\\dbt_utils_not_accepted_values__444513eee24c91c159372e8e806dd9b8.sql", "compiled": true, "compiled_code": "\nwith all_values as (\n\n select distinct\n certainty as value_field\n\n from \"app\".\"reporting\".\"encounter_diagnoses\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n 'disproven','error'\n )\n\n)\n\nselect *\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "certainty", "file_key_name": "models.encounter_diagnoses", "attached_node": "model.tamanu_source_dbt.encounter_diagnoses", "test_metadata": {"name": "not_accepted_values", "kwargs": {"column_name": "certainty", "values": ["disproven", "error"], "model": "{{ get_where_subquery(ref('encounter_diagnoses')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_accesses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_accesses_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_accesses_id"], "alias": "source_unique_logs__tamanu_accesses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7236876, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_unique_logs__tamanu_accesses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"accesses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_id"], "alias": "source_not_null_logs__tamanu_accesses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7294486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"accesses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_created_at.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_created_at"], "alias": "source_not_null_logs__tamanu_accesses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7294486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"logs\".\"accesses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_updated_at.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_updated_at"], "alias": "source_not_null_logs__tamanu_accesses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7294486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"logs\".\"accesses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_user_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_user_id"], "alias": "source_not_null_logs__tamanu_accesses_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7294486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"logs\".\"accesses\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_record_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_record_id"], "alias": "source_not_null_logs__tamanu_accesses_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7294486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"logs\".\"accesses\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_record_type.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_record_type"], "alias": "source_not_null_logs__tamanu_accesses_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7344854, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"logs\".\"accesses\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_session_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_session_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_session_id"], "alias": "source_not_null_logs__tamanu_accesses_session_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7344854, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_session_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect session_id\nfrom \"app\".\"logs\".\"accesses\"\nwhere session_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "session_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "session_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_device_id.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_device_id"], "alias": "source_not_null_logs__tamanu_accesses_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7344854, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"logs\".\"accesses\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_logged_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_logged_at.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_logged_at"], "alias": "source_not_null_logs__tamanu_accesses_logged_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7344854, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_logged_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect logged_at\nfrom \"app\".\"logs\".\"accesses\"\nwhere logged_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "logged_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "logged_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_front_end_context", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_front_end_context.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_front_end_context"], "alias": "source_not_null_logs__tamanu_accesses_front_end_context", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7344854, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_front_end_context.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect front_end_context\nfrom \"app\".\"logs\".\"accesses\"\nwhere front_end_context is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "front_end_context", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "front_end_context", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_back_end_context", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_back_end_context.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_back_end_context"], "alias": "source_not_null_logs__tamanu_accesses_back_end_context", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7344854, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_back_end_context.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect back_end_context\nfrom \"app\".\"logs\".\"accesses\"\nwhere back_end_context is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "back_end_context", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "back_end_context", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_is_mobile", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_is_mobile.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_is_mobile"], "alias": "source_not_null_logs__tamanu_accesses_is_mobile", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7410266, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_is_mobile.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_mobile\nfrom \"app\".\"logs\".\"accesses\"\nwhere is_mobile is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_mobile", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_mobile", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_version", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_version.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_version"], "alias": "source_not_null_logs__tamanu_accesses_version", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7410266, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_version.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect version\nfrom \"app\".\"logs\".\"accesses\"\nwhere version is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "version", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "version", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_accesses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_accesses_updated_at_sync_tick.sql", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_accesses_updated_at_sync_tick"], "alias": "source_not_null_logs__tamanu_accesses_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7410266, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "accesses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.accesses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\accesses.yml\\source_not_null_logs__tamanu_accesses_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"logs\".\"accesses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('logs__tamanu', 'accesses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_changes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_changes_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_changes_id"], "alias": "source_unique_logs__tamanu_changes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7520456, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_unique_logs__tamanu_changes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"changes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_id"], "alias": "source_not_null_logs__tamanu_changes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7520456, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"changes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_table_oid", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_table_oid.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_table_oid"], "alias": "source_not_null_logs__tamanu_changes_table_oid", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7520456, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_table_oid.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect table_oid\nfrom \"app\".\"logs\".\"changes\"\nwhere table_oid is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "table_oid", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "table_oid", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_table_schema", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_table_schema.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_table_schema"], "alias": "source_not_null_logs__tamanu_changes_table_schema", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7520456, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_table_schema.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect table_schema\nfrom \"app\".\"logs\".\"changes\"\nwhere table_schema is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "table_schema", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "table_schema", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_table_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_table_name.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_table_name"], "alias": "source_not_null_logs__tamanu_changes_table_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7520456, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_table_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect table_name\nfrom \"app\".\"logs\".\"changes\"\nwhere table_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "table_name", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "table_name", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_logged_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_logged_at.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_logged_at"], "alias": "source_not_null_logs__tamanu_changes_logged_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.761466, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_logged_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect logged_at\nfrom \"app\".\"logs\".\"changes\"\nwhere logged_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "logged_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "logged_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_created_at.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_created_at"], "alias": "source_not_null_logs__tamanu_changes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.761466, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"logs\".\"changes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_updated_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_updated_by_user_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_updated_by_user_id"], "alias": "source_not_null_logs__tamanu_changes_updated_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.761466, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_updated_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_by_user_id\nfrom \"app\".\"logs\".\"changes\"\nwhere updated_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_by_user_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_by_user_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465", "fqn": ["tamanu_source_dbt", "logs", "source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a"}, "created_at": 1782423652.761466, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_relationships_logs__tam_661a762c3da1c9a0b72c7de93aeb2e7a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select updated_by_user_id as from_field\n from \"app\".\"logs\".\"changes\"\n where updated_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_by_user_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "updated_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_device_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_device_id"], "alias": "source_not_null_logs__tamanu_changes_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.764992, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"logs\".\"changes\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_version", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_version.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_version"], "alias": "source_not_null_logs__tamanu_changes_version", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.764992, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_version.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect version\nfrom \"app\".\"logs\".\"changes\"\nwhere version is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "version", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "version", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_record_id.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_record_id"], "alias": "source_not_null_logs__tamanu_changes_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.764992, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"logs\".\"changes\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_record_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_record_created_at.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_record_created_at"], "alias": "source_not_null_logs__tamanu_changes_record_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.764992, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_record_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_created_at\nfrom \"app\".\"logs\".\"changes\"\nwhere record_created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_record_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_record_updated_at.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_record_updated_at"], "alias": "source_not_null_logs__tamanu_changes_record_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7707295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_record_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_updated_at\nfrom \"app\".\"logs\".\"changes\"\nwhere record_updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_updated_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_updated_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_record_data", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_record_data.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_record_data"], "alias": "source_not_null_logs__tamanu_changes_record_data", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7707295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_record_data.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_data\nfrom \"app\".\"logs\".\"changes\"\nwhere record_data is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_data", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_data", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_changes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_changes_updated_at_sync_tick.sql", "original_file_path": "models\\logs\\changes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_changes_updated_at_sync_tick"], "alias": "source_not_null_logs__tamanu_changes_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7707295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "changes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.changes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\changes.yml\\source_not_null_logs__tamanu_changes_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"logs\".\"changes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('logs__tamanu', 'changes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_debug_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_debug_logs_id.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_debug_logs_id"], "alias": "source_unique_logs__tamanu_debug_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7707295, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_unique_logs__tamanu_debug_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"debug_logs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_debug_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_debug_logs_id.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_debug_logs_id"], "alias": "source_not_null_logs__tamanu_debug_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7707295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_not_null_logs__tamanu_debug_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"debug_logs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_debug_logs_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_debug_logs_type.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_debug_logs_type"], "alias": "source_not_null_logs__tamanu_debug_logs_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7707295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_not_null_logs__tamanu_debug_logs_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"logs\".\"debug_logs\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0", "fqn": ["tamanu_source_dbt", "logs", "source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate"], "alias": "source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf"}, "created_at": 1782423652.7707295, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_accepted_values_logs__t_a6089bed013dc2009483697663c0eadf.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n type as value_field,\n count(*) as n_records\n\n from \"app\".\"logs\".\"debug_logs\"\n group by type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'syncLookupUpdate'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "type", "values": ["syncLookupUpdate"], "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_debug_logs_info", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_debug_logs_info.sql", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_debug_logs_info"], "alias": "source_not_null_logs__tamanu_debug_logs_info", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7707295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "debug_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\debug_logs.yml\\source_not_null_logs__tamanu_debug_logs_info.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect info\nfrom \"app\".\"logs\".\"debug_logs\"\nwhere info is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "info", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "info", "model": "{{ get_where_subquery(source('logs__tamanu', 'debug_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_dhis2_pushes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_dhis2_pushes_id.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_dhis2_pushes_id"], "alias": "source_unique_logs__tamanu_dhis2_pushes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7707295, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_unique_logs__tamanu_dhis2_pushes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_id.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_id"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_created_at.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_created_at"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_report_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_report_id.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_report_id"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_report_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_report_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect report_id\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere report_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "report_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "report_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_status.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_status"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_dhis2_pushes_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_dhis2_pushes_updated_at.sql", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_dhis2_pushes_updated_at"], "alias": "source_not_null_logs__tamanu_dhis2_pushes_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "dhis2_pushes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\dhis2_pushes.yml\\source_not_null_logs__tamanu_dhis2_pushes_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"logs\".\"dhis2_pushes\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'dhis2_pushes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_fhir_writes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_fhir_writes_id.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_fhir_writes_id"], "alias": "source_unique_logs__tamanu_fhir_writes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_unique_logs__tamanu_fhir_writes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_id.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_id"], "alias": "source_not_null_logs__tamanu_fhir_writes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_created_at.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_created_at"], "alias": "source_not_null_logs__tamanu_fhir_writes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_verb", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_verb.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_verb"], "alias": "source_not_null_logs__tamanu_fhir_writes_verb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_verb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect verb\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere verb is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "verb", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "verb", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_url", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_url.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_url"], "alias": "source_not_null_logs__tamanu_fhir_writes_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_url.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect url\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere url is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "url", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "url", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_body", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_body.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_body"], "alias": "source_not_null_logs__tamanu_fhir_writes_body", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_body.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect body\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere body is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "body", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "body", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_fhir_writes_headers", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_fhir_writes_headers.sql", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_fhir_writes_headers"], "alias": "source_not_null_logs__tamanu_fhir_writes_headers", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "fhir_writes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\fhir_writes.yml\\source_not_null_logs__tamanu_fhir_writes_headers.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect headers\nfrom \"app\".\"logs\".\"fhir_writes\"\nwhere headers is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "headers", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "headers", "model": "{{ get_where_subquery(source('logs__tamanu', 'fhir_writes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_logs__tamanu_migrations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_logs__tamanu_migrations_id.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e", "fqn": ["tamanu_source_dbt", "logs", "source_unique_logs__tamanu_migrations_id"], "alias": "source_unique_logs__tamanu_migrations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_unique_logs__tamanu_migrations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"logs\".\"migrations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_id.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_id"], "alias": "source_not_null_logs__tamanu_migrations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"logs\".\"migrations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_logged_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_logged_at.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_logged_at"], "alias": "source_not_null_logs__tamanu_migrations_logged_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_logged_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect logged_at\nfrom \"app\".\"logs\".\"migrations\"\nwhere logged_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "logged_at", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "logged_at", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_record_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_record_sync_tick.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_record_sync_tick"], "alias": "source_not_null_logs__tamanu_migrations_record_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_record_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_sync_tick\nfrom \"app\".\"logs\".\"migrations\"\nwhere record_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_sync_tick", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_sync_tick", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_device_id.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_device_id"], "alias": "source_not_null_logs__tamanu_migrations_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"logs\".\"migrations\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_version", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_version.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_version"], "alias": "source_not_null_logs__tamanu_migrations_version", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7807634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_version.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect version\nfrom \"app\".\"logs\".\"migrations\"\nwhere version is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "version", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "version", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_direction", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_direction.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_direction"], "alias": "source_not_null_logs__tamanu_migrations_direction", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_direction.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect direction\nfrom \"app\".\"logs\".\"migrations\"\nwhere direction is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "direction", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "direction", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_migrations", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_migrations.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_migrations"], "alias": "source_not_null_logs__tamanu_migrations_migrations", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_migrations.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect migrations\nfrom \"app\".\"logs\".\"migrations\"\nwhere migrations is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "migrations", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "migrations", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_logs__tamanu_migrations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_logs__tamanu_migrations_updated_at_sync_tick.sql", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54", "fqn": ["tamanu_source_dbt", "logs", "source_not_null_logs__tamanu_migrations_updated_at_sync_tick"], "alias": "source_not_null_logs__tamanu_migrations_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["logs__tamanu", "migrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.logs__tamanu.migrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\logs\\migrations.yml\\source_not_null_logs__tamanu_migrations_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"logs\".\"migrations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.logs__tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('logs__tamanu', 'migrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_administered_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_administered_vaccines_id.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_administered_vaccines_id"], "alias": "source_unique_tamanu_administered_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_unique_tamanu_administered_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_administered_vaccines_id.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_id"], "alias": "source_not_null_tamanu_administered_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_administered_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_administered_vaccines_created_at.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_created_at"], "alias": "source_not_null_tamanu_administered_vaccines_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_administered_vaccines_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_administered_vaccines_updated_at.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_updated_at"], "alias": "source_not_null_tamanu_administered_vaccines_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_administered_vaccines_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_administered_vaccines_status.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_status"], "alias": "source_not_null_tamanu_administered_vaccines_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_administered_vaccines_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING"], "alias": "source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_accepted_values_tamanu__eca002619343f7b579dceee6a0b93178.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"administered_vaccines\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'DUE','GIVEN','HISTORICAL','MISSED','NOT_GIVEN','OVERDUE','RECORDED_IN_ERROR','SCHEDULED','UNKNOWN','UPCOMING'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["DUE", "GIVEN", "HISTORICAL", "MISSED", "NOT_GIVEN", "OVERDUE", "RECORDED_IN_ERROR", "SCHEDULED", "UNKNOWN", "UPCOMING"], "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_"], "alias": "source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"], ["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines", "source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_relationships_tamanu_ad_0b6a3e9e4e95a5c1ab4b913751db69bd.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select scheduled_vaccine_id as from_field\n from \"app\".\"public\".\"administered_vaccines\"\n where scheduled_vaccine_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"scheduled_vaccines\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scheduled_vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "scheduled_vaccine_id", "to": "source('tamanu', 'scheduled_vaccines')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9"}, "created_at": 1782423652.7966049, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_relationships_tamanu_ad_7aaf964bf8da393b1f62c434ad1c28b9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"administered_vaccines\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other"], "alias": "source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e"}, "created_at": 1782423652.8123305, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_accepted_values_tamanu__dc7be7e03f56f41762aac86d8b244c8e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n injection_site as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"administered_vaccines\"\n group by injection_site\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'left_arm','right_arm','left_thigh','right_thigh','oral','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "injection_site", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "injection_site", "values": ["left_arm", "right_arm", "left_thigh", "right_thigh", "oral", "other"], "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_administered_vaccines_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_administered_vaccines_updated_at_sync_tick"], "alias": "source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7"}, "created_at": 1782423652.8123305, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\source_not_null_tamanu_adminis_fa025d03582b8577644e880861ddccb7.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"administered_vaccines\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce.sql", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_"], "alias": "dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce"}, "created_at": 1782423652.8123305, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "administered_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.administered_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\administered_vaccines.yml\\dbt_utils_source_relationships_6f63962dacc62493b35f6e2fbc7e89ce.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n not_given_reason_id as id\n\n from \"app\".\"public\".\"administered_vaccines\"\n\n where not_given_reason_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'vaccineNotGivenReason'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "not_given_reason_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "not_given_reason_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'vaccineNotGivenReason'", "model": "{{ get_where_subquery(source('tamanu', 'administered_vaccines')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_appointments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_appointments_id.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_appointments_id"], "alias": "source_unique_tamanu_appointments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8123305, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_unique_tamanu_appointments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"appointments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_id.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_id"], "alias": "source_not_null_tamanu_appointments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8123305, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"appointments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4"}, "created_at": 1782423652.8123305, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_relationships_tamanu_ap_4f6b5b155e835f1a5f829748963a8de4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"appointments\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ap_75af671c924175fc8823980196455715.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_ap_75af671c924175fc8823980196455715", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ap_75af671c924175fc8823980196455715", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ap_75af671c924175fc8823980196455715"}, "created_at": 1782423652.8293607, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ap_75af671c924175fc8823980196455715\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_relationships_tamanu_ap_75af671c924175fc8823980196455715.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"appointments\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233"}, "created_at": 1782423652.8298647, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_relationships_tamanu_ap_3a83e0c665a036e02f84cda3d87e5233.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"appointments\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_type_legacy", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_type_legacy.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_type_legacy"], "alias": "source_not_null_tamanu_appointments_type_legacy", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8298647, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_type_legacy.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type_legacy\nfrom \"app\".\"public\".\"appointments\"\nwhere type_legacy is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type_legacy", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type_legacy", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_status.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_status"], "alias": "source_not_null_tamanu_appointments_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8298647, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"appointments\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled"], "alias": "source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256"}, "created_at": 1782423652.8298647, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_accepted_values_tamanu__b6d38a3f13333f1e14a480b836f6f256.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"appointments\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Confirmed','Arrived','Assessed','Seen','No-show','Cancelled'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["Confirmed", "Arrived", "Assessed", "Seen", "No-show", "Cancelled"], "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_"], "alias": "source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867"}, "created_at": 1782423652.8398898, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_relationships_tamanu_ap_478b534e72ae029f417c9a70a155c867.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_group_id as from_field\n from \"app\".\"public\".\"appointments\"\n where location_group_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"location_groups\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_group_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_group_id", "to": "source('tamanu', 'location_groups')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_appointments_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.840908, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"appointments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_"], "alias": "dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911"}, "created_at": 1782423652.84393, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\dbt_utils_source_relationships_cd8239390c6d6981620db84ee8ed2911.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n booking_type_id as id\n\n from \"app\".\"public\".\"appointments\"\n\n where booking_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'bookingType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "booking_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "booking_type_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'bookingType'", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_"], "alias": "dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0"}, "created_at": 1782423652.84393, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\dbt_utils_source_relationships_60d9ac296507fdcb962df35e594046f0.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n appointment_type_id as id\n\n from \"app\".\"public\".\"appointments\"\n\n where appointment_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'appointmentType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "appointment_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "appointment_type_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'appointmentType'", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointments_is_high_priority", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointments_is_high_priority.sql", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointments_is_high_priority"], "alias": "source_not_null_tamanu_appointments_is_high_priority", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8506613, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointments.yml\\source_not_null_tamanu_appointments_is_high_priority.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_high_priority\nfrom \"app\".\"public\".\"appointments\"\nwhere is_high_priority is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_high_priority", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_high_priority", "model": "{{ get_where_subquery(source('tamanu', 'appointments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_appointment_procedure_types_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_appointment_procedure_types_id.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_appointment_procedure_types_id"], "alias": "source_unique_tamanu_appointment_procedure_types_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8516896, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_unique_tamanu_appointment_procedure_types_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_procedure_types_id.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_id"], "alias": "source_not_null_tamanu_appointment_procedure_types_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8527744, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appointment_procedure_types_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_appointment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_appointment_id"], "alias": "source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f"}, "created_at": 1782423652.853306, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appoint_8a482054604b9a95b107c57b47540a0f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect appointment_id\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere appointment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "appointment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "appointment_id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_procedure_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_procedure_type_id"], "alias": "source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703"}, "created_at": 1782423652.8543844, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appoint_71b265d22c36fa3e137a7d89146c8703.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect procedure_type_id\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere procedure_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "procedure_type_id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_procedure_types_created_at.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_created_at"], "alias": "source_not_null_tamanu_appointment_procedure_types_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8549168, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appointment_procedure_types_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_procedure_types_updated_at.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_updated_at"], "alias": "source_not_null_tamanu_appointment_procedure_types_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8559856, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appointment_procedure_types_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042.sql", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick"], "alias": "source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042"}, "created_at": 1782423652.8570461, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_procedure_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_procedure_types.yml\\source_not_null_tamanu_appoint_032ffafa3a69d15d514fd4c9b3714042.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"appointment_procedure_types\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'appointment_procedure_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_appointment_schedules_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_appointment_schedules_id.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_appointment_schedules_id"], "alias": "source_unique_tamanu_appointment_schedules_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.858105, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_unique_tamanu_appointment_schedules_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_id.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_id"], "alias": "source_not_null_tamanu_appointment_schedules_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8591633, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_interval", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_interval.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_interval"], "alias": "source_not_null_tamanu_appointment_schedules_interval", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8603106, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_interval.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect interval\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere interval is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "interval", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "interval", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_frequency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_frequency.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_frequency"], "alias": "source_not_null_tamanu_appointment_schedules_frequency", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.860838, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_frequency.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect frequency\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere frequency is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "frequency", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "frequency", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_created_at.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_created_at"], "alias": "source_not_null_tamanu_appointment_schedules_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8619168, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_updated_at.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_updated_at"], "alias": "source_not_null_tamanu_appointment_schedules_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8624663, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_updated_at_sync_tick"], "alias": "source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c"}, "created_at": 1782423652.8635662, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appoint_122320333d395d375f76621d2d639d2c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_appointment_schedules_is_fully_generated", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_appointment_schedules_is_fully_generated.sql", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_appointment_schedules_is_fully_generated"], "alias": "source_not_null_tamanu_appointment_schedules_is_fully_generated", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.864655, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "appointment_schedules"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.appointment_schedules"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\appointment_schedules.yml\\source_not_null_tamanu_appointment_schedules_is_fully_generated.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_fully_generated\nfrom \"app\".\"public\".\"appointment_schedules\"\nwhere is_fully_generated is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_fully_generated", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_fully_generated", "model": "{{ get_where_subquery(source('tamanu', 'appointment_schedules')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_assets_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_assets_id.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_assets_id"], "alias": "source_unique_tamanu_assets_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.865907, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_unique_tamanu_assets_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"assets\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_id.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_id"], "alias": "source_not_null_tamanu_assets_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8665535, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"assets\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_name.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_name"], "alias": "source_not_null_tamanu_assets_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.867173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"assets\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_type.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_type"], "alias": "source_not_null_tamanu_assets_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8678234, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"assets\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_assets_type__image_png__image_svg", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu_assets_type__image_png__image_svg.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_assets_type__image_png__image_svg"], "alias": "source_accepted_values_tamanu_assets_type__image_png__image_svg", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8690317, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_accepted_values_tamanu_assets_type__image_png__image_svg.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"assets\"\n group by type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'image/png','image/svg'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "type", "values": ["image/png", "image/svg"], "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_data", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_data.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_data"], "alias": "source_not_null_tamanu_assets_data", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8726203, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_data.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect data\nfrom \"app\".\"public\".\"assets\"\nwhere data is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "data", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_assets_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_assets_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\assets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_assets_updated_at_sync_tick"], "alias": "source_not_null_tamanu_assets_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8731568, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "assets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.assets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\assets.yml\\source_not_null_tamanu_assets_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"assets\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'assets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_attachments_id.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_attachments_id"], "alias": "source_unique_tamanu_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8743937, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_unique_tamanu_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"attachments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_attachments_id.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_attachments_id"], "alias": "source_not_null_tamanu_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8762908, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_not_null_tamanu_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"attachments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_attachments_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_attachments_type.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_attachments_type"], "alias": "source_not_null_tamanu_attachments_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8768182, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_not_null_tamanu_attachments_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"attachments\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_attachments_data", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_attachments_data.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_attachments_data"], "alias": "source_not_null_tamanu_attachments_data", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8778763, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_not_null_tamanu_attachments_data.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect data\nfrom \"app\".\"public\".\"attachments\"\nwhere data is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "data", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_attachments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_attachments_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_attachments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_attachments_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.878406, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\attachments.yml\\source_not_null_tamanu_attachments_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"attachments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_certifiable_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_certifiable_vaccines_id.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_certifiable_vaccines_id"], "alias": "source_unique_tamanu_certifiable_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8800201, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_unique_tamanu_certifiable_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_id.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_id"], "alias": "source_not_null_tamanu_certifiable_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.880549, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_created_at.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_created_at"], "alias": "source_not_null_tamanu_certifiable_vaccines_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.881602, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_updated_at.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_updated_at"], "alias": "source_not_null_tamanu_certifiable_vaccines_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.882129, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_certifiable_vaccines_vaccine_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_certifiable_vaccines_vaccine_id.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_certifiable_vaccines_vaccine_id"], "alias": "source_unique_tamanu_certifiable_vaccines_vaccine_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8831866, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_unique_tamanu_certifiable_vaccines_vaccine_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n vaccine_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere vaccine_id is not null\ngroup by vaccine_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "vaccine_id", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_vaccine_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_vaccine_id.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_vaccine_id"], "alias": "source_not_null_tamanu_certifiable_vaccines_vaccine_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.884255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_vaccine_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect vaccine_id\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere vaccine_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "vaccine_id", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_"], "alias": "dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa"}, "created_at": 1782423652.8858967, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\dbt_utils_source_relationships_9500d91ae0467de747470c74facd17fa.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n vaccine_id as id\n\n from \"app\".\"public\".\"certifiable_vaccines\"\n\n where vaccine_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'vaccine'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "vaccine_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'vaccine'", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_"], "alias": "dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824"}, "created_at": 1782423652.8896818, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\dbt_utils_source_relationships_ad1c2893ecdf9c785413816b55008824.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n manufacturer_id as id\n\n from \"app\".\"public\".\"certifiable_vaccines\"\n\n where manufacturer_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'manufacturer'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "manufacturer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "manufacturer_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'manufacturer'", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_icd11_drug_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_icd11_drug_code"], "alias": "source_not_null_tamanu_certifiable_vaccines_icd11_drug_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8928668, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd11_drug_code\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere icd11_drug_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "icd11_drug_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd11_drug_code", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_icd11_disease_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_icd11_disease_code"], "alias": "source_not_null_tamanu_certifiable_vaccines_icd11_disease_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8933818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd11_disease_code\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere icd11_disease_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "icd11_disease_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd11_disease_code", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_vaccine_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_vaccine_code.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_vaccine_code"], "alias": "source_not_null_tamanu_certifiable_vaccines_vaccine_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8939013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_vaccine_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect vaccine_code\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere vaccine_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "vaccine_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "vaccine_code", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_maximum_dosage", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifiable_vaccines_maximum_dosage.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_maximum_dosage"], "alias": "source_not_null_tamanu_certifiable_vaccines_maximum_dosage", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8939013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifiable_vaccines_maximum_dosage.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect maximum_dosage\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere maximum_dosage is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "maximum_dosage", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "maximum_dosage", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9.sql", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick"], "alias": "source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9"}, "created_at": 1782423652.8939013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certifiable_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certifiable_vaccines.yml\\source_not_null_tamanu_certifi_ca807df7c843b63429f7ff00e5ef9ee9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"certifiable_vaccines\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'certifiable_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_certificate_notifications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_certificate_notifications_id.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_certificate_notifications_id"], "alias": "source_unique_tamanu_certificate_notifications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8939013, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_unique_tamanu_certificate_notifications_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certificate_notifications_id.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_id"], "alias": "source_not_null_tamanu_certificate_notifications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8939013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certificate_notifications_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certificate_notifications_type.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_type"], "alias": "source_not_null_tamanu_certificate_notifications_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.8939013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certificate_notifications_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc"], "alias": "source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8"}, "created_at": 1782423652.8939013, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_accepted_values_tamanu__1910f6b17643ddcd64235ac94f4f11e8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"certificate_notifications\"\n group by type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'covid_19_clearance','vaccination_certificate','icao.test','icao.vacc'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "type", "values": ["covid_19_clearance", "vaccination_certificate", "icao.test", "icao.vacc"], "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_require_signing", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_require_signing"], "alias": "source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e"}, "created_at": 1782423652.9034128, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certifi_e5b408a5b57dbdec88d86717d040ea6e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect require_signing\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere require_signing is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "require_signing", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "require_signing", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b"}, "created_at": 1782423652.9034128, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_relationships_tamanu_ce_824713c8e33f184ec25af7ac6ebee94b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"certificate_notifications\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_"], "alias": "source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af"}, "created_at": 1782423652.9034128, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"], ["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests", "source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_relationships_tamanu_ce_dfc1ba9c1b82fadbe1b635468aed77af.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_id as from_field\n from \"app\".\"public\".\"certificate_notifications\"\n where lab_test_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_tests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_id", "to": "source('tamanu', 'lab_tests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certificate_notifications_status.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_status"], "alias": "source_not_null_tamanu_certificate_notifications_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9034128, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certificate_notifications_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore"], "alias": "source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4"}, "created_at": 1782423652.9034128, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_accepted_values_tamanu__8c94030779fe9afff0d475e06b61a9c4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"certificate_notifications\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Queued','Processed','Error','Ignore'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["Queued", "Processed", "Error", "Ignore"], "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_"], "alias": "source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961"}, "created_at": 1782423652.9034128, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_relationships_tamanu_ce_87cffd1d01ff6a56948080ca13e27961.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_request_id as from_field\n from \"app\".\"public\".\"certificate_notifications\"\n where lab_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_request_id", "to": "source('tamanu', 'lab_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_certificate_notifications_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4.sql", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_certificate_notifications_updated_at_sync_tick"], "alias": "source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4"}, "created_at": 1782423652.9034128, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "certificate_notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.certificate_notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\certificate_notifications.yml\\source_not_null_tamanu_certifi_6e82400cb3082e91a13c6d38ca58a8e4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"certificate_notifications\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'certificate_notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_contributing_death_causes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_contributing_death_causes_id.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_contributing_death_causes_id"], "alias": "source_unique_tamanu_contributing_death_causes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9034128, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_unique_tamanu_contributing_death_causes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contributing_death_causes_id.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_id"], "alias": "source_not_null_tamanu_contributing_death_causes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contributing_death_causes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_time_after_onset", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_time_after_onset"], "alias": "source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contrib_5d5a7e80ef08ec17c56726c48a135617.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect time_after_onset\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere time_after_onset is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "time_after_onset", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "time_after_onset", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_patient_death_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_patient_death_data_id"], "alias": "source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contrib_b7a13a5ebb62b2fb7e6b604de40b223b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_death_data_id\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere patient_death_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_death_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_death_data_id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_"], "alias": "source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"], ["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_relationships_tamanu_co_8145a3f4d489e04b6654fb4e861d3396.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_death_data_id as from_field\n from \"app\".\"public\".\"contributing_death_causes\"\n where patient_death_data_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patient_death_data\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_death_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_death_data_id", "to": "source('tamanu', 'patient_death_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_condition_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contributing_death_causes_condition_id.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_condition_id"], "alias": "source_not_null_tamanu_contributing_death_causes_condition_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contributing_death_causes_condition_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition_id\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere condition_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition_id", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\dbt_utils_source_relationships_12fef80b3b86d7b9f38d90b77c9225da.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n condition_id as id\n\n from \"app\".\"public\".\"contributing_death_causes\"\n\n where condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a.sql", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick"], "alias": "source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "contributing_death_causes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\contributing_death_causes.yml\\source_not_null_tamanu_contrib_7a706c62f0cc8a462b4a13b405ae4e8a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"contributing_death_causes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'contributing_death_causes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_death_revert_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_death_revert_logs_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_death_revert_logs_id"], "alias": "source_unique_tamanu_death_revert_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_unique_tamanu_death_revert_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_id"], "alias": "source_not_null_tamanu_death_revert_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_created_at.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_created_at"], "alias": "source_not_null_tamanu_death_revert_logs_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_updated_at.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_updated_at"], "alias": "source_not_null_tamanu_death_revert_logs_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_revert_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_revert_time.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_revert_time"], "alias": "source_not_null_tamanu_death_revert_logs_revert_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_revert_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect revert_time\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere revert_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "revert_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "revert_time", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_death_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_death_data_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_death_data_id"], "alias": "source_not_null_tamanu_death_revert_logs_death_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9192643, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_death_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect death_data_id\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere death_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "death_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "death_data_id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_"], "alias": "source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8"}, "created_at": 1782423652.9349773, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"], ["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_relationships_tamanu_de_2a54bf0ab63be5423117566a1a680fd8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select death_data_id as from_field\n from \"app\".\"public\".\"death_revert_logs\"\n where death_data_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patient_death_data\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "death_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "death_data_id", "to": "source('tamanu', 'patient_death_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_patient_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_patient_id"], "alias": "source_not_null_tamanu_death_revert_logs_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.937067, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220"}, "created_at": 1782423652.938711, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_relationships_tamanu_de_37013d9147d1990112fdde5d737aa220.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"death_revert_logs\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_reverted_by_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_reverted_by_id.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_reverted_by_id"], "alias": "source_not_null_tamanu_death_revert_logs_reverted_by_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9418724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_reverted_by_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reverted_by_id\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere reverted_by_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reverted_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reverted_by_id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0"}, "created_at": 1782423652.9418724, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_relationships_tamanu_de_edb318ae50acbcd231e818d7b02da6b0.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select reverted_by_id as from_field\n from \"app\".\"public\".\"death_revert_logs\"\n where reverted_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reverted_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "reverted_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_death_revert_logs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_death_revert_logs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_death_revert_logs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.945561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "death_revert_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.death_revert_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\death_revert_logs.yml\\source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"death_revert_logs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'death_revert_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_departments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_departments_id.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_departments_id"], "alias": "source_unique_tamanu_departments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9465857, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_unique_tamanu_departments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"departments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_departments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_departments_id.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_departments_id"], "alias": "source_not_null_tamanu_departments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9476128, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_not_null_tamanu_departments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"departments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_departments_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_departments_code.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_departments_code"], "alias": "source_not_null_tamanu_departments_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9476128, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_not_null_tamanu_departments_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"departments\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_departments_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_departments_name.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_departments_name"], "alias": "source_not_null_tamanu_departments_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9476128, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_not_null_tamanu_departments_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"departments\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86"}, "created_at": 1782423652.9476128, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_relationships_tamanu_de_1f3ec675052379764a48aa93acec3e86.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"departments\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_departments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_departments_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\departments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_departments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_departments_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\departments.yml\\source_not_null_tamanu_departments_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"departments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'departments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_devices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_devices_id.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_devices_id"], "alias": "source_unique_tamanu_devices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_unique_tamanu_devices_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"devices\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_id.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_id"], "alias": "source_not_null_tamanu_devices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"devices\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_created_at.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_created_at"], "alias": "source_not_null_tamanu_devices_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"devices\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_updated_at.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_updated_at"], "alias": "source_not_null_tamanu_devices_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"devices\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_last_seen_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_last_seen_at.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_last_seen_at"], "alias": "source_not_null_tamanu_devices_last_seen_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_last_seen_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect last_seen_at\nfrom \"app\".\"public\".\"devices\"\nwhere last_seen_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_seen_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_seen_at", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_registered_by_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_registered_by_id.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_registered_by_id"], "alias": "source_not_null_tamanu_devices_registered_by_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_registered_by_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect registered_by_id\nfrom \"app\".\"public\".\"devices\"\nwhere registered_by_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registered_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "registered_by_id", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_relationships_tamanu_de_d7a378dc5fe60f1196e84e672a6d8160.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select registered_by_id as from_field\n from \"app\".\"public\".\"devices\"\n where registered_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registered_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'users')", "field": "id", "column_name": "registered_by_id", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_devices_scopes", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_devices_scopes.sql", "original_file_path": "models\\sources\\devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_devices_scopes"], "alias": "source_not_null_tamanu_devices_scopes", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\devices.yml\\source_not_null_tamanu_devices_scopes.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect scopes\nfrom \"app\".\"public\".\"devices\"\nwhere scopes is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scopes", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "scopes", "model": "{{ get_where_subquery(source('tamanu', 'devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_discharges_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_discharges_id.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_discharges_id"], "alias": "source_unique_tamanu_discharges_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_unique_tamanu_discharges_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"discharges\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_discharges_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_discharges_id.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_discharges_id"], "alias": "source_not_null_tamanu_discharges_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_not_null_tamanu_discharges_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"discharges\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_discharges_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_discharges_encounter_id.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_discharges_encounter_id"], "alias": "source_not_null_tamanu_discharges_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9512653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_not_null_tamanu_discharges_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"discharges\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1"}, "created_at": 1782423652.9662843, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_9937c1a8558847b3c86b755314f2b0b1.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"discharges\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975"}, "created_at": 1782423652.9662843, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_e5cf1d12f72e8f097325f74916f81975.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select discharger_id as from_field\n from \"app\".\"public\".\"discharges\"\n where discharger_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "discharger_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "discharger_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_"], "alias": "dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9"}, "created_at": 1782423652.9662843, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\dbt_utils_source_relationships_b963dbbb1037214038e4b26b626b1af9.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n disposition_id as id\n\n from \"app\".\"public\".\"discharges\"\n\n where disposition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'dischargeDisposition'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "disposition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "disposition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'dischargeDisposition'", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_discharges_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_discharges_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_discharges_updated_at_sync_tick"], "alias": "source_not_null_tamanu_discharges_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9662843, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_not_null_tamanu_discharges_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"discharges\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd"}, "created_at": 1782423652.9662843, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_d0fd6188d7232f2b06ff02e74d239edd.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_name as from_field\n from \"app\".\"public\".\"discharges\"\n where facility_name is not null\n),\n\nparent as (\n select name as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_name", "to": "source('tamanu', 'facilities')", "field": "name", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c"}, "created_at": 1782423652.9662843, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_bbcfe64432ff46e89906d27535f8520c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_address as from_field\n from \"app\".\"public\".\"discharges\"\n where facility_address is not null\n),\n\nparent as (\n select street_address as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_address", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_address", "to": "source('tamanu', 'facilities')", "field": "street_address", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192.sql", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192"}, "created_at": 1782423652.9822125, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "discharges"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.discharges"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\discharges.yml\\source_relationships_tamanu_di_6cf3073596394ccfd61dfb76d7e2f192.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_town as from_field\n from \"app\".\"public\".\"discharges\"\n where facility_town is not null\n),\n\nparent as (\n select city_town as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_town", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_town", "to": "source('tamanu', 'facilities')", "field": "city_town", "model": "{{ get_where_subquery(source('tamanu', 'discharges')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_document_metadata_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_document_metadata_id.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_document_metadata_id"], "alias": "source_unique_tamanu_document_metadata_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9822125, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_unique_tamanu_document_metadata_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"document_metadata\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_id.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_id"], "alias": "source_not_null_tamanu_document_metadata_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9822125, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"document_metadata\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_name.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_name"], "alias": "source_not_null_tamanu_document_metadata_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9822125, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"document_metadata\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_type.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_type"], "alias": "source_not_null_tamanu_document_metadata_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9822125, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"document_metadata\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_document_uploaded_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_document_uploaded_at.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_document_uploaded_at"], "alias": "source_not_null_tamanu_document_metadata_document_uploaded_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9822125, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_document_uploaded_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect document_uploaded_at\nfrom \"app\".\"public\".\"document_metadata\"\nwhere document_uploaded_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "document_uploaded_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "document_uploaded_at", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9"}, "created_at": 1782423652.9923406, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_relationships_tamanu_do_20161140ec18a6a23a065465ad6ee8c9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"document_metadata\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a"}, "created_at": 1782423652.9923406, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_relationships_tamanu_do_02f551d80abecf58d973c9334597801a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"document_metadata\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_attachment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_attachment_id.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_attachment_id"], "alias": "source_not_null_tamanu_document_metadata_attachment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_attachment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect attachment_id\nfrom \"app\".\"public\".\"document_metadata\"\nwhere attachment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attachment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "attachment_id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_"], "alias": "source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"], ["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments", "source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_relationships_tamanu_do_8cd52ffeba14e9e2f53e95596317806d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select attachment_id as from_field\n from \"app\".\"public\".\"document_metadata\"\n where attachment_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"attachments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attachment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "attachment_id", "to": "source('tamanu', 'attachments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_"], "alias": "source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"], ["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_relationships_tamanu_do_005f8a825dc7f67945bf1b91663cb4d4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select department_id as from_field\n from \"app\".\"public\".\"document_metadata\"\n where department_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"departments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "department_id", "to": "source('tamanu', 'departments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_updated_at_sync_tick"], "alias": "source_not_null_tamanu_document_metadata_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"document_metadata\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_document_metadata_source", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_document_metadata_source.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_document_metadata_source"], "alias": "source_not_null_tamanu_document_metadata_source", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_not_null_tamanu_document_metadata_source.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source\nfrom \"app\".\"public\".\"document_metadata\"\nwhere source is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "source", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "source", "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383.sql", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded"], "alias": "source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "document_metadata"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.document_metadata"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\document_metadata.yml\\source_accepted_values_tamanu__4a25f4b11ec2def8ec64a93b547d0383.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n source as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"document_metadata\"\n group by source\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'patient_letter','uploaded'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "source", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "source", "values": ["patient_letter", "uploaded"], "model": "{{ get_where_subquery(source('tamanu', 'document_metadata')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounters_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounters_id.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounters_id"], "alias": "source_unique_tamanu_encounters_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_unique_tamanu_encounters_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounters\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_id.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_id"], "alias": "source_not_null_tamanu_encounters_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounters\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_created_at.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_created_at"], "alias": "source_not_null_tamanu_encounters_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounters\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_updated_at.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_updated_at"], "alias": "source_not_null_tamanu_encounters_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounters\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_encounter_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_encounter_type.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_encounter_type"], "alias": "source_not_null_tamanu_encounters_encounter_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423652.9978638, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_encounter_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_type\nfrom \"app\".\"public\".\"encounters\"\nwhere encounter_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_type", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination"], "alias": "source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee"}, "created_at": 1782423653.013715, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_accepted_values_tamanu__7eaef115e1c2591f32bf0f19f4fb31ee.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n encounter_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"encounters\"\n group by encounter_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'admission','clinic','imaging','emergency','observation','triage','surveyResponse','vaccination'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "encounter_type", "values": ["admission", "clinic", "imaging", "emergency", "observation", "triage", "surveyResponse", "vaccination"], "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_start_date.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_start_date"], "alias": "source_not_null_tamanu_encounters_start_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.013715, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_start_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_date\nfrom \"app\".\"public\".\"encounters\"\nwhere start_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_date", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_13180f1fedec4cce1227952402808020.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_en_13180f1fedec4cce1227952402808020", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_13180f1fedec4cce1227952402808020", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_13180f1fedec4cce1227952402808020"}, "created_at": 1782423653.013715, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_13180f1fedec4cce1227952402808020\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_13180f1fedec4cce1227952402808020.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"encounters\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87"}, "created_at": 1782423653.013715, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_fa630f610d6086e732a416e5b1276f87.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select examiner_id as from_field\n from \"app\".\"public\".\"encounters\"\n where examiner_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "examiner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "examiner_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64"}, "created_at": 1782423653.013715, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_15328f119f64994547fe5431151c4a64.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"encounters\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_"], "alias": "source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4"}, "created_at": 1782423653.013715, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_aa33f1d99fa13a8f6975b43607c710d4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select department_id as from_field\n from \"app\".\"public\".\"encounters\"\n where department_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"departments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "department_id", "to": "source('tamanu', 'departments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_"], "alias": "dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c"}, "created_at": 1782423653.0295208, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\dbt_utils_source_relationships_2fdae708756336ea20481808cae08a6c.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n patient_billing_type_id as id\n\n from \"app\".\"public\".\"encounters\"\n\n where patient_billing_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'patientBillingType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_billing_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "patient_billing_type_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'patientBillingType'", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_"], "alias": "dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9"}, "created_at": 1782423653.032807, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\dbt_utils_source_relationships_75b30552533a9e6287e5c800df205ee9.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n referral_source_id as id\n\n from \"app\".\"public\".\"encounters\"\n\n where referral_source_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'referralSource'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "referral_source_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "referral_source_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'referralSource'", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64"}, "created_at": 1782423653.033511, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_relationships_tamanu_en_c0792930ba61c5b0fc342a964d525e64.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select planned_location_id as from_field\n from \"app\".\"public\".\"encounters\"\n where planned_location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "planned_location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "planned_location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounters_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounters_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounters_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encounters_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.033511, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounters.yml\\source_not_null_tamanu_encounters_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounters\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounters')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_diagnoses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_diagnoses_id.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_diagnoses_id"], "alias": "source_unique_tamanu_encounter_diagnoses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.033511, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_unique_tamanu_encounter_diagnoses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_id.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_id"], "alias": "source_not_null_tamanu_encounter_diagnoses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.041055, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_created_at.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_created_at"], "alias": "source_not_null_tamanu_encounter_diagnoses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.041055, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_updated_at.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_updated_at"], "alias": "source_not_null_tamanu_encounter_diagnoses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.041055, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected"], "alias": "source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e"}, "created_at": 1782423653.041055, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_accepted_values_tamanu__f61fadc6be341257d0b9f42ad8a8790e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n certainty as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"encounter_diagnoses\"\n group by certainty\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'confirmed','disproven','emergency','error','suspected'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "certainty", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "certainty", "values": ["confirmed", "disproven", "emergency", "error", "suspected"], "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_date.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_date"], "alias": "source_not_null_tamanu_encounter_diagnoses_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0456328, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712"}, "created_at": 1782423653.0456328, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_relationships_tamanu_en_b2c0dc464fc3d89a0b1353f3d4d04712.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"encounter_diagnoses\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536"}, "created_at": 1782423653.0456328, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\dbt_utils_source_relationships_399bad9887181d803b77782bbd98d536.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n diagnosis_id as id\n\n from \"app\".\"public\".\"encounter_diagnoses\"\n\n where diagnosis_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "diagnosis_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "diagnosis_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0456328, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_diagnoses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b.sql", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b"}, "created_at": 1782423653.0456328, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "encounter_diagnoses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.encounter_diagnoses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diagnoses.yml\\source_relationships_tamanu_en_2e0be5ad3d30c46eef8e1b02e4319e5b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"encounter_diagnoses\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diagnoses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_diets_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_diets_id.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_diets_id"], "alias": "source_unique_tamanu_encounter_diets_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0558484, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_unique_tamanu_encounter_diets_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_id.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_id"], "alias": "source_not_null_tamanu_encounter_diets_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0558484, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_encounter_id.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_encounter_id"], "alias": "source_not_null_tamanu_encounter_diets_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0558484, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77"}, "created_at": 1782423653.0558484, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_relationships_tamanu_en_da32df47fb0ce149fa086a1f9e3a6b77.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"encounter_diets\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_diet_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_diet_id.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_diet_id"], "alias": "source_not_null_tamanu_encounter_diets_diet_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_diet_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect diet_id\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere diet_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "diet_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "diet_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_"], "alias": "dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\dbt_utils_source_relationships_dc70639bcbbd060dff898102909054b3.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n diet_id as id\n\n from \"app\".\"public\".\"encounter_diets\"\n\n where diet_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diet'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "diet_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "diet_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diet'", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_created_at.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_created_at"], "alias": "source_not_null_tamanu_encounter_diets_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_updated_at.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_updated_at"], "alias": "source_not_null_tamanu_encounter_diets_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_diets_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_diets_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_diets_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encounter_diets_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_diets"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_diets"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_diets.yml\\source_not_null_tamanu_encounter_diets_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_diets\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_diets')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_history_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_history_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_history_id"], "alias": "source_unique_tamanu_encounter_history_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_unique_tamanu_encounter_history_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_history\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_id"], "alias": "source_not_null_tamanu_encounter_history_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_created_at.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_created_at"], "alias": "source_not_null_tamanu_encounter_history_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_history\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_updated_at.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_updated_at"], "alias": "source_not_null_tamanu_encounter_history_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_history\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_date.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_date"], "alias": "source_not_null_tamanu_encounter_history_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"encounter_history\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_encounter_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_encounter_id"], "alias": "source_not_null_tamanu_encounter_history_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1"}, "created_at": 1782423653.0613797, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_81f7c46b7605420269fdd4eadc8092e1.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_department_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_department_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_department_id"], "alias": "source_not_null_tamanu_encounter_history_department_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0773947, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_department_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect department_id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere department_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "department_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_"], "alias": "source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095"}, "created_at": 1782423653.0773947, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_9559b570b08912110b9c0eda0b850095.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select department_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where department_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"departments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "department_id", "to": "source('tamanu', 'departments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_location_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_location_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_location_id"], "alias": "source_not_null_tamanu_encounter_history_location_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0773947, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_location_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect location_id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere location_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "location_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c"}, "created_at": 1782423653.0773947, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_be319768c2bacab4a4eff3bc94b92d6c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_examiner_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_examiner_id.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_examiner_id"], "alias": "source_not_null_tamanu_encounter_history_examiner_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0773947, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_examiner_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect examiner_id\nfrom \"app\".\"public\".\"encounter_history\"\nwhere examiner_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "examiner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "examiner_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99"}, "created_at": 1782423653.0773947, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_6ad0a05d11fc4402385b1f3a39441a99.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select examiner_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where examiner_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "examiner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "examiner_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_encounter_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_encounter_type.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_encounter_type"], "alias": "source_not_null_tamanu_encounter_history_encounter_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0773947, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_encounter_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_type\nfrom \"app\".\"public\".\"encounter_history\"\nwhere encounter_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_type", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination"], "alias": "source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7"}, "created_at": 1782423653.0773947, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_accepted_values_tamanu__00ad04c72cc0ab49990f16abcadc79a7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n encounter_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"encounter_history\"\n group by encounter_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'admission','clinic','imaging','emergency','observation','triage','surveyResponse','vaccination'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "encounter_type", "values": ["admission", "clinic", "imaging", "emergency", "observation", "triage", "surveyResponse", "vaccination"], "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encounter_history_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0773947, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_history\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_relationships_tamanu_en_03bed6c25cbc3fccbdc2ed0a6f6e2b9f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select actor_id as from_field\n from \"app\".\"public\".\"encounter_history\"\n where actor_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "actor_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "actor_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_history_change_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_history_change_type.sql", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_history_change_type"], "alias": "source_not_null_tamanu_encounter_history_change_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": "change_type IS NOT NULL", "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "where": "change_type IS NOT NULL"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(where=\"change_type IS NOT NULL\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_history"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_history.yml\\source_not_null_tamanu_encounter_history_change_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect change_type\nfrom (select * from \"app\".\"public\".\"encounter_history\" where change_type IS NOT NULL) dbt_subquery\nwhere change_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "change_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "change_type", "model": "{{ get_where_subquery(source('tamanu', 'encounter_history')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_pause_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_pause_prescriptions_id.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_pause_prescriptions_id"], "alias": "source_unique_tamanu_encounter_pause_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_unique_tamanu_encounter_pause_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_pause_prescriptions_id.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_id"], "alias": "source_not_null_tamanu_encounter_pause_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encounter_pause_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id"], "alias": "source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_9a64a18275dbccf86970633bcee907c1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_prescription_id\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere encounter_prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_pause_duration", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_pause_duration"], "alias": "source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_0e3f0f5bf7a967a5d1a0aaaceb7dca2f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pause_duration\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere pause_duration is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pause_duration", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pause_duration", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit"], "alias": "source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_ada94f6eebab22f9ca0b527d737830cd.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pause_time_unit\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere pause_time_unit is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pause_time_unit", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pause_time_unit", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date"], "alias": "source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_42705cf7c6542d71a20652516373c5f0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pause_start_date\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere pause_start_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pause_start_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pause_start_date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date"], "alias": "source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_f85d28735b13d4ffe2b7225869bdd176.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pause_end_date\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere pause_end_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pause_end_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pause_end_date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_pause_prescriptions_created_at.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_created_at"], "alias": "source_not_null_tamanu_encounter_pause_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encounter_pause_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_pause_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_updated_at"], "alias": "source_not_null_tamanu_encounter_pause_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encounter_pause_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df.sql", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescriptions.yml\\source_not_null_tamanu_encount_09d2d7e2e4a39d02d1e644024822b8df.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_pause_prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_pause_prescription_histories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_pause_prescription_histories_id.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_pause_prescription_histories_id"], "alias": "source_unique_tamanu_encounter_pause_prescription_histories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_unique_tamanu_encounter_pause_prescription_histories_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_id"], "alias": "source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_e04820fb3dadcccb272ee4c587d040f4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id"], "alias": "source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481"}, "created_at": 1782423653.0931048, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_fcc5298b7bacf4500f9c368d8b052481.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_prescription_id\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere encounter_prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_action", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_action"], "alias": "source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_a3e1e8721a8439c141d7bb0e3a2efd88.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect action\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere action is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "action", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "action", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_action_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_action_date"], "alias": "source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_1ea81f05063da733f0d68858d21d4803.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect action_date\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere action_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "action_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "action_date", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_created_at"], "alias": "source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_ad73d183557f9bceb67c3b570cda64ac.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_updated_at"], "alias": "source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_47d2ce9d4c4a56e6fbaa7ac04c727b7e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb.sql", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_pause_prescription_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_pause_prescription_histories.yml\\source_not_null_tamanu_encount_d358191dd4e9dbefd0bd207aa1e537cb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_pause_prescription_histories\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_pause_prescription_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_encounter_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_encounter_prescriptions_id.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_encounter_prescriptions_id"], "alias": "source_unique_tamanu_encounter_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_unique_tamanu_encounter_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_id.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_id"], "alias": "source_not_null_tamanu_encounter_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_encounter_id.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_encounter_id"], "alias": "source_not_null_tamanu_encounter_prescriptions_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_prescription_id.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_prescription_id"], "alias": "source_not_null_tamanu_encounter_prescriptions_prescription_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_prescription_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect prescription_id\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge"], "alias": "source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encount_1ee0fd9065d5d575facf3a3364eee90b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_selected_for_discharge\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere is_selected_for_discharge is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_selected_for_discharge", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_selected_for_discharge", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_created_at.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_created_at"], "alias": "source_not_null_tamanu_encounter_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encounter_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_updated_at"], "alias": "source_not_null_tamanu_encounter_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encounter_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388.sql", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounter_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\encounter_prescriptions.yml\\source_not_null_tamanu_encount_78ba745983e7c4b97420f52e319f9388.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"encounter_prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'encounter_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_facilities_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_facilities_id.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_facilities_id"], "alias": "source_unique_tamanu_facilities_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_unique_tamanu_facilities_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"facilities\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_id.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_id"], "alias": "source_not_null_tamanu_facilities_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"facilities\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_code.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_code"], "alias": "source_not_null_tamanu_facilities_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"facilities\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_name.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_name"], "alias": "source_not_null_tamanu_facilities_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.108969, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"facilities\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_facilities_visibility_status__current__historical", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_facilities_visibility_status__current__historical"], "alias": "source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_accepted_values_tamanu__ce0d4ff270e4dd6acad8df864e06be83.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n visibility_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"facilities\"\n group by visibility_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'current','historical'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "visibility_status", "values": ["current", "historical"], "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_"], "alias": "dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\dbt_utils_source_relationships_4e36c38d45264d0e0fe9353e8a21d88d.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n catchment_id as id\n\n from \"app\".\"public\".\"facilities\"\n\n where catchment_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'catchment'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "catchment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "catchment_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'catchment'", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_updated_at_sync_tick"], "alias": "source_not_null_tamanu_facilities_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"facilities\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_facilities_is_sensitive", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_facilities_is_sensitive.sql", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_facilities_is_sensitive"], "alias": "source_not_null_tamanu_facilities_is_sensitive", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\facilities.yml\\source_not_null_tamanu_facilities_is_sensitive.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_sensitive\nfrom \"app\".\"public\".\"facilities\"\nwhere is_sensitive is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_sensitive", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_sensitive", "model": "{{ get_where_subquery(source('tamanu', 'facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_area_external_codes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_area_external_codes_id.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_area_external_codes_id"], "alias": "source_unique_tamanu_imaging_area_external_codes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_unique_tamanu_imaging_area_external_codes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_id.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_id"], "alias": "source_not_null_tamanu_imaging_area_external_codes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_created_at.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_created_at"], "alias": "source_not_null_tamanu_imaging_area_external_codes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_updated_at.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_updated_at"], "alias": "source_not_null_tamanu_imaging_area_external_codes_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_visibility_status"], "alias": "source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_2c80c936835ef2b87ae341b8ce337f65.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_area_external_codes_area_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_area_external_codes_area_id.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_area_external_codes_area_id"], "alias": "source_unique_tamanu_imaging_area_external_codes_area_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.124688, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_unique_tamanu_imaging_area_external_codes_area_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n area_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere area_id is not null\ngroup by area_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "area_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_area_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_area_id.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_area_id"], "alias": "source_not_null_tamanu_imaging_area_external_codes_area_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_area_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect area_id\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere area_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "area_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_"], "alias": "source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_relationships_tamanu_im_8f9ba5858d5ba292092dc613bafcdc4a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select area_id as from_field\n from \"app\".\"public\".\"imaging_area_external_codes\"\n where area_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"reference_data\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "area_id", "to": "source('tamanu', 'reference_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_area_external_codes_code.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_code"], "alias": "source_not_null_tamanu_imaging_area_external_codes_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_area_external_codes_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab.sql", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_area_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_area_external_codes.yml\\source_not_null_tamanu_imaging_093823420e8e7b4e6fc17405c6e01eab.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_area_external_codes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_area_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_requests_id.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_requests_id"], "alias": "source_unique_tamanu_imaging_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_unique_tamanu_imaging_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_id.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_id"], "alias": "source_not_null_tamanu_imaging_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_created_at.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_created_at"], "alias": "source_not_null_tamanu_imaging_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_updated_at.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_updated_at"], "alias": "source_not_null_tamanu_imaging_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error"], "alias": "source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_accepted_values_tamanu__e706cfda0e37002b14546067a36e4017.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"imaging_requests\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'pending','in_progress','completed','cancelled','deleted','entered_in_error'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["pending", "in_progress", "completed", "cancelled", "deleted", "entered_in_error"], "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_requested_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_requested_date.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_requested_date"], "alias": "source_not_null_tamanu_imaging_requests_requested_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_requested_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect requested_date\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere requested_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "requested_date", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82"}, "created_at": 1782423653.1410801, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_e91cdd17135bacaefbb0e41a863dfa82.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a"}, "created_at": 1782423653.1566188, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_57226fb69578110ada58d2a51d68aa8a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select requested_by_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where requested_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "requested_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6"}, "created_at": 1782423653.1566188, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_0abbc5c1b7e70c78fd1ace5ee79344b6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select completed_by_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where completed_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "completed_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "completed_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2"}, "created_at": 1782423653.1566188, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_00fb4796a67be837520f7e81978749e2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_id", "to": "source('tamanu', 'locations')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay"], "alias": "source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f"}, "created_at": 1782423653.1566188, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_accepted_values_tamanu__5a491239c2adb0ef1cf07f3eb018ee9f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n imaging_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"imaging_requests\"\n group by imaging_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'angiogram','colonoscopy','ctScan','ecg','echocardiogram','endoscopy','fluroscopy','holterMonitor','mammogram','orthopantomography','mri','stressTest','ultrasound','vascularStudy','xRay'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "imaging_type", "values": ["angiogram", "colonoscopy", "ctScan", "ecg", "echocardiogram", "endoscopy", "fluroscopy", "holterMonitor", "mammogram", "orthopantomography", "mri", "stressTest", "ultrasound", "vascularStudy", "xRay"], "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_"], "alias": "source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1"}, "created_at": 1782423653.1566188, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"], ["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups", "source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_relationships_tamanu_im_9eedcc49686db126a35af7db386be7f1.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_group_id as from_field\n from \"app\".\"public\".\"imaging_requests\"\n where location_group_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"location_groups\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_group_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_group_id", "to": "source('tamanu', 'location_groups')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_requests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_requests_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_requests_display_id.sql", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_requests_display_id"], "alias": "source_not_null_tamanu_imaging_requests_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_requests.yml\\source_not_null_tamanu_imaging_requests_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_id\nfrom \"app\".\"public\".\"imaging_requests\"\nwhere display_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_request_areas_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_request_areas_id.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_request_areas_id"], "alias": "source_unique_tamanu_imaging_request_areas_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_unique_tamanu_imaging_request_areas_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_id.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_id"], "alias": "source_not_null_tamanu_imaging_request_areas_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_created_at.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_created_at"], "alias": "source_not_null_tamanu_imaging_request_areas_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_updated_at.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_updated_at"], "alias": "source_not_null_tamanu_imaging_request_areas_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_imaging_request_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_imaging_request_id.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_imaging_request_id"], "alias": "source_not_null_tamanu_imaging_request_areas_imaging_request_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_imaging_request_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect imaging_request_id\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere imaging_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "imaging_request_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_"], "alias": "source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"], ["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_relationships_tamanu_im_0465e87fe241b66c7f71cdc1b6e494e6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select imaging_request_id as from_field\n from \"app\".\"public\".\"imaging_request_areas\"\n where imaging_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"imaging_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "imaging_request_id", "to": "source('tamanu', 'imaging_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_area_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_request_areas_area_id.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_area_id"], "alias": "source_not_null_tamanu_imaging_request_areas_area_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_request_areas_area_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect area_id\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere area_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "area_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_"], "alias": "source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_relationships_tamanu_im_27f7127d31a2d9a34a6803aa45ae1e55.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select area_id as from_field\n from \"app\".\"public\".\"imaging_request_areas\"\n where area_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"reference_data\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "area_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "area_id", "to": "source('tamanu', 'reference_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760.sql", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_request_areas"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_request_areas.yml\\source_not_null_tamanu_imaging_6297633ac354d8d30be1f15d8121c760.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_request_areas\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_request_areas')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_results_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_results_id.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_results_id"], "alias": "source_unique_tamanu_imaging_results_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_unique_tamanu_imaging_results_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_results\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_id.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_id"], "alias": "source_not_null_tamanu_imaging_results_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1725845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_results\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_created_at.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_created_at"], "alias": "source_not_null_tamanu_imaging_results_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_results\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_updated_at.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_updated_at"], "alias": "source_not_null_tamanu_imaging_results_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_results\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_results_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_results\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_visibility_status.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_visibility_status"], "alias": "source_not_null_tamanu_imaging_results_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"imaging_results\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_imaging_request_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_imaging_request_id.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_imaging_request_id"], "alias": "source_not_null_tamanu_imaging_results_imaging_request_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_imaging_request_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect imaging_request_id\nfrom \"app\".\"public\".\"imaging_results\"\nwhere imaging_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "imaging_request_id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_"], "alias": "source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_requests"], ["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_relationships_tamanu_im_e277fbdaf6496fc209dae2c03fae6cde.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select imaging_request_id as from_field\n from \"app\".\"public\".\"imaging_results\"\n where imaging_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"imaging_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "imaging_request_id", "to": "source('tamanu', 'imaging_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_relationships_tamanu_im_488baf45204d64cd9e491ec5e7b600a5.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select completed_by_id as from_field\n from \"app\".\"public\".\"imaging_results\"\n where completed_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "completed_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "completed_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_results_completed_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_results_completed_at.sql", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_results_completed_at"], "alias": "source_not_null_tamanu_imaging_results_completed_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_results"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_results"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_results.yml\\source_not_null_tamanu_imaging_results_completed_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect completed_at\nfrom \"app\".\"public\".\"imaging_results\"\nwhere completed_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "completed_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "completed_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_results')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_imaging_type_external_codes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_imaging_type_external_codes_id.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_imaging_type_external_codes_id"], "alias": "source_unique_tamanu_imaging_type_external_codes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_unique_tamanu_imaging_type_external_codes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_type_external_codes_id.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_id"], "alias": "source_not_null_tamanu_imaging_type_external_codes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_type_external_codes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_type_external_codes_created_at.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_created_at"], "alias": "source_not_null_tamanu_imaging_type_external_codes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_type_external_codes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_type_external_codes_updated_at.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_updated_at"], "alias": "source_not_null_tamanu_imaging_type_external_codes_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_type_external_codes_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_visibility_status"], "alias": "source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_98a787e9ac00a6d0baf47258f2b7b804.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_imaging_type_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_imaging_type_code"], "alias": "source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a"}, "created_at": 1782423653.1883411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_373baf34e4baa1d32de80325f0bc175a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect imaging_type_code\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere imaging_type_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "imaging_type_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "imaging_type_code", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_type_external_codes_code.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_code"], "alias": "source_not_null_tamanu_imaging_type_external_codes_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_type_external_codes_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85.sql", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick"], "alias": "source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "imaging_type_external_codes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\imaging_type_external_codes.yml\\source_not_null_tamanu_imaging_34469d4bbdbd68c469cd712b71de1d85.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"imaging_type_external_codes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'imaging_type_external_codes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoices_id.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoices_id"], "alias": "source_unique_tamanu_invoices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_unique_tamanu_invoices_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoices\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_id.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_id"], "alias": "source_not_null_tamanu_invoices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoices\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_display_id.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_display_id"], "alias": "source_not_null_tamanu_invoices_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_id\nfrom \"app\".\"public\".\"invoices\"\nwhere display_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_date.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_date"], "alias": "source_not_null_tamanu_invoices_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"invoices\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_status.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_status"], "alias": "source_not_null_tamanu_invoices_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"invoices\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised"], "alias": "source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_accepted_values_tamanu__c1bf7ef91745e936067f21d8c60cdee9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"invoices\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'cancelled','in_progress','finalised'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["cancelled", "in_progress", "finalised"], "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_encounter_id.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_encounter_id"], "alias": "source_not_null_tamanu_invoices_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"invoices\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea"}, "created_at": 1782423653.2042527, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_relationships_tamanu_in_47c85a765c41af008005ce231dcca4ea.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"invoices\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_created_at.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_created_at"], "alias": "source_not_null_tamanu_invoices_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoices\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_patient_payment_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_patient_payment_status.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_patient_payment_status"], "alias": "source_not_null_tamanu_invoices_patient_payment_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_patient_payment_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_payment_status\nfrom \"app\".\"public\".\"invoices\"\nwhere patient_payment_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_payment_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_payment_status", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial"], "alias": "source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_accepted_values_tamanu__0ccf9b61af9a58ab61ca9ddeb2258ca8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n patient_payment_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"invoices\"\n group by patient_payment_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'unpaid','paid','partial'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_payment_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "patient_payment_status", "values": ["unpaid", "paid", "partial"], "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_insurer_payment_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_insurer_payment_status.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_insurer_payment_status"], "alias": "source_not_null_tamanu_invoices_insurer_payment_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_insurer_payment_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect insurer_payment_status\nfrom \"app\".\"public\".\"invoices\"\nwhere insurer_payment_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurer_payment_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "insurer_payment_status", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected"], "alias": "source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_accepted_values_tamanu__1c8058746f05ad7f386a1977c9970d1d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n insurer_payment_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"invoices\"\n group by insurer_payment_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'unpaid','paid','partial','rejected'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurer_payment_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "insurer_payment_status", "values": ["unpaid", "paid", "partial", "rejected"], "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoices_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices.yml\\source_not_null_tamanu_invoices_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoices\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoices_invoice_insurance_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoices_invoice_insurance_plans_id.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoices_invoice_insurance_plans_id"], "alias": "source_unique_tamanu_invoices_invoice_insurance_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_unique_tamanu_invoices_invoice_insurance_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoices_invoice_insurance_plans_id.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_id"], "alias": "source_not_null_tamanu_invoices_invoice_insurance_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoices_invoice_insurance_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_created_at"], "alias": "source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_d7aed70f771949ca060c230721f8956d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at"], "alias": "source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_0530506cb6d69b20eb2e4c0c8435396c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_54cf6165ff5d9eab52272c83a5e7eed1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id"], "alias": "source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_8cac9489249ae58e0afdb997c3136ed1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_id\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere invoice_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc.sql", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id"], "alias": "source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices_invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoices_invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_df09d95973bef45ab2f4e46a478b9dbc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_insurance_plan_id\nfrom \"app\".\"public\".\"invoices_invoice_insurance_plans\"\nwhere invoice_insurance_plan_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_insurance_plan_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_insurance_plan_id", "model": "{{ get_where_subquery(source('tamanu', 'invoices_invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_discounts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_discounts_id.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_discounts_id"], "alias": "source_unique_tamanu_invoice_discounts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2199745, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_unique_tamanu_invoice_discounts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_id.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_id"], "alias": "source_not_null_tamanu_invoice_discounts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2357676, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_invoice_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_invoice_id.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_invoice_id"], "alias": "source_not_null_tamanu_invoice_discounts_invoice_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2357676, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_invoice_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_id\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere invoice_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_"], "alias": "source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b"}, "created_at": 1782423653.2357676, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"], ["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_relationships_tamanu_in_187ceacf5902dc903aa82cf304fcb06b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_id as from_field\n from \"app\".\"public\".\"invoice_discounts\"\n where invoice_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoices\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_id", "to": "source('tamanu', 'invoices')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_percentage", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_percentage.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_percentage"], "alias": "source_not_null_tamanu_invoice_discounts_percentage", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2357676, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_percentage.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect percentage\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere percentage is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "percentage", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "percentage", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_is_manual", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_is_manual.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_is_manual"], "alias": "source_not_null_tamanu_invoice_discounts_is_manual", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2413845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_is_manual.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_manual\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere is_manual is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_manual", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_manual", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_applied_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_applied_by_user_id.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_applied_by_user_id"], "alias": "source_not_null_tamanu_invoice_discounts_applied_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.2413845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_applied_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect applied_by_user_id\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere applied_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "applied_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "applied_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e"}, "created_at": 1782423653.2413845, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_relationships_tamanu_in_3c1a8b81c61e8d514506e3c15765bb9e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select applied_by_user_id as from_field\n from \"app\".\"public\".\"invoice_discounts\"\n where applied_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "applied_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "applied_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_applied_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_applied_time.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_applied_time"], "alias": "source_not_null_tamanu_invoice_discounts_applied_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3075953, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_applied_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect applied_time\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere applied_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "applied_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "applied_time", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_created_at.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_created_at"], "alias": "source_not_null_tamanu_invoice_discounts_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3093562, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_discounts_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_discounts_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_discounts_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3103833, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_discounts.yml\\source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_discounts\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_insurance_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_insurance_plans_id.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_insurance_plans_id"], "alias": "source_unique_tamanu_invoice_insurance_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3109102, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_unique_tamanu_invoice_insurance_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plans_id.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_id"], "alias": "source_not_null_tamanu_invoice_insurance_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3125188, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_insurance_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plans_created_at.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_created_at"], "alias": "source_not_null_tamanu_invoice_insurance_plans_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3135524, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_insurance_plans_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plans_updated_at.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_updated_at"], "alias": "source_not_null_tamanu_invoice_insurance_plans_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3135524, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_insurance_plans_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72"}, "created_at": 1782423653.3145766, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_e01100816cd295efc9820ad3424c3f72.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plans_code.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_code"], "alias": "source_not_null_tamanu_invoice_insurance_plans_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3145766, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_insurance_plans_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plans_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0.sql", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plans_visibility_status"], "alias": "source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plans.yml\\source_not_null_tamanu_invoice_45af4ee809db73b2654c1ed0ce4cfed0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"invoice_insurance_plans\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_insurance_plan_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_insurance_plan_items_id.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_insurance_plan_items_id"], "alias": "source_unique_tamanu_invoice_insurance_plan_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_unique_tamanu_invoice_insurance_plan_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plan_items_id.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_id"], "alias": "source_not_null_tamanu_invoice_insurance_plan_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_insurance_plan_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plan_items_created_at.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_created_at"], "alias": "source_not_null_tamanu_invoice_insurance_plan_items_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_insurance_plan_items_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurance_plan_items_updated_at.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_updated_at"], "alias": "source_not_null_tamanu_invoice_insurance_plan_items_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_insurance_plan_items_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_855dad3e2edede24eb80b170e7889448.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id"], "alias": "source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_cebcbb5ef9fa7a68984d859e6210b7c4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_insurance_plan_id\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere invoice_insurance_plan_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_insurance_plan_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_insurance_plan_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42.sql", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id"], "alias": "source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurance_plan_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurance_plan_items.yml\\source_not_null_tamanu_invoice_fefe28a15361de8e28ef99931807ef42.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_product_id\nfrom \"app\".\"public\".\"invoice_insurance_plan_items\"\nwhere invoice_product_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_product_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_product_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurance_plan_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_insurer_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_insurer_payments_id.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_insurer_payments_id"], "alias": "source_unique_tamanu_invoice_insurer_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_unique_tamanu_invoice_insurer_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurer_payments_id.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_id"], "alias": "source_not_null_tamanu_invoice_insurer_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_insurer_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_insurer_payments_invoice_payment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_insurer_payments_invoice_payment_id"], "alias": "source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_unique_tamanu_invoice_i_ff616bdd4f24f65bacff754ba7572933.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n invoice_payment_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere invoice_payment_id is not null\ngroup by invoice_payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "invoice_payment_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id"], "alias": "source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_983343c9acd4b1a168a63a5a81a526dc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_payment_id\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere invoice_payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_payment_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_"], "alias": "source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc"}, "created_at": 1782423653.3163357, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"], ["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments", "source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_relationships_tamanu_in_5c75d1e9aa64ee85ca7c87d087357efc.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_payment_id as from_field\n from \"app\".\"public\".\"invoice_insurer_payments\"\n where invoice_payment_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoice_payments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_payment_id", "to": "source('tamanu', 'invoice_payments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_insurer_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurer_payments_insurer_id.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_insurer_id"], "alias": "source_not_null_tamanu_invoice_insurer_payments_insurer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3303611, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_insurer_payments_insurer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect insurer_id\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere insurer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "insurer_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_"], "alias": "dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f"}, "created_at": 1782423653.3303611, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\dbt_utils_source_relationships_b8dfad1a14f91a00c4e0bffa71a4747f.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n insurer_id as id\n\n from \"app\".\"public\".\"invoice_insurer_payments\"\n\n where insurer_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'insurer'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "insurer_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'insurer'", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurer_payments_status.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_status"], "alias": "source_not_null_tamanu_invoice_insurer_payments_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3303611, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_insurer_payments_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected"], "alias": "source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b"}, "created_at": 1782423653.3303611, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_accepted_values_tamanu__daaaf49f65b35ccd155c3f4b43dc868b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"invoice_insurer_payments\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'unpaid','paid','partial','rejected'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["unpaid", "paid", "partial", "rejected"], "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_insurer_payments_created_at.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_created_at"], "alias": "source_not_null_tamanu_invoice_insurer_payments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3303611, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_insurer_payments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9.sql", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9"}, "created_at": 1782423653.3303611, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_insurer_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_insurer_payments.yml\\source_not_null_tamanu_invoice_a7574701f269308adcb445479d3a8ea9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_insurer_payments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_insurer_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_items_id.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_items_id"], "alias": "source_unique_tamanu_invoice_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3303611, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_unique_tamanu_invoice_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_items\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_id.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_id"], "alias": "source_not_null_tamanu_invoice_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.341467, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_items\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_invoice_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_invoice_id.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_invoice_id"], "alias": "source_not_null_tamanu_invoice_items_invoice_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.341467, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_invoice_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_id\nfrom \"app\".\"public\".\"invoice_items\"\nwhere invoice_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_"], "alias": "source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8"}, "created_at": 1782423653.341467, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"], ["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_relationships_tamanu_in_e59051bf7847c8e21d20ee2a38ef66d8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_id as from_field\n from \"app\".\"public\".\"invoice_items\"\n where invoice_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoices\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_id", "to": "source('tamanu', 'invoices')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_order_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_order_date.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_order_date"], "alias": "source_not_null_tamanu_invoice_items_order_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_order_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_date\nfrom \"app\".\"public\".\"invoice_items\"\nwhere order_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_date", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_"], "alias": "source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"], ["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products", "source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_relationships_tamanu_in_c9ea1a56be53f31bce74d8eb386c0513.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select product_id as from_field\n from \"app\".\"public\".\"invoice_items\"\n where product_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoice_products\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "product_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "product_id", "to": "source('tamanu', 'invoice_products')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_quantity", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_quantity.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_quantity"], "alias": "source_not_null_tamanu_invoice_items_quantity", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_quantity.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect quantity\nfrom \"app\".\"public\".\"invoice_items\"\nwhere quantity is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "quantity", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "quantity", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_ordered_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_ordered_by_user_id.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_ordered_by_user_id"], "alias": "source_not_null_tamanu_invoice_items_ordered_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_ordered_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect ordered_by_user_id\nfrom \"app\".\"public\".\"invoice_items\"\nwhere ordered_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ordered_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ordered_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_relationships_tamanu_in_f72f9ac5edc0c5ca5ee9ed64f9ad749a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select ordered_by_user_id as from_field\n from \"app\".\"public\".\"invoice_items\"\n where ordered_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ordered_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "ordered_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_created_at.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_created_at"], "alias": "source_not_null_tamanu_invoice_items_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_items\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_items_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_items\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_items_approved", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_items_approved.sql", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_items_approved"], "alias": "source_not_null_tamanu_invoice_items_approved", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_items.yml\\source_not_null_tamanu_invoice_items_approved.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect approved\nfrom \"app\".\"public\".\"invoice_items\"\nwhere approved is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "approved", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "approved", "model": "{{ get_where_subquery(source('tamanu', 'invoice_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_item_discounts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_item_discounts_id.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_item_discounts_id"], "alias": "source_unique_tamanu_invoice_item_discounts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_unique_tamanu_invoice_item_discounts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_id.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_id"], "alias": "source_not_null_tamanu_invoice_item_discounts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_invoice_item_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_invoice_item_id.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_invoice_item_id"], "alias": "source_not_null_tamanu_invoice_item_discounts_invoice_item_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_invoice_item_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_item_id\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere invoice_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_item_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_item_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_"], "alias": "source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937"}, "created_at": 1782423653.3460274, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_items"], ["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_relationships_tamanu_in_f0981d8d8855f4c026e5bea8008e7937.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_item_id as from_field\n from \"app\".\"public\".\"invoice_item_discounts\"\n where invoice_item_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoice_items\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_item_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_item_id", "to": "source('tamanu', 'invoice_items')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_amount", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_amount.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_amount"], "alias": "source_not_null_tamanu_invoice_item_discounts_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_created_at.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_created_at"], "alias": "source_not_null_tamanu_invoice_item_discounts_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_85f684f1cd1756ed7eb800b2c37208bc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_discounts_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_discounts_type.sql", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_discounts_type"], "alias": "source_not_null_tamanu_invoice_item_discounts_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_discounts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_discounts.yml\\source_not_null_tamanu_invoice_item_discounts_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"invoice_item_discounts\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_discounts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_item_finalised_insurances_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_item_finalised_insurances_id.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_item_finalised_insurances_id"], "alias": "source_unique_tamanu_invoice_item_finalised_insurances_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_unique_tamanu_invoice_item_finalised_insurances_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_item_finalised_insurances_id.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_id"], "alias": "source_not_null_tamanu_invoice_item_finalised_insurances_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_item_finalised_insurances_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_created_at"], "alias": "source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_f54971eab00cb6a0f462bf65df782cfc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_updated_at"], "alias": "source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_7c5e6c11a6f4751087acac89e486a0b2.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_971be7805449de9c1f341fbfae327da2.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id"], "alias": "source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_8acbf1c0dc48294b369e9adf4df1f7c8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_item_id\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere invoice_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_item_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_item_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final"], "alias": "source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_28dea00218802bfd720c5aff04cfc098.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coverage_value_final\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere coverage_value_final is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "coverage_value_final", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coverage_value_final", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45.sql", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id"], "alias": "source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_item_finalised_insurances"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_item_finalised_insurances.yml\\source_not_null_tamanu_invoice_f202aba7fb5eaffa7fcedfd832387d45.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_insurance_plan_id\nfrom \"app\".\"public\".\"invoice_item_finalised_insurances\"\nwhere invoice_insurance_plan_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_insurance_plan_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_insurance_plan_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_item_finalised_insurances')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_patient_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_patient_payments_id.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_patient_payments_id"], "alias": "source_unique_tamanu_invoice_patient_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_unique_tamanu_invoice_patient_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_patient_payments_id.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_id"], "alias": "source_not_null_tamanu_invoice_patient_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_patient_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_patient_payments_invoice_payment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_patient_payments_invoice_payment_id"], "alias": "source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7"}, "created_at": 1782423653.3619113, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_unique_tamanu_invoice_p_1aa0e611a3519c89055180dfbe7408c7.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n invoice_payment_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere invoice_payment_id is not null\ngroup by invoice_payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "invoice_payment_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_invoice_payment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_invoice_payment_id"], "alias": "source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_166108b7670f067441de68d2351adf80.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_payment_id\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere invoice_payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_payment_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_"], "alias": "source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"], ["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments", "source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_relationships_tamanu_in_d5cfe189c00d884b66146447018c3270.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_payment_id as from_field\n from \"app\".\"public\".\"invoice_patient_payments\"\n where invoice_payment_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoice_payments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_payment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_payment_id", "to": "source('tamanu', 'invoice_payments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_method_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_patient_payments_method_id.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_method_id"], "alias": "source_not_null_tamanu_invoice_patient_payments_method_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_patient_payments_method_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect method_id\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere method_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "method_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "method_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_"], "alias": "dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\dbt_utils_source_relationships_9564c833f21ab7df1899acc03abd6bba.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n method_id as id\n\n from \"app\".\"public\".\"invoice_patient_payments\"\n\n where method_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'paymentMethod'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "method_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "method_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'paymentMethod'", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_patient_payments_created_at.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_created_at"], "alias": "source_not_null_tamanu_invoice_patient_payments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_patient_payments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa.sql", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_patient_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_patient_payments.yml\\source_not_null_tamanu_invoice_4ff9253104ad2bf5d7a753f4573d9bfa.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_patient_payments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_patient_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_payments_id.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_payments_id"], "alias": "source_unique_tamanu_invoice_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_unique_tamanu_invoice_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_id.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_id"], "alias": "source_not_null_tamanu_invoice_payments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_invoice_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_invoice_id.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_invoice_id"], "alias": "source_not_null_tamanu_invoice_payments_invoice_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_invoice_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_id\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere invoice_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_"], "alias": "source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03"}, "created_at": 1782423653.3776784, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoices"], ["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoices", "source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_relationships_tamanu_in_a2c3183cac3f41a62a0a036f80237a03.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select invoice_id as from_field\n from \"app\".\"public\".\"invoice_payments\"\n where invoice_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"invoices\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "invoice_id", "to": "source('tamanu', 'invoices')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_date.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_date"], "alias": "source_not_null_tamanu_invoice_payments_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3944669, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_receipt_number", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_receipt_number.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_receipt_number"], "alias": "source_not_null_tamanu_invoice_payments_receipt_number", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3944669, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_receipt_number.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect receipt_number\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere receipt_number is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "receipt_number", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "receipt_number", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_amount", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_amount.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_amount"], "alias": "source_not_null_tamanu_invoice_payments_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3944669, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_created_at.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_created_at"], "alias": "source_not_null_tamanu_invoice_payments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3944669, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187"}, "created_at": 1782423653.3944669, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_relationships_tamanu_in_40646841267129a2f1cd0a86ec591187.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select updated_by_user_id as from_field\n from \"app\".\"public\".\"invoice_payments\"\n where updated_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "updated_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_payments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_payments_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_payments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_payments_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3944669, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_payments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_payments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_payments.yml\\source_not_null_tamanu_invoice_payments_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_payments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_payments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_price_lists_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_price_lists_id.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_price_lists_id"], "alias": "source_unique_tamanu_invoice_price_lists_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.3944669, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_unique_tamanu_invoice_price_lists_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_id.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_id"], "alias": "source_not_null_tamanu_invoice_price_lists_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4046524, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_created_at.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_created_at"], "alias": "source_not_null_tamanu_invoice_price_lists_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4056716, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_updated_at.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_updated_at"], "alias": "source_not_null_tamanu_invoice_price_lists_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4056716, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4066696, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_code.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_code"], "alias": "source_not_null_tamanu_invoice_price_lists_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4076712, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_lists_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_lists_visibility_status.sql", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_lists_visibility_status"], "alias": "source_not_null_tamanu_invoice_price_lists_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4086695, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_lists"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_lists.yml\\source_not_null_tamanu_invoice_price_lists_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"invoice_price_lists\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_lists')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_price_list_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_price_list_items_id.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_price_list_items_id"], "alias": "source_unique_tamanu_invoice_price_list_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4096704, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_unique_tamanu_invoice_price_list_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_list_items_id.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_id"], "alias": "source_not_null_tamanu_invoice_price_list_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4106622, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_price_list_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_list_items_created_at.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_created_at"], "alias": "source_not_null_tamanu_invoice_price_list_items_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.411663, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_price_list_items_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_list_items_updated_at.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_updated_at"], "alias": "source_not_null_tamanu_invoice_price_list_items_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4126627, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_price_list_items_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223"}, "created_at": 1782423653.4126627, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_e8f1bb5845a86606e7cbf81ea06ec223.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id"], "alias": "source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d"}, "created_at": 1782423653.4146688, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_f33723a6a6f69425839077c30589433d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_price_list_id\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere invoice_price_list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_price_list_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_price_list_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_invoice_product_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_invoice_product_id"], "alias": "source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5"}, "created_at": 1782423653.4156601, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_87328fff0aea86f06a9c5fd4ffe7d4a5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect invoice_product_id\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere invoice_product_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "invoice_product_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_product_id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_price_list_items_is_hidden", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_price_list_items_is_hidden.sql", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_price_list_items_is_hidden"], "alias": "source_not_null_tamanu_invoice_price_list_items_is_hidden", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4156601, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_price_list_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_price_list_items.yml\\source_not_null_tamanu_invoice_price_list_items_is_hidden.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_hidden\nfrom \"app\".\"public\".\"invoice_price_list_items\"\nwhere is_hidden is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_hidden", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_hidden", "model": "{{ get_where_subquery(source('tamanu', 'invoice_price_list_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_invoice_products_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_invoice_products_id.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_invoice_products_id"], "alias": "source_unique_tamanu_invoice_products_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.41766, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_unique_tamanu_invoice_products_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"invoice_products\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_id.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_id"], "alias": "source_not_null_tamanu_invoice_products_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4186606, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"invoice_products\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_name.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_name"], "alias": "source_not_null_tamanu_invoice_products_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4186606, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"invoice_products\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_insurable", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_insurable.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_insurable"], "alias": "source_not_null_tamanu_invoice_products_insurable", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4196582, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_insurable.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect insurable\nfrom \"app\".\"public\".\"invoice_products\"\nwhere insurable is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "insurable", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "insurable", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_created_at.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_created_at"], "alias": "source_not_null_tamanu_invoice_products_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4206564, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"invoice_products\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_visibility_status.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_visibility_status"], "alias": "source_not_null_tamanu_invoice_products_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"invoice_products\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_invoice_products_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_invoice_products_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_invoice_products_updated_at_sync_tick"], "alias": "source_not_null_tamanu_invoice_products_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "invoice_products"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.invoice_products"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\invoice_products.yml\\source_not_null_tamanu_invoice_products_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"invoice_products\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'invoice_products')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_ips_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_ips_requests_id.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_ips_requests_id"], "alias": "source_unique_tamanu_ips_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_unique_tamanu_ips_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"ips_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_id.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_id"], "alias": "source_not_null_tamanu_ips_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"ips_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_created_at.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_created_at"], "alias": "source_not_null_tamanu_ips_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"ips_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_updated_at.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_updated_at"], "alias": "source_not_null_tamanu_ips_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"ips_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_patient_id.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_patient_id"], "alias": "source_not_null_tamanu_ips_requests_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"ips_requests\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_created_by", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_created_by.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_created_by"], "alias": "source_not_null_tamanu_ips_requests_created_by", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_created_by.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_by\nfrom \"app\".\"public\".\"ips_requests\"\nwhere created_by is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_by", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_by", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_relationships_tamanu_ip_44873478a5e9f5565ed779c906d70119.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select created_by as from_field\n from \"app\".\"public\".\"ips_requests\"\n where created_by is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_by", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "created_by", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_status.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_status"], "alias": "source_not_null_tamanu_ips_requests_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"ips_requests\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_email.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_email"], "alias": "source_not_null_tamanu_ips_requests_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_email.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect email\nfrom \"app\".\"public\".\"ips_requests\"\nwhere email is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_ips_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_ips_requests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_ips_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_ips_requests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "ips_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.ips_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\ips_requests.yml\\source_not_null_tamanu_ips_requests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"ips_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'ips_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_requests_id.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_requests_id"], "alias": "source_unique_tamanu_lab_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.421347, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_unique_tamanu_lab_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_id.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_id"], "alias": "source_not_null_tamanu_lab_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.436573, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_created_at.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_created_at"], "alias": "source_not_null_tamanu_lab_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4374592, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_updated_at.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_updated_at"], "alias": "source_not_null_tamanu_lab_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.438247, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error"], "alias": "source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d"}, "created_at": 1782423653.4394462, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_accepted_values_tamanu__49d0cb15cd39a06eeffcacc5a1d0563d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"lab_requests\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'reception_pending','results_pending','interim_results','to_be_verified','verified','published','cancelled','invalidated','deleted','sample-not-collected','entered-in-error'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["reception_pending", "results_pending", "interim_results", "to_be_verified", "verified", "published", "cancelled", "invalidated", "deleted", "sample-not-collected", "entered-in-error"], "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922"}, "created_at": 1782423653.443702, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_794cfd7feb660eee022a0a148d1c9922.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select requested_by_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where requested_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "requested_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5"}, "created_at": 1782423653.4466815, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_b885be3a539616c7db94444f050f11a5.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_"], "alias": "dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e"}, "created_at": 1782423653.449468, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_41d5142a34eb2763eae42c3bacd2987e.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_category_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where lab_test_category_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestCategory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"to_condition": "type = 'labTestCategory'", "column_name": "lab_test_category_id", "to": "source('tamanu', 'reference_data')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_display_id.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_display_id"], "alias": "source_not_null_tamanu_lab_requests_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4524775, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_id\nfrom \"app\".\"public\".\"lab_requests\"\nwhere display_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_"], "alias": "dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32"}, "created_at": 1782423653.4524775, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_8cf06f59860165f4bb21fc0bfc6d6e32.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_priority_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where lab_test_priority_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestPriority'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_priority_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_test_priority_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestPriority'", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_"], "alias": "dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63"}, "created_at": 1782423653.4524775, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_3c5911e1d5dbeae86f9382701ed17e63.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_laboratory_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where lab_test_laboratory_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestLaboratory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_laboratory_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_test_laboratory_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestLaboratory'", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_requests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_requests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4524775, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_not_null_tamanu_lab_requests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused"], "alias": "source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297"}, "created_at": 1782423653.4524775, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_accepted_values_tamanu__7654e248e09c22d70aea001dc5144297.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n reason_for_cancellation as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"lab_requests\"\n group by reason_for_cancellation\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'clinical','duplicate','entered-in-error','other','patient-discharged','patient-refused'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reason_for_cancellation", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "reason_for_cancellation", "values": ["clinical", "duplicate", "entered-in-error", "other", "patient-discharged", "patient-refused"], "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_"], "alias": "source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe"}, "created_at": 1782423653.4524775, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "departments"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_1a8a2c31ea1f9f0820c9a47a97518afe.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select department_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where department_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"departments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "department_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "department_id", "to": "source('tamanu', 'departments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_081684246f6bf00522c0c77579566577.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_"], "alias": "source_relationships_tamanu_la_081684246f6bf00522c0c77579566577", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_081684246f6bf00522c0c77579566577", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_081684246f6bf00522c0c77579566577"}, "created_at": 1782423653.4681742, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_081684246f6bf00522c0c77579566577\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_081684246f6bf00522c0c77579566577.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_panel_request_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where lab_test_panel_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_panel_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_panel_request_id", "to": "source('tamanu', 'lab_test_panel_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_"], "alias": "dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7"}, "created_at": 1782423653.4681742, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_15b340ce98774176dc0533ead99502c7.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_sample_site_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where lab_sample_site_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labSampleSite'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_sample_site_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_sample_site_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labSampleSite'", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_"], "alias": "dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748"}, "created_at": 1782423653.4681742, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\dbt_utils_source_relationships_98b52936ce8ec0d1626214bff7bd6748.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n specimen_type_id as id\n\n from \"app\".\"public\".\"lab_requests\"\n\n where specimen_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'specimenType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "specimen_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "specimen_type_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'specimenType'", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6.sql", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6"}, "created_at": 1782423653.4681742, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "lab_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.lab_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_requests.yml\\source_relationships_tamanu_la_0c622d266d5911b841d249d771338ae6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select collected_by_id as from_field\n from \"app\".\"public\".\"lab_requests\"\n where collected_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "collected_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "collected_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_request_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_request_attachments_id.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_request_attachments_id"], "alias": "source_unique_tamanu_lab_request_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4681742, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_unique_tamanu_lab_request_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_id.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_id"], "alias": "source_not_null_tamanu_lab_request_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4681742, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_created_at.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_created_at"], "alias": "source_not_null_tamanu_lab_request_attachments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4681742, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_updated_at.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_updated_at"], "alias": "source_not_null_tamanu_lab_request_attachments_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4681742, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_attachment_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_attachment_id.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_attachment_id"], "alias": "source_not_null_tamanu_lab_request_attachments_attachment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_attachment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect attachment_id\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere attachment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attachment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "attachment_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_"], "alias": "source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "attachments"], ["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.attachments", "source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_relationships_tamanu_la_905d49ac10ad93efe089a7a5d3d0dceb.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select attachment_id as from_field\n from \"app\".\"public\".\"lab_request_attachments\"\n where attachment_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"attachments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attachment_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "attachment_id", "to": "source('tamanu', 'attachments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_lab_request_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_attachments_lab_request_id.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_lab_request_id"], "alias": "source_not_null_tamanu_lab_request_attachments_lab_request_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_request_attachments_lab_request_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lab_request_id\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere lab_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lab_request_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_"], "alias": "source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_relationships_tamanu_la_f50e7480c9709cf9af340816771af108.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_request_id as from_field\n from \"app\".\"public\".\"lab_request_attachments\"\n where lab_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_request_id", "to": "source('tamanu', 'lab_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_"], "alias": "source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"], ["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_relationships_tamanu_la_22d4d2ded0be345b72383928510912fc.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select replaced_by_id as from_field\n from \"app\".\"public\".\"lab_request_attachments\"\n where replaced_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_request_attachments\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "replaced_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "replaced_by_id", "to": "source('tamanu', 'lab_request_attachments')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15.sql", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_attachments.yml\\source_not_null_tamanu_lab_req_2b32b52ee932c44ae817f460186eca15.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_request_attachments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_request_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_request_logs_id.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_request_logs_id"], "alias": "source_unique_tamanu_lab_request_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_unique_tamanu_lab_request_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_request_logs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_logs_id.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_logs_id"], "alias": "source_not_null_tamanu_lab_request_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_not_null_tamanu_lab_request_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_request_logs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_logs_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_logs_status.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_logs_status"], "alias": "source_not_null_tamanu_lab_request_logs_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_not_null_tamanu_lab_request_logs_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"lab_request_logs\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_"], "alias": "source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4"}, "created_at": 1782423653.4840493, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_relationships_tamanu_la_1da9ed9e87be39f7e77b64224b7936b4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_request_id as from_field\n from \"app\".\"public\".\"lab_request_logs\"\n where lab_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_request_id", "to": "source('tamanu', 'lab_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55"}, "created_at": 1782423653.4997735, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_relationships_tamanu_la_7d0fff009413fe5bf5040529bcc5bd55.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select updated_by_id as from_field\n from \"app\".\"public\".\"lab_request_logs\"\n where updated_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "updated_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_request_logs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_request_logs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_request_logs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4997735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_request_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_request_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_request_logs.yml\\source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_request_logs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_request_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_tests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_tests_id.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_tests_id"], "alias": "source_unique_tamanu_lab_tests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4997735, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_unique_tamanu_lab_tests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_tests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_id.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_id"], "alias": "source_not_null_tamanu_lab_tests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4997735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_tests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_created_at.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_created_at"], "alias": "source_not_null_tamanu_lab_tests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4997735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_tests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_updated_at.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_updated_at"], "alias": "source_not_null_tamanu_lab_tests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4997735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_tests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_date.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_date"], "alias": "source_not_null_tamanu_lab_tests_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4997735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"lab_tests\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_result", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_result.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_result"], "alias": "source_not_null_tamanu_lab_tests_result", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.4997735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_result.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect result\nfrom \"app\".\"public\".\"lab_tests\"\nwhere result is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "result", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "result", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_"], "alias": "source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d"}, "created_at": 1782423653.5158617, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_requests"], ["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_relationships_tamanu_la_92003cb8abdb214accd2b3c248a5fc1d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_request_id as from_field\n from \"app\".\"public\".\"lab_tests\"\n where lab_request_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_requests\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_request_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_request_id", "to": "source('tamanu', 'lab_requests')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_"], "alias": "source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380"}, "created_at": 1782423653.5158617, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"], ["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types", "source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_relationships_tamanu_la_74099ec7b41e1a1719a3fbe7d4feb380.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_type_id as from_field\n from \"app\".\"public\".\"lab_tests\"\n where lab_test_type_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_types\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_type_id", "to": "source('tamanu', 'lab_test_types')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_"], "alias": "dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de"}, "created_at": 1782423653.5158617, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\dbt_utils_source_relationships_3c4c6e13151cd9ebe7b5fed04061c7de.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n category_id as id\n\n from \"app\".\"public\".\"lab_tests\"\n\n where category_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestCategory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "category_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestCategory'", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_"], "alias": "dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6"}, "created_at": 1782423653.5158617, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\dbt_utils_source_relationships_5c1ceead95ed0ecab3b357c570de5fc6.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_method_id as id\n\n from \"app\".\"public\".\"lab_tests\"\n\n where lab_test_method_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestMethod'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_method_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_test_method_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestMethod'", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_tests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_tests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_tests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5158617, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_tests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_tests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_tests.yml\\source_not_null_tamanu_lab_tests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_tests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_tests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_test_panels_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_test_panels_id.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_test_panels_id"], "alias": "source_unique_tamanu_lab_test_panels_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.53157, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_unique_tamanu_lab_test_panels_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_id.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_id"], "alias": "source_not_null_tamanu_lab_test_panels_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.53157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_created_at.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_created_at"], "alias": "source_not_null_tamanu_lab_test_panels_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.53157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_updated_at.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_updated_at"], "alias": "source_not_null_tamanu_lab_test_panels_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.53157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_name.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_name"], "alias": "source_not_null_tamanu_lab_test_panels_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.53157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_code.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_code"], "alias": "source_not_null_tamanu_lab_test_panels_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.53157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_visibility_status.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_visibility_status"], "alias": "source_not_null_tamanu_lab_test_panels_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.53157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_"], "alias": "dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd"}, "created_at": 1782423653.53157, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\dbt_utils_source_relationships_c5636052a7379c5f2c7c06e9e554c1cd.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n category_id as id\n\n from \"app\".\"public\".\"lab_test_panels\"\n\n where category_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestCategory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "category_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestCategory'", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panels_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panels_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_test_panels_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.53157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panels.yml\\source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_test_panels\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panels')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_created_at"], "alias": "source_not_null_tamanu_lab_test_panel_lab_test_types_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5419252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at"], "alias": "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5419252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id"], "alias": "source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f"}, "created_at": 1782423653.5419252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_tes_8e7c6807308c22538914333539151a2f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lab_test_panel_id\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere lab_test_panel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lab_test_panel_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_"], "alias": "source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394"}, "created_at": 1782423653.5419252, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"], ["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels", "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_relationships_tamanu_la_ef4c88f2acf07aa612fb52ded2ca3394.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_panel_id as from_field\n from \"app\".\"public\".\"lab_test_panel_lab_test_types\"\n where lab_test_panel_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_panels\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_panel_id", "to": "source('tamanu', 'lab_test_panels')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id"], "alias": "source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_tes_db27b94c531fa498ab1ef02bd5a11587.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lab_test_type_id\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere lab_test_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lab_test_type_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_"], "alias": "source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"], ["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types", "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_relationships_tamanu_la_e392665d7fa59eb3bd49f0acf984b2de.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_type_id as from_field\n from \"app\".\"public\".\"lab_test_panel_lab_test_types\"\n where lab_test_type_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_types\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_type_id", "to": "source('tamanu', 'lab_test_types')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types__order_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_lab_test_types__order_.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types__order_"], "alias": "source_not_null_tamanu_lab_test_panel_lab_test_types__order_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_test_panel_lab_test_types__order_.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect \"order\"\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere \"order\" is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "\"order\"", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "\"order\"", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055.sql", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_lab_test_types.yml\\source_not_null_tamanu_lab_tes_d0add5176e8dfca528420a37631e6055.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_test_panel_lab_test_types\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_test_panel_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_test_panel_requests_id.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_test_panel_requests_id"], "alias": "source_unique_tamanu_lab_test_panel_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_unique_tamanu_lab_test_panel_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_requests_id.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_id"], "alias": "source_not_null_tamanu_lab_test_panel_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_test_panel_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_requests_created_at.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_created_at"], "alias": "source_not_null_tamanu_lab_test_panel_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_test_panel_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_requests_updated_at.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_updated_at"], "alias": "source_not_null_tamanu_lab_test_panel_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_test_panel_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id"], "alias": "source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_tes_49126af370f2ef154963960347d1266b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lab_test_panel_id\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere lab_test_panel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lab_test_panel_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_"], "alias": "source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panels"], ["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panels", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_relationships_tamanu_la_72fcfa621ed5492abd990ec25888b6bc.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select lab_test_panel_id as from_field\n from \"app\".\"public\".\"lab_test_panel_requests\"\n where lab_test_panel_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"lab_test_panels\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_panel_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "lab_test_panel_id", "to": "source('tamanu', 'lab_test_panels')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_panel_requests_encounter_id.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_encounter_id"], "alias": "source_not_null_tamanu_lab_test_panel_requests_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_test_panel_requests_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba"}, "created_at": 1782423653.54745, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_relationships_tamanu_la_0d9f27f60350cb540a459507877b95ba.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"lab_test_panel_requests\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d.sql", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_panel_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_panel_requests.yml\\source_not_null_tamanu_lab_tes_3aba46af31a2eee1e3c65aa28b89428d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_test_panel_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_panel_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_lab_test_types_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_lab_test_types_id.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_lab_test_types_id"], "alias": "source_unique_tamanu_lab_test_types_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_unique_tamanu_lab_test_types_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_id.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_id"], "alias": "source_not_null_tamanu_lab_test_types_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_created_at.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_created_at"], "alias": "source_not_null_tamanu_lab_test_types_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_updated_at.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_updated_at"], "alias": "source_not_null_tamanu_lab_test_types_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_code.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_code"], "alias": "source_not_null_tamanu_lab_test_types_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_name.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_name"], "alias": "source_not_null_tamanu_lab_test_types_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_unit", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_unit.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_unit"], "alias": "source_not_null_tamanu_lab_test_types_unit", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_unit.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unit\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere unit is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unit", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unit", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_result_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_result_type.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_result_type"], "alias": "source_not_null_tamanu_lab_test_types_result_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_result_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect result_type\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere result_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "result_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "result_type", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select"], "alias": "source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_accepted_values_tamanu__0cd3a79c9e7278d80974fb3dd210be4c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n result_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"lab_test_types\"\n group by result_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'FreeText','Number','Select'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "result_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "result_type", "values": ["FreeText", "Number", "Select"], "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_"], "alias": "dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253"}, "created_at": 1782423653.563204, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\dbt_utils_source_relationships_d4aa985574aba386fb94444533fe0253.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n lab_test_category_id as id\n\n from \"app\".\"public\".\"lab_test_types\"\n\n where lab_test_category_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'labTestCategory'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lab_test_category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "lab_test_category_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'labTestCategory'", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_updated_at_sync_tick"], "alias": "source_not_null_tamanu_lab_test_types_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_lab_test_types_is_sensitive", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_lab_test_types_is_sensitive.sql", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_lab_test_types_is_sensitive"], "alias": "source_not_null_tamanu_lab_test_types_is_sensitive", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "lab_test_types"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.lab_test_types"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\lab_test_types.yml\\source_not_null_tamanu_lab_test_types_is_sensitive.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_sensitive\nfrom \"app\".\"public\".\"lab_test_types\"\nwhere is_sensitive is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_sensitive", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_sensitive", "model": "{{ get_where_subquery(source('tamanu', 'lab_test_types')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_local_system_facts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_local_system_facts_id.sql", "original_file_path": "models\\sources\\local_system_facts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_local_system_facts_id"], "alias": "source_unique_tamanu_local_system_facts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "local_system_facts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.local_system_facts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\local_system_facts.yml\\source_unique_tamanu_local_system_facts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"local_system_facts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'local_system_facts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_local_system_facts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_local_system_facts_id.sql", "original_file_path": "models\\sources\\local_system_facts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_local_system_facts_id"], "alias": "source_not_null_tamanu_local_system_facts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "local_system_facts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.local_system_facts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\local_system_facts.yml\\source_not_null_tamanu_local_system_facts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"local_system_facts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'local_system_facts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_local_system_facts_key", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_local_system_facts_key.sql", "original_file_path": "models\\sources\\local_system_facts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_local_system_facts_key"], "alias": "source_not_null_tamanu_local_system_facts_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "local_system_facts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.local_system_facts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\local_system_facts.yml\\source_not_null_tamanu_local_system_facts_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect key\nfrom \"app\".\"public\".\"local_system_facts\"\nwhere key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "key", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "key", "model": "{{ get_where_subquery(source('tamanu', 'local_system_facts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_locations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_locations_id.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_locations_id"], "alias": "source_unique_tamanu_locations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_unique_tamanu_locations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"locations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_locations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locations_id.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_locations_id"], "alias": "source_not_null_tamanu_locations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_not_null_tamanu_locations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"locations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_locations_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_locations_code.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_locations_code"], "alias": "source_unique_tamanu_locations_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_unique_tamanu_locations_code.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n code as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"locations\"\nwhere code is not null\ngroup by code\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_locations_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locations_code.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_locations_code"], "alias": "source_not_null_tamanu_locations_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_not_null_tamanu_locations_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"locations\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_locations_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locations_name.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_locations_name"], "alias": "source_not_null_tamanu_locations_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_not_null_tamanu_locations_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"locations\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_relationships_tamanu_lo_04639952f9cab8b1912c3aad10cf2955.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"locations\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_locations_visibility_status__current__historical", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_locations_visibility_status__current__historical"], "alias": "source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b"}, "created_at": 1782423653.5791855, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_accepted_values_tamanu__25bd1c58e7a57665c2c011a7d6056f2b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n visibility_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"locations\"\n group by visibility_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'current','historical'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "visibility_status", "values": ["current", "historical"], "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_"], "alias": "source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"], ["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups", "source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_relationships_tamanu_lo_651f6f8670aadefc9d724a200c207f69.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_group_id as from_field\n from \"app\".\"public\".\"locations\"\n where location_group_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"location_groups\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_group_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "location_group_id", "to": "source('tamanu', 'location_groups')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_locations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locations_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\locations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_locations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_locations_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\locations.yml\\source_not_null_tamanu_locations_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"locations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'locations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_location_assignments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_location_assignments_id.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_location_assignments_id"], "alias": "source_unique_tamanu_location_assignments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_unique_tamanu_location_assignments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"location_assignments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_id.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_id"], "alias": "source_not_null_tamanu_location_assignments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"location_assignments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_user_id.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_user_id"], "alias": "source_not_null_tamanu_location_assignments_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"location_assignments\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_location_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_location_id.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_location_id"], "alias": "source_not_null_tamanu_location_assignments_location_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_location_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect location_id\nfrom \"app\".\"public\".\"location_assignments\"\nwhere location_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "location_id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_date.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_date"], "alias": "source_not_null_tamanu_location_assignments_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"location_assignments\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_start_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_start_time.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_start_time"], "alias": "source_not_null_tamanu_location_assignments_start_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_start_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_time\nfrom \"app\".\"public\".\"location_assignments\"\nwhere start_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_time", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_end_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_end_time.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_end_time"], "alias": "source_not_null_tamanu_location_assignments_end_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_end_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect end_time\nfrom \"app\".\"public\".\"location_assignments\"\nwhere end_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "end_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "end_time", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_created_at.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_created_at"], "alias": "source_not_null_tamanu_location_assignments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"location_assignments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignments_updated_at.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_updated_at"], "alias": "source_not_null_tamanu_location_assignments_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_location_assignments_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"location_assignments\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766.sql", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignments.yml\\source_not_null_tamanu_locatio_5d42155e50faddea8898718637e3d766.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"location_assignments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'location_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_location_assignment_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_location_assignment_templates_id.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_location_assignment_templates_id"], "alias": "source_unique_tamanu_location_assignment_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_unique_tamanu_location_assignment_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_id.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_id"], "alias": "source_not_null_tamanu_location_assignment_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.594891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_user_id.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_user_id"], "alias": "source_not_null_tamanu_location_assignment_templates_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_location_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_location_id"], "alias": "source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_da2bfda0b42784a16e668c46b0542524.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect location_id\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere location_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "location_id", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_date.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_date"], "alias": "source_not_null_tamanu_location_assignment_templates_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_start_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_start_time.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_start_time"], "alias": "source_not_null_tamanu_location_assignment_templates_start_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_start_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_time\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere start_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_time", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_end_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_end_time.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_end_time"], "alias": "source_not_null_tamanu_location_assignment_templates_end_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_end_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect end_time\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere end_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "end_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "end_time", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_repeat_end_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_repeat_end_date"], "alias": "source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_b8acb799300384351e0ae65772880b51.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect repeat_end_date\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere repeat_end_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "repeat_end_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "repeat_end_date", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_repeat_frequency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_repeat_frequency"], "alias": "source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_f6951ec45370462a2acc8387c2367f0f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect repeat_frequency\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere repeat_frequency is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "repeat_frequency", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "repeat_frequency", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_repeat_unit", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_repeat_unit"], "alias": "source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_aa1d1e6c407835f0e02cc5a70b096722.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect repeat_unit\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere repeat_unit is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "repeat_unit", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "repeat_unit", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_created_at.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_created_at"], "alias": "source_not_null_tamanu_location_assignment_templates_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_assignment_templates_updated_at.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_updated_at"], "alias": "source_not_null_tamanu_location_assignment_templates_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_location_assignment_templates_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc.sql", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick"], "alias": "source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_assignment_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_assignment_templates.yml\\source_not_null_tamanu_locatio_6a7f38887280ccd51ee1f8ecd2f431bc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"location_assignment_templates\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'location_assignment_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_location_groups_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_location_groups_id.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_location_groups_id"], "alias": "source_unique_tamanu_location_groups_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_unique_tamanu_location_groups_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"location_groups\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_id.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_id"], "alias": "source_not_null_tamanu_location_groups_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"location_groups\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_created_at.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_created_at"], "alias": "source_not_null_tamanu_location_groups_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"location_groups\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_updated_at.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_updated_at"], "alias": "source_not_null_tamanu_location_groups_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"location_groups\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_location_groups_visibility_status__current__historical", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_location_groups_visibility_status__current__historical"], "alias": "source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980"}, "created_at": 1782423653.6108842, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_accepted_values_tamanu__74b57dc647618ecdc6dad5f890620980.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n visibility_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"location_groups\"\n group by visibility_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'current','historical'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "visibility_status", "values": ["current", "historical"], "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_name.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_name"], "alias": "source_not_null_tamanu_location_groups_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"location_groups\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_code.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_code"], "alias": "source_not_null_tamanu_location_groups_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"location_groups\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_facility_id.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_facility_id"], "alias": "source_not_null_tamanu_location_groups_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"location_groups\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_relationships_tamanu_lo_e5e4eeaedf59ada3b625f989fffb21f8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"location_groups\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_updated_at_sync_tick"], "alias": "source_not_null_tamanu_location_groups_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"location_groups\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_location_groups_is_bookable", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_location_groups_is_bookable.sql", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_location_groups_is_bookable"], "alias": "source_not_null_tamanu_location_groups_is_bookable", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "location_groups"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.location_groups"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\location_groups.yml\\source_not_null_tamanu_location_groups_is_bookable.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_bookable\nfrom \"app\".\"public\".\"location_groups\"\nwhere is_bookable is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_bookable", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_bookable", "model": "{{ get_where_subquery(source('tamanu', 'location_groups')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_medication_administration_records_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_medication_administration_records_id.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_medication_administration_records_id"], "alias": "source_unique_tamanu_medication_administration_records_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_unique_tamanu_medication_administration_records_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_administration_records_id.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_id"], "alias": "source_not_null_tamanu_medication_administration_records_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medication_administration_records_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN"], "alias": "source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_accepted_values_tamanu__6e466a47f54e5f94522707203935e9a7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"medication_administration_records\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'GIVEN','NOT_GIVEN'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["GIVEN", "NOT_GIVEN"], "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_due_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_administration_records_due_at.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_due_at"], "alias": "source_not_null_tamanu_medication_administration_records_due_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medication_administration_records_due_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect due_at\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere due_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "due_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "due_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_is_auto_generated", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_is_auto_generated"], "alias": "source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_27cf3f9832e5480a994a3e479cdad31f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_auto_generated\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere is_auto_generated is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_auto_generated", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_auto_generated", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_created_at"], "alias": "source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_a51da974204f1451b738f5ecf933e8a5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_updated_at"], "alias": "source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909"}, "created_at": 1782423653.626641, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_caaf5139b8e843a5d91ae7cc15c14909.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_updated_at_sync_tick"], "alias": "source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_859c89a72cccfaff11899d18cbfb0ff0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_records_is_edited", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394.sql", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_records_is_edited"], "alias": "source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_records"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_records"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_records.yml\\source_not_null_tamanu_medicat_ddbe436211f6ce360ecf7d2c4489e394.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_edited\nfrom \"app\".\"public\".\"medication_administration_records\"\nwhere is_edited is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_edited", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_edited", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_records')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_medication_administration_record_doses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_medication_administration_record_doses_id.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_medication_administration_record_doses_id"], "alias": "source_unique_tamanu_medication_administration_record_doses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_unique_tamanu_medication_administration_record_doses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_id"], "alias": "source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_5ae282dc2dbe6ed8c6c0449c123e1285.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_dose_amount", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_dose_amount"], "alias": "source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_b4c79a7df34f496e6c6583d07e8227d0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect dose_amount\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere dose_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "dose_amount", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "dose_amount", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_given_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_given_time"], "alias": "source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_622d01db35b6429abdb1484053926169.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect given_time\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere given_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "given_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "given_time", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_given_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_given_by_user_id"], "alias": "source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_b5a9a7862808019a4a02f75fc3772ba5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect given_by_user_id\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere given_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "given_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "given_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id"], "alias": "source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_1b3f5e7d5292bb2a4f0dd350b15726df.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_by_user_id\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere recorded_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_mar_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_mar_id"], "alias": "source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_c58e952ef6370722eba0a1134e35d38f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect mar_id\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere mar_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "mar_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "mar_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_created_at"], "alias": "source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_b8d92542dec53d43147ce9529191626a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_updated_at"], "alias": "source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_c1091a085ea3bc2221b67ff4da35d509.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_323ae863feace9128b25ca53926e61ea.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_administration_record_doses_dose_index", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74.sql", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_administration_record_doses_dose_index"], "alias": "source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_administration_record_doses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_administration_record_doses.yml\\source_not_null_tamanu_medicat_9c2a92300491d9cd5f407ea68d6f7d74.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect dose_index\nfrom \"app\".\"public\".\"medication_administration_record_doses\"\nwhere dose_index is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "dose_index", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "dose_index", "model": "{{ get_where_subquery(source('tamanu', 'medication_administration_record_doses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_medication_dispenses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_medication_dispenses_id.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_medication_dispenses_id"], "alias": "source_unique_tamanu_medication_dispenses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_unique_tamanu_medication_dispenses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_id.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_id"], "alias": "source_not_null_tamanu_medication_dispenses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id"], "alias": "source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medicat_47baa946e9a0beae34756784753e1b88.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pharmacy_order_prescription_id\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere pharmacy_order_prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pharmacy_order_prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pharmacy_order_prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_quantity", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_quantity.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_quantity"], "alias": "source_not_null_tamanu_medication_dispenses_quantity", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_quantity.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect quantity\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere quantity is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "quantity", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "quantity", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_dispensed_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_dispensed_by_user_id"], "alias": "source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medicat_f81e17293bfdca9c7eb30fc5637bc91c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect dispensed_by_user_id\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere dispensed_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "dispensed_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "dispensed_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_dispensed_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_dispensed_at.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_dispensed_at"], "alias": "source_not_null_tamanu_medication_dispenses_dispensed_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6420605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_dispensed_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect dispensed_at\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere dispensed_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "dispensed_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "dispensed_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_created_at.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_created_at"], "alias": "source_not_null_tamanu_medication_dispenses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medication_dispenses_updated_at.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_updated_at"], "alias": "source_not_null_tamanu_medication_dispenses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medication_dispenses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_medication_dispenses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794.sql", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_medication_dispenses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "medication_dispenses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.medication_dispenses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\medication_dispenses.yml\\source_not_null_tamanu_medicat_30a58ea07fb61d44cfdff2fbf2097794.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"medication_dispenses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'medication_dispenses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_notes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_notes_id.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_notes_id"], "alias": "source_unique_tamanu_notes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_unique_tamanu_notes_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"notes\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_id.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_id"], "alias": "source_not_null_tamanu_notes_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"notes\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_created_at.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_created_at"], "alias": "source_not_null_tamanu_notes_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"notes\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_updated_at.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_updated_at"], "alias": "source_not_null_tamanu_notes_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"notes\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_record_id.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_record_id"], "alias": "source_not_null_tamanu_notes_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"public\".\"notes\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_record_type.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_record_type"], "alias": "source_not_null_tamanu_notes_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"public\".\"notes\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage"], "alias": "source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_accepted_values_tamanu__d17ff06c2fb879c65473b91b3a8f21f3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n record_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"notes\"\n group by record_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Encounter','ImagingRequest','LabRequest','Patient','PatientCarePlan','Triage'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "record_type", "values": ["Encounter", "ImagingRequest", "LabRequest", "Patient", "PatientCarePlan", "Triage"], "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_date.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_date"], "alias": "source_not_null_tamanu_notes_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"notes\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_updated_at_sync_tick"], "alias": "source_not_null_tamanu_notes_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"notes\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_notes_author_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_notes_author_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3"}, "created_at": 1782423653.657818, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_relationships_tamanu_no_39756f88f8af689fc33fa616ac2a2ed3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select author_id as from_field\n from \"app\".\"public\".\"notes\"\n where author_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "author_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "author_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_relationships_tamanu_no_03645bf53e52261be97347577b4b2caa.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select on_behalf_of_id as from_field\n from \"app\".\"public\".\"notes\"\n where on_behalf_of_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "on_behalf_of_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "on_behalf_of_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_content", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_content.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_content"], "alias": "source_not_null_tamanu_notes_content", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_content.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect content\nfrom \"app\".\"public\".\"notes\"\nwhere content is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "content", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "content", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_"], "alias": "source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"], ["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_relationships_tamanu_no_e459d796a026a85af8bddcf84d75e935.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select revised_by_id as from_field\n from \"app\".\"public\".\"notes\"\n where revised_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"notes\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "revised_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "revised_by_id", "to": "source('tamanu', 'notes')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_note_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_note_type_id.sql", "original_file_path": "models\\sources\\notes.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_note_type_id"], "alias": "source_not_null_tamanu_notes_note_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes.yml\\source_not_null_tamanu_notes_note_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect note_type_id\nfrom \"app\".\"public\".\"notes\"\nwhere note_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "note_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "note_type_id", "model": "{{ get_where_subquery(source('tamanu', 'notes')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_notes_legacy_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_notes_legacy_id.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_notes_legacy_id"], "alias": "source_unique_tamanu_notes_legacy_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_unique_tamanu_notes_legacy_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_id.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_id"], "alias": "source_not_null_tamanu_notes_legacy_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_created_at.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_created_at"], "alias": "source_not_null_tamanu_notes_legacy_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_updated_at.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_updated_at"], "alias": "source_not_null_tamanu_notes_legacy_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_record_id.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_record_id"], "alias": "source_not_null_tamanu_notes_legacy_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_record_type.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_record_type"], "alias": "source_not_null_tamanu_notes_legacy_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_date.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_date"], "alias": "source_not_null_tamanu_notes_legacy_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6737561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_content", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_content.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_content"], "alias": "source_not_null_tamanu_notes_legacy_content", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6895845, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_content.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect content\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere content is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "content", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "content", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notes_legacy_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notes_legacy_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notes_legacy_updated_at_sync_tick"], "alias": "source_not_null_tamanu_notes_legacy_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6905942, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notes_legacy"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notes_legacy"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notes_legacy.yml\\source_not_null_tamanu_notes_legacy_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"notes_legacy\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'notes_legacy')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_note_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_note_items_id.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_note_items_id"], "alias": "source_unique_tamanu_note_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.691519, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_unique_tamanu_note_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"note_items\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_id.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_id"], "alias": "source_not_null_tamanu_note_items_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6928103, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"note_items\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_created_at.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_created_at"], "alias": "source_not_null_tamanu_note_items_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6934297, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"note_items\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_updated_at.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_updated_at"], "alias": "source_not_null_tamanu_note_items_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.6940427, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"note_items\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_note_page_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_note_page_id.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_note_page_id"], "alias": "source_not_null_tamanu_note_items_note_page_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.695314, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_note_page_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect note_page_id\nfrom \"app\".\"public\".\"note_items\"\nwhere note_page_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "note_page_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "note_page_id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_"], "alias": "source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22"}, "created_at": 1782423653.6959453, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"], ["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages", "source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_relationships_tamanu_no_ee2695a8b3be707ab79596b72eebdc22.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select note_page_id as from_field\n from \"app\".\"public\".\"note_items\"\n where note_page_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"note_pages\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "note_page_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "note_page_id", "to": "source('tamanu', 'note_pages')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9"}, "created_at": 1782423653.6990902, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_relationships_tamanu_no_872c206c148659324bc23a10176f6cc9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select author_id as from_field\n from \"app\".\"public\".\"note_items\"\n where author_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "author_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "author_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3"}, "created_at": 1782423653.7014964, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_relationships_tamanu_no_ba894cd73c65ab03a8672e3cd4d6e8a3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select on_behalf_of_id as from_field\n from \"app\".\"public\".\"note_items\"\n where on_behalf_of_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "on_behalf_of_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "on_behalf_of_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_content", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_content.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_content"], "alias": "source_not_null_tamanu_note_items_content", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7020235, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_content.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect content\nfrom \"app\".\"public\".\"note_items\"\nwhere content is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "content", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "content", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_date.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_date"], "alias": "source_not_null_tamanu_note_items_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"note_items\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_items_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_items_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_items_updated_at_sync_tick"], "alias": "source_not_null_tamanu_note_items_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_items"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_items"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_items.yml\\source_not_null_tamanu_note_items_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"note_items\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'note_items')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_note_pages_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_note_pages_id.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_note_pages_id"], "alias": "source_unique_tamanu_note_pages_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_unique_tamanu_note_pages_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"note_pages\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_id.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_id"], "alias": "source_not_null_tamanu_note_pages_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"note_pages\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_created_at.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_created_at"], "alias": "source_not_null_tamanu_note_pages_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"note_pages\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_updated_at.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_updated_at"], "alias": "source_not_null_tamanu_note_pages_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"note_pages\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_note_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_note_type.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_note_type"], "alias": "source_not_null_tamanu_note_pages_note_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_note_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect note_type\nfrom \"app\".\"public\".\"note_pages\"\nwhere note_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "note_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "note_type", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_record_id.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_record_id"], "alias": "source_not_null_tamanu_note_pages_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"public\".\"note_pages\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_record_type.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_record_type"], "alias": "source_not_null_tamanu_note_pages_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"public\".\"note_pages\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_date.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_date"], "alias": "source_not_null_tamanu_note_pages_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"note_pages\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_note_pages_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_note_pages_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_note_pages_updated_at_sync_tick"], "alias": "source_not_null_tamanu_note_pages_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "note_pages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.note_pages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\note_pages.yml\\source_not_null_tamanu_note_pages_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"note_pages\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'note_pages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_notifications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_notifications_id.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_notifications_id"], "alias": "source_unique_tamanu_notifications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_unique_tamanu_notifications_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"notifications\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_id.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_id"], "alias": "source_not_null_tamanu_notifications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"notifications\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_type.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_type"], "alias": "source_not_null_tamanu_notifications_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"notifications\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_status.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_status"], "alias": "source_not_null_tamanu_notifications_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"notifications\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_user_id.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_user_id"], "alias": "source_not_null_tamanu_notifications_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"notifications\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_created_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_created_time.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_created_time"], "alias": "source_not_null_tamanu_notifications_created_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_created_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_time\nfrom \"app\".\"public\".\"notifications\"\nwhere created_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_time", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_metadata", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_metadata.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_metadata"], "alias": "source_not_null_tamanu_notifications_metadata", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7055428, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_metadata.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect metadata\nfrom \"app\".\"public\".\"notifications\"\nwhere metadata is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "metadata", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "metadata", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_created_at.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_created_at"], "alias": "source_not_null_tamanu_notifications_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"notifications\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_updated_at.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_updated_at"], "alias": "source_not_null_tamanu_notifications_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"notifications\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_notifications_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_notifications_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_notifications_updated_at_sync_tick"], "alias": "source_not_null_tamanu_notifications_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "notifications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.notifications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\notifications.yml\\source_not_null_tamanu_notifications_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"notifications\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'notifications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_one_time_logins_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_one_time_logins_id.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_one_time_logins_id"], "alias": "source_unique_tamanu_one_time_logins_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_unique_tamanu_one_time_logins_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_one_time_logins_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_one_time_logins_id.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_one_time_logins_id"], "alias": "source_not_null_tamanu_one_time_logins_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_not_null_tamanu_one_time_logins_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_one_time_logins_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_one_time_logins_user_id.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_one_time_logins_user_id"], "alias": "source_not_null_tamanu_one_time_logins_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_not_null_tamanu_one_time_logins_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_relationships_tamanu_on_f8aa3385c0789f9fb0c838d1ca0c0eb2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"one_time_logins\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_one_time_logins_token", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_one_time_logins_token.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_one_time_logins_token"], "alias": "source_not_null_tamanu_one_time_logins_token", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_not_null_tamanu_one_time_logins_token.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect token\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere token is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "token", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "token", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_one_time_logins_expires_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_one_time_logins_expires_at.sql", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_one_time_logins_expires_at"], "alias": "source_not_null_tamanu_one_time_logins_expires_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "one_time_logins"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.one_time_logins"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\one_time_logins.yml\\source_not_null_tamanu_one_time_logins_expires_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect expires_at\nfrom \"app\".\"public\".\"one_time_logins\"\nwhere expires_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "expires_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "expires_at", "model": "{{ get_where_subquery(source('tamanu', 'one_time_logins')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patients_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patients_id.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patients_id"], "alias": "source_unique_tamanu_patients_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_unique_tamanu_patients_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patients\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_id.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_id"], "alias": "source_not_null_tamanu_patients_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patients\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_created_at.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_created_at"], "alias": "source_not_null_tamanu_patients_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patients\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_updated_at.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_updated_at"], "alias": "source_not_null_tamanu_patients_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patients\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patients_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patients_display_id.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patients_display_id"], "alias": "source_unique_tamanu_patients_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_unique_tamanu_patients_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n display_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patients\"\nwhere display_id is not null\ngroup by display_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_display_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_display_id.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_display_id"], "alias": "source_not_null_tamanu_patients_display_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_display_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_id\nfrom \"app\".\"public\".\"patients\"\nwhere display_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_id", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_sex", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_sex.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_sex"], "alias": "source_not_null_tamanu_patients_sex", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7212975, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_sex.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect sex\nfrom \"app\".\"public\".\"patients\"\nwhere sex is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "sex", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "sex", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patients_sex__female__male__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu_patients_sex__female__male__other.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patients_sex__female__male__other"], "alias": "source_accepted_values_tamanu_patients_sex__female__male__other", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.737376, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_accepted_values_tamanu_patients_sex__female__male__other.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n sex as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patients\"\n group by sex\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'female','male','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "sex", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "sex", "values": ["female", "male", "other"], "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patients_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patients_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patients_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patients_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.737376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patients.yml\\source_not_null_tamanu_patients_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patients\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown"], "alias": "source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448"}, "created_at": 1782423653.7421248, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_accepted_values_tamanu__453a4f088e798b80cd07239fd94a7448.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n marital_status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_additional_data\"\n group by marital_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Defacto','Married','Single','Widow','Divorced','Separated','Unknown'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "marital_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "marital_status", "values": ["Defacto", "Married", "Single", "Widow", "Divorced", "Separated", "Unknown"], "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_"], "alias": "source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb"}, "created_at": 1782423653.7421248, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_accepted_values_tamanu__712c12f6b76c8390b819628267fb46fb.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n blood_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_additional_data\"\n group by blood_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'A+','A-','AB-','AB+','B+','B-','O+','O-'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "blood_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "blood_type", "values": ["A+", "A-", "AB-", "AB+", "B+", "B-", "O+", "O-"], "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_additional_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_additional_data_patient_id.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_additional_data_patient_id"], "alias": "source_unique_tamanu_patient_additional_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7421248, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_unique_tamanu_patient_additional_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_additional_data\"\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_additional_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_additional_data_patient_id.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_additional_data_patient_id"], "alias": "source_not_null_tamanu_patient_additional_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_not_null_tamanu_patient_additional_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_additional_data\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_additional_data_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9.sql", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_additional_data_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_additional_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_additional_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_additional_data.yml\\source_not_null_tamanu_patient_a203ecdfc3883025fe47c89a97bffce9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_additional_data\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_additional_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_allergies_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_allergies_id.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_allergies_id"], "alias": "source_unique_tamanu_patient_allergies_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_unique_tamanu_patient_allergies_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_id.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_id"], "alias": "source_not_null_tamanu_patient_allergies_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_created_at.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_created_at"], "alias": "source_not_null_tamanu_patient_allergies_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_updated_at.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_updated_at"], "alias": "source_not_null_tamanu_patient_allergies_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_recorded_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_recorded_date.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_recorded_date"], "alias": "source_not_null_tamanu_patient_allergies_recorded_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_recorded_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_date\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere recorded_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_date", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_allergies_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_allergies_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_allergies_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_allergies_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_allergies"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_allergies"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_allergies.yml\\source_not_null_tamanu_patient_allergies_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_allergies\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_allergies')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_birth_data_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_birth_data_created_at.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_birth_data_created_at"], "alias": "source_not_null_tamanu_patient_birth_data_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_not_null_tamanu_patient_birth_data_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_birth_data_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_birth_data_updated_at.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_birth_data_updated_at"], "alias": "source_not_null_tamanu_patient_birth_data_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_not_null_tamanu_patient_birth_data_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_birth_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_birth_data_patient_id.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_birth_data_patient_id"], "alias": "source_unique_tamanu_patient_birth_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_unique_tamanu_patient_birth_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_birth_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_birth_data_patient_id.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_birth_data_patient_id"], "alias": "source_not_null_tamanu_patient_birth_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_not_null_tamanu_patient_birth_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_relationships_tamanu_pa_a97094180131721392cbf0084cd905db.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_birth_data\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other"], "alias": "source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388"}, "created_at": 1782423653.7531674, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_accepted_values_tamanu__037f97ec5370d6769dbd07e322c6a388.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n birth_delivery_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_birth_data\"\n group by birth_delivery_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'normal_vaginal_delivery','breech','emergency_c_section','elective_c_section','vacuum_extraction','forceps','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "birth_delivery_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "birth_delivery_type", "values": ["normal_vaginal_delivery", "breech", "emergency_c_section", "elective_c_section", "vacuum_extraction", "forceps", "other"], "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other"], "alias": "source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80"}, "created_at": 1782423653.7691927, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_accepted_values_tamanu__124e108606f5539f08e5560007bb0d80.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n attendant_at_birth as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_birth_data\"\n group by attendant_at_birth\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'doctor','midwife','nurse','traditional_birth_attentdant','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "attendant_at_birth", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "attendant_at_birth", "values": ["doctor", "midwife", "nurse", "traditional_birth_attentdant", "other"], "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a"}, "created_at": 1782423653.7691927, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_relationships_tamanu_pa_e52e0cc4c4153926072096e04ffbc86a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select birth_facility_id as from_field\n from \"app\".\"public\".\"patient_birth_data\"\n where birth_facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "birth_facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "birth_facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other"], "alias": "source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f"}, "created_at": 1782423653.7691927, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_accepted_values_tamanu__ca28a69286629dfa94d0afaacacd7a6f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n registered_birth_place as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_birth_data\"\n group by registered_birth_place\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'health_facility','home','other'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registered_birth_place", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "registered_birth_place", "values": ["health_facility", "home", "other"], "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_birth_data_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_birth_data_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_birth_data_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7691927, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_birth_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_birth_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_birth_data.yml\\source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_birth_data\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_birth_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_care_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_care_plans_id.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_care_plans_id"], "alias": "source_unique_tamanu_patient_care_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7691927, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_unique_tamanu_patient_care_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_id.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_id"], "alias": "source_not_null_tamanu_patient_care_plans_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7691927, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_created_at.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_created_at"], "alias": "source_not_null_tamanu_patient_care_plans_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7691927, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_updated_at.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_updated_at"], "alias": "source_not_null_tamanu_patient_care_plans_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.7691927, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_date.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_date"], "alias": "source_not_null_tamanu_patient_care_plans_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_care_plans_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_care_plans_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_care_plans_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_care_plans"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_care_plans"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_care_plans.yml\\source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_care_plans\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_care_plans')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_communications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_communications_id.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_communications_id"], "alias": "source_unique_tamanu_patient_communications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_unique_tamanu_patient_communications_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_communications\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_id.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_id"], "alias": "source_not_null_tamanu_patient_communications_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_communications\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_created_at.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_created_at"], "alias": "source_not_null_tamanu_patient_communications_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_communications\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_updated_at.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_updated_at"], "alias": "source_not_null_tamanu_patient_communications_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_communications\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_type.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_type"], "alias": "source_not_null_tamanu_patient_communications_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"patient_communications\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_channel", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_channel.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_channel"], "alias": "source_not_null_tamanu_patient_communications_channel", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_channel.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel\nfrom \"app\".\"public\".\"patient_communications\"\nwhere channel is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_communications_status.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_status"], "alias": "source_not_null_tamanu_patient_communications_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_communications_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"patient_communications\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_relationships_tamanu_pa_29312226495b1c61b7940169207a0c20.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_communications\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_communications_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2.sql", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_communications_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_communications"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_communications"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_communications.yml\\source_not_null_tamanu_patient_afead9d96d423292d879257a0dfc38e2.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_communications\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_communications')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_conditions_id.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_conditions_id"], "alias": "source_unique_tamanu_patient_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_unique_tamanu_patient_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_id.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_id"], "alias": "source_not_null_tamanu_patient_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_created_at.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_created_at"], "alias": "source_not_null_tamanu_patient_conditions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_updated_at.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_updated_at"], "alias": "source_not_null_tamanu_patient_conditions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.785062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_recorded_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_recorded_date.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_recorded_date"], "alias": "source_not_null_tamanu_patient_conditions_recorded_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_recorded_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_date\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere recorded_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_date", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_conditions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_conditions_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_conditions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_conditions_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_conditions.yml\\source_not_null_tamanu_patient_conditions_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_conditions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_contacts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_contacts_id.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_contacts_id"], "alias": "source_unique_tamanu_patient_contacts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_unique_tamanu_patient_contacts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_id.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_id"], "alias": "source_not_null_tamanu_patient_contacts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_created_at.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_created_at"], "alias": "source_not_null_tamanu_patient_contacts_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_updated_at.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_updated_at"], "alias": "source_not_null_tamanu_patient_contacts_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_name.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_name"], "alias": "source_not_null_tamanu_patient_contacts_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_method", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_method.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_method"], "alias": "source_not_null_tamanu_patient_contacts_method", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_method.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect method\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere method is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "method", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "method", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram"], "alias": "source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_accepted_values_tamanu__3337f38cefaf418fde78cd55d60f3516.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n method as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_contacts\"\n group by method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Email','Sms','WhatsApp','Telegram'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "method", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "method", "values": ["Email", "Sms", "WhatsApp", "Telegram"], "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_patient_id.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_patient_id"], "alias": "source_not_null_tamanu_patient_contacts_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_relationships_tamanu_pa_79a4e729edd5633efa02e869cd4e6735.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_contacts\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_relationship_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_relationship_id.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_relationship_id"], "alias": "source_not_null_tamanu_patient_contacts_relationship_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_relationship_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect relationship_id\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere relationship_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "relationship_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "relationship_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_"], "alias": "dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6"}, "created_at": 1782423653.800931, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\dbt_utils_source_relationships_f66de343c00c540b973d5747882b48c6.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n relationship_id as id\n\n from \"app\".\"public\".\"patient_contacts\"\n\n where relationship_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'contactRelationship'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "relationship_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "relationship_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'contactRelationship'", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_contacts_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_contacts_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_contacts_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_contacts_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8168378, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_contacts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_contacts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_contacts.yml\\source_not_null_tamanu_patient_contacts_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_contacts\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_contacts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_death_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_death_data_id.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_death_data_id"], "alias": "source_unique_tamanu_patient_death_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8168378, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_unique_tamanu_patient_death_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_id.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_id"], "alias": "source_not_null_tamanu_patient_death_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8168378, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_patient_id.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_patient_id"], "alias": "source_not_null_tamanu_patient_death_data_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8168378, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c"}, "created_at": 1782423653.8168378, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_relationships_tamanu_pa_c96c1aca5f3fed71b1aa2fcef745159c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_death_data\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_clinician_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_clinician_id.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_clinician_id"], "alias": "source_not_null_tamanu_patient_death_data_clinician_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8168378, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_clinician_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect clinician_id\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere clinician_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "clinician_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79"}, "created_at": 1782423653.8168378, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_relationships_tamanu_pa_905c78bf8f7f3284333db634b4b88a79.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"patient_death_data\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f"}, "created_at": 1782423653.8168378, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_relationships_tamanu_pa_4dacd179c28058072b48eb5f5ae4622f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"patient_death_data\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d"}, "created_at": 1782423653.8168378, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_0e46a17abe0ad1338384c03ce59faf5d.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n last_surgery_reason_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where last_surgery_reason_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_surgery_reason_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "last_surgery_reason_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c"}, "created_at": 1782423653.8327937, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_fa3b8f64d15a4340fddf0e3879f1a40c.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n primary_cause_condition_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where primary_cause_condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "primary_cause_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "primary_cause_condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa"}, "created_at": 1782423653.8327937, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_f5fd564cabe36c9cd3fbbfaf0f1c88aa.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n antecedent_cause1_condition_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where antecedent_cause1_condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "antecedent_cause1_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "antecedent_cause1_condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6"}, "created_at": 1782423653.8422134, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_e9968183cba4f4b7a404a9cba4788ea6.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n antecedent_cause2_condition_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where antecedent_cause2_condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "antecedent_cause2_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "antecedent_cause2_condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_death_data_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8422134, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_death_data_is_final", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_death_data_is_final.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_death_data_is_final"], "alias": "source_not_null_tamanu_patient_death_data_is_final", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8422134, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\source_not_null_tamanu_patient_death_data_is_final.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_final\nfrom \"app\".\"public\".\"patient_death_data\"\nwhere is_final is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_final", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_final", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338.sql", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338"}, "created_at": 1782423653.8422134, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_death_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_death_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_death_data.yml\\dbt_utils_source_relationships_b4b9d8d1ebf44b05c32b479f86d99338.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n antecedent_cause3_condition_id as id\n\n from \"app\".\"public\".\"patient_death_data\"\n\n where antecedent_cause3_condition_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "antecedent_cause3_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "antecedent_cause3_condition_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_death_data')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_facilities_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_facilities_facility_id.sql", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_facilities_facility_id"], "alias": "source_not_null_tamanu_patient_facilities_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_facilities.yml\\source_not_null_tamanu_patient_facilities_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"patient_facilities\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449.sql", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_facilities.yml\\source_relationships_tamanu_pa_c78717bf2419228f10044e6d85ff8449.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"patient_facilities\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_facilities_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_facilities_patient_id.sql", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_facilities_patient_id"], "alias": "source_not_null_tamanu_patient_facilities_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_facilities.yml\\source_not_null_tamanu_patient_facilities_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_facilities\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e.sql", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_facilities.yml\\source_relationships_tamanu_pa_eabe8ec8f86a90ec7286506eabcb346e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_facilities\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_family_histories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_family_histories_id.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_family_histories_id"], "alias": "source_unique_tamanu_patient_family_histories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_unique_tamanu_patient_family_histories_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_family_histories_id.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_id"], "alias": "source_not_null_tamanu_patient_family_histories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_family_histories_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_family_histories_created_at.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_created_at"], "alias": "source_not_null_tamanu_patient_family_histories_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_family_histories_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_family_histories_updated_at.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_updated_at"], "alias": "source_not_null_tamanu_patient_family_histories_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_family_histories_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_recorded_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_family_histories_recorded_date.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_recorded_date"], "alias": "source_not_null_tamanu_patient_family_histories_recorded_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_family_histories_recorded_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_date\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere recorded_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_date", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_b004150615fa7d97829881147916498e.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_b004150615fa7d97829881147916498e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_b004150615fa7d97829881147916498e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_b004150615fa7d97829881147916498e"}, "created_at": 1782423653.8487334, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_b004150615fa7d97829881147916498e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_relationships_tamanu_pa_b004150615fa7d97829881147916498e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_family_histories\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_relationships_tamanu_pa_b58d28778d1a22717c29b03e2aca8f18.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select practitioner_id as from_field\n from \"app\".\"public\".\"patient_family_histories\"\n where practitioner_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "practitioner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "practitioner_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_"], "alias": "dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\dbt_utils_source_relationships_907e8e0449182ba7f445947ced3ecda9.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n diagnosis_id as id\n\n from \"app\".\"public\".\"patient_family_histories\"\n\n where diagnosis_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'diagnosis'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "diagnosis_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "diagnosis_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'diagnosis'", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_family_histories_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc.sql", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_family_histories_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_family_histories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_family_histories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_family_histories.yml\\source_not_null_tamanu_patient_5df7cd67df9c1488598bf02e557025bc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_family_histories\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_family_histories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_field_definitions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_field_definitions_id.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_field_definitions_id"], "alias": "source_unique_tamanu_patient_field_definitions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_unique_tamanu_patient_field_definitions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_id.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_id"], "alias": "source_not_null_tamanu_patient_field_definitions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_created_at.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_created_at"], "alias": "source_not_null_tamanu_patient_field_definitions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_updated_at.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_updated_at"], "alias": "source_not_null_tamanu_patient_field_definitions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_name.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_name"], "alias": "source_not_null_tamanu_patient_field_definitions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_field_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_field_type.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_field_type"], "alias": "source_not_null_tamanu_patient_field_definitions_field_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_field_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect field_type\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere field_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "field_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "field_type", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select"], "alias": "source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8"}, "created_at": 1782423653.864566, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_accepted_values_tamanu__647dccd3ebadda4cb5ff363cb8ca1df8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n field_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"patient_field_definitions\"\n group by field_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'string','number','select'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "field_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "field_type", "values": ["string", "number", "select"], "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_visibility_status"], "alias": "source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_0fcc98fd8e5e9a2ddfd940e18b8b19f9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_category_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definitions_category_id.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_category_id"], "alias": "source_not_null_tamanu_patient_field_definitions_category_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_field_definitions_category_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect category_id\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere category_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "category_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_"], "alias": "source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"], ["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories", "source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_relationships_tamanu_pa_05825c695ad9d98106c4064c94940236.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select category_id as from_field\n from \"app\".\"public\".\"patient_field_definitions\"\n where category_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patient_field_definition_categories\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "category_id", "to": "source('tamanu', 'patient_field_definition_categories')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d.sql", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definitions.yml\\source_not_null_tamanu_patient_bf8623e34945acb417bde3547a7bb00d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_field_definitions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_field_definition_categories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_field_definition_categories_id.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_field_definition_categories_id"], "alias": "source_unique_tamanu_patient_field_definition_categories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_unique_tamanu_patient_field_definition_categories_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definition_categories_id.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_id"], "alias": "source_not_null_tamanu_patient_field_definition_categories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_field_definition_categories_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_created_at"], "alias": "source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_abf395cee2068f502fc2e358485115f4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_updated_at"], "alias": "source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_e2615e1e28eb778c127c208eabeece28.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_definition_categories_name.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_name"], "alias": "source_not_null_tamanu_patient_field_definition_categories_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_field_definition_categories_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7.sql", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_definition_categories.yml\\source_not_null_tamanu_patient_cccdd8d27ac59a96674c575a309724b7.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_field_definition_categories\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_definition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_created_at.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_created_at"], "alias": "source_not_null_tamanu_patient_field_values_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_updated_at.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_updated_at"], "alias": "source_not_null_tamanu_patient_field_values_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_value", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_value.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_value"], "alias": "source_not_null_tamanu_patient_field_values_value", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_value.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect value\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere value is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "value", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "value", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_definition_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_definition_id.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_definition_id"], "alias": "source_not_null_tamanu_patient_field_values_definition_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8802962, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_definition_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect definition_id\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere definition_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "definition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "definition_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_"], "alias": "source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_definitions"], ["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_definitions", "source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_relationships_tamanu_pa_db3e44e09502980455d7eb94d81dce3a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select definition_id as from_field\n from \"app\".\"public\".\"patient_field_values\"\n where definition_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patient_field_definitions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "definition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "definition_id", "to": "source('tamanu', 'patient_field_definitions')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_field_values_patient_id.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_patient_id"], "alias": "source_not_null_tamanu_patient_field_values_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_field_values_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_relationships_tamanu_pa_3f7fbf90fc1f177ddd15acc3bef3d52d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_field_values\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_field_values_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1.sql", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_field_values_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_field_values"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_field_values"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_field_values.yml\\source_not_null_tamanu_patient_0863520b9639f783db3b3d362f6a0aa1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_field_values\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_field_values')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_issues_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_issues_id.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_issues_id"], "alias": "source_unique_tamanu_patient_issues_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_unique_tamanu_patient_issues_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_issues\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_id.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_id"], "alias": "source_not_null_tamanu_patient_issues_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_issues\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_created_at.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_created_at"], "alias": "source_not_null_tamanu_patient_issues_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_issues\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_updated_at.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_updated_at"], "alias": "source_not_null_tamanu_patient_issues_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_issues\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_recorded_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_recorded_date.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_recorded_date"], "alias": "source_not_null_tamanu_patient_issues_recorded_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_recorded_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recorded_date\nfrom \"app\".\"public\".\"patient_issues\"\nwhere recorded_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recorded_date", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_type.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_type"], "alias": "source_not_null_tamanu_patient_issues_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"patient_issues\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc"}, "created_at": 1782423653.8962967, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_relationships_tamanu_pa_11d3db8e3761e666259492a9f7225fcc.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_issues\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_issues_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_issues_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_issues_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_issues_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_issues"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_issues"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_issues.yml\\source_not_null_tamanu_patient_issues_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_issues\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_issues')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_ongoing_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_ongoing_prescriptions_id.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_ongoing_prescriptions_id"], "alias": "source_unique_tamanu_patient_ongoing_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_unique_tamanu_patient_ongoing_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_ongoing_prescriptions_id.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_id"], "alias": "source_not_null_tamanu_patient_ongoing_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_ongoing_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_patient_id"], "alias": "source_not_null_tamanu_patient_ongoing_prescriptions_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id"], "alias": "source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_a79104510c6558312316085bc7cccfb6.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect prescription_id\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_ongoing_prescriptions_created_at.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_created_at"], "alias": "source_not_null_tamanu_patient_ongoing_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_ongoing_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at"], "alias": "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479.sql", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_ongoing_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_ongoing_prescriptions.yml\\source_not_null_tamanu_patient_f069c79bae2d4c81733b203f8a958479.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_ongoing_prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_ongoing_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_program_registrations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_program_registrations_id.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_program_registrations_id"], "alias": "source_unique_tamanu_patient_program_registrations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_unique_tamanu_patient_program_registrations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_id.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_id"], "alias": "source_not_null_tamanu_patient_program_registrations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_created_at.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_created_at"], "alias": "source_not_null_tamanu_patient_program_registrations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_updated_at.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_updated_at"], "alias": "source_not_null_tamanu_patient_program_registrations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_date.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_date"], "alias": "source_not_null_tamanu_patient_program_registrations_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_registration_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_registration_status"], "alias": "source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_0b4174385f5f0f26edf1b11ad8f250c7.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect registration_status\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere registration_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registration_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "registration_status", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_program_registrations_patient_id.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_patient_id"], "alias": "source_not_null_tamanu_patient_program_registrations_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_program_registrations_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c"}, "created_at": 1782423653.9120193, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_67fe8431d317e60dd499b6095574d73c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_program_registry_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_program_registry_id"], "alias": "source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098"}, "created_at": 1782423653.9291506, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_b313c67021d77a35334c90202158b098.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_id\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere program_registry_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_"], "alias": "source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea"}, "created_at": 1782423653.9291506, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_66b916c0d37cc0fb803f87949d6444ea.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_registry_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where program_registry_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registries\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_registry_id", "to": "source('tamanu', 'program_registries')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_"], "alias": "source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0"}, "created_at": 1782423653.9291506, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_8947710d564d36d8b20ba96110997ed0.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinical_status_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where clinical_status_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registry_clinical_statuses\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinical_status_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinical_status_id", "to": "source('tamanu', 'program_registry_clinical_statuses')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_clinician_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_clinician_id"], "alias": "source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682"}, "created_at": 1782423653.9291506, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_dc75750717c8f99e9d1eac769870a682.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect clinician_id\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere clinician_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "clinician_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_24112443541f682d55878e61af957461.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_24112443541f682d55878e61af957461", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_24112443541f682d55878e61af957461", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_24112443541f682d55878e61af957461"}, "created_at": 1782423653.938966, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_24112443541f682d55878e61af957461\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_24112443541f682d55878e61af957461.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419"}, "created_at": 1782423653.9409635, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_38fcda585ae422d7c37411ea85809419.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select registering_facility_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where registering_facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "registering_facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "registering_facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26"}, "created_at": 1782423653.9444847, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_relationships_tamanu_pa_58c80d42a1671d27482f46d736f73e26.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"patient_program_registrations\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_"], "alias": "dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c"}, "created_at": 1782423653.9474814, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\dbt_utils_source_relationships_bf086bd35f2c06ac9c177ae3fdc1440c.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n village_id as id\n\n from \"app\".\"public\".\"patient_program_registrations\"\n\n where village_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'village'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "village_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "village_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'village'", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb.sql", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb"}, "created_at": 1782423653.951484, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registrations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registrations.yml\\source_not_null_tamanu_patient_1eb9a19311f3899c930f6013deba5cbb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_program_registrations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registrations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_program_registration_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_program_registration_conditions_id.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_program_registration_conditions_id"], "alias": "source_unique_tamanu_patient_program_registration_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9524837, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_unique_tamanu_patient_program_registration_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_id"], "alias": "source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8"}, "created_at": 1782423653.953362, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_e1a0875d2f8370a639a39e66313a54d8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_created_at"], "alias": "source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1"}, "created_at": 1782423653.953866, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_fb29367a1b2a4b655e2dc679f4d6d5e1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_updated_at"], "alias": "source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013"}, "created_at": 1782423653.9551785, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_3ed13cc8bb0e80092fdf2a13034ca013.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_date"], "alias": "source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e"}, "created_at": 1782423653.9562907, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_eb6ddead16ab669ae3252875d7b3ad4e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_"], "alias": "source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b"}, "created_at": 1782423653.956815, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"], ["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_relationships_tamanu_pa_e79b2438034c42e58b5c5b2539b9356b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_registry_condition_id as from_field\n from \"app\".\"public\".\"patient_program_registration_conditions\"\n where program_registry_condition_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registry_conditions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_condition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_registry_condition_id", "to": "source('tamanu', 'program_registry_conditions')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847"}, "created_at": 1782423653.9594986, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_relationships_tamanu_pa_a43c5af7e4a09c2c83da292c916c7847.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select clinician_id as from_field\n from \"app\".\"public\".\"patient_program_registration_conditions\"\n where clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6"}, "created_at": 1782423653.9626868, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_relationships_tamanu_pa_3825b449fdbcb5f619ee1fbbc56bb8a6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select deletion_clinician_id as from_field\n from \"app\".\"public\".\"patient_program_registration_conditions\"\n where deletion_clinician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "deletion_clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "deletion_clinician_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a"}, "created_at": 1782423653.965295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_04c836cd5c65e3b3b3a82e521c276a1a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79.sql", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id"], "alias": "source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79"}, "created_at": 1782423653.966352, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_program_registration_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_program_registration_conditions.yml\\source_not_null_tamanu_patient_6689f85e653a5201bd84873ff8f58c79.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_condition_category_id\nfrom \"app\".\"public\".\"patient_program_registration_conditions\"\nwhere program_registry_condition_category_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_condition_category_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_condition_category_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_program_registration_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_secondary_ids_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_secondary_ids_id.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_secondary_ids_id"], "alias": "source_unique_tamanu_patient_secondary_ids_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.967398, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_unique_tamanu_patient_secondary_ids_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_id.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_id"], "alias": "source_not_null_tamanu_patient_secondary_ids_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9684436, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_value", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_value.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_value"], "alias": "source_not_null_tamanu_patient_secondary_ids_value", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.969486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_value.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect value\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere value is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "value", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "value", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_visibility_status.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_visibility_status"], "alias": "source_not_null_tamanu_patient_secondary_ids_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9700067, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_type_id.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_type_id"], "alias": "source_not_null_tamanu_patient_secondary_ids_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9710398, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type_id\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_secondary_ids_patient_id.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_patient_id"], "alias": "source_not_null_tamanu_patient_secondary_ids_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9715636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_secondary_ids_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a.sql", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick"], "alias": "source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a"}, "created_at": 1782423653.9726195, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_secondary_ids"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_secondary_ids.yml\\source_not_null_tamanu_patient_a8ab8fb64f9c8e3baccb3e0d3142ec6a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"patient_secondary_ids\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'patient_secondary_ids')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_patient_vrs_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_patient_vrs_data_id.sql", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_patient_vrs_data_id"], "alias": "source_unique_tamanu_patient_vrs_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9726195, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_vrs_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_vrs_data.yml\\source_unique_tamanu_patient_vrs_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"patient_vrs_data\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_vrs_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_vrs_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_vrs_data_id.sql", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_vrs_data_id"], "alias": "source_not_null_tamanu_patient_vrs_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9746304, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_vrs_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_vrs_data.yml\\source_not_null_tamanu_patient_vrs_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"patient_vrs_data\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_vrs_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a.sql", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a"}, "created_at": 1782423653.9756823, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "patient_vrs_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.patient_vrs_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_vrs_data.yml\\source_relationships_tamanu_pa_8e72551999606f3ac0ad694f02d2b37a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"patient_vrs_data\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'patient_vrs_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.sql", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote"], "alias": "source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9777715, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patient_vrs_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\patient_vrs_data.yml\\source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_deleted_by_remote\nfrom \"app\".\"public\".\"patient_vrs_data\"\nwhere is_deleted_by_remote is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_deleted_by_remote", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_deleted_by_remote", "model": "{{ get_where_subquery(source('tamanu', 'patient_vrs_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_permissions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_permissions_id.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_permissions_id"], "alias": "source_unique_tamanu_permissions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9777715, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_unique_tamanu_permissions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"permissions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_id.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_id"], "alias": "source_not_null_tamanu_permissions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9777715, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"permissions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_role_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_role_id.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_role_id"], "alias": "source_not_null_tamanu_permissions_role_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9777715, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_role_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect role_id\nfrom \"app\".\"public\".\"permissions\"\nwhere role_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "role_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "role_id", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_"], "alias": "source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963"}, "created_at": 1782423653.9777715, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"], ["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles", "source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_relationships_tamanu_pe_1a8dcc850df03a3ecc14b48122544963.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select role_id as from_field\n from \"app\".\"public\".\"permissions\"\n where role_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"roles\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "role_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "role_id", "to": "source('tamanu', 'roles')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_noun", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_noun.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_noun"], "alias": "source_not_null_tamanu_permissions_noun", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9777715, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_noun.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect noun\nfrom \"app\".\"public\".\"permissions\"\nwhere noun is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "noun", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "noun", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_verb", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_verb.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_verb"], "alias": "source_not_null_tamanu_permissions_verb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9858263, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_verb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect verb\nfrom \"app\".\"public\".\"permissions\"\nwhere verb is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "verb", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "verb", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_permissions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_permissions_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_permissions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_permissions_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.987115, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "permissions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.permissions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\permissions.yml\\source_not_null_tamanu_permissions_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"permissions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'permissions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_pharmacy_orders_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_pharmacy_orders_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_pharmacy_orders_id"], "alias": "source_unique_tamanu_pharmacy_orders_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9881203, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_unique_tamanu_pharmacy_orders_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_id"], "alias": "source_not_null_tamanu_pharmacy_orders_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9891584, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_ordering_clinician_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_ordering_clinician_id"], "alias": "source_not_null_tamanu_pharmacy_orders_ordering_clinician_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9896882, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect ordering_clinician_id\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere ordering_clinician_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ordering_clinician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ordering_clinician_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_encounter_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_encounter_id"], "alias": "source_not_null_tamanu_pharmacy_orders_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.990727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_created_at.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_created_at"], "alias": "source_not_null_tamanu_pharmacy_orders_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9912376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_updated_at.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_updated_at"], "alias": "source_not_null_tamanu_pharmacy_orders_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9922986, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick"], "alias": "source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9933496, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_is_discharge_prescription", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_is_discharge_prescription"], "alias": "source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9"}, "created_at": 1782423653.993873, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmac_7803503b753c14e99185cf602b5e07b9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_discharge_prescription\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere is_discharge_prescription is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_discharge_prescription", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_discharge_prescription", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_date.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_date"], "alias": "source_not_null_tamanu_pharmacy_orders_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9949303, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_orders_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_orders_facility_id.sql", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_orders_facility_id"], "alias": "source_not_null_tamanu_pharmacy_orders_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9954417, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_orders"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_orders.yml\\source_not_null_tamanu_pharmacy_orders_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"pharmacy_orders\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_orders')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_pharmacy_order_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_pharmacy_order_prescriptions_id.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_pharmacy_order_prescriptions_id"], "alias": "source_unique_tamanu_pharmacy_order_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.99649, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_unique_tamanu_pharmacy_order_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_order_prescriptions_id.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_id"], "alias": "source_not_null_tamanu_pharmacy_order_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9975252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmacy_order_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id"], "alias": "source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff"}, "created_at": 1782423653.9985554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmac_e74cd5f61aa3c2ce395f97934c38b5ff.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect pharmacy_order_id\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere pharmacy_order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "pharmacy_order_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pharmacy_order_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id"], "alias": "source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38"}, "created_at": 1782423653.9985554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmac_5f66059351abcdf0ef677a75f5e0df38.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect prescription_id\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere prescription_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "prescription_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "prescription_id", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_quantity", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_order_prescriptions_quantity.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_quantity"], "alias": "source_not_null_tamanu_pharmacy_order_prescriptions_quantity", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9985554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmacy_order_prescriptions_quantity.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect quantity\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere quantity is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "quantity", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "quantity", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_order_prescriptions_created_at.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_created_at"], "alias": "source_not_null_tamanu_pharmacy_order_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423653.9985554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmacy_order_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at"], "alias": "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.001572, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_is_completed", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_is_completed"], "alias": "source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77"}, "created_at": 1782423654.0036006, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmac_ac2df8cceeb6f072c941becedeafef77.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_completed\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere is_completed is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_completed", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_completed", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0.sql", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0"}, "created_at": 1782423654.0041454, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "pharmacy_order_prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\pharmacy_order_prescriptions.yml\\source_not_null_tamanu_pharmac_d23681af90564acf93d6e1ee8c7f61a0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"pharmacy_order_prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'pharmacy_order_prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_portal_one_time_tokens_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_portal_one_time_tokens_id.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_portal_one_time_tokens_id"], "alias": "source_unique_tamanu_portal_one_time_tokens_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0053318, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_unique_tamanu_portal_one_time_tokens_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_id.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_id"], "alias": "source_not_null_tamanu_portal_one_time_tokens_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.006427, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_created_at.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_created_at"], "alias": "source_not_null_tamanu_portal_one_time_tokens_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0069747, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_updated_at.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_updated_at"], "alias": "source_not_null_tamanu_portal_one_time_tokens_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0080636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_portal_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_portal_user_id.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_portal_user_id"], "alias": "source_not_null_tamanu_portal_one_time_tokens_portal_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0085862, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_portal_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect portal_user_id\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere portal_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "portal_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "portal_user_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_type.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_type"], "alias": "source_not_null_tamanu_portal_one_time_tokens_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0096476, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_token", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_token.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_token"], "alias": "source_not_null_tamanu_portal_one_time_tokens_token", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0101814, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_token.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect token\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere token is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "token", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "token", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_one_time_tokens_expires_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_one_time_tokens_expires_at.sql", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_one_time_tokens_expires_at"], "alias": "source_not_null_tamanu_portal_one_time_tokens_expires_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0112484, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_one_time_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_one_time_tokens.yml\\source_not_null_tamanu_portal_one_time_tokens_expires_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect expires_at\nfrom \"app\".\"public\".\"portal_one_time_tokens\"\nwhere expires_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "expires_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "expires_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_one_time_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_portal_survey_assignments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_portal_survey_assignments_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_portal_survey_assignments_id"], "alias": "source_unique_tamanu_portal_survey_assignments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.013073, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_unique_tamanu_portal_survey_assignments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.013628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_created_at.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_created_at"], "alias": "source_not_null_tamanu_portal_survey_assignments_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0147183, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_updated_at.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_updated_at"], "alias": "source_not_null_tamanu_portal_survey_assignments_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0152462, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_patient_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_patient_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0163157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_survey_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_survey_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_survey_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_survey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.016841, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_survey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect survey_id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere survey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "survey_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_status.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_status"], "alias": "source_not_null_tamanu_portal_survey_assignments_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0175858, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_assigned_by_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_assigned_by_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_assigned_by_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_assigned_by_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0186613, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_assigned_by_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect assigned_by_id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere assigned_by_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "assigned_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "assigned_by_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2"}, "created_at": 1782423654.0197496, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal__97281f9b4a17aedd3f69aa37f98a01b2.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_assigned_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_assigned_at.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_assigned_at"], "alias": "source_not_null_tamanu_portal_survey_assignments_assigned_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.020282, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_assigned_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect assigned_at\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere assigned_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "assigned_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "assigned_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_survey_assignments_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_survey_assignments_facility_id.sql", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_survey_assignments_facility_id"], "alias": "source_not_null_tamanu_portal_survey_assignments_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0213385, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_survey_assignments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_survey_assignments.yml\\source_not_null_tamanu_portal_survey_assignments_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"portal_survey_assignments\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_survey_assignments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_portal_users_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_portal_users_id.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_portal_users_id"], "alias": "source_unique_tamanu_portal_users_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.022386, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_unique_tamanu_portal_users_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"portal_users\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_id.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_id"], "alias": "source_not_null_tamanu_portal_users_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0229373, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"portal_users\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_created_at.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_created_at"], "alias": "source_not_null_tamanu_portal_users_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0240347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"portal_users\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_updated_at.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_updated_at"], "alias": "source_not_null_tamanu_portal_users_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.025098, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"portal_users\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_patient_id.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_patient_id"], "alias": "source_not_null_tamanu_portal_users_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0256252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"portal_users\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_portal_users_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_portal_users_email.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_portal_users_email"], "alias": "source_unique_tamanu_portal_users_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0266693, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_unique_tamanu_portal_users_email.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n email as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"portal_users\"\nwhere email is not null\ngroup by email\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_email.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_email"], "alias": "source_not_null_tamanu_portal_users_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0271995, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_email.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect email\nfrom \"app\".\"public\".\"portal_users\"\nwhere email is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_status.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_status"], "alias": "source_not_null_tamanu_portal_users_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0282714, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"portal_users\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_portal_users_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_portal_users_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_portal_users_updated_at_sync_tick"], "alias": "source_not_null_tamanu_portal_users_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.028804, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "portal_users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.portal_users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\portal_users.yml\\source_not_null_tamanu_portal_users_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"portal_users\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'portal_users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_prescriptions_id.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_prescriptions_id"], "alias": "source_unique_tamanu_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0303926, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_unique_tamanu_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"prescriptions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_id.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_id"], "alias": "source_not_null_tamanu_prescriptions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0314395, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"prescriptions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_created_at.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_created_at"], "alias": "source_not_null_tamanu_prescriptions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.031964, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"prescriptions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_updated_at.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_updated_at"], "alias": "source_not_null_tamanu_prescriptions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0329952, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"prescriptions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_date.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_date"], "alias": "source_not_null_tamanu_prescriptions_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0340393, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"prescriptions\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_units", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_units.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_units"], "alias": "source_not_null_tamanu_prescriptions_units", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0345697, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_units.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect units\nfrom \"app\".\"public\".\"prescriptions\"\nwhere units is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "units", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "units", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_frequency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_frequency.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_frequency"], "alias": "source_not_null_tamanu_prescriptions_frequency", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0356302, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_frequency.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect frequency\nfrom \"app\".\"public\".\"prescriptions\"\nwhere frequency is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "frequency", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "frequency", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_start_date.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_start_date"], "alias": "source_not_null_tamanu_prescriptions_start_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0361574, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_start_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_date\nfrom \"app\".\"public\".\"prescriptions\"\nwhere start_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_date", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_prescriptions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_prescriptions_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_prescriptions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_prescriptions_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0372121, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "prescriptions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.prescriptions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\prescriptions.yml\\source_not_null_tamanu_prescriptions_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"prescriptions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'prescriptions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_procedures_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_procedures_id.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_procedures_id"], "alias": "source_unique_tamanu_procedures_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0382795, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_unique_tamanu_procedures_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"procedures\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_id.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_id"], "alias": "source_not_null_tamanu_procedures_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0388236, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"procedures\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_created_at.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_created_at"], "alias": "source_not_null_tamanu_procedures_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0388236, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"procedures\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_updated_at.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_updated_at"], "alias": "source_not_null_tamanu_procedures_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0388236, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"procedures\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_date.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_date"], "alias": "source_not_null_tamanu_procedures_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0388236, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"procedures\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578"}, "created_at": 1782423654.0428598, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_relationships_tamanu_pr_ac8b6cd2d56f9b2670aa5c1393244578.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"procedures\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'encounters')", "field": "id", "column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_"], "alias": "source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd"}, "created_at": 1782423654.0428598, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "locations"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_relationships_tamanu_pr_dd0f63ff67eaff3c16c1f92729f32ebd.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select location_id as from_field\n from \"app\".\"public\".\"procedures\"\n where location_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"locations\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "location_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'locations')", "field": "id", "column_name": "location_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_"], "alias": "dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc"}, "created_at": 1782423654.048992, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\dbt_utils_source_relationships_a6dc0a3ec12ae6bde245ad5e8ea7fbdc.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n procedure_type_id as id\n\n from \"app\".\"public\".\"procedures\"\n\n where procedure_type_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'procedureType'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'procedureType'", "column_name": "procedure_type_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_"], "alias": "dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1"}, "created_at": 1782423654.048992, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\dbt_utils_source_relationships_ab1c603a129592f765725b67bebb0be1.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n anaesthetic_id as id\n\n from \"app\".\"public\".\"procedures\"\n\n where anaesthetic_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'drug'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "anaesthetic_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'drug'", "column_name": "anaesthetic_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c"}, "created_at": 1782423654.048992, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_relationships_tamanu_pr_4bb62730ef6b6a0f1affe153853a784c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select physician_id as from_field\n from \"app\".\"public\".\"procedures\"\n where physician_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "physician_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'users')", "field": "id", "column_name": "physician_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad"}, "created_at": 1782423654.048992, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_relationships_tamanu_pr_05f2cb4aac671f94eb918e115baea4ad.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select anaesthetist_id as from_field\n from \"app\".\"public\".\"procedures\"\n where anaesthetist_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "anaesthetist_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"to": "source('tamanu', 'users')", "field": "id", "column_name": "anaesthetist_id", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedures_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedures_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedures_updated_at_sync_tick"], "alias": "source_not_null_tamanu_procedures_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.048992, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedures"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedures"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedures.yml\\source_not_null_tamanu_procedures_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"procedures\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'procedures')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_procedure_assistant_clinicians_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_procedure_assistant_clinicians_id.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_procedure_assistant_clinicians_id"], "alias": "source_unique_tamanu_procedure_assistant_clinicians_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_unique_tamanu_procedure_assistant_clinicians_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_assistant_clinicians_id.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_id"], "alias": "source_not_null_tamanu_procedure_assistant_clinicians_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedure_assistant_clinicians_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_procedure_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_procedure_id"], "alias": "source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedu_e2064b298ed13be6e056a8e59995e186.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect procedure_id\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere procedure_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "procedure_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_assistant_clinicians_user_id.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_user_id"], "alias": "source_not_null_tamanu_procedure_assistant_clinicians_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedure_assistant_clinicians_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_created_at"], "alias": "source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedu_905b8ae19c0a560f3af293ecff7eb9fe.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_updated_at"], "alias": "source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedu_93084fa47a1a0b145ba568e84bd0244b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41.sql", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick"], "alias": "source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_assistant_clinicians"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_assistant_clinicians.yml\\source_not_null_tamanu_procedu_78dc2ab8983cace3db5895264bd83e41.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"procedure_assistant_clinicians\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'procedure_assistant_clinicians')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_procedure_survey_responses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_procedure_survey_responses_id.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_procedure_survey_responses_id"], "alias": "source_unique_tamanu_procedure_survey_responses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_unique_tamanu_procedure_survey_responses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_survey_responses_id.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_id"], "alias": "source_not_null_tamanu_procedure_survey_responses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedure_survey_responses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_procedure_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_survey_responses_procedure_id.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_procedure_id"], "alias": "source_not_null_tamanu_procedure_survey_responses_procedure_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedure_survey_responses_procedure_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect procedure_id\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere procedure_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "procedure_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_survey_response_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_survey_response_id"], "alias": "source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedu_2867eed558117f5250d3f5a750993222.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect survey_response_id\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere survey_response_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_response_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "survey_response_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_survey_responses_created_at.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_created_at"], "alias": "source_not_null_tamanu_procedure_survey_responses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedure_survey_responses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_survey_responses_updated_at.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_updated_at"], "alias": "source_not_null_tamanu_procedure_survey_responses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedure_survey_responses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc.sql", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_survey_responses.yml\\source_not_null_tamanu_procedu_0fbbffc1b278fd8d4f89765e240396cc.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"procedure_survey_responses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'procedure_survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_procedure_type_surveys_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_procedure_type_surveys_id.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_procedure_type_surveys_id"], "alias": "source_unique_tamanu_procedure_type_surveys_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_unique_tamanu_procedure_type_surveys_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_id.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_id"], "alias": "source_not_null_tamanu_procedure_type_surveys_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_procedure_type_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_procedure_type_id.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_procedure_type_id"], "alias": "source_not_null_tamanu_procedure_type_surveys_procedure_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_procedure_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect procedure_type_id\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere procedure_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "procedure_type_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "procedure_type_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_survey_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_survey_id.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_survey_id"], "alias": "source_not_null_tamanu_procedure_type_surveys_survey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0640173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_survey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect survey_id\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere survey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "survey_id", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_created_at.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_created_at"], "alias": "source_not_null_tamanu_procedure_type_surveys_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedure_type_surveys_updated_at.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_updated_at"], "alias": "source_not_null_tamanu_procedure_type_surveys_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedure_type_surveys_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e.sql", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick"], "alias": "source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "procedure_type_surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\procedure_type_surveys.yml\\source_not_null_tamanu_procedu_977927964e2861f5a7c410668aa7a21e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"procedure_type_surveys\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'procedure_type_surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_programs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_programs_id.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_programs_id"], "alias": "source_unique_tamanu_programs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_unique_tamanu_programs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"programs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_programs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_programs_id.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_programs_id"], "alias": "source_not_null_tamanu_programs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_not_null_tamanu_programs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"programs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_programs_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_programs_created_at.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_programs_created_at"], "alias": "source_not_null_tamanu_programs_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_not_null_tamanu_programs_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"programs\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_programs_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_programs_updated_at.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_programs_updated_at"], "alias": "source_not_null_tamanu_programs_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_not_null_tamanu_programs_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"programs\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_programs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_programs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\programs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_programs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_programs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\programs.yml\\source_not_null_tamanu_programs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"programs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'programs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_data_elements_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_data_elements_id.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_data_elements_id"], "alias": "source_unique_tamanu_program_data_elements_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_unique_tamanu_program_data_elements_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_data_elements_id.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_id"], "alias": "source_not_null_tamanu_program_data_elements_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_data_elements_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_data_elements_created_at.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_created_at"], "alias": "source_not_null_tamanu_program_data_elements_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_data_elements_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_data_elements_updated_at.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_updated_at"], "alias": "source_not_null_tamanu_program_data_elements_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_data_elements_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_data_elements_type.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_type"], "alias": "source_not_null_tamanu_program_data_elements_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_data_elements_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_data_elements_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824.sql", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_data_elements_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_data_elements.yml\\source_not_null_tamanu_program_967fbe5ed50fe5c4f87e3432726d5824.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_data_elements\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_data_elements')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registries_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registries_id.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registries_id"], "alias": "source_unique_tamanu_program_registries_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.079943, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_unique_tamanu_program_registries_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registries\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_id.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_id"], "alias": "source_not_null_tamanu_program_registries_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0935173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_registries\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_created_at.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_created_at"], "alias": "source_not_null_tamanu_program_registries_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0935173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_registries\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_updated_at.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_updated_at"], "alias": "source_not_null_tamanu_program_registries_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0935173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_registries\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registries_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registries_code.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registries_code"], "alias": "source_unique_tamanu_program_registries_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_unique_tamanu_program_registries_code.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n code as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registries\"\nwhere code is not null\ngroup by code\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_code.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_code"], "alias": "source_not_null_tamanu_program_registries_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"program_registries\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_name.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_name"], "alias": "source_not_null_tamanu_program_registries_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"program_registries\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_currently_at_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_currently_at_type.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_currently_at_type"], "alias": "source_not_null_tamanu_program_registries_currently_at_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_currently_at_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect currently_at_type\nfrom \"app\".\"public\".\"program_registries\"\nwhere currently_at_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "currently_at_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "currently_at_type", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_program_registries_currently_at_type__village__facility", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_program_registries_currently_at_type__village__facility"], "alias": "source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_accepted_values_tamanu__798681f07c23b5908c876ab18d6c1321.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n currently_at_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"program_registries\"\n group by currently_at_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'village','facility'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "currently_at_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "currently_at_type", "values": ["village", "facility"], "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_program_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_program_id.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_program_id"], "alias": "source_not_null_tamanu_program_registries_program_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_program_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_id\nfrom \"app\".\"public\".\"program_registries\"\nwhere program_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_id", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registries_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registries_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registries_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_registries_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registries.yml\\source_not_null_tamanu_program_registries_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_registries\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_registries')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_clinical_statuses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_clinical_statuses_id.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_clinical_statuses_id"], "alias": "source_unique_tamanu_program_registry_clinical_statuses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_unique_tamanu_program_registry_clinical_statuses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_clinical_statuses_id.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_id"], "alias": "source_not_null_tamanu_program_registry_clinical_statuses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_registry_clinical_statuses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_created_at"], "alias": "source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_fc0d8d971bdfe18fe835b7de4cb8ae1a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_updated_at"], "alias": "source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_53451cd5c8e210744f01a8dcc6015e74.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_clinical_statuses_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_clinical_statuses_code.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_clinical_statuses_code"], "alias": "source_unique_tamanu_program_registry_clinical_statuses_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_unique_tamanu_program_registry_clinical_statuses_code.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n code as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere code is not null\ngroup by code\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_clinical_statuses_code.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_code"], "alias": "source_not_null_tamanu_program_registry_clinical_statuses_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_registry_clinical_statuses_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_clinical_statuses_name.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_name"], "alias": "source_not_null_tamanu_program_registry_clinical_statuses_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_registry_clinical_statuses_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id"], "alias": "source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_f4a8353a6dbc7cb846139c812c99c1f5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_id\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere program_registry_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_"], "alias": "source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181"}, "created_at": 1782423654.0960724, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"], ["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_relationships_tamanu_pr_5e7f9660e033eb35ad4d26c6a5e97181.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_registry_id as from_field\n from \"app\".\"public\".\"program_registry_clinical_statuses\"\n where program_registry_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registries\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_registry_id", "to": "source('tamanu', 'program_registries')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c.sql", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_clinical_statuses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_clinical_statuses.yml\\source_not_null_tamanu_program_97130df8175309d93eebd85ca577fa1c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_registry_clinical_statuses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_clinical_statuses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_conditions_id.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_conditions_id"], "alias": "source_unique_tamanu_program_registry_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_unique_tamanu_program_registry_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_id.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_id"], "alias": "source_not_null_tamanu_program_registry_conditions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_created_at.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_created_at"], "alias": "source_not_null_tamanu_program_registry_conditions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_updated_at.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_updated_at"], "alias": "source_not_null_tamanu_program_registry_conditions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_conditions_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_conditions_code.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_conditions_code"], "alias": "source_unique_tamanu_program_registry_conditions_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_unique_tamanu_program_registry_conditions_code.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n code as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere code is not null\ngroup by code\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_code.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_code"], "alias": "source_not_null_tamanu_program_registry_conditions_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_conditions_name.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_name"], "alias": "source_not_null_tamanu_program_registry_conditions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_registry_conditions_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_program_registry_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_program_registry_id"], "alias": "source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_0864f103a6e5eecc1e4a60e212d1c5d5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_id\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere program_registry_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_"], "alias": "source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registries"], ["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_relationships_tamanu_pr_9774d75a909ed3789fa933885f18167e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_registry_id as from_field\n from \"app\".\"public\".\"program_registry_conditions\"\n where program_registry_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_registries\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_registry_id", "to": "source('tamanu', 'program_registries')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b.sql", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_conditions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_conditions.yml\\source_not_null_tamanu_program_f33a74dbb7ba897c04e964927bd9171b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_registry_conditions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_conditions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_program_registry_condition_categories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_program_registry_condition_categories_id.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_program_registry_condition_categories_id"], "alias": "source_unique_tamanu_program_registry_condition_categories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_unique_tamanu_program_registry_condition_categories_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_registry_condition_categories_id.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_id"], "alias": "source_not_null_tamanu_program_registry_condition_categories_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1119041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_registry_condition_categories_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_created_at"], "alias": "source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_49b83e6819cdb65b5af03964d270d341.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_updated_at"], "alias": "source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_c558f15ea68c0b2926626de892f4b8a7.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_code"], "alias": "source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_3df82a5fd0bf0039a439f1b57ed6ca0f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_name"], "alias": "source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_ddcf7dd809d0edb5fc642fc4ae841e1c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_program_registry_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_program_registry_id"], "alias": "source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_11e682f5529ac54e7843dc0808ae0a8c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect program_registry_id\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere program_registry_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_registry_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "program_registry_id", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528.sql", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick"], "alias": "source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_registry_condition_categories"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\program_registry_condition_categories.yml\\source_not_null_tamanu_program_315fe0a3cfa9a2e63766846cfbce2528.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"program_registry_condition_categories\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'program_registry_condition_categories')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_data_id.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_data_id"], "alias": "source_unique_tamanu_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_unique_tamanu_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_data\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_id.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_id"], "alias": "source_not_null_tamanu_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"reference_data\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_created_at.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_created_at"], "alias": "source_not_null_tamanu_reference_data_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_data\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_updated_at.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_updated_at"], "alias": "source_not_null_tamanu_reference_data_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_data\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_code.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_code"], "alias": "source_not_null_tamanu_reference_data_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect code\nfrom \"app\".\"public\".\"reference_data\"\nwhere code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "code", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_type.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_type"], "alias": "source_not_null_tamanu_reference_data_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"reference_data\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_name.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_name"], "alias": "source_not_null_tamanu_reference_data_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"reference_data\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_updated_at_sync_tick"], "alias": "source_not_null_tamanu_reference_data_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_data\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_system_required", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_system_required.sql", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_system_required"], "alias": "source_not_null_tamanu_reference_data_system_required", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data.yml\\source_not_null_tamanu_reference_data_system_required.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect system_required\nfrom \"app\".\"public\".\"reference_data\"\nwhere system_required is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "system_required", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "system_required", "model": "{{ get_where_subquery(source('tamanu', 'reference_data')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_data_relations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_data_relations_id.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_data_relations_id"], "alias": "source_unique_tamanu_reference_data_relations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_unique_tamanu_reference_data_relations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_relations_id.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_id"], "alias": "source_not_null_tamanu_reference_data_relations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1276143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_reference_data_relations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_relations_created_at.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_created_at"], "alias": "source_not_null_tamanu_reference_data_relations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1424677, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_reference_data_relations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_relations_updated_at.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_updated_at"], "alias": "source_not_null_tamanu_reference_data_relations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_reference_data_relations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_data_relations_type.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_type"], "alias": "source_not_null_tamanu_reference_data_relations_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_reference_data_relations_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_data_relations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1.sql", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_data_relations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data_relations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data_relations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_data_relations.yml\\source_not_null_tamanu_referen_8011b7a9252ff0fdea21248282e062d1.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_data_relations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_data_relations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_drugs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_drugs_id.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_drugs_id"], "alias": "source_unique_tamanu_reference_drugs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_unique_tamanu_reference_drugs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_id.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_id"], "alias": "source_not_null_tamanu_reference_drugs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_drugs_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_drugs_reference_data_id.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_drugs_reference_data_id"], "alias": "source_unique_tamanu_reference_drugs_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_unique_tamanu_reference_drugs_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n reference_data_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere reference_data_id is not null\ngroup by reference_data_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_reference_data_id.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_reference_data_id"], "alias": "source_not_null_tamanu_reference_drugs_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reference_data_id\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere reference_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_is_sensitive", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_is_sensitive.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_is_sensitive"], "alias": "source_not_null_tamanu_reference_drugs_is_sensitive", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_is_sensitive.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_sensitive\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere is_sensitive is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_sensitive", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_sensitive", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_created_at.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_created_at"], "alias": "source_not_null_tamanu_reference_drugs_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_updated_at.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_updated_at"], "alias": "source_not_null_tamanu_reference_drugs_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drugs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drugs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drugs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_reference_drugs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drugs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drugs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drugs.yml\\source_not_null_tamanu_reference_drugs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_drugs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_drugs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_reference_drug_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_reference_drug_id"], "alias": "source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_referen_a85329f24a02d8a266ae910b0c808eca.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reference_drug_id\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere reference_drug_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_drug_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reference_drug_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_facility_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drug_facilities_facility_id.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_facility_id"], "alias": "source_not_null_tamanu_reference_drug_facilities_facility_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_reference_drug_facilities_facility_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_id\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere facility_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drug_facilities_created_at.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_created_at"], "alias": "source_not_null_tamanu_reference_drug_facilities_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_reference_drug_facilities_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drug_facilities_updated_at.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_updated_at"], "alias": "source_not_null_tamanu_reference_drug_facilities_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_reference_drug_facilities_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick"], "alias": "source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_referen_b4bf525cb27a74fbe2fad4a7072b224a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_drug_facilities_stock_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_drug_facilities_stock_status.sql", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_drug_facilities_stock_status"], "alias": "source_not_null_tamanu_reference_drug_facilities_stock_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1434772, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_drug_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_drug_facilities.yml\\source_not_null_tamanu_reference_drug_facilities_stock_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect stock_status\nfrom \"app\".\"public\".\"reference_drug_facilities\"\nwhere stock_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stock_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stock_status", "model": "{{ get_where_subquery(source('tamanu', 'reference_drug_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_reference_medication_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_reference_medication_templates_id.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_reference_medication_templates_id"], "alias": "source_unique_tamanu_reference_medication_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_unique_tamanu_reference_medication_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_id.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_id"], "alias": "source_not_null_tamanu_reference_medication_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_reference_data_id"], "alias": "source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_4b587921cea1c081c1877ed79180dad8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reference_data_id\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere reference_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_medication_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_medication_id"], "alias": "source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_9832446b4446a89d5bfae765b3726e08.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect medication_id\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere medication_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "medication_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "medication_id", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_is_variable_dose", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_is_variable_dose"], "alias": "source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_c91b73a0f7138a3d251efd3548b80c83.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_variable_dose\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere is_variable_dose is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_variable_dose", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_variable_dose", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_is_prn", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_is_prn.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_is_prn"], "alias": "source_not_null_tamanu_reference_medication_templates_is_prn", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_is_prn.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_prn\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere is_prn is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_prn", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_prn", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_units", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_units.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_units"], "alias": "source_not_null_tamanu_reference_medication_templates_units", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_units.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect units\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere units is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "units", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "units", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_frequency", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_frequency.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_frequency"], "alias": "source_not_null_tamanu_reference_medication_templates_frequency", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_frequency.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect frequency\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere frequency is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "frequency", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "frequency", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_route", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_reference_medication_templates_route.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_route"], "alias": "source_not_null_tamanu_reference_medication_templates_route", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_reference_medication_templates_route.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect route\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere route is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "route", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "route", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_created_at"], "alias": "source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_7801f11da6d8089c215ad4fde7902f4c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_updated_at"], "alias": "source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_92867e68db3b698d92819df62a513e26.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick"], "alias": "source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_2aea13ddb9f31f038797d517752519f8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_reference_medication_templates_is_ongoing", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb.sql", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_reference_medication_templates_is_ongoing"], "alias": "source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_medication_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\reference_medication_templates.yml\\source_not_null_tamanu_referen_607287a71f873b793a8936fce54239fb.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_ongoing\nfrom \"app\".\"public\".\"reference_medication_templates\"\nwhere is_ongoing is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_ongoing", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_ongoing", "model": "{{ get_where_subquery(source('tamanu', 'reference_medication_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_referrals_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_referrals_id.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_referrals_id"], "alias": "source_unique_tamanu_referrals_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_unique_tamanu_referrals_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"referrals\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_id.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_id"], "alias": "source_not_null_tamanu_referrals_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"referrals\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_created_at.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_created_at"], "alias": "source_not_null_tamanu_referrals_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"referrals\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_updated_at.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_updated_at"], "alias": "source_not_null_tamanu_referrals_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"referrals\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7"}, "created_at": 1782423654.15925, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_relationships_tamanu_re_64cd5fa5a35a08b671f81bc8fd3f29e7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select initiating_encounter_id as from_field\n from \"app\".\"public\".\"referrals\"\n where initiating_encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "initiating_encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "initiating_encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_relationships_tamanu_re_442fab802054d8cdc9fe956ad0e3152a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select completing_encounter_id as from_field\n from \"app\".\"public\".\"referrals\"\n where completing_encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "completing_encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "completing_encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_"], "alias": "source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"], ["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses", "source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_relationships_tamanu_re_223c3ab3179233f5d9188adf5d1b12dd.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select survey_response_id as from_field\n from \"app\".\"public\".\"referrals\"\n where survey_response_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"survey_responses\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_response_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "survey_response_id", "to": "source('tamanu', 'survey_responses')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_status.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_status"], "alias": "source_not_null_tamanu_referrals_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"referrals\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_referrals_status__pending__cancelled__completed", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_referrals_status__pending__cancelled__completed"], "alias": "source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_accepted_values_tamanu__c7c5c42266d9cf50bc3048ec645a42e4.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"referrals\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'pending','cancelled','completed'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["pending", "cancelled", "completed"], "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_referrals_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_referrals_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_referrals_updated_at_sync_tick"], "alias": "source_not_null_tamanu_referrals_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "referrals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.referrals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\referrals.yml\\source_not_null_tamanu_referrals_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"referrals\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'referrals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_refresh_tokens_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_refresh_tokens_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_refresh_tokens_id"], "alias": "source_unique_tamanu_refresh_tokens_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_unique_tamanu_refresh_tokens_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_id"], "alias": "source_not_null_tamanu_refresh_tokens_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_refresh_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_refresh_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_refresh_id"], "alias": "source_not_null_tamanu_refresh_tokens_refresh_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_refresh_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect refresh_id\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere refresh_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "refresh_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "refresh_id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_device_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_device_id"], "alias": "source_not_null_tamanu_refresh_tokens_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_user_id.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_user_id"], "alias": "source_not_null_tamanu_refresh_tokens_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1753094, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_relationships_tamanu_re_7a2111bbf9247158a1cce7b969b4e2c7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"refresh_tokens\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_refresh_tokens_expires_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_refresh_tokens_expires_at.sql", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_refresh_tokens_expires_at"], "alias": "source_not_null_tamanu_refresh_tokens_expires_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "refresh_tokens"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.refresh_tokens"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\refresh_tokens.yml\\source_not_null_tamanu_refresh_tokens_expires_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect expires_at\nfrom \"app\".\"public\".\"refresh_tokens\"\nwhere expires_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "expires_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "expires_at", "model": "{{ get_where_subquery(source('tamanu', 'refresh_tokens')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_report_definitions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_report_definitions_id.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_report_definitions_id"], "alias": "source_unique_tamanu_report_definitions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_unique_tamanu_report_definitions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"report_definitions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definitions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definitions_id.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definitions_id"], "alias": "source_not_null_tamanu_report_definitions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_not_null_tamanu_report_definitions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"report_definitions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_report_definitions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_report_definitions_name.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_report_definitions_name"], "alias": "source_unique_tamanu_report_definitions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_unique_tamanu_report_definitions_name.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n name as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"report_definitions\"\nwhere name is not null\ngroup by name\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definitions_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definitions_name.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definitions_name"], "alias": "source_not_null_tamanu_report_definitions_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_not_null_tamanu_report_definitions_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"report_definitions\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definitions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definitions_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definitions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_report_definitions_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_not_null_tamanu_report_definitions_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"report_definitions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definitions_db_schema", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definitions_db_schema.sql", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definitions_db_schema"], "alias": "source_not_null_tamanu_report_definitions_db_schema", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definitions.yml\\source_not_null_tamanu_report_definitions_db_schema.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect db_schema\nfrom \"app\".\"public\".\"report_definitions\"\nwhere db_schema is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "db_schema", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "db_schema", "model": "{{ get_where_subquery(source('tamanu', 'report_definitions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_report_definition_versions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_report_definition_versions_id.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_report_definition_versions_id"], "alias": "source_unique_tamanu_report_definition_versions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_unique_tamanu_report_definition_versions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definition_versions_id.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_id"], "alias": "source_not_null_tamanu_report_definition_versions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report_definition_versions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_version_number", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_version_number"], "alias": "source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report__ed416d07e81fc4b4afe6895aef3eca64.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect version_number\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere version_number is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "version_number", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "version_number", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definition_versions_status.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_status"], "alias": "source_not_null_tamanu_report_definition_versions_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report_definition_versions_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_report_definition_versions_status__draft__published", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_report_definition_versions_status__draft__published"], "alias": "source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a"}, "created_at": 1782423654.1911376, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_accepted_values_tamanu__ab42f0393d707c008d76d55ee8dae00a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"report_definition_versions\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'draft','published'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["draft", "published"], "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_"], "alias": "source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definitions"], ["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definitions", "source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_relationships_tamanu_re_9ce80923810fa2afed323e2d0d069c96.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select report_definition_id as from_field\n from \"app\".\"public\".\"report_definition_versions\"\n where report_definition_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"report_definitions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "report_definition_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "report_definition_id", "to": "source('tamanu', 'report_definitions')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_definition_versions_user_id.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_user_id"], "alias": "source_not_null_tamanu_report_definition_versions_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report_definition_versions_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_relationships_tamanu_re_e952ab9d0a604644196bf80eb50efd1f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"report_definition_versions\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_definition_versions_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8.sql", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_definition_versions_updated_at_sync_tick"], "alias": "source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_definition_versions.yml\\source_not_null_tamanu_report__7d8650ed4f6189543ec687ec254075a8.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"report_definition_versions\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'report_definition_versions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_report_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_report_requests_id.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_report_requests_id"], "alias": "source_unique_tamanu_report_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_unique_tamanu_report_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"report_requests\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_id.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_id"], "alias": "source_not_null_tamanu_report_requests_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"report_requests\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_created_at.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_created_at"], "alias": "source_not_null_tamanu_report_requests_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"report_requests\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_updated_at.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_updated_at"], "alias": "source_not_null_tamanu_report_requests_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"report_requests\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_recipients", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_recipients.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_recipients"], "alias": "source_not_null_tamanu_report_requests_recipients", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_recipients.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect recipients\nfrom \"app\".\"public\".\"report_requests\"\nwhere recipients is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recipients", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "recipients", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_status.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_status"], "alias": "source_not_null_tamanu_report_requests_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"report_requests\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error"], "alias": "source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8"}, "created_at": 1782423654.2067974, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_accepted_values_tamanu__24a114ea0caac02877dca5c270dc5fc8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"report_requests\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Received','Processing','Processed','Error'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "status", "values": ["Received", "Processing", "Processed", "Error"], "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_requested_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_requested_by_user_id.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_requested_by_user_id"], "alias": "source_not_null_tamanu_report_requests_requested_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2226448, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_requested_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect requested_by_user_id\nfrom \"app\".\"public\".\"report_requests\"\nwhere requested_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "requested_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95"}, "created_at": 1782423654.2226448, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_relationships_tamanu_re_1723d1cbb5133171b4b17f176af16c95.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select requested_by_user_id as from_field\n from \"app\".\"public\".\"report_requests\"\n where requested_by_user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "requested_by_user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6"}, "created_at": 1782423654.2226448, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_relationships_tamanu_re_129974f546797fea7a3845057b3199b6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"report_requests\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_export_format", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_export_format.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_export_format"], "alias": "source_not_null_tamanu_report_requests_export_format", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2226448, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_export_format.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect export_format\nfrom \"app\".\"public\".\"report_requests\"\nwhere export_format is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "export_format", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "export_format", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_report_requests_export_format__xlsx__csv", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_report_requests_export_format__xlsx__csv"], "alias": "source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d"}, "created_at": 1782423654.2226448, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_accepted_values_tamanu__7cad5453a40be771bcdacbe1df1da35d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n export_format as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"report_requests\"\n group by export_format\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'xlsx','csv'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "export_format", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "export_format", "values": ["xlsx", "csv"], "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_"], "alias": "source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553"}, "created_at": 1782423654.2226448, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_definition_versions"], ["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_definition_versions", "source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_relationships_tamanu_re_2927e7a244cfed48746aa65a6789c553.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select report_definition_version_id as from_field\n from \"app\".\"public\".\"report_requests\"\n where report_definition_version_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"report_definition_versions\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "report_definition_version_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "report_definition_version_id", "to": "source('tamanu', 'report_definition_versions')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_report_requests_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_report_requests_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_report_requests_updated_at_sync_tick"], "alias": "source_not_null_tamanu_report_requests_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2226448, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "report_requests"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.report_requests"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\report_requests.yml\\source_not_null_tamanu_report_requests_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"report_requests\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'report_requests')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_roles_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_roles_id.sql", "original_file_path": "models\\sources\\roles.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_roles_id"], "alias": "source_unique_tamanu_roles_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2387738, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\roles.yml\\source_unique_tamanu_roles_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"roles\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'roles')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_roles_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_roles_id.sql", "original_file_path": "models\\sources\\roles.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_roles_id"], "alias": "source_not_null_tamanu_roles_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2387738, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\roles.yml\\source_not_null_tamanu_roles_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"roles\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'roles')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_roles_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_roles_name.sql", "original_file_path": "models\\sources\\roles.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_roles_name"], "alias": "source_not_null_tamanu_roles_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2387738, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\roles.yml\\source_not_null_tamanu_roles_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"roles\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'roles')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_roles_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_roles_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\roles.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_roles_updated_at_sync_tick"], "alias": "source_not_null_tamanu_roles_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2387738, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "roles"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.roles"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\roles.yml\\source_not_null_tamanu_roles_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"roles\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'roles')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_scheduled_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_scheduled_vaccines_id.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_scheduled_vaccines_id"], "alias": "source_unique_tamanu_scheduled_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_unique_tamanu_scheduled_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_id.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_id"], "alias": "source_not_null_tamanu_scheduled_vaccines_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_created_at.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_created_at"], "alias": "source_not_null_tamanu_scheduled_vaccines_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_updated_at.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_updated_at"], "alias": "source_not_null_tamanu_scheduled_vaccines_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine"], "alias": "source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_accepted_values_tamanu__c3e1fa228e8e0d7fa4dc9c39cd9bd7e7.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n category as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"scheduled_vaccines\"\n group by category\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Campaign','Catchup','Other','Routine'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "category", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "category", "values": ["Campaign", "Catchup", "Other", "Routine"], "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick"], "alias": "source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_hide_from_certificate", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_hide_from_certificate"], "alias": "source_not_null_tamanu_scheduled_vaccines_hide_from_certificate", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect hide_from_certificate\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere hide_from_certificate is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "hide_from_certificate", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "hide_from_certificate", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_scheduled_vaccines_sort_index", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_scheduled_vaccines_sort_index.sql", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_scheduled_vaccines_sort_index"], "alias": "source_not_null_tamanu_scheduled_vaccines_sort_index", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\scheduled_vaccines.yml\\source_not_null_tamanu_scheduled_vaccines_sort_index.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect sort_index\nfrom \"app\".\"public\".\"scheduled_vaccines\"\nwhere sort_index is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "sort_index", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "sort_index", "model": "{{ get_where_subquery(source('tamanu', 'scheduled_vaccines')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_SequelizeMeta_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_SequelizeMeta_name.sql", "original_file_path": "models\\sources\\SequelizeMeta.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_SequelizeMeta_name"], "alias": "source_unique_tamanu_SequelizeMeta_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "SequelizeMeta"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.SequelizeMeta"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\SequelizeMeta.yml\\source_unique_tamanu_SequelizeMeta_name.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n name as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"SequelizeMeta\"\nwhere name is not null\ngroup by name\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'SequelizeMeta')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_SequelizeMeta_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_SequelizeMeta_name.sql", "original_file_path": "models\\sources\\SequelizeMeta.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_SequelizeMeta_name"], "alias": "source_not_null_tamanu_SequelizeMeta_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2425554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "SequelizeMeta"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.SequelizeMeta"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\SequelizeMeta.yml\\source_not_null_tamanu_SequelizeMeta_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"SequelizeMeta\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'SequelizeMeta')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_settings_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_settings_id.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_settings_id"], "alias": "source_unique_tamanu_settings_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_unique_tamanu_settings_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"settings\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_id.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_id"], "alias": "source_not_null_tamanu_settings_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"settings\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_created_at.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_created_at"], "alias": "source_not_null_tamanu_settings_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"settings\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_updated_at.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_updated_at"], "alias": "source_not_null_tamanu_settings_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"settings\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_key", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_key.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_key"], "alias": "source_not_null_tamanu_settings_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect key\nfrom \"app\".\"public\".\"settings\"\nwhere key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "key", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "key", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_relationships_tamanu_se_8f578dab1de5c540e4f6ec449925f06b.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"settings\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_updated_at_sync_tick"], "alias": "source_not_null_tamanu_settings_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"settings\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_settings_scope", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_settings_scope.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_settings_scope"], "alias": "source_not_null_tamanu_settings_scope", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_not_null_tamanu_settings_scope.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect scope\nfrom \"app\".\"public\".\"settings\"\nwhere scope is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scope", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "scope", "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_settings_scope__global__central__facility", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84.sql", "original_file_path": "models\\sources\\settings.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_settings_scope__global__central__facility"], "alias": "source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "settings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.settings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\settings.yml\\source_accepted_values_tamanu__d09e2a950f2e92ca2ed5e37588c7fe84.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n scope as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"settings\"\n group by scope\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'global','central','facility'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scope", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "scope", "values": ["global", "central", "facility"], "model": "{{ get_where_subquery(source('tamanu', 'settings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_signers_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_signers_id.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_signers_id"], "alias": "source_unique_tamanu_signers_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_unique_tamanu_signers_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"signers\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_id.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_id"], "alias": "source_not_null_tamanu_signers_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"signers\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_created_at.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_created_at"], "alias": "source_not_null_tamanu_signers_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.254678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"signers\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_updated_at.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_updated_at"], "alias": "source_not_null_tamanu_signers_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"signers\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_country_code", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_country_code.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_country_code"], "alias": "source_not_null_tamanu_signers_country_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_country_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect country_code\nfrom \"app\".\"public\".\"signers\"\nwhere country_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "country_code", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "country_code", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_public_key", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_public_key.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_public_key"], "alias": "source_not_null_tamanu_signers_public_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_public_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect public_key\nfrom \"app\".\"public\".\"signers\"\nwhere public_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "public_key", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "public_key", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_request", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_request.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_request"], "alias": "source_not_null_tamanu_signers_request", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_request.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect request\nfrom \"app\".\"public\".\"signers\"\nwhere request is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "request", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "request", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_signers_signatures_issued", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_signers_signatures_issued.sql", "original_file_path": "models\\sources\\signers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_signers_signatures_issued"], "alias": "source_not_null_tamanu_signers_signatures_issued", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "signers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.signers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\signers.yml\\source_not_null_tamanu_signers_signatures_issued.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect signatures_issued\nfrom \"app\".\"public\".\"signers\"\nwhere signatures_issued is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "signatures_issued", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "signatures_issued", "model": "{{ get_where_subquery(source('tamanu', 'signers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_socket_io_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_socket_io_attachments_id.sql", "original_file_path": "models\\sources\\socket_io_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_socket_io_attachments_id"], "alias": "source_unique_tamanu_socket_io_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "socket_io_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\socket_io_attachments.yml\\source_unique_tamanu_socket_io_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"socket_io_attachments\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'socket_io_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_socket_io_attachments_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_socket_io_attachments_id.sql", "original_file_path": "models\\sources\\socket_io_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_socket_io_attachments_id"], "alias": "source_not_null_tamanu_socket_io_attachments_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "socket_io_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\socket_io_attachments.yml\\source_not_null_tamanu_socket_io_attachments_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"socket_io_attachments\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'socket_io_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9.sql", "original_file_path": "models\\sources\\socket_io_attachments.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick"], "alias": "source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "socket_io_attachments"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\socket_io_attachments.yml\\source_not_null_tamanu_socket__a4f1d603af05f714ad5168498e4b89c9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"socket_io_attachments\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'socket_io_attachments')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_surveys_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_surveys_id.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_surveys_id"], "alias": "source_unique_tamanu_surveys_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_unique_tamanu_surveys_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"surveys\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_id.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_id"], "alias": "source_not_null_tamanu_surveys_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"surveys\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_created_at.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_created_at"], "alias": "source_not_null_tamanu_surveys_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"surveys\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_updated_at.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_updated_at"], "alias": "source_not_null_tamanu_surveys_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"surveys\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_"], "alias": "source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "programs"], ["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.programs", "source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_relationships_tamanu_su_1586588afe9f2664a305c99082d665d6.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select program_id as from_field\n from \"app\".\"public\".\"surveys\"\n where program_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"programs\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "program_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "program_id", "to": "source('tamanu', 'programs')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals"], "alias": "source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234"}, "created_at": 1782423654.270619, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_accepted_values_tamanu__92304247c93ca90fc7c79b59e3d65234.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n survey_type as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"surveys\"\n group by survey_type\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'programs','referral','obsolete','vitals'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "survey_type", "values": ["programs", "referral", "obsolete", "vitals"], "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_is_sensitive", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_is_sensitive.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_is_sensitive"], "alias": "source_not_null_tamanu_surveys_is_sensitive", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_is_sensitive.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_sensitive\nfrom \"app\".\"public\".\"surveys\"\nwhere is_sensitive is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_sensitive", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_sensitive", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_updated_at_sync_tick"], "alias": "source_not_null_tamanu_surveys_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"surveys\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_notifiable", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_notifiable.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_notifiable"], "alias": "source_not_null_tamanu_surveys_notifiable", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_notifiable.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect notifiable\nfrom \"app\".\"public\".\"surveys\"\nwhere notifiable is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "notifiable", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "notifiable", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_notify_email_addresses", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_notify_email_addresses.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_notify_email_addresses"], "alias": "source_not_null_tamanu_surveys_notify_email_addresses", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_notify_email_addresses.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect notify_email_addresses\nfrom \"app\".\"public\".\"surveys\"\nwhere notify_email_addresses is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "notify_email_addresses", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "notify_email_addresses", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_surveys_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_surveys_visibility_status.sql", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_surveys_visibility_status"], "alias": "source_not_null_tamanu_surveys_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\surveys.yml\\source_not_null_tamanu_surveys_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"surveys\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'surveys')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_survey_responses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_survey_responses_id.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_survey_responses_id"], "alias": "source_unique_tamanu_survey_responses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_unique_tamanu_survey_responses_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"survey_responses\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_responses_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_responses_id.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_responses_id"], "alias": "source_not_null_tamanu_survey_responses_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_not_null_tamanu_survey_responses_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"survey_responses\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_responses_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_responses_created_at.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_responses_created_at"], "alias": "source_not_null_tamanu_survey_responses_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_not_null_tamanu_survey_responses_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"survey_responses\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_responses_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_responses_updated_at.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_responses_updated_at"], "alias": "source_not_null_tamanu_survey_responses_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_not_null_tamanu_survey_responses_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"survey_responses\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_"], "alias": "source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "surveys"], ["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.surveys", "source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_relationships_tamanu_su_895e4158164f4758d12db6b338c6c90e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select survey_id as from_field\n from \"app\".\"public\".\"survey_responses\"\n where survey_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"surveys\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "survey_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "survey_id", "to": "source('tamanu', 'surveys')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_relationships_tamanu_su_c5a4c7d9712d12478b7352a879b17f34.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"survey_responses\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74"}, "created_at": 1782423654.2864869, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_relationships_tamanu_su_d3e5b91e2f0c24d0433feacb80a4ea74.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"survey_responses\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_responses_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_responses_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_responses_updated_at_sync_tick"], "alias": "source_not_null_tamanu_survey_responses_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_responses.yml\\source_not_null_tamanu_survey_responses_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"survey_responses\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'survey_responses')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_survey_response_answers_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_survey_response_answers_id.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_survey_response_answers_id"], "alias": "source_unique_tamanu_survey_response_answers_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_unique_tamanu_survey_response_answers_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_response_answers_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_response_answers_id.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_response_answers_id"], "alias": "source_not_null_tamanu_survey_response_answers_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_not_null_tamanu_survey_response_answers_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_response_answers_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_response_answers_created_at.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_response_answers_created_at"], "alias": "source_not_null_tamanu_survey_response_answers_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_not_null_tamanu_survey_response_answers_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_response_answers_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_response_answers_updated_at.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_response_answers_updated_at"], "alias": "source_not_null_tamanu_survey_response_answers_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_not_null_tamanu_survey_response_answers_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_"], "alias": "source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_responses"], ["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_responses", "source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_relationships_tamanu_su_ebabe73f2f65d4bdcdcf075510b21618.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select response_id as from_field\n from \"app\".\"public\".\"survey_response_answers\"\n where response_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"survey_responses\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "response_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "response_id", "to": "source('tamanu', 'survey_responses')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_"], "alias": "source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "program_data_elements"], ["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.program_data_elements", "source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_relationships_tamanu_su_175e530dfd6be996063e2705e1a8a898.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select data_element_id as from_field\n from \"app\".\"public\".\"survey_response_answers\"\n where data_element_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"program_data_elements\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data_element_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "data_element_id", "to": "source('tamanu', 'program_data_elements')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_response_answers_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404.sql", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_response_answers_updated_at_sync_tick"], "alias": "source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_response_answers.yml\\source_not_null_tamanu_survey__70dfab34cc934909fe4894cbcc99d404.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"survey_response_answers\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'survey_response_answers')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_survey_screen_components_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_survey_screen_components_id.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_survey_screen_components_id"], "alias": "source_unique_tamanu_survey_screen_components_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_unique_tamanu_survey_screen_components_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_screen_components_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_screen_components_id.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_screen_components_id"], "alias": "source_not_null_tamanu_survey_screen_components_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3025956, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_not_null_tamanu_survey_screen_components_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_screen_components_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_screen_components_created_at.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_screen_components_created_at"], "alias": "source_not_null_tamanu_survey_screen_components_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_not_null_tamanu_survey_screen_components_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_screen_components_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey_screen_components_updated_at.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_screen_components_updated_at"], "alias": "source_not_null_tamanu_survey_screen_components_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_not_null_tamanu_survey_screen_components_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_survey_screen_components_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444.sql", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_survey_screen_components_updated_at_sync_tick"], "alias": "source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_screen_components"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_screen_components"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\survey_screen_components.yml\\source_not_null_tamanu_survey__9ff1b196021da7b7c574cfc16944b444.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"survey_screen_components\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'survey_screen_components')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.sql", "original_file_path": "models\\sources\\sync_device_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick"], "alias": "source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_device_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_device_ticks.yml\\source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n persisted_at_sync_tick as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_device_ticks\"\nwhere persisted_at_sync_tick is not null\ngroup by persisted_at_sync_tick\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "persisted_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "persisted_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_device_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.sql", "original_file_path": "models\\sources\\sync_device_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick"], "alias": "source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_device_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_device_ticks.yml\\source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect persisted_at_sync_tick\nfrom \"app\".\"public\".\"sync_device_ticks\"\nwhere persisted_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "persisted_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "persisted_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_device_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_device_ticks_device_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_device_ticks_device_id.sql", "original_file_path": "models\\sources\\sync_device_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_device_ticks_device_id"], "alias": "source_not_null_tamanu_sync_device_ticks_device_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_device_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_device_ticks.yml\\source_not_null_tamanu_sync_device_ticks_device_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_id\nfrom \"app\".\"public\".\"sync_device_ticks\"\nwhere device_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_id", "model": "{{ get_where_subquery(source('tamanu', 'sync_device_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_lookup_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_lookup_id.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_lookup_id"], "alias": "source_unique_tamanu_sync_lookup_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_unique_tamanu_sync_lookup_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_id.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_id"], "alias": "source_not_null_tamanu_sync_lookup_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_record_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_record_id.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_record_id"], "alias": "source_not_null_tamanu_sync_lookup_record_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_record_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_id\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere record_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_record_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_record_type.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_record_type"], "alias": "source_not_null_tamanu_sync_lookup_record_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_record_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere record_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_data", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_data.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_data"], "alias": "source_not_null_tamanu_sync_lookup_data", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_data.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect data\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere data is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "data", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "data", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_updated_at_sync_tick"], "alias": "source_not_null_tamanu_sync_lookup_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_relationships_tamanu_sy_2336e1407af420ceca3b4d4452200cd8.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"sync_lookup\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a"}, "created_at": 1782423654.3186252, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_relationships_tamanu_sy_5d305b97136c018b26a52273906e2c6a.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"sync_lookup\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_"], "alias": "source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9"}, "created_at": 1782423654.3347328, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "facilities"], ["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_relationships_tamanu_sy_2dbba204e9e53f0eedaddb61c753c0b9.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select facility_id as from_field\n from \"app\".\"public\".\"sync_lookup\"\n where facility_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"facilities\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "facility_id", "to": "source('tamanu', 'facilities')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_is_lab_request", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_is_lab_request.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_is_lab_request"], "alias": "source_not_null_tamanu_sync_lookup_is_lab_request", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3347328, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_is_lab_request.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_lab_request\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere is_lab_request is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_lab_request", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_lab_request", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_is_deleted", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_is_deleted.sql", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_is_deleted"], "alias": "source_not_null_tamanu_sync_lookup_is_deleted", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3347328, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup.yml\\source_not_null_tamanu_sync_lookup_is_deleted.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_deleted\nfrom \"app\".\"public\".\"sync_lookup\"\nwhere is_deleted is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_deleted", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_deleted", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_ticks_source_start_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_ticks_source_start_tick.sql", "original_file_path": "models\\sources\\sync_lookup_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_ticks_source_start_tick"], "alias": "source_not_null_tamanu_sync_lookup_ticks_source_start_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3347328, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup_ticks.yml\\source_not_null_tamanu_sync_lookup_ticks_source_start_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_start_tick\nfrom \"app\".\"public\".\"sync_lookup_ticks\"\nwhere source_start_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "source_start_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_start_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_lookup_ticks_lookup_end_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.sql", "original_file_path": "models\\sources\\sync_lookup_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_lookup_ticks_lookup_end_tick"], "alias": "source_unique_tamanu_sync_lookup_ticks_lookup_end_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3347328, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup_ticks.yml\\source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n lookup_end_tick as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_lookup_ticks\"\nwhere lookup_end_tick is not null\ngroup by lookup_end_tick\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lookup_end_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "lookup_end_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.sql", "original_file_path": "models\\sources\\sync_lookup_ticks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick"], "alias": "source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3347328, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_lookup_ticks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_lookup_ticks.yml\\source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lookup_end_tick\nfrom \"app\".\"public\".\"sync_lookup_ticks\"\nwhere lookup_end_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lookup_end_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lookup_end_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_lookup_ticks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_queued_devices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_queued_devices_id.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_queued_devices_id"], "alias": "source_unique_tamanu_sync_queued_devices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.342576, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_unique_tamanu_sync_queued_devices_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_id.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_id"], "alias": "source_not_null_tamanu_sync_queued_devices_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.342576, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_last_seen_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_last_seen_time.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_last_seen_time"], "alias": "source_not_null_tamanu_sync_queued_devices_last_seen_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.342576, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_last_seen_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect last_seen_time\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere last_seen_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_seen_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_seen_time", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_last_synced_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_last_synced_tick.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_last_synced_tick"], "alias": "source_not_null_tamanu_sync_queued_devices_last_synced_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.342576, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_last_synced_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect last_synced_tick\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere last_synced_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_synced_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_synced_tick", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_urgent", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_urgent.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_urgent"], "alias": "source_not_null_tamanu_sync_queued_devices_urgent", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.342576, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_urgent.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect urgent\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere urgent is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "urgent", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "urgent", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_created_at.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_created_at"], "alias": "source_not_null_tamanu_sync_queued_devices_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.342576, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_updated_at.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_updated_at"], "alias": "source_not_null_tamanu_sync_queued_devices_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.342576, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_queued_devices_facility_ids", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_queued_devices_facility_ids.sql", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_queued_devices_facility_ids"], "alias": "source_not_null_tamanu_sync_queued_devices_facility_ids", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.342576, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_queued_devices"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_queued_devices.yml\\source_not_null_tamanu_sync_queued_devices_facility_ids.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect facility_ids\nfrom \"app\".\"public\".\"sync_queued_devices\"\nwhere facility_ids is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "facility_ids", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "facility_ids", "model": "{{ get_where_subquery(source('tamanu', 'sync_queued_devices')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_sync_sessions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_sync_sessions_id.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_sync_sessions_id"], "alias": "source_unique_tamanu_sync_sessions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_unique_tamanu_sync_sessions_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_id.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_id"], "alias": "source_not_null_tamanu_sync_sessions_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_created_at.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_created_at"], "alias": "source_not_null_tamanu_sync_sessions_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_updated_at.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_updated_at"], "alias": "source_not_null_tamanu_sync_sessions_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_start_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_start_time.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_start_time"], "alias": "source_not_null_tamanu_sync_sessions_start_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_start_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_time\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere start_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_time", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_last_connection_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_last_connection_time.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_last_connection_time"], "alias": "source_not_null_tamanu_sync_sessions_last_connection_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_last_connection_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect last_connection_time\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere last_connection_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "last_connection_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "last_connection_time", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_sync_sessions_parameters", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_sync_sessions_parameters.sql", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_sync_sessions_parameters"], "alias": "source_not_null_tamanu_sync_sessions_parameters", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "sync_sessions"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.sync_sessions"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\sync_sessions.yml\\source_not_null_tamanu_sync_sessions_parameters.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect parameters\nfrom \"app\".\"public\".\"sync_sessions\"\nwhere parameters is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "parameters", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "parameters", "model": "{{ get_where_subquery(source('tamanu', 'sync_sessions')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_tasks_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_tasks_id.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_tasks_id"], "alias": "source_unique_tamanu_tasks_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_unique_tamanu_tasks_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"tasks\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_id.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_id"], "alias": "source_not_null_tamanu_tasks_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"tasks\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_encounter_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_encounter_id.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_encounter_id"], "alias": "source_not_null_tamanu_tasks_encounter_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_encounter_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect encounter_id\nfrom \"app\".\"public\".\"tasks\"\nwhere encounter_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "encounter_id", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_name.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_name"], "alias": "source_not_null_tamanu_tasks_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"tasks\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_due_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_due_time.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_due_time"], "alias": "source_not_null_tamanu_tasks_due_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_due_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect due_time\nfrom \"app\".\"public\".\"tasks\"\nwhere due_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "due_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "due_time", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_requested_by_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_requested_by_user_id.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_requested_by_user_id"], "alias": "source_not_null_tamanu_tasks_requested_by_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_requested_by_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect requested_by_user_id\nfrom \"app\".\"public\".\"tasks\"\nwhere requested_by_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "requested_by_user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "requested_by_user_id", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_request_time", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_request_time.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_request_time"], "alias": "source_not_null_tamanu_tasks_request_time", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_request_time.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect request_time\nfrom \"app\".\"public\".\"tasks\"\nwhere request_time is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "request_time", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "request_time", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_status.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_status"], "alias": "source_not_null_tamanu_tasks_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect status\nfrom \"app\".\"public\".\"tasks\"\nwhere status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "status", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_created_at.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_created_at"], "alias": "source_not_null_tamanu_tasks_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"tasks\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_updated_at.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_updated_at"], "alias": "source_not_null_tamanu_tasks_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"tasks\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_updated_at_sync_tick"], "alias": "source_not_null_tamanu_tasks_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"tasks\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_tasks_task_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_tasks_task_type.sql", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_tasks_task_type"], "alias": "source_not_null_tamanu_tasks_task_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3506212, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "tasks"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.tasks"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\tasks.yml\\source_not_null_tamanu_tasks_task_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_type\nfrom \"app\".\"public\".\"tasks\"\nwhere task_type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_type", "model": "{{ get_where_subquery(source('tamanu', 'tasks')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_task_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_task_designations_id.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_task_designations_id"], "alias": "source_unique_tamanu_task_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_unique_tamanu_task_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"task_designations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_id.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_id"], "alias": "source_not_null_tamanu_task_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"task_designations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_task_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_task_id.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_task_id"], "alias": "source_not_null_tamanu_task_designations_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_task_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"app\".\"public\".\"task_designations\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_designation_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_designation_id.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_designation_id"], "alias": "source_not_null_tamanu_task_designations_designation_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_designation_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect designation_id\nfrom \"app\".\"public\".\"task_designations\"\nwhere designation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "designation_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "designation_id", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_created_at.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_created_at"], "alias": "source_not_null_tamanu_task_designations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"task_designations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_updated_at.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_updated_at"], "alias": "source_not_null_tamanu_task_designations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"task_designations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_designations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_designations_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_designations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_task_designations_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_designations.yml\\source_not_null_tamanu_task_designations_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"task_designations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'task_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_task_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_task_templates_id.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_task_templates_id"], "alias": "source_unique_tamanu_task_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_unique_tamanu_task_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"task_templates\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_id.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_id"], "alias": "source_not_null_tamanu_task_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"task_templates\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_task_templates_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_task_templates_reference_data_id.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_task_templates_reference_data_id"], "alias": "source_unique_tamanu_task_templates_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_unique_tamanu_task_templates_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n reference_data_id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"task_templates\"\nwhere reference_data_id is not null\ngroup by reference_data_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_reference_data_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_reference_data_id.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_reference_data_id"], "alias": "source_not_null_tamanu_task_templates_reference_data_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_reference_data_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect reference_data_id\nfrom \"app\".\"public\".\"task_templates\"\nwhere reference_data_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reference_data_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "reference_data_id", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_created_at.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_created_at"], "alias": "source_not_null_tamanu_task_templates_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"task_templates\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_updated_at.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_updated_at"], "alias": "source_not_null_tamanu_task_templates_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"task_templates\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_templates_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_templates_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_templates_updated_at_sync_tick"], "alias": "source_not_null_tamanu_task_templates_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_templates.yml\\source_not_null_tamanu_task_templates_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"task_templates\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'task_templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_task_template_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_task_template_designations_id.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_task_template_designations_id"], "alias": "source_unique_tamanu_task_template_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_unique_tamanu_task_template_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_template_designations_id.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_id"], "alias": "source_not_null_tamanu_task_template_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_template_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_task_template_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_task_template_id"], "alias": "source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_te_62ea528aaa6c507a64186b3e3e80e44a.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_template_id\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere task_template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_template_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_template_id", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_designation_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_designation_id"], "alias": "source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f"}, "created_at": 1782423654.3666897, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_te_cff933c930191116587c20b715a2f58f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect designation_id\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere designation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "designation_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "designation_id", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_template_designations_created_at.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_created_at"], "alias": "source_not_null_tamanu_task_template_designations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_template_designations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_template_designations_updated_at.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_updated_at"], "alias": "source_not_null_tamanu_task_template_designations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_template_designations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_task_template_designations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5.sql", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_task_template_designations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "task_template_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.task_template_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\task_template_designations.yml\\source_not_null_tamanu_task_te_8a12f2b889e62e6a749a784c31ec10c5.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"task_template_designations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'task_template_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_templates_id.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_templates_id"], "alias": "source_unique_tamanu_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_unique_tamanu_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"templates\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_templates_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_templates_id.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_templates_id"], "alias": "source_not_null_tamanu_templates_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_not_null_tamanu_templates_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"templates\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_templates_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_templates_name.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_templates_name"], "alias": "source_not_null_tamanu_templates_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_not_null_tamanu_templates_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect name\nfrom \"app\".\"public\".\"templates\"\nwhere name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "name", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_relationships_tamanu_te_605b603aafe2e4884982637acd6344c3.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select created_by_id as from_field\n from \"app\".\"public\".\"templates\"\n where created_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "created_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_templates_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_templates_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_templates_updated_at_sync_tick"], "alias": "source_not_null_tamanu_templates_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_not_null_tamanu_templates_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"templates\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_templates_type", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_templates_type.sql", "original_file_path": "models\\sources\\templates.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_templates_type"], "alias": "source_not_null_tamanu_templates_type", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "templates"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.templates"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\templates.yml\\source_not_null_tamanu_templates_type.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect type\nfrom \"app\".\"public\".\"templates\"\nwhere type is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "type", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "type", "model": "{{ get_where_subquery(source('tamanu', 'templates')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_string_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_string_id.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_string_id"], "alias": "source_not_null_tamanu_translated_strings_string_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_string_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect string_id\nfrom \"app\".\"public\".\"translated_strings\"\nwhere string_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "string_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "string_id", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_language", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_language.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_language"], "alias": "source_not_null_tamanu_translated_strings_language", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_language.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect language\nfrom \"app\".\"public\".\"translated_strings\"\nwhere language is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "language", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "language", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_created_at.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_created_at"], "alias": "source_not_null_tamanu_translated_strings_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"translated_strings\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_updated_at.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_updated_at"], "alias": "source_not_null_tamanu_translated_strings_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"translated_strings\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_translated_strings_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_translated_strings_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_translated_strings_updated_at_sync_tick"], "alias": "source_not_null_tamanu_translated_strings_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.3826401, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "translated_strings"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.translated_strings"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\translated_strings.yml\\source_not_null_tamanu_translated_strings_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"translated_strings\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'translated_strings')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_triages_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_triages_id.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_triages_id"], "alias": "source_unique_tamanu_triages_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.398653, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_unique_tamanu_triages_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"triages\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_triages_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_triages_id.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_triages_id"], "alias": "source_not_null_tamanu_triages_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.398653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_not_null_tamanu_triages_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"triages\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_triages_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_triages_created_at.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_triages_created_at"], "alias": "source_not_null_tamanu_triages_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.398653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_not_null_tamanu_triages_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"triages\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_triages_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_triages_updated_at.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_triages_updated_at"], "alias": "source_not_null_tamanu_triages_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.398653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_not_null_tamanu_triages_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"triages\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_"], "alias": "source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2"}, "created_at": 1782423654.398653, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "encounters"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_relationships_tamanu_tr_d4f8a89b29ce7ab15207638339c985f2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select encounter_id as from_field\n from \"app\".\"public\".\"triages\"\n where encounter_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"encounters\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "encounter_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "encounter_id", "to": "source('tamanu', 'encounters')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c"}, "created_at": 1782423654.398653, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_relationships_tamanu_tr_5d680b56abdb98eb519629e224abc16c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select practitioner_id as from_field\n from \"app\".\"public\".\"triages\"\n where practitioner_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "practitioner_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "practitioner_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_"], "alias": "dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e"}, "created_at": 1782423654.398653, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\dbt_utils_source_relationships_278ee1dc4ae6a66423b03d53f829725e.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n chief_complaint_id as id\n\n from \"app\".\"public\".\"triages\"\n\n where chief_complaint_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'triageReason'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "chief_complaint_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "chief_complaint_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'triageReason'", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_"], "alias": "dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9"}, "created_at": 1782423654.398653, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\dbt_utils_source_relationships_851a099daef9562b55902648307bd9c9.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n secondary_complaint_id as id\n\n from \"app\".\"public\".\"triages\"\n\n where secondary_complaint_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'triageReason'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "secondary_complaint_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "secondary_complaint_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'triageReason'", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_"], "alias": "dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "reference_data"], ["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_relationships_where", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\dbt_utils_source_relationships_dfe40a15b3657684b208d652fc8a09ea.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith left_table as (\n\n select\n arrival_mode_id as id\n\n from \"app\".\"public\".\"triages\"\n\n where arrival_mode_id is not null\n and 1=1\n\n),\n\nright_table as (\n\n select\n id as id\n\n from \"app\".\"public\".\"reference_data\"\n\n where id is not null\n and type = 'arrivalMode'\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "arrival_mode_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships_where", "kwargs": {"column_name": "arrival_mode_id", "to": "source('tamanu', 'reference_data')", "field": "id", "to_condition": "type = 'arrivalMode'", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_triages_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_triages_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\triages.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_triages_updated_at_sync_tick"], "alias": "source_not_null_tamanu_triages_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "triages"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.triages"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\triages.yml\\source_not_null_tamanu_triages_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"triages\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'triages')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2.sql", "original_file_path": "models\\sources\\upcoming_vaccinations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_"], "alias": "source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "patients"], ["tamanu", "upcoming_vaccinations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\upcoming_vaccinations.yml\\source_relationships_tamanu_up_d92e2efe0ae22f254b06c252b0a138d2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select patient_id as from_field\n from \"app\".\"public\".\"upcoming_vaccinations\"\n where patient_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"patients\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "patient_id", "to": "source('tamanu', 'patients')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'upcoming_vaccinations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2.sql", "original_file_path": "models\\sources\\upcoming_vaccinations.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_"], "alias": "source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "scheduled_vaccines"], ["tamanu", "upcoming_vaccinations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines", "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\upcoming_vaccinations.yml\\source_relationships_tamanu_up_e4efb31756830da4dc43696974d90cc2.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select scheduled_vaccine_id as from_field\n from \"app\".\"public\".\"upcoming_vaccinations\"\n where scheduled_vaccine_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"scheduled_vaccines\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "scheduled_vaccine_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "scheduled_vaccine_id", "to": "source('tamanu', 'scheduled_vaccines')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'upcoming_vaccinations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_users_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_users_id.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_users_id"], "alias": "source_unique_tamanu_users_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_unique_tamanu_users_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"users\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_id.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_id"], "alias": "source_not_null_tamanu_users_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"users\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_created_at.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_created_at"], "alias": "source_not_null_tamanu_users_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"users\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_updated_at.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_updated_at"], "alias": "source_not_null_tamanu_users_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"users\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_users_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_users_email.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_users_email"], "alias": "source_unique_tamanu_users_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_unique_tamanu_users_email.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n email as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"users\"\nwhere email is not null\ngroup by email\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_email", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_email.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_email"], "alias": "source_not_null_tamanu_users_email", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4147348, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_email.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect email\nfrom \"app\".\"public\".\"users\"\nwhere email is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "email", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_display_name", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_display_name.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_display_name"], "alias": "source_not_null_tamanu_users_display_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.430583, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_display_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect display_name\nfrom \"app\".\"public\".\"users\"\nwhere display_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "display_name", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "display_name", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_role", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_role.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_role"], "alias": "source_not_null_tamanu_users_role", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.430583, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_role.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect role\nfrom \"app\".\"public\".\"users\"\nwhere role is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "role", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "role", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_updated_at_sync_tick"], "alias": "source_not_null_tamanu_users_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.430583, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"users\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_visibility_status", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_visibility_status.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_visibility_status"], "alias": "source_not_null_tamanu_users_visibility_status", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.430583, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_visibility_status.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect visibility_status\nfrom \"app\".\"public\".\"users\"\nwhere visibility_status is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "visibility_status", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "visibility_status", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_users_device_registration_quota", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_users_device_registration_quota.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_users_device_registration_quota"], "alias": "source_not_null_tamanu_users_device_registration_quota", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.430583, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\source_not_null_tamanu_users_device_registration_quota.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect device_registration_quota\nfrom \"app\".\"public\".\"users\"\nwhere device_registration_quota is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_registration_quota", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "device_registration_quota", "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979.sql", "original_file_path": "models\\sources\\users.yml", "unique_id": "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704", "fqn": ["tamanu_source_dbt", "sources", "dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0"], "alias": "dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979"}, "created_at": 1782423654.430583, "relation_name": null, "raw_code": "{{ dbt_utils.test_accepted_range(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.test_accepted_range", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\users.yml\\dbt_utils_source_accepted_rang_582fdc17e1da62c414afe0e52fdca979.sql", "compiled": true, "compiled_code": "\n\nwith meet_condition as(\n select *\n from \"app\".\"public\".\"users\"\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not device_registration_quota >= 0\n)\n\nselect *\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_registration_quota", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_range", "kwargs": {"column_name": "device_registration_quota", "min_value": 0, "model": "{{ get_where_subquery(source('tamanu', 'users')) }}"}, "namespace": "dbt_utils"}}, "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_designations_id.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_designations_id"], "alias": "source_unique_tamanu_user_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.437376, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_unique_tamanu_user_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_designations\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_id.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_id"], "alias": "source_not_null_tamanu_user_designations_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.437376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_designations\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_user_id.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_user_id"], "alias": "source_not_null_tamanu_user_designations_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.437376, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_designations\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_designation_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_designation_id.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_designation_id"], "alias": "source_not_null_tamanu_user_designations_designation_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.443026, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_designation_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect designation_id\nfrom \"app\".\"public\".\"user_designations\"\nwhere designation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "designation_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "designation_id", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_created_at.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_created_at"], "alias": "source_not_null_tamanu_user_designations_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.443026, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_designations\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_updated_at.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_updated_at"], "alias": "source_not_null_tamanu_user_designations_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.443026, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_designations\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_designations_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_designations_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_designations_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_designations_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.443026, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_designations"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_designations"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_designations.yml\\source_not_null_tamanu_user_designations_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_designations\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_designations')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_facilities_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_facilities_id.sql", "original_file_path": "models\\sources\\user_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_facilities_id"], "alias": "source_unique_tamanu_user_facilities_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4465659, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_facilities.yml\\source_unique_tamanu_user_facilities_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_facilities\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_facilities_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_facilities_id.sql", "original_file_path": "models\\sources\\user_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_facilities_id"], "alias": "source_not_null_tamanu_user_facilities_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.447724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_facilities.yml\\source_not_null_tamanu_user_facilities_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_facilities\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_facilities_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_facilities_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_facilities.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_facilities_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_facilities_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.447724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_facilities"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_facilities"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_facilities.yml\\source_not_null_tamanu_user_facilities_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_facilities\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_facilities')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_leaves_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_leaves_id.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_leaves_id"], "alias": "source_unique_tamanu_user_leaves_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.447724, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_unique_tamanu_user_leaves_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_leaves\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_id.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_id"], "alias": "source_not_null_tamanu_user_leaves_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.447724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_leaves\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_start_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_start_date.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_start_date"], "alias": "source_not_null_tamanu_user_leaves_start_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.447724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_start_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect start_date\nfrom \"app\".\"public\".\"user_leaves\"\nwhere start_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "start_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "start_date", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_end_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_end_date.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_end_date"], "alias": "source_not_null_tamanu_user_leaves_end_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.447724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_end_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect end_date\nfrom \"app\".\"public\".\"user_leaves\"\nwhere end_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "end_date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "end_date", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_user_id.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_user_id"], "alias": "source_not_null_tamanu_user_leaves_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.447724, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_leaves\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_created_at.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_created_at"], "alias": "source_not_null_tamanu_user_leaves_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4546678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_leaves\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_updated_at.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_updated_at"], "alias": "source_not_null_tamanu_user_leaves_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4556777, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_leaves\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_leaves_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_leaves_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_leaves_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_leaves_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4556777, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_leaves"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_leaves"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_leaves.yml\\source_not_null_tamanu_user_leaves_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_leaves\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_leaves')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_localisation_caches_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_localisation_caches_id.sql", "original_file_path": "models\\sources\\user_localisation_caches.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_localisation_caches_id"], "alias": "source_unique_tamanu_user_localisation_caches_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4576821, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_localisation_caches"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_localisation_caches.yml\\source_unique_tamanu_user_localisation_caches_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_localisation_caches\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_localisation_caches')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_localisation_caches_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_localisation_caches_id.sql", "original_file_path": "models\\sources\\user_localisation_caches.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_localisation_caches_id"], "alias": "source_not_null_tamanu_user_localisation_caches_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4576821, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_localisation_caches"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_localisation_caches.yml\\source_not_null_tamanu_user_localisation_caches_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_localisation_caches\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_localisation_caches')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_localisation_caches_localisation", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_localisation_caches_localisation.sql", "original_file_path": "models\\sources\\user_localisation_caches.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_localisation_caches_localisation"], "alias": "source_not_null_tamanu_user_localisation_caches_localisation", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4586751, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_localisation_caches"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_localisation_caches.yml\\source_not_null_tamanu_user_localisation_caches_localisation.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect localisation\nfrom \"app\".\"public\".\"user_localisation_caches\"\nwhere localisation is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "localisation", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "localisation", "model": "{{ get_where_subquery(source('tamanu', 'user_localisation_caches')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_login_attempts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_login_attempts_id.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_login_attempts_id"], "alias": "source_unique_tamanu_user_login_attempts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4606733, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_unique_tamanu_user_login_attempts_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_id.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_id"], "alias": "source_not_null_tamanu_user_login_attempts_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4606733, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_created_at.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_created_at"], "alias": "source_not_null_tamanu_user_login_attempts_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.461675, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_updated_at.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_updated_at"], "alias": "source_not_null_tamanu_user_login_attempts_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4626732, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_outcome", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_outcome.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_outcome"], "alias": "source_not_null_tamanu_user_login_attempts_outcome", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4636745, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_outcome.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect outcome\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere outcome is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "outcome", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "outcome", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_"], "alias": "source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293"}, "created_at": 1782423654.4646778, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "devices"], ["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.devices", "source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_relationships_tamanu_us_dff488d3ef570250809bf70a91c34293.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select device_id as from_field\n from \"app\".\"public\".\"user_login_attempts\"\n where device_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"devices\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "device_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "device_id", "to": "source('tamanu', 'devices')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_user_id.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_user_id"], "alias": "source_not_null_tamanu_user_login_attempts_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.467675, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce"}, "created_at": 1782423654.4686737, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_relationships_tamanu_us_f3d365e59652ac11ae8c06093564f0ce.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select user_id as from_field\n from \"app\".\"public\".\"user_login_attempts\"\n where user_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "user_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_login_attempts_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_login_attempts_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_login_attempts_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_login_attempts"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_login_attempts"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_login_attempts.yml\\source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_login_attempts\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_login_attempts')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_preferences_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_preferences_id.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_preferences_id"], "alias": "source_unique_tamanu_user_preferences_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_unique_tamanu_user_preferences_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_preferences\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_id.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_id"], "alias": "source_not_null_tamanu_user_preferences_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_preferences\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_created_at.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_created_at"], "alias": "source_not_null_tamanu_user_preferences_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_preferences\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_updated_at.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_updated_at"], "alias": "source_not_null_tamanu_user_preferences_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_preferences\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_user_id.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_user_id"], "alias": "source_not_null_tamanu_user_preferences_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_preferences\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_updated_at_sync_tick"], "alias": "source_not_null_tamanu_user_preferences_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"user_preferences\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_key", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_key.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_key"], "alias": "source_not_null_tamanu_user_preferences_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect key\nfrom \"app\".\"public\".\"user_preferences\"\nwhere key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "key", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "key", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_preferences_value", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_preferences_value.sql", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_preferences_value"], "alias": "source_not_null_tamanu_user_preferences_value", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_preferences"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_preferences"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_preferences.yml\\source_not_null_tamanu_user_preferences_value.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect value\nfrom \"app\".\"public\".\"user_preferences\"\nwhere value is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "value", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "value", "model": "{{ get_where_subquery(source('tamanu', 'user_preferences')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_user_recently_viewed_patients_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_user_recently_viewed_patients_id.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_user_recently_viewed_patients_id"], "alias": "source_unique_tamanu_user_recently_viewed_patients_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_unique_tamanu_user_recently_viewed_patients_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_id.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_id"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_created_at.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_created_at"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_updated_at.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_updated_at"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_user_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_user_id.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_user_id"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_user_recently_viewed_patients_patient_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_user_recently_viewed_patients_patient_id.sql", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_user_recently_viewed_patients_patient_id"], "alias": "source_not_null_tamanu_user_recently_viewed_patients_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4715202, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "user_recently_viewed_patients"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\user_recently_viewed_patients.yml\\source_not_null_tamanu_user_recently_viewed_patients_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom \"app\".\"public\".\"user_recently_viewed_patients\"\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "patient_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(source('tamanu', 'user_recently_viewed_patients')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_vitals_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_vitals_id.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_vitals_id"], "alias": "source_unique_tamanu_vitals_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_unique_tamanu_vitals_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"vitals\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_id.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_id"], "alias": "source_not_null_tamanu_vitals_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"vitals\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_created_at.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_created_at"], "alias": "source_not_null_tamanu_vitals_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"vitals\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_updated_at.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_updated_at"], "alias": "source_not_null_tamanu_vitals_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"vitals\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_date_recorded", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_date_recorded.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_date_recorded"], "alias": "source_not_null_tamanu_vitals_date_recorded", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_date_recorded.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_recorded\nfrom \"app\".\"public\".\"vitals\"\nwhere date_recorded is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_recorded", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_recorded", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vitals_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vitals_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vitals_updated_at_sync_tick"], "alias": "source_not_null_tamanu_vitals_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vitals"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vitals"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vitals.yml\\source_not_null_tamanu_vitals_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"vitals\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'vitals')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_unique_tamanu_vital_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_unique_tamanu_vital_logs_id.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4", "fqn": ["tamanu_source_dbt", "sources", "source_unique_tamanu_vital_logs_id"], "alias": "source_unique_tamanu_vital_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_unique_tamanu_vital_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n id as unique_field,\n count(*) as n_records\n\nfrom \"app\".\"public\".\"vital_logs\"\nwhere id is not null\ngroup by id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_id.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_id"], "alias": "source_not_null_tamanu_vital_logs_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect id\nfrom \"app\".\"public\".\"vital_logs\"\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_created_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_created_at.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_created_at"], "alias": "source_not_null_tamanu_vital_logs_created_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_created_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect created_at\nfrom \"app\".\"public\".\"vital_logs\"\nwhere created_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "created_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "created_at", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_updated_at", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_updated_at.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_updated_at"], "alias": "source_not_null_tamanu_vital_logs_updated_at", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_updated_at.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at\nfrom \"app\".\"public\".\"vital_logs\"\nwhere updated_at is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_date", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_date.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_date"], "alias": "source_not_null_tamanu_vital_logs_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date\nfrom \"app\".\"public\".\"vital_logs\"\nwhere date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff", "fqn": ["tamanu_source_dbt", "sources", "source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error"], "alias": "source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_accepted_values_tamanu__24b988e5e1da546dd21013ff9b701c2d.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n reason_for_change as value_field,\n count(*) as n_records\n\n from \"app\".\"public\".\"vital_logs\"\n group by reason_for_change\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'incorrect-patient','incorrect-value','other','recorded-in-error'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "reason_for_change", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "accepted_values", "kwargs": {"column_name": "reason_for_change", "values": ["incorrect-patient", "incorrect-value", "other", "recorded-in-error"], "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_"], "alias": "source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179"}, "created_at": 1782423654.4863465, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "users"], ["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_relationships_tamanu_vi_d010ae2b4cac3ae428fd864928e29179.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select recorded_by_id as from_field\n from \"app\".\"public\".\"vital_logs\"\n where recorded_by_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"users\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "recorded_by_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "recorded_by_id", "to": "source('tamanu', 'users')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_answer_id", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_answer_id.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_answer_id"], "alias": "source_not_null_tamanu_vital_logs_answer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.5024035, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_answer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect answer_id\nfrom \"app\".\"public\".\"vital_logs\"\nwhere answer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "answer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "answer_id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26", "fqn": ["tamanu_source_dbt", "sources", "source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_"], "alias": "source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn", "alias": "source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f"}, "created_at": 1782423654.5024035, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}{{ config(alias=\"source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f\") }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "survey_response_answers"], ["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.survey_response_answers", "source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_relationships_tamanu_vi_2edb243485e7aeb8af697205cf62a43f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select answer_id as from_field\n from \"app\".\"public\".\"vital_logs\"\n where answer_id is not null\n),\n\nparent as (\n select id as to_field\n from \"app\".\"public\".\"survey_response_answers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "answer_id", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "relationships", "kwargs": {"column_name": "answer_id", "to": "source('tamanu', 'survey_response_answers')", "field": "id", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}, "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877": {"database": "app", "schema": "reporting_dbt_test__audit", "name": "source_not_null_tamanu_vital_logs_updated_at_sync_tick", "resource_type": "test", "package_name": "tamanu_source_dbt", "path": "source_not_null_tamanu_vital_logs_updated_at_sync_tick.sql", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877", "fqn": ["tamanu_source_dbt", "sources", "source_not_null_tamanu_vital_logs_updated_at_sync_tick"], "alias": "source_not_null_tamanu_vital_logs_updated_at_sync_tick", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"severity": "warn"}, "created_at": 1782423654.5065496, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["tamanu", "vital_logs"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["source.tamanu_source_dbt.tamanu.vital_logs"]}, "compiled_path": "target\\compiled\\tamanu_source_dbt\\models\\sources\\vital_logs.yml\\source_not_null_tamanu_vital_logs_updated_at_sync_tick.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect updated_at_sync_tick\nfrom \"app\".\"public\".\"vital_logs\"\nwhere updated_at_sync_tick is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "updated_at_sync_tick", "file_key_name": "sources.tamanu", "attached_node": null, "test_metadata": {"name": "not_null", "kwargs": {"column_name": "updated_at_sync_tick", "model": "{{ get_where_subquery(source('tamanu', 'vital_logs')) }}"}, "namespace": null}}}, "sources": {"source.tamanu_source_dbt.logs__tamanu.accesses": {"database": "app", "schema": "logs", "name": "accesses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\accesses.yml", "original_file_path": "models\\logs\\accesses.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.accesses", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "accesses"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "accesses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Audit logs for users accessing records", "columns": {"id": {"name": "id", "description": "UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__deleted_at"]}, "user_id": {"name": "user_id", "description": "The user that accessed the records", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__user_id"]}, "record_id": {"name": "record_id", "description": "The ID of the accessed record", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__record_id"]}, "record_type": {"name": "record_type", "description": "The type of record accessed", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__record_type"]}, "facility_id": {"name": "facility_id", "description": "The facility that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__facility_id"]}, "session_id": {"name": "session_id", "description": "The user session that the record was accessed on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__session_id"]}, "device_id": {"name": "device_id", "description": "The id for the device that the user was accessing the record on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__device_id"]}, "logged_at": {"name": "logged_at", "description": "The time string of when the record was accessed", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__logged_at"]}, "front_end_context": {"name": "front_end_context", "description": "A JSON object containing front end information about the record access", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__front_end_context"]}, "back_end_context": {"name": "back_end_context", "description": "A JSON object containing back end information about the record access", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__back_end_context"]}, "is_mobile": {"name": "is_mobile", "description": "Whether or not the user accessed the record from mobile", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__is_mobile"]}, "version": {"name": "version", "description": "The version of tamanu the record was created on", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__accesses__version"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in accesses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_accesses_changed", "set_accesses_updated_at", "set_accesses_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_accesses_changed", "set_accesses_updated_at", "set_accesses_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_accesses_changed", "set_accesses_updated_at", "set_accesses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"accesses\"", "created_at": 1782423652.7520456, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__accesses"]}, "source.tamanu_source_dbt.logs__tamanu.changes": {"database": "app", "schema": "logs", "name": "changes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\changes.yml", "original_file_path": "models\\logs\\changes.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.changes", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "changes"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "changes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Contains a full log of all changes made to the core database records.\r\n\r\nThe changes are logged via triggers on source tables. The full row data is\r\nlogged in this table on every change to every row for every table that's covered.\r\nThese triggers are applied by Tamanu rather than being hardcoded in migrations.\r\n\r\nSome tables are excluded from logging. These are listed in the `NON_LOGGED_TABLES`\r\nconstant in the database package, and include the sync subsystem and other\r\ninternal system tables.\r\n\r\nNote that changes before this table was put in service will of course not have\r\nbeen logged.", "columns": {"id": {"name": "id", "description": "The ID of the change log row. UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__id"]}, "table_oid": {"name": "table_oid", "description": "The Postgres OID of the table this change is from.\r\n\r\nPostgres OIDs are much more precise than `schema.name`, and are not susceptible\r\nto search path conflicts, so should be preferred for querying within the same\r\ndatabase. However, they are not easily relatable from outside the database, so\r\nthe schema and name fields are also recorded for those uses, plus human readers.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__table_oid"]}, "table_schema": {"name": "table_schema", "description": "The schema (~database namespace) of the table this change is from.\r\n\r\nThis will typically be `public`; as of writing tables from other schemas are not\r\nautomatically logged.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__table_schema"]}, "table_name": {"name": "table_name", "description": "The name of the table this change is from.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__table_name"]}, "logged_at": {"name": "logged_at", "description": "The timestamp this change was logged.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__logged_at"]}, "created_at": {"name": "created_at", "description": "Then sequelize metadata for the records created time", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__created_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__updated_by_user_id"]}, "device_id": {"name": "device_id", "description": "The `device_id` of the user behind the change", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__device_id"]}, "version": {"name": "version", "description": "The Tamanu version at time of change", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__version"]}, "record_id": {"name": "record_id", "description": "The value of the `id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_id"]}, "record_created_at": {"name": "record_created_at", "description": "The `created_at` metadata from record the changelog was recorded against", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_created_at"]}, "record_updated_at": {"name": "record_updated_at", "description": "The `updated_at` metadata from record the changelog was recorded against", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_updated_at"]}, "record_deleted_at": {"name": "record_deleted_at", "description": "The `deleted_at` metadata from record the changelog was recorded against", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_deleted_at"]}, "record_data": {"name": "record_data", "description": "The full row data of the change.\r\n\r\nNote that as this is `JSONB`, some type information may be lost. However, row\r\ndata in a Tamanu system is transported using JSON via the sync system anyway, so\r\nit is expected that all data trivially round-trips via JSON.", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__record_data"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in changes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick"]}, "reason": {"name": "reason", "description": "A string representing the reason for the change.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__reason"]}, "migration_context": {"name": "migration_context", "description": "Stores a JSON string (as type TEXT) with migration context information\r\nif the changelog was created from a migration.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__changes__migration_context"]}}, "meta": {"triggers": ["notify_changes_changed", "set_changes_updated_at", "set_changes_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_changes_changed", "set_changes_updated_at", "set_changes_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_changes_changed", "set_changes_updated_at", "set_changes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"changes\"", "created_at": 1782423652.7707295, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__changes"]}, "source.tamanu_source_dbt.logs__tamanu.debug_logs": {"database": "app", "schema": "logs", "name": "debug_logs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\debug_logs.yml", "original_file_path": "models\\logs\\debug_logs.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.debug_logs", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "debug_logs"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "debug_logs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Debugging logs stored in the database for easy reporting.\r\n\r\nTamanu has an associated tool called [Tamanu Alerts] which runs queries on the Tamanu database to\r\ndetermine alert conditions, especially for the Sync mechanisms. However, sometimes the information\r\nnecessary to determine an alert condition lives in logs, not in database tables. In those cases,\r\nthis table is used.\r\n\r\n[Tamanu Alerts]: https://docs.rs/bestool/latest/bestool/__help/tamanu/alerts/struct.AlertsArgs.html", "columns": {"id": {"name": "id", "description": "UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__debug_logs__id"]}, "type": {"name": "type", "description": "Stable classifier for the log message.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__debug_logs__type"]}, "info": {"name": "info", "description": "Arbitrary JSON log message.\r\n\r\nNot that unlike typical JSON-based log messages (only top-level string key to scalar value), this\r\ncan be nested arbitrarily deep, as it can include objects directly from the application.", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__debug_logs__info"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"debug_logs\"", "created_at": 1782423652.7707295, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__debug_logs"]}, "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes": {"database": "app", "schema": "logs", "name": "dhis2_pushes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\dhis2_pushes.yml", "original_file_path": "models\\logs\\dhis2_pushes.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "dhis2_pushes"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "dhis2_pushes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Audit logs for DHIS2 integration pushes.\r\n\r\nThis table tracks the results of automated pushes of report data to DHIS2 instances.\r\nThe DHIS2IntegrationProcessor scheduled task processes configured reports and pushes\r\ntheir data to external DHIS2 systems. Each push attempt is logged here with details\r\nabout the success/failure status, import counts, and any conflicts encountered.\r\n\r\nThe table stores metadata about data synchronization operations including how many\r\nrecords were imported, updated, ignored, or deleted during each push operation.", "columns": {"id": {"name": "id", "description": "UUID primary key for the push log entry.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when the push log entry was created.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__created_at"]}, "report_id": {"name": "report_id", "description": "The ID of the report that was pushed to DHIS2.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__report_id"]}, "status": {"name": "status", "description": "The status of the push operation: \"success\", \"failure\", or \"warning\".", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__status"]}, "imported": {"name": "imported", "description": "Number of records that were successfully imported to DHIS2.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__imported"]}, "updated": {"name": "updated", "description": "Number of records that were updated in DHIS2.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__updated"]}, "deleted": {"name": "deleted", "description": "Number of records that were deleted from DHIS2.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__deleted"]}, "ignored": {"name": "ignored", "description": "Number of records that were ignored during the push operation.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__ignored"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the push log entry was last updated.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when the push log entry was deleted (soft delete).", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__deleted_at"]}, "conflicts": {"name": "conflicts", "description": "JSON array of conflict details encountered during the push operation.", "meta": {"masking": "text"}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__conflicts"]}, "message": {"name": "message", "description": "Human-readable message describing the result of the push operation.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__dhis2_pushes__message"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"dhis2_pushes\"", "created_at": 1782423652.7807634, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__dhis2_pushes"]}, "source.tamanu_source_dbt.logs__tamanu.fhir_writes": {"database": "app", "schema": "logs", "name": "fhir_writes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\fhir_writes.yml", "original_file_path": "models\\logs\\fhir_writes.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.fhir_writes", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "fhir_writes"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "fhir_writes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Full-request logs of writes (creates and modifies) coming over the FHIR API.\r\n\r\nFHIR is an extensive standard and we current support a small subset of it. There's an even tinier\r\nsubset of that which supports writes instead of just reads and searches. To avoid missing or losing\r\ndata which we could support accepting as writes in the future, and for development purposes, this\r\ntable logs the full request bodies for FHIR endpoints. This is not just the endpoints that we\r\ncurrently support, but all incoming write requests.", "columns": {"id": {"name": "id", "description": "UUID", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__id"]}, "created_at": {"name": "created_at", "description": "When Tamanu received the request.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__created_at"]}, "verb": {"name": "verb", "description": "HTTP verb (GET, POST, etc)", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__verb"]}, "url": {"name": "url", "description": "HTTP URL", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__url"]}, "body": {"name": "body", "description": "Full request body", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__body"]}, "headers": {"name": "headers", "description": "Selected request headers.\r\n\r\nSome headers are stripped for sensitivity.", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__headers"]}, "user_id": {"name": "user_id", "description": "The authenticated user for the API request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__fhir_writes__user_id"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"fhir_writes\"", "created_at": 1782423652.7807634, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__fhir_writes"]}, "source.tamanu_source_dbt.logs__tamanu.migrations": {"database": "app", "schema": "logs", "name": "migrations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\logs\\migrations.yml", "original_file_path": "models\\logs\\migrations.yml", "unique_id": "source.tamanu_source_dbt.logs__tamanu.migrations", "fqn": ["tamanu_source_dbt", "logs", "logs__tamanu", "migrations"], "source_name": "logs__tamanu", "source_description": "Contains logging tables across different domains.", "loader": "", "identifier": "migrations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This table keeps track of when migrations are run.\r\n\r\nThe SequelizeMeta table in the public schema is internal migration state, and\r\nonly records which migrations are currently applied. This table instead logs\r\nwhenever migrations are performed, up and down, with additional timing info.", "columns": {"id": {"name": "id", "description": "A randomly generated UUID.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__id"]}, "logged_at": {"name": "logged_at", "description": "The local server time when the migration run happened.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__logged_at"]}, "record_sync_tick": {"name": "record_sync_tick", "description": "TODO", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__record_sync_tick"]}, "device_id": {"name": "device_id", "description": "TODO", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__device_id"]}, "version": {"name": "version", "description": "TODO", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__version"]}, "direction": {"name": "direction", "description": "What kind of migration operation this was (typically `up`).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__direction"]}, "migrations": {"name": "migrations", "description": "The list of migrations applied during this operation.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__migrations__migrations"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in migrations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_migrations_changed", "set_migrations_updated_at", "set_migrations_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_migrations_changed", "set_migrations_updated_at", "set_migrations_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_migrations_changed", "set_migrations_updated_at", "set_migrations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"logs\".\"migrations\"", "created_at": 1782423652.7966049, "unrendered_database": null, "unrendered_schema": "logs", "doc_blocks": ["doc.tamanu_source_dbt.logs__table__migrations"]}, "source.tamanu_source_dbt.tamanu.administered_vaccines": {"database": "app", "schema": "public", "name": "administered_vaccines", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\administered_vaccines.yml", "original_file_path": "models\\sources\\administered_vaccines.yml", "unique_id": "source.tamanu_source_dbt.tamanu.administered_vaccines", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "administered_vaccines"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "administered_vaccines", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of vaccines administered to patients.\r\n\r\nVaccinations are recorded via the Vaccinations modal; they are selected\r\nfrom a list of Scheduled Vaccines and linked to a Patient via an Encounter.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in administered_vaccines.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in administered_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in administered_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in administered_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "batch": {"name": "batch", "description": "Batch identifier of vaccine administrations recorded", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__batch"]}, "status": {"name": "status", "description": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__status"]}, "reason": {"name": "reason", "description": "Reason for vaccine administrations `NOT_GIVEN` status. This is a free text field", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__reason"]}, "date": {"name": "date", "description": "Local date for the record in administered_vaccines.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) this vaccine was given in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__encounter_id"]}, "injection_site": {"name": "injection_site", "description": "Injection site of the vaccine administrations recorded", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__injection_site"]}, "consent": {"name": "consent", "description": "Consent of the vaccine administrations recorded", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent"]}, "recorder_id": {"name": "recorder_id", "description": "Reference to the [User](#!/source/source.tamanu.tamanu.users) who recorded this vaccination.\r\nThis may differ from the User or person who administered the vaccine.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__recorder_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__location_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__department_id"]}, "given_by": {"name": "given_by", "description": "Free text field for the name of the health practitioner who administered the\r\nvaccine. This is defaulted to the `display_name` of the logged-in User, but can\r\nbe changed. It is not a requirement that the administerer is a Tamanu User.", "meta": {"masking": "name"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_by"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in administered_vaccines.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in administered_vaccines.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "not_given_reason_id": {"name": "not_given_reason_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id"]}, "given_elsewhere": {"name": "given_elsewhere", "description": "Checks if the vaccine was given elsewhere", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__given_elsewhere"]}, "vaccine_name": {"name": "vaccine_name", "description": "Vaccine name of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_name"]}, "vaccine_brand": {"name": "vaccine_brand", "description": "Vaccine brand of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__vaccine_brand"]}, "disease": {"name": "disease", "description": "Disease the vaccine addresses of the vaccine administration recorded", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__disease"]}, "circumstance_ids": {"name": "circumstance_ids", "description": "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineCircumstance`).", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__circumstance_ids"]}, "consent_given_by": {"name": "consent_given_by", "description": "Free text field recording who gave consent for the vaccination.\r\nThis is usually the patient themselves, but may differ for children or dependent\r\npersons or other cases.", "meta": {"masking": "name"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.administered_vaccines__consent_given_by"]}}, "meta": {"triggers": ["notify_administered_vaccines_changed", "record_administered_vaccines_changelog", "set_administered_vaccines_updated_at", "set_administered_vaccines_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_administered_vaccines_changed", "record_administered_vaccines_changelog", "set_administered_vaccines_updated_at", "set_administered_vaccines_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_administered_vaccines_changed", "record_administered_vaccines_changelog", "set_administered_vaccines_updated_at", "set_administered_vaccines_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"administered_vaccines\"", "created_at": 1782423652.8123305, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__administered_vaccines"]}, "source.tamanu_source_dbt.tamanu.appointments": {"database": "app", "schema": "public", "name": "appointments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\appointments.yml", "original_file_path": "models\\sources\\appointments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.appointments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "appointments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "appointments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of appointments.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in appointments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in appointments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in appointments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "start_time": {"name": "start_time", "description": "When the appointment starts.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time"]}, "end_time": {"name": "end_time", "description": "When the appointment ends.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__clinician_id"]}, "location_id": {"name": "location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_id"]}, "type_legacy": {"name": "type_legacy", "description": "The legacy type of appointment.\r\n\r\nOne of:\r\n- `Standard`\r\n- `Emergency`\r\n- `Specialist`\r\n- `Other`", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__type_legacy"]}, "status": {"name": "status", "description": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__status"]}, "start_time_legacy": {"name": "start_time_legacy", "description": "[Deprecated] Start time.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__start_time_legacy"]}, "end_time_legacy": {"name": "end_time_legacy", "description": "[Deprecated] End time.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__end_time_legacy"]}, "location_group_id": {"name": "location_group_id", "description": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__location_group_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in appointments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "booking_type_id": {"name": "booking_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__booking_type_id"]}, "appointment_type_id": {"name": "appointment_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__appointment_type_id"]}, "is_high_priority": {"name": "is_high_priority", "description": "Boolean specify if the appointment is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__is_high_priority"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) linked to this appointment", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__encounter_id"]}, "schedule_id": {"name": "schedule_id", "description": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__schedule_id"]}, "additional_clinician_id": {"name": "additional_clinician_id", "description": "Reference to an additional [clinician](#!/source/source.tamanu.tamanu.users)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__additional_clinician_id"]}, "link_encounter_id": {"name": "link_encounter_id", "description": "Reference to the related [encounter](#!/source/source.tamanu.tamanu.encounters) of the appointment", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointments__link_encounter_id"]}}, "meta": {"triggers": ["notify_appointments_changed", "record_appointments_changelog", "set_appointments_updated_at", "set_appointments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_appointments_changed", "record_appointments_changelog", "set_appointments_updated_at", "set_appointments_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_appointments_changed", "record_appointments_changelog", "set_appointments_updated_at", "set_appointments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"appointments\"", "created_at": 1782423652.8511662, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__appointments"]}, "source.tamanu_source_dbt.tamanu.appointment_procedure_types": {"database": "app", "schema": "public", "name": "appointment_procedure_types", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\appointment_procedure_types.yml", "original_file_path": "models\\sources\\appointment_procedure_types.yml", "unique_id": "source.tamanu_source_dbt.tamanu.appointment_procedure_types", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "appointment_procedure_types"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "appointment_procedure_types", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Junction table linking appointments to procedure types, allowing multiple procedure types to be associated with a single appointment.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointment_procedure_types.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "appointment_id": {"name": "appointment_id", "description": "Reference to the [appointment](#!/source/source.tamanu.tamanu.appointments) this procedure type is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_procedure_types__appointment_id"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`) associated with this appointment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_procedure_types__procedure_type_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in appointment_procedure_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in appointment_procedure_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in appointment_procedure_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in appointment_procedure_types.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_appointment_procedure_types_changed", "record_appointment_procedure_types_changelog", "set_appointment_procedure_types_updated_at", "set_appointment_procedure_types_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_appointment_procedure_types_changed", "record_appointment_procedure_types_changelog", "set_appointment_procedure_types_updated_at", "set_appointment_procedure_types_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_appointment_procedure_types_changed", "record_appointment_procedure_types_changelog", "set_appointment_procedure_types_updated_at", "set_appointment_procedure_types_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"appointment_procedure_types\"", "created_at": 1782423652.8575845, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__appointment_procedure_types"]}, "source.tamanu_source_dbt.tamanu.appointment_schedules": {"database": "app", "schema": "public", "name": "appointment_schedules", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\appointment_schedules.yml", "original_file_path": "models\\sources\\appointment_schedules.yml", "unique_id": "source.tamanu_source_dbt.tamanu.appointment_schedules", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "appointment_schedules"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "appointment_schedules", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Defines recurrence rules for appointments.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in appointment_schedules.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "until_date": {"name": "until_date", "description": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__until_date"]}, "interval": {"name": "interval", "description": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\"", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__interval"]}, "frequency": {"name": "frequency", "description": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__frequency"]}, "days_of_week": {"name": "days_of_week", "description": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__days_of_week"]}, "nth_weekday": {"name": "nth_weekday", "description": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__nth_weekday"]}, "occurrence_count": {"name": "occurrence_count", "description": "When this value is set, the recurrence ends after generating the specified number of occurrences\r\nAt least one of `occurrence_count` or `until_date` must be set.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__occurrence_count"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in appointment_schedules.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in appointment_schedules.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in appointment_schedules.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in appointment_schedules.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_fully_generated": {"name": "is_fully_generated", "description": "Whether or not all repeating appointments have been created for a schedule", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__is_fully_generated"]}, "generated_until_date": {"name": "generated_until_date", "description": "The date of the most recent appointment in a schedule, this is set after generation of the repeated appointment and then updated if it is necessary to generate further appointments.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__generated_until_date"]}, "cancelled_at_date": {"name": "cancelled_at_date", "description": "The date from which appointments in a schedule have been cancelled, this is set when cancelling 'this and all future appointments'.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.appointment_schedules__cancelled_at_date"]}}, "meta": {"triggers": ["notify_appointment_schedules_changed", "record_appointment_schedules_changelog", "set_appointment_schedules_updated_at", "set_appointment_schedules_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_appointment_schedules_changed", "record_appointment_schedules_changelog", "set_appointment_schedules_updated_at", "set_appointment_schedules_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_appointment_schedules_changed", "record_appointment_schedules_changelog", "set_appointment_schedules_updated_at", "set_appointment_schedules_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"appointment_schedules\"", "created_at": 1782423652.8652725, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__appointment_schedules"]}, "source.tamanu_source_dbt.tamanu.assets": {"database": "app", "schema": "public", "name": "assets", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\assets.yml", "original_file_path": "models\\sources\\assets.yml", "unique_id": "source.tamanu_source_dbt.tamanu.assets", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "assets"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "assets", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of assets used in the tamanu app ui and patient letters.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in assets.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in assets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in assets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in assets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of the asset set by the user on upload.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.assets__name"]}, "type": {"name": "type", "description": "This is the type of asset stored.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.assets__type"]}, "data": {"name": "data", "description": "Contains a binary version of image data uploaded by user.", "meta": {}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.assets__data"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facilities](#!/source/source.tamanu.tamanu.facilities) this asset is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.assets__facility_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in assets.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_assets_changed", "record_assets_changelog", "set_assets_updated_at", "set_assets_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_assets_changed", "record_assets_changelog", "set_assets_updated_at", "set_assets_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_assets_changed", "record_assets_changelog", "set_assets_updated_at", "set_assets_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"assets\"", "created_at": 1782423652.8737745, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__assets"]}, "source.tamanu_source_dbt.tamanu.attachments": {"database": "app", "schema": "public", "name": "attachments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\attachments.yml", "original_file_path": "models\\sources\\attachments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.attachments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "attachments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "attachments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Uploaded files.\r\n\r\nThese can be documents, photo IDs, patient letters...\r\n\r\nMost direct uploads will have a corresponding [`document_metadata`](#!/source/source.tamanu.tamanu.document_metadata),\r\nbut there's other ways to upload files, such as [for lab requests](#!/source/source.tamanu.tamanu.lab_request_attachments).\r\n\r\nUploaded files are not currently synced to facility servers. Instead, servers request the contents\r\nof documents just-in-time. This does require facility servers to be \"online\" but significantly\r\nreduces sync pressure.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in attachments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "type": {"name": "type", "description": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.attachments__type"]}, "size": {"name": "size", "description": "The file size in bytes.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.attachments__size"]}, "data": {"name": "data", "description": "The file data.", "meta": {"masking": "zero"}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {"masking": "zero"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.attachments__data"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in attachments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_attachments_changed", "record_attachments_changelog", "set_attachments_updated_at", "set_attachments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_attachments_changed", "record_attachments_changelog", "set_attachments_updated_at", "set_attachments_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_attachments_changed", "record_attachments_changelog", "set_attachments_updated_at", "set_attachments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"attachments\"", "created_at": 1782423652.8794928, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__attachments"]}, "source.tamanu_source_dbt.tamanu.certifiable_vaccines": {"database": "app", "schema": "public", "name": "certifiable_vaccines", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\certifiable_vaccines.yml", "original_file_path": "models\\sources\\certifiable_vaccines.yml", "unique_id": "source.tamanu_source_dbt.tamanu.certifiable_vaccines", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "certifiable_vaccines"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "certifiable_vaccines", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of scheduled vaccines which can be certified via EUDCC or ICAO VDC.\r\n\r\nIntroduced during the COVID-19 pandemic, these are standards which can be\r\nused to produce a QR code containing vaccine information and a digital signature\r\nwhich certifies that the vaccines were administered by a competent authority.\r\n\r\nThis table both contains additional information about scheduled vaccines which is\r\nrequired for those to be certified, and signals that the vaccines listed may be\r\nincluded in certification QR codes.\r\n\r\nSee also the [`signers`](#!/source/source.tamanu.tamanu.signers) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in certifiable_vaccines.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in certifiable_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in certifiable_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in certifiable_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "vaccine_id": {"name": "vaccine_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=vaccine`)\r\nfor the vaccine drug.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__vaccine_id"]}, "manufacturer_id": {"name": "manufacturer_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=manufacturer`)\r\nfor the organisation that manufactured the drug.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__manufacturer_id"]}, "icd11_drug_code": {"name": "icd11_drug_code", "description": "Free-text for the ICD11 code for the drug.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__icd11_drug_code"]}, "icd11_disease_code": {"name": "icd11_disease_code", "description": "Free-text for the ICD11 code for the disease targeted by the drug.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__icd11_disease_code"]}, "vaccine_code": {"name": "vaccine_code", "description": "SNOMED CT or ATC code for the vaccine type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__vaccine_code"]}, "target_code": {"name": "target_code", "description": "SNOMED CT or ATC code for targeted disease.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__target_code"]}, "eu_product_code": {"name": "eu_product_code", "description": "EU authorisation code for the vaccine product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__eu_product_code"]}, "maximum_dosage": {"name": "maximum_dosage", "description": "Maximum number of doses. Defaults to 1.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certifiable_vaccines__maximum_dosage"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in certifiable_vaccines.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_certifiable_vaccines_changed", "record_certifiable_vaccines_changelog", "set_certifiable_vaccines_updated_at", "set_certifiable_vaccines_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_certifiable_vaccines_changed", "record_certifiable_vaccines_changelog", "set_certifiable_vaccines_updated_at", "set_certifiable_vaccines_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_certifiable_vaccines_changed", "record_certifiable_vaccines_changelog", "set_certifiable_vaccines_updated_at", "set_certifiable_vaccines_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"certifiable_vaccines\"", "created_at": 1782423652.8939013, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__certifiable_vaccines"]}, "source.tamanu_source_dbt.tamanu.certificate_notifications": {"database": "app", "schema": "public", "name": "certificate_notifications", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\certificate_notifications.yml", "original_file_path": "models\\sources\\certificate_notifications.yml", "unique_id": "source.tamanu_source_dbt.tamanu.certificate_notifications", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "certificate_notifications"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "certificate_notifications", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Various medical certificates being sent to patients.\r\n\r\nThese rows are processed by the `CertificateNotificationProcessor` scheduled task, and generate a\r\n[`patient_communications`](#!/source/source.tamanu.tamanu.patient_communications) row.\r\n\r\nThe actual certificate itself is stored separately on the filesystem while it's generated.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in certificate_notifications.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in certificate_notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in certificate_notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in certificate_notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "type": {"name": "type", "description": "Type of certificate being generated.\r\n\r\nThis dictates both from which resource the certificate is generated, and also the template being\r\nused for generating the certificate itself.\r\n\r\nOne of:\r\n- `covid_19_clearance`\r\n- `vaccination_certificate`\r\n- `icao.test`\r\n- `icao.vacc`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__type"]}, "require_signing": {"name": "require_signing", "description": "If the certificates requires cryptographic signing.\r\n\r\nSee [`certifiable_vaccines`](#!/source/source.tamanu.tamanu.certifiable_vaccines).\r\n\r\nOnly applicable to `icao.test` and `icao.vacc` types.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__require_signing"]}, "patient_id": {"name": "patient_id", "description": "Reference to a [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__patient_id"]}, "forward_address": {"name": "forward_address", "description": "An email address to send the generated certificate to.", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__forward_address"]}, "lab_test_id": {"name": "lab_test_id", "description": "The [lab test](#!/source/source.tamanu.tamanu.lab_tests) this certificate is for, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__lab_test_id"]}, "status": {"name": "status", "description": "Processing status.\r\n\r\nOne of:\r\n- `Queued`\r\n- `Processed`\r\n- `Error`\r\n- `Ignore`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__status"]}, "error": {"name": "error", "description": "If the certificate generation fails, this is the error.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__error"]}, "created_by": {"name": "created_by", "description": "The name of the user who initiated the creation of this certificate.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__created_by"]}, "lab_request_id": {"name": "lab_request_id", "description": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this certificate is for, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__lab_request_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in certificate_notifications.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "printed_date": {"name": "printed_date", "description": "When this certificate was printed, if applicable.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__printed_date"]}, "facility_name": {"name": "facility_name", "description": "The name of the facility where the creation of this certificate was initiated.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__facility_name"]}, "language": {"name": "language", "description": "Used to translate the certificate.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.certificate_notifications__language"]}}, "meta": {"triggers": ["notify_certificate_notifications_changed", "record_certificate_notifications_changelog", "set_certificate_notifications_updated_at", "set_certificate_notifications_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_certificate_notifications_changed", "record_certificate_notifications_changelog", "set_certificate_notifications_updated_at", "set_certificate_notifications_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_certificate_notifications_changed", "record_certificate_notifications_changelog", "set_certificate_notifications_updated_at", "set_certificate_notifications_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"certificate_notifications\"", "created_at": 1782423652.9034128, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__certificate_notifications"]}, "source.tamanu_source_dbt.tamanu.contributing_death_causes": {"database": "app", "schema": "public", "name": "contributing_death_causes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\contributing_death_causes.yml", "original_file_path": "models\\sources\\contributing_death_causes.yml", "unique_id": "source.tamanu_source_dbt.tamanu.contributing_death_causes", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "contributing_death_causes"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "contributing_death_causes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Contributing causes recorded with the patient's death data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in contributing_death_causes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "time_after_onset": {"name": "time_after_onset", "description": "Time between onset of recorded cause and death in minutes.", "meta": {"masking": {"kind": "integer", "range": "0-50000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-50000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__time_after_onset"]}, "patient_death_data_id": {"name": "patient_death_data_id", "description": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id"]}, "condition_id": {"name": "condition_id", "description": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.contributing_death_causes__condition_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in contributing_death_causes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in contributing_death_causes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in contributing_death_causes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in contributing_death_causes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_contributing_death_causes_changed", "record_contributing_death_causes_changelog", "set_contributing_death_causes_updated_at", "set_contributing_death_causes_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_contributing_death_causes_changed", "record_contributing_death_causes_changelog", "set_contributing_death_causes_updated_at", "set_contributing_death_causes_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_contributing_death_causes_changed", "record_contributing_death_causes_changelog", "set_contributing_death_causes_updated_at", "set_contributing_death_causes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"contributing_death_causes\"", "created_at": 1782423652.9192643, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__contributing_death_causes"]}, "source.tamanu_source_dbt.tamanu.death_revert_logs": {"database": "app", "schema": "public", "name": "death_revert_logs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\death_revert_logs.yml", "original_file_path": "models\\sources\\death_revert_logs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.death_revert_logs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "death_revert_logs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "death_revert_logs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Patient deaths can be reverted if they were recorded in error, this tracks those reverts.\r\n\r\nSee [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in death_revert_logs.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in death_revert_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in death_revert_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in death_revert_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "revert_time": {"name": "revert_time", "description": "When the reversion happened.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.death_revert_logs__revert_time"]}, "death_data_id": {"name": "death_data_id", "description": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record this is reverting.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.death_revert_logs__death_data_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.death_revert_logs__patient_id"]}, "reverted_by_id": {"name": "reverted_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who reverted this death record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.death_revert_logs__reverted_by_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in death_revert_logs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_death_revert_logs_changed", "record_death_revert_logs_changelog", "set_death_revert_logs_updated_at", "set_death_revert_logs_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_death_revert_logs_changed", "record_death_revert_logs_changelog", "set_death_revert_logs_updated_at", "set_death_revert_logs_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_death_revert_logs_changed", "record_death_revert_logs_changelog", "set_death_revert_logs_updated_at", "set_death_revert_logs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"death_revert_logs\"", "created_at": 1782423652.945561, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__death_revert_logs"]}, "source.tamanu_source_dbt.tamanu.departments": {"database": "app", "schema": "public", "name": "departments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\departments.yml", "original_file_path": "models\\sources\\departments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.departments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "departments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "departments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Basic department info with a reference to parent facility.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in departments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in departments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in departments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in departments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code for department.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__code"]}, "name": {"name": "name", "description": "Full readable name for department.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__name"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this department is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.departments__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in departments.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in departments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_departments_changed", "record_departments_changelog", "set_departments_updated_at", "set_departments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_departments_changed", "record_departments_changelog", "set_departments_updated_at", "set_departments_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_departments_changed", "record_departments_changelog", "set_departments_updated_at", "set_departments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"departments\"", "created_at": 1782423652.9512653, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__departments"]}, "source.tamanu_source_dbt.tamanu.devices": {"database": "app", "schema": "public", "name": "devices", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\devices.yml", "original_file_path": "models\\sources\\devices.yml", "unique_id": "source.tamanu_source_dbt.tamanu.devices", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "devices"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "devices", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Devices that are authorised to login.\r\n\r\nDevices not in the table can only connect if the user they're\r\n**first** logging in as has enough quota (`device_registration_quota`\r\non the [`users`](#!/source/source.tamanu.tamanu.users) table.)\r\n\r\nThis check is not performed when `features.deviceRegistrationQuota` is disabled.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in devices.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "last_seen_at": {"name": "last_seen_at", "description": "When this device last logged in.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.devices__last_seen_at"]}, "registered_by_id": {"name": "registered_by_id", "description": "Which user registered this device.\r\n\r\nThis is used for quota calculations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.devices__registered_by_id"]}, "name": {"name": "name", "description": "Optional descriptive name, to make it easier to map device IDs to real devices\r\nin debugging and troubleshooting situations.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.devices__name"]}, "scopes": {"name": "scopes", "description": "Scopes the device is authorised to access.\r\n\r\nScopes allow access to parts of the API that are closed to other devices\r\notherwise. Some scopes are restricted by quota. Devices aren't allowed to\r\nrequest more scopes than they currently have, but may login without\r\nspecifying the full scopes they have.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.devices__scopes"]}}, "meta": {"triggers": ["record_devices_changelog"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["record_devices_changelog"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["record_devices_changelog"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"devices\"", "created_at": 1782423652.9512653, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__devices"]}, "source.tamanu_source_dbt.tamanu.discharges": {"database": "app", "schema": "public", "name": "discharges", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\discharges.yml", "original_file_path": "models\\sources\\discharges.yml", "unique_id": "source.tamanu_source_dbt.tamanu.discharges", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "discharges"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "discharges", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information about a discharge.\r\n\r\nA discharge is the end of the lifecycle for an encounter.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in discharges.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in discharges.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in discharges.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in discharges.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form notes about the discharge.\r\n\r\nMay include treatment plan and follow-ups, written by the discharging clinician.\r\n\r\nSince v2.0, also see the [`notes`](#!/source/source.tamanu.tamanu.notes) table for encounter and discharge notes.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__note"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this discharge is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__encounter_id"]}, "discharger_id": {"name": "discharger_id", "description": "The [discharging clinician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__discharger_id"]}, "disposition_id": {"name": "disposition_id", "description": "The discharge disposition or classification of the discharge ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__disposition_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in discharges.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "facility_name": {"name": "facility_name", "description": "Name of the discharging facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__facility_name"]}, "facility_address": {"name": "facility_address", "description": "Address of the discharging facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__facility_address"]}, "facility_town": {"name": "facility_town", "description": "Town of the discharging facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.discharges__facility_town"]}}, "meta": {"triggers": ["notify_discharges_changed", "record_discharges_changelog", "set_discharges_updated_at", "set_discharges_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_discharges_changed", "record_discharges_changelog", "set_discharges_updated_at", "set_discharges_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_discharges_changed", "record_discharges_changelog", "set_discharges_updated_at", "set_discharges_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"discharges\"", "created_at": 1782423652.9822125, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__discharges"]}, "source.tamanu_source_dbt.tamanu.document_metadata": {"database": "app", "schema": "public", "name": "document_metadata", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\document_metadata.yml", "original_file_path": "models\\sources\\document_metadata.yml", "unique_id": "source.tamanu_source_dbt.tamanu.document_metadata", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "document_metadata"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "document_metadata", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information about an uploaded document or file, typically attached to an encounter or directly to a patient.\r\n\r\nThe actual file data is stored in [`attachments`](#!/source/source.tamanu.tamanu.attachments).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in document_metadata.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Free-form name of the document.\r\n\r\nOften this is the filename.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__name"]}, "type": {"name": "type", "description": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__type"]}, "document_created_at": {"name": "document_created_at", "description": "When the document was created.\r\n\r\nHistorically (before v2.0) this was the \"created at\" timestamp of the file itself, as reported by\r\nthe OS. However that information is no longer available to Tamanu in most contexts, so this is now\r\nusually set to the upload time.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_created_at"]}, "document_uploaded_at": {"name": "document_uploaded_at", "description": "When the document was uploaded.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_uploaded_at"]}, "document_owner": {"name": "document_owner", "description": "Name of the person who owns the document.\r\n\r\nTypically this is the uploader's name.", "meta": {"masking": "name"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_owner"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) the document was uploaded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__patient_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) the document was uploaded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__encounter_id"]}, "attachment_id": {"name": "attachment_id", "description": "The [file data](#!/source/source.tamanu.tamanu.attachments).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__attachment_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in document_metadata.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in document_metadata.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in document_metadata.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the document was uploaded from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__department_id"]}, "note": {"name": "note", "description": "Free-form description of the document.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__note"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in document_metadata.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "document_created_at_legacy": {"name": "document_created_at_legacy", "description": "[Deprecated] When the document was created.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_created_at_legacy"]}, "document_uploaded_at_legacy": {"name": "document_uploaded_at_legacy", "description": "[Deprecated] When the document was uploaded.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__document_uploaded_at_legacy"]}, "source": {"name": "source", "description": "Where the document came from.\r\n\r\nOne of:\r\n- `patient_letter`\r\n- `uploaded`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.document_metadata__source"]}}, "meta": {"triggers": ["notify_document_metadata_changed", "record_document_metadata_changelog", "set_document_metadata_updated_at", "set_document_metadata_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_document_metadata_changed", "record_document_metadata_changelog", "set_document_metadata_updated_at", "set_document_metadata_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_document_metadata_changed", "record_document_metadata_changelog", "set_document_metadata_updated_at", "set_document_metadata_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"document_metadata\"", "created_at": 1782423652.9978638, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__document_metadata"]}, "source.tamanu_source_dbt.tamanu.encounters": {"database": "app", "schema": "public", "name": "encounters", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounters.yml", "original_file_path": "models\\sources\\encounters.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounters", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounters"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounters", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Tracks the basic information of the patient encounters within Tamanu from start to finish", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounters.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounters.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounters.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounters.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__encounter_type"]}, "start_date": {"name": "start_date", "description": "The beginning of the encounter", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date"]}, "end_date": {"name": "end_date", "description": "The date encounter was discharged/ended", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date"]}, "reason_for_encounter": {"name": "reason_for_encounter", "description": "Free-form information about the encounter.\r\n\r\nCan include info like type of survey submitted, emergency diagnosis, etc.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__reason_for_encounter"]}, "device_id": {"name": "device_id", "description": "Unique identifier for the device that created the encounter.\r\n\r\nDevice IDs are proper to each device and not globally recorded in e.g. a `devices` table.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__device_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_id"]}, "examiner_id": {"name": "examiner_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__examiner_id"]}, "location_id": {"name": "location_id", "description": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__location_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) this encounter is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__department_id"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "The billing type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__patient_billing_type_id"]}, "start_date_legacy": {"name": "start_date_legacy", "description": "[Deprecated] Start date.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__start_date_legacy"]}, "end_date_legacy": {"name": "end_date_legacy", "description": "[Deprecated] End date.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__end_date_legacy"]}, "referral_source_id": {"name": "referral_source_id", "description": "The referral source ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__referral_source_id"]}, "planned_location_id": {"name": "planned_location_id", "description": "The [location](#!/source/source.tamanu.tamanu.locations) that the encounter will transfer to at the\r\n`planned_location_start_time`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__planned_location_id"]}, "planned_location_start_time": {"name": "planned_location_start_time", "description": "The time that the encounter will transfer to the planned location.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__planned_location_start_time"]}, "discharge_draft": {"name": "discharge_draft", "description": "Draft data of the encounter", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__discharge_draft"]}, "estimated_end_date": {"name": "estimated_end_date", "description": "The estimated discharge date of the encounter", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounters__estimated_end_date"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounters.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounters_changed", "record_encounters_changelog", "set_encounters_updated_at", "set_encounters_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounters_changed", "record_encounters_changelog", "set_encounters_updated_at", "set_encounters_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_encounters_changed", "record_encounters_changelog", "set_encounters_updated_at", "set_encounters_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounters\"", "created_at": 1782423653.033511, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounters"]}, "source.tamanu_source_dbt.tamanu.encounter_diagnoses": {"database": "app", "schema": "public", "name": "encounter_diagnoses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_diagnoses.yml", "original_file_path": "models\\sources\\encounter_diagnoses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_diagnoses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_diagnoses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_diagnoses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records diagnoses made during an encounter", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diagnoses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_diagnoses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_diagnoses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_diagnoses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "certainty": {"name": "certainty", "description": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__certainty"]}, "is_primary": {"name": "is_primary", "description": "A boolean indicating if this is a primary diagnosis", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__is_primary"]}, "date": {"name": "date", "description": "Local date for the record in encounter_diagnoses.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__encounter_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in encounter_diagnoses.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_diagnoses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that diagnosis.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diagnoses__clinician_id"]}}, "meta": {"triggers": ["notify_encounter_diagnoses_changed", "record_encounter_diagnoses_changelog", "set_encounter_diagnoses_updated_at", "set_encounter_diagnoses_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_diagnoses_changed", "record_encounter_diagnoses_changelog", "set_encounter_diagnoses_updated_at", "set_encounter_diagnoses_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_encounter_diagnoses_changed", "record_encounter_diagnoses_changelog", "set_encounter_diagnoses_updated_at", "set_encounter_diagnoses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_diagnoses\"", "created_at": 1782423653.0558484, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_diagnoses"]}, "source.tamanu_source_dbt.tamanu.encounter_diets": {"database": "app", "schema": "public", "name": "encounter_diets", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_diets.yml", "original_file_path": "models\\sources\\encounter_diets.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_diets", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_diets"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_diets", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A diet associated with an encounter.\r\n\r\nA patient can be placed on a diet for various medical purposes.\r\nDiets are specified in reference data.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_diets.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diet is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diets__encounter_id"]}, "diet_id": {"name": "diet_id", "description": "The diet ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diet`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_diets__diet_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_diets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_diets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_diets.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_diets.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounter_diets_changed", "record_encounter_diets_changelog", "set_encounter_diets_updated_at", "set_encounter_diets_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_diets_changed", "record_encounter_diets_changelog", "set_encounter_diets_updated_at", "set_encounter_diets_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_encounter_diets_changed", "record_encounter_diets_changelog", "set_encounter_diets_updated_at", "set_encounter_diets_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_diets\"", "created_at": 1782423653.0613797, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_diets"]}, "source.tamanu_source_dbt.tamanu.encounter_history": {"database": "app", "schema": "public", "name": "encounter_history", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_history.yml", "original_file_path": "models\\sources\\encounter_history.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_history", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_history"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records changes to an encounter's basic details.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_history.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_history.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_history.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_history.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in encounter_history.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the original [encounter](#!/source/source.tamanu.tamanu.encounters) this history is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__encounter_id"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the encounter was in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__department_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the encounter was in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__location_id"]}, "examiner_id": {"name": "examiner_id", "description": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users) for the encounter.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__examiner_id"]}, "encounter_type": {"name": "encounter_type", "description": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__encounter_type"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_history.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "actor_id": {"name": "actor_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) made the change.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__actor_id"]}, "change_type": {"name": "change_type", "description": "The field which was changed.\r\n\r\nOne of:\r\n- `encounter_type`\r\n- `location`\r\n- `department`\r\n- `examiner`", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_history__change_type"]}}, "meta": {"triggers": ["notify_encounter_history_changed", "record_encounter_history_changelog", "set_encounter_history_updated_at", "set_encounter_history_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_history_changed", "record_encounter_history_changelog", "set_encounter_history_updated_at", "set_encounter_history_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_encounter_history_changed", "record_encounter_history_changelog", "set_encounter_history_updated_at", "set_encounter_history_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_history\"", "created_at": 1782423653.0931048, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_history"]}, "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions": {"database": "app", "schema": "public", "name": "encounter_pause_prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_pause_prescriptions.yml", "original_file_path": "models\\sources\\encounter_pause_prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_pause_prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_pause_prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records details about the prescription being paused, the duration and timing of the pause, and the clinician responsible for initiating the pause.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_pause_prescriptions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_prescription_id": {"name": "encounter_prescription_id", "description": "References the unique identifier of the prescription being paused. This links to the `encounter_prescriptions` table to provide context about the specific prescription.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__encounter_prescription_id"]}, "pause_duration": {"name": "pause_duration", "description": "Describes the length of time for which the prescription is paused. This value works in conjunction with the `pause_time_unit` field to specify the duration (e.g., 5 days, 2 weeks).", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_duration"]}, "pause_time_unit": {"name": "pause_time_unit", "description": "Specifies the unit of time for the pause duration. Common values include days, weeks and it works in conjunction with the `pause_duration` field to define the total pause period.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_time_unit"]}, "pause_start_date": {"name": "pause_start_date", "description": "Indicates the date when the prescription pause begins. This field is used to track the start of the pause period.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_start_date"]}, "pause_end_date": {"name": "pause_end_date", "description": "Indicates the date when the prescription pause ends. This field is used to track the end of the pause period.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_end_date"]}, "notes": {"name": "notes", "description": "Provides additional information or context about the prescription pause.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__notes"]}, "pausing_clinician_id": {"name": "pausing_clinician_id", "description": "References the unique identifier of the clinician responsible for initiating the pause.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__pausing_clinician_id"]}, "created_by": {"name": "created_by", "description": "References the unique identifier of the user who created the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescriptions__created_by"]}, "updated_by": {"name": "updated_by", "description": "The identifier of the user logged on when the record was created, updated or deleted in encounter_pause_prescriptions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_by"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_pause_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_pause_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_pause_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_pause_prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounter_pause_prescriptions_changed", "record_encounter_pause_prescriptions_changelog", "set_encounter_pause_prescriptions_updated_at", "set_encounter_pause_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_pause_prescriptions_changed", "record_encounter_pause_prescriptions_changelog", "set_encounter_pause_prescriptions_updated_at", "set_encounter_pause_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_encounter_pause_prescriptions_changed", "record_encounter_pause_prescriptions_changelog", "set_encounter_pause_prescriptions_updated_at", "set_encounter_pause_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_pause_prescriptions\"", "created_at": 1782423653.0931048, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_pause_prescriptions"]}, "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories": {"database": "app", "schema": "public", "name": "encounter_pause_prescription_histories", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_pause_prescription_histories.yml", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_pause_prescription_histories"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_pause_prescription_histories", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This table tracks the history of paused prescriptions for encounters, including details about the action, user, and duration.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_pause_prescription_histories.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_prescription_id": {"name": "encounter_prescription_id", "description": "The ID of the prescription associated with the encounter.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__encounter_prescription_id"]}, "action": {"name": "action", "description": "The type of action performed, such as \"pause\" or \"resume.\"", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__action"]}, "action_date": {"name": "action_date", "description": "The date and time when the action was performed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_date"]}, "action_user_id": {"name": "action_user_id", "description": "The ID of the user who performed the action.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_user_id"]}, "notes": {"name": "notes", "description": "Additional notes or comments of the paused prescription.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__notes"]}, "pause_duration": {"name": "pause_duration", "description": "The duration for which the prescription was paused.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_duration"]}, "pause_time_unit": {"name": "pause_time_unit", "description": "The unit of time for the pause duration, such as \"days\" or \"hours.\"", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_time_unit"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_pause_prescription_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_pause_prescription_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_pause_prescription_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_pause_prescription_histories.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounter_pause_prescription_histories_changed", "record_encounter_pause_prescription_histories_changelog", "set_encounter_pause_prescription_histories_updated_at", "set_encounter_pause_prescription_histories_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_pause_prescription_histories_changed", "record_encounter_pause_prescription_histories_changelog", "set_encounter_pause_prescription_histories_updated_at", "set_encounter_pause_prescription_histories_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_encounter_pause_prescription_histories_changed", "record_encounter_pause_prescription_histories_changelog", "set_encounter_pause_prescription_histories_updated_at", "set_encounter_pause_prescription_histories_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_pause_prescription_histories\"", "created_at": 1782423653.108969, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_pause_prescription_histories"]}, "source.tamanu_source_dbt.tamanu.encounter_prescriptions": {"database": "app", "schema": "public", "name": "encounter_prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\encounter_prescriptions.yml", "original_file_path": "models\\sources\\encounter_prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.encounter_prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "encounter_prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "encounter_prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of encounter to prescription", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in encounter_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__encounter_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__prescription_id"]}, "is_selected_for_discharge": {"name": "is_selected_for_discharge", "description": "Whether the prescription is for when the patient is discharged.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in encounter_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in encounter_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in encounter_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in encounter_prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_encounter_prescriptions_changed", "record_encounter_prescriptions_changelog", "set_encounter_prescriptions_updated_at", "set_encounter_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_encounter_prescriptions_changed", "record_encounter_prescriptions_changelog", "set_encounter_prescriptions_updated_at", "set_encounter_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_encounter_prescriptions_changed", "record_encounter_prescriptions_changelog", "set_encounter_prescriptions_updated_at", "set_encounter_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"encounter_prescriptions\"", "created_at": 1782423653.108969, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__encounter_prescriptions"]}, "source.tamanu_source_dbt.tamanu.facilities": {"database": "app", "schema": "public", "name": "facilities", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\facilities.yml", "original_file_path": "models\\sources\\facilities.yml", "unique_id": "source.tamanu_source_dbt.tamanu.facilities", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "facilities"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "facilities", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of facilities.\r\n\r\nFacilities may be either or both of:\r\n\r\n- Any healthcare facility, like hospitals, clinics, mobile vaccination vans, laboratories, etc\r\n- A Tamanu Facility deployment.\r\n\r\nWhen syncing, patient and related records are scoped to a facility, according to the\r\n[`patient_facilities`](#!/source/source.tamanu.tamanu.patient_facilities) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in facilities.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code (identifier) for the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__code"]}, "name": {"name": "name", "description": "Full readable name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__name"]}, "division": {"name": "division", "description": "Administrative division this facility lives in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__division"]}, "type": {"name": "type", "description": "Type of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__type"]}, "email": {"name": "email", "description": "Administrative email address of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__email"]}, "contact_number": {"name": "contact_number", "description": "Administrative contact number of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__contact_number"]}, "city_town": {"name": "city_town", "description": "City or town of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__city_town"]}, "street_address": {"name": "street_address", "description": "Street address of the facility.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__street_address"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in facilities.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "catchment_id": {"name": "catchment_id", "description": "Catchment area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__catchment_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in facilities.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_sensitive": {"name": "is_sensitive", "description": "If set to `true`, encounters created on this facility will only be viewable when logged into this facility", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.facilities__is_sensitive"]}}, "meta": {"triggers": ["notify_facilities_changed", "record_facilities_changelog", "set_facilities_updated_at", "set_facilities_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_facilities_changed", "record_facilities_changelog", "set_facilities_updated_at", "set_facilities_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_facilities_changed", "record_facilities_changelog", "set_facilities_updated_at", "set_facilities_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"facilities\"", "created_at": 1782423653.124688, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__facilities"]}, "source.tamanu_source_dbt.tamanu.imaging_area_external_codes": {"database": "app", "schema": "public", "name": "imaging_area_external_codes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_area_external_codes.yml", "original_file_path": "models\\sources\\imaging_area_external_codes.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_area_external_codes", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_area_external_codes"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_area_external_codes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "External codes for imaging areas (such as for [PACS](https://en.wikipedia.org/wiki/Picture_archiving_and_communication_system)).\r\n\r\nImaging areas are stored in [Reference Data](#!/source/source.tamanu.tamanu.reference_data), this\r\ntable adds additional (external) codes.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_area_external_codes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_area_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_area_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_area_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_area_external_codes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "area_id": {"name": "area_id", "description": "Reference to the imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__area_id"]}, "code": {"name": "code", "description": "External code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__code"]}, "description": {"name": "description", "description": "Human-friendly description for the area/code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_area_external_codes__description"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_area_external_codes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_imaging_area_external_codes_changed", "record_imaging_area_external_codes_changelog", "set_imaging_area_external_codes_updated_at", "set_imaging_area_external_codes_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_imaging_area_external_codes_changed", "record_imaging_area_external_codes_changelog", "set_imaging_area_external_codes_updated_at", "set_imaging_area_external_codes_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_imaging_area_external_codes_changed", "record_imaging_area_external_codes_changelog", "set_imaging_area_external_codes_updated_at", "set_imaging_area_external_codes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_area_external_codes\"", "created_at": 1782423653.1410801, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_area_external_codes"]}, "source.tamanu_source_dbt.tamanu.imaging_requests": {"database": "app", "schema": "public", "name": "imaging_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_requests.yml", "original_file_path": "models\\sources\\imaging_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Imaging requests are the entrypoint of imaging workflows in Tamanu.\r\n\r\nEach row is a request for radiology to perform one or more imagings on a patient.\r\n\r\nImagings can have one or more [request areas](#!/source/source.tamanu.tamanu.imaging_request_areas)\r\nattached, and when completed will have [results](#!/source/source.tamanu.tamanu.imaging_results).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_requests.", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__status"]}, "requested_date": {"name": "requested_date", "description": "When the imaging was requested.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this imaging request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__encounter_id"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_by_id"]}, "legacy_results": {"name": "legacy_results", "description": "[Deprecated] Description of the results.\r\n\r\nSince v1.24 this has moved to the [imaging results](#!/source/source.tamanu.tamanu.imaging_results) table.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__legacy_results"]}, "completed_by_id": {"name": "completed_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__completed_by_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) for this imaging request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__location_id"]}, "imaging_type": {"name": "imaging_type", "description": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__imaging_type"]}, "requested_date_legacy": {"name": "requested_date_legacy", "description": "[Deprecated] Timestamp when the imaging was requested.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__requested_date_legacy"]}, "priority": {"name": "priority", "description": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__priority"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [location group](#!/source/source.tamanu.tamanu.location_groups) for this imaging request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__location_group_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113).", "meta": {"masking": "text"}, "data_type": "character varying(1024)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_requests__display_id"]}}, "meta": {"triggers": ["notify_imaging_requests_changed", "record_imaging_requests_changelog", "set_imaging_requests_updated_at", "set_imaging_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_imaging_requests_changed", "record_imaging_requests_changelog", "set_imaging_requests_updated_at", "set_imaging_requests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_imaging_requests_changed", "record_imaging_requests_changelog", "set_imaging_requests_updated_at", "set_imaging_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_requests\"", "created_at": 1782423653.1725845, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_requests"]}, "source.tamanu_source_dbt.tamanu.imaging_request_areas": {"database": "app", "schema": "public", "name": "imaging_request_areas", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_request_areas.yml", "original_file_path": "models\\sources\\imaging_request_areas.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_request_areas", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_request_areas"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_request_areas", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Areas to be imaged as part of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_request_areas.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_request_areas.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_request_areas.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_request_areas.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "imaging_request_id": {"name": "imaging_request_id", "description": "The [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_request_areas__imaging_request_id"]}, "area_id": {"name": "area_id", "description": "The imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_request_areas__area_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_request_areas.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_imaging_request_areas_changed", "record_imaging_request_areas_changelog", "set_imaging_request_areas_updated_at", "set_imaging_request_areas_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_imaging_request_areas_changed", "record_imaging_request_areas_changelog", "set_imaging_request_areas_updated_at", "set_imaging_request_areas_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_imaging_request_areas_changed", "record_imaging_request_areas_changelog", "set_imaging_request_areas_updated_at", "set_imaging_request_areas_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_request_areas\"", "created_at": 1782423653.1725845, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_request_areas"]}, "source.tamanu_source_dbt.tamanu.imaging_results": {"database": "app", "schema": "public", "name": "imaging_results", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_results.yml", "original_file_path": "models\\sources\\imaging_results.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_results", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_results"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_results", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Result of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).\r\n\r\nIn practice, there is usually one or two results per request:\r\n- one containing a reference to a PACS image, when imaging integrations are enabled;\r\n- one containing notes from a doctor who analysed the image.\r\n\r\nHowever there is no limit; for example there may be multiple notes from multiple doctors.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_results.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_results.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_results.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_results.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_results.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_results.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "imaging_request_id": {"name": "imaging_request_id", "description": "Reference to the [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).", "meta": {}, "data_type": "character varying", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__imaging_request_id"]}, "completed_by_id": {"name": "completed_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_by_id"]}, "description": {"name": "description", "description": "Free-form description / notes about this imaging.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__description"]}, "external_code": {"name": "external_code", "description": "External code for this result, used with PACS integration (generally via FHIR).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__external_code"]}, "completed_at": {"name": "completed_at", "description": "When this result was completed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__completed_at"]}, "result_image_url": {"name": "result_image_url", "description": "Link to external imaging result viewer.", "meta": {"masking": "url"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "url"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_results__result_image_url"]}}, "meta": {"triggers": ["notify_imaging_results_changed", "record_imaging_results_changelog", "set_imaging_results_updated_at", "set_imaging_results_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_imaging_results_changed", "record_imaging_results_changelog", "set_imaging_results_updated_at", "set_imaging_results_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_imaging_results_changed", "record_imaging_results_changelog", "set_imaging_results_updated_at", "set_imaging_results_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_results\"", "created_at": 1782423653.1883411, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_results"]}, "source.tamanu_source_dbt.tamanu.imaging_type_external_codes": {"database": "app", "schema": "public", "name": "imaging_type_external_codes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\imaging_type_external_codes.yml", "original_file_path": "models\\sources\\imaging_type_external_codes.yml", "unique_id": "source.tamanu_source_dbt.tamanu.imaging_type_external_codes", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "imaging_type_external_codes"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "imaging_type_external_codes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Mapping table for imaging types to external codes.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in imaging_type_external_codes.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in imaging_type_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in imaging_type_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in imaging_type_external_codes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in imaging_type_external_codes.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "imaging_type_code": {"name": "imaging_type_code", "description": "Tamanu's imaging type code.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_type_external_codes__imaging_type_code"]}, "code": {"name": "code", "description": "External code.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_type_external_codes__code"]}, "description": {"name": "description", "description": "Description of code.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.imaging_type_external_codes__description"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in imaging_type_external_codes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["fhir_refresh", "notify_imaging_type_external_codes_changed", "record_imaging_type_external_codes_changelog", "set_imaging_type_external_codes_updated_at", "set_imaging_type_external_codes_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["fhir_refresh", "notify_imaging_type_external_codes_changed", "record_imaging_type_external_codes_changelog", "set_imaging_type_external_codes_updated_at", "set_imaging_type_external_codes_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["fhir_refresh", "notify_imaging_type_external_codes_changed", "record_imaging_type_external_codes_changelog", "set_imaging_type_external_codes_updated_at", "set_imaging_type_external_codes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"imaging_type_external_codes\"", "created_at": 1782423653.2042527, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__imaging_type_external_codes"]}, "source.tamanu_source_dbt.tamanu.invoices": {"database": "app", "schema": "public", "name": "invoices", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoices.yml", "original_file_path": "models\\sources\\invoices.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoices", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoices"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoices", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Invoices related to encounters.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoices.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__display_id"]}, "date": {"name": "date", "description": "Local date for the record in invoices.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "status": {"name": "status", "description": "Status of the invoice.\r\n\r\nOne of:\r\n- `cancelled`\r\n- `in_progress`\r\n- `finalised`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__status"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this invoice is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__encounter_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_payment_status": {"name": "patient_payment_status", "description": "Payment status (patient portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__patient_payment_status"]}, "insurer_payment_status": {"name": "insurer_payment_status", "description": "Payment status (insurer portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices__insurer_payment_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoices.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoices_changed", "record_invoices_changelog", "set_invoices_updated_at", "set_invoices_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoices_changed", "record_invoices_changelog", "set_invoices_updated_at", "set_invoices_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoices_changed", "record_invoices_changelog", "set_invoices_updated_at", "set_invoices_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoices\"", "created_at": 1782423653.2199745, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoices"]}, "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans": {"database": "app", "schema": "public", "name": "invoices_invoice_insurance_plans", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoices_invoice_insurance_plans.yml", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoices_invoice_insurance_plans"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoices_invoice_insurance_plans", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Junction table linking invoices to insurance contracts. This many-to-many relationship allows an invoice to be associated with multiple insurance contracts.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoices_invoice_insurance_plans.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoices_invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoices_invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoices_invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoices_invoice_insurance_plans.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "invoice_id": {"name": "invoice_id", "description": "Reference to the [invoice](#!/source/source.tamanu.tamanu.invoices) that this insurance contract applies to.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_id"]}, "invoice_insurance_plan_id": {"name": "invoice_insurance_plan_id", "description": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans) being applied to the invoice.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_insurance_plan_id"]}}, "meta": {"triggers": ["notify_invoices_invoice_insurance_plans_changed", "record_invoices_invoice_insurance_plans_changelog", "set_invoices_invoice_insurance_plans_updated_at", "set_invoices_invoice_insurance_plans_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoices_invoice_insurance_plans_changed", "record_invoices_invoice_insurance_plans_changelog", "set_invoices_invoice_insurance_plans_updated_at", "set_invoices_invoice_insurance_plans_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoices_invoice_insurance_plans_changed", "record_invoices_invoice_insurance_plans_changelog", "set_invoices_invoice_insurance_plans_updated_at", "set_invoices_invoice_insurance_plans_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoices_invoice_insurance_plans\"", "created_at": 1782423653.2199745, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoices_invoice_insurance_plans"]}, "source.tamanu_source_dbt.tamanu.invoice_discounts": {"database": "app", "schema": "public", "name": "invoice_discounts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_discounts.yml", "original_file_path": "models\\sources\\invoice_discounts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_discounts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_discounts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_discounts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Invoice discount that is applied to the patient's portion of the discountable costs.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_discounts.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_id": {"name": "invoice_id", "description": "The [invoice](#!/source/source.tamanu.tamanu.invoices).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__invoice_id"]}, "percentage": {"name": "percentage", "description": "Percentage discount to apply to the invoice", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__percentage"]}, "reason": {"name": "reason", "description": "Reason the discount is given", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__reason"]}, "is_manual": {"name": "is_manual", "description": "Indicates if the discount was manually added or based on an assessment", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__is_manual"]}, "applied_by_user_id": {"name": "applied_by_user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) who applied this discount.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__applied_by_user_id"]}, "applied_time": {"name": "applied_time", "description": "When this discount was applied.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_discounts__applied_time"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_discounts.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoice_discounts_changed", "record_invoice_discounts_changelog", "set_invoice_discounts_updated_at", "set_invoice_discounts_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_discounts_changed", "record_invoice_discounts_changelog", "set_invoice_discounts_updated_at", "set_invoice_discounts_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_discounts_changed", "record_invoice_discounts_changelog", "set_invoice_discounts_updated_at", "set_invoice_discounts_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_discounts\"", "created_at": 1782423653.3109102, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_discounts"]}, "source.tamanu_source_dbt.tamanu.invoice_insurance_plans": {"database": "app", "schema": "public", "name": "invoice_insurance_plans", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_insurance_plans.yml", "original_file_path": "models\\sources\\invoice_insurance_plans.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurance_plans", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_insurance_plans"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_insurance_plans", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table for insurance contracts used for invoicing.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurance_plans.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_insurance_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_insurance_plans.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "code": {"name": "code", "description": "Unique identifier code for the insurance contract.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__code"]}, "name": {"name": "name", "description": "Human-readable name of the insurance contract.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__name"]}, "default_coverage": {"name": "default_coverage", "description": "The default coverage (in percentage) of the insurance contract.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plans__default_coverage"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_insurance_plans.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_invoice_insurance_plans_changed", "record_invoice_insurance_plans_changelog", "set_invoice_insurance_plans_updated_at", "set_invoice_insurance_plans_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_insurance_plans_changed", "record_invoice_insurance_plans_changelog", "set_invoice_insurance_plans_updated_at", "set_invoice_insurance_plans_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_insurance_plans_changed", "record_invoice_insurance_plans_changelog", "set_invoice_insurance_plans_updated_at", "set_invoice_insurance_plans_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_insurance_plans\"", "created_at": 1782423653.3163357, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurance_plans"]}, "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items": {"database": "app", "schema": "public", "name": "invoice_insurance_plan_items", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_insurance_plan_items.yml", "original_file_path": "models\\sources\\invoice_insurance_plan_items.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_insurance_plan_items"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_insurance_plan_items", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table for insurance contract items used for invoicing.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurance_plan_items.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_insurance_plan_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_insurance_plan_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_insurance_plan_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_insurance_plan_items.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "invoice_insurance_plan_id": {"name": "invoice_insurance_plan_id", "description": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans).", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_insurance_plan_id"]}, "invoice_product_id": {"name": "invoice_product_id", "description": "Reference to the [invoice product](#!/source/source.tamanu.tamanu.invoice_products).", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_product_id"]}, "coverage_value": {"name": "coverage_value", "description": "The amount of coverage (in percentage) of the insurance contract item.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurance_plan_items__coverage_value"]}}, "meta": {"triggers": ["notify_invoice_insurance_plan_items_changed", "record_invoice_insurance_plan_items_changelog", "set_invoice_insurance_plan_items_updated_at", "set_invoice_insurance_plan_items_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_insurance_plan_items_changed", "record_invoice_insurance_plan_items_changelog", "set_invoice_insurance_plan_items_updated_at", "set_invoice_insurance_plan_items_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_insurance_plan_items_changed", "record_invoice_insurance_plan_items_changelog", "set_invoice_insurance_plan_items_updated_at", "set_invoice_insurance_plan_items_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_insurance_plan_items\"", "created_at": 1782423653.3163357, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurance_plan_items"]}, "source.tamanu_source_dbt.tamanu.invoice_insurer_payments": {"database": "app", "schema": "public", "name": "invoice_insurer_payments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_insurer_payments.yml", "original_file_path": "models\\sources\\invoice_insurer_payments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurer_payments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_insurer_payments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_insurer_payments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Extra metadata about a payment when it was done by a patient.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_insurer_payments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_payment_id": {"name": "invoice_payment_id", "description": "The [payment](#!/source/source.tamanu.tamanu.invoice_payments).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurer_payments__invoice_payment_id"]}, "insurer_id": {"name": "insurer_id", "description": "The insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurer_payments__insurer_id"]}, "status": {"name": "status", "description": "The status of this payment.\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurer_payments__status"]}, "reason": {"name": "reason", "description": "The reason for the payment. Generally this is used for rejections.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_insurer_payments__reason"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_insurer_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_insurer_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_insurer_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_insurer_payments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoice_insurer_payments_changed", "record_invoice_insurer_payments_changelog", "set_invoice_insurer_payments_updated_at", "set_invoice_insurer_payments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_insurer_payments_changed", "record_invoice_insurer_payments_changelog", "set_invoice_insurer_payments_updated_at", "set_invoice_insurer_payments_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_insurer_payments_changed", "record_invoice_insurer_payments_changelog", "set_invoice_insurer_payments_updated_at", "set_invoice_insurer_payments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_insurer_payments\"", "created_at": 1782423653.3303611, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_insurer_payments"]}, "source.tamanu_source_dbt.tamanu.invoice_items": {"database": "app", "schema": "public", "name": "invoice_items", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_items.yml", "original_file_path": "models\\sources\\invoice_items.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_items", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_items"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_items", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Items (products) on invoices.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_items.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_id": {"name": "invoice_id", "description": "The [invoice](#!/source/source.tamanu.tamanu.invoices).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__invoice_id"]}, "order_date": {"name": "order_date", "description": "When the item was ordered.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__order_date"]}, "product_id": {"name": "product_id", "description": "The [product](#!/source/source.tamanu.tamanu.invoice_products).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_id"]}, "quantity": {"name": "quantity", "description": "Quantity ordered.", "meta": {"masking": {"kind": "integer", "range": "0-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__quantity"]}, "product_name_final": {"name": "product_name_final", "description": "The final product name used on the invoice. Saved from the product name field when the invoice is finalised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_name_final"]}, "manual_entry_price": {"name": "manual_entry_price", "description": "Manually entered price override for this item, if specified. When set, this takes precedence over the product's standard price.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__manual_entry_price"]}, "ordered_by_user_id": {"name": "ordered_by_user_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) ordered the item.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__ordered_by_user_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "product_code_final": {"name": "product_code_final", "description": "The final product code used on the invoice. Saved from the product code field when the invoice is finalised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__product_code_final"]}, "note": {"name": "note", "description": "Free-form note for this item.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__note"]}, "source_record_type": {"name": "source_record_type", "description": "The underlying model that the source record belongs to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__source_record_type"]}, "source_record_id": {"name": "source_record_id", "description": "Foreign key relation for record type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__source_record_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_items.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "approved": {"name": "approved", "description": "A boolean field that enables clinicians to track the approval status of individual invoice line items", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__approved"]}, "price_final": {"name": "price_final", "description": "The final price per unit for this item on the invoice. This is determined by the manual_entry_price if provided, otherwise from the product's price when the invoice is finalised.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_items__price_final"]}}, "meta": {"triggers": ["notify_invoice_items_changed", "record_invoice_items_changelog", "set_invoice_items_updated_at", "set_invoice_items_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_items_changed", "record_invoice_items_changelog", "set_invoice_items_updated_at", "set_invoice_items_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_items_changed", "record_invoice_items_changelog", "set_invoice_items_updated_at", "set_invoice_items_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_items\"", "created_at": 1782423653.3460274, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_items"]}, "source.tamanu_source_dbt.tamanu.invoice_item_discounts": {"database": "app", "schema": "public", "name": "invoice_item_discounts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_item_discounts.yml", "original_file_path": "models\\sources\\invoice_item_discounts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_item_discounts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_item_discounts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_item_discounts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Discounts applied to invoice items.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_item_discounts.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_item_id": {"name": "invoice_item_id", "description": "The [invoice item](#!/source/source.tamanu.tamanu.invoice_items).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_discounts__invoice_item_id"]}, "amount": {"name": "amount", "description": "Discount amount of invoice items (can be percentage or a whole number)", "meta": {"masking": "money"}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {"masking": "money"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_discounts__amount"]}, "reason": {"name": "reason", "description": "Free-form reason for the discount.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_discounts__reason"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_item_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_item_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_item_discounts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_item_discounts.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "type": {"name": "type", "description": "Discount type of invoice items", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_discounts__type"]}}, "meta": {"triggers": ["notify_invoice_item_discounts_changed", "record_invoice_item_discounts_changelog", "set_invoice_item_discounts_updated_at", "set_invoice_item_discounts_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_item_discounts_changed", "record_invoice_item_discounts_changelog", "set_invoice_item_discounts_updated_at", "set_invoice_item_discounts_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_item_discounts_changed", "record_invoice_item_discounts_changelog", "set_invoice_item_discounts_updated_at", "set_invoice_item_discounts_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_item_discounts\"", "created_at": 1782423653.3619113, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_item_discounts"]}, "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances": {"database": "app", "schema": "public", "name": "invoice_item_finalised_insurances", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_item_finalised_insurances.yml", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_item_finalised_insurances"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_item_finalised_insurances", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Finalised insurance coverage values for invoice items.\r\n\r\nThis table stores the insurance coverage amounts that were locked in when an invoice item is finalised, \r\npreserving the coverage percentage at that point in time even if the insurance plan's coverage changes later.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_item_finalised_insurances.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_item_finalised_insurances.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_item_finalised_insurances.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_item_finalised_insurances.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_item_finalised_insurances.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "invoice_item_id": {"name": "invoice_item_id", "description": "The [invoice item](#!/source/source.tamanu.tamanu.invoice_items) this insurance coverage applies to.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_item_id"]}, "coverage_value_final": {"name": "coverage_value_final", "description": "The finalised coverage percentage for this invoice item.\r\n\r\nThis value is copied from the insurance plan's coverage at the time the invoice item is finalised,\r\npreserving it for the record even if the insurance plan's coverage percentage changes later.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_finalised_insurances__coverage_value_final"]}, "invoice_insurance_plan_id": {"name": "invoice_insurance_plan_id", "description": "The [insurance plan](#!/source/source.tamanu.tamanu.invoice_insurance_plans) providing the coverage.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_insurance_plan_id"]}}, "meta": {"triggers": ["notify_invoice_item_finalised_insurances_changed", "record_invoice_item_finalised_insurances_changelog", "set_invoice_item_finalised_insurances_updated_at", "set_invoice_item_finalised_insurances_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_item_finalised_insurances_changed", "record_invoice_item_finalised_insurances_changelog", "set_invoice_item_finalised_insurances_updated_at", "set_invoice_item_finalised_insurances_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_item_finalised_insurances_changed", "record_invoice_item_finalised_insurances_changelog", "set_invoice_item_finalised_insurances_updated_at", "set_invoice_item_finalised_insurances_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_item_finalised_insurances\"", "created_at": 1782423653.3619113, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_item_finalised_insurances"]}, "source.tamanu_source_dbt.tamanu.invoice_patient_payments": {"database": "app", "schema": "public", "name": "invoice_patient_payments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_patient_payments.yml", "original_file_path": "models\\sources\\invoice_patient_payments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_patient_payments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_patient_payments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_patient_payments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Extra metadata about a payment when it was done by a patient.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_patient_payments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_payment_id": {"name": "invoice_payment_id", "description": "The [payment](#!/source/source.tamanu.tamanu.invoice_payments).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_patient_payments__invoice_payment_id"]}, "method_id": {"name": "method_id", "description": "The method used to pay ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_patient_payments__method_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_patient_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_patient_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_patient_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "cheque_number": {"name": "cheque_number", "description": "The cheque number for cheque payments.", "meta": {"masking": {"kind": "integer", "range": "10000000-99999999"}}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "10000000-99999999"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_patient_payments__cheque_number"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_patient_payments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoice_patient_payments_changed", "record_invoice_patient_payments_changelog", "set_invoice_patient_payments_updated_at", "set_invoice_patient_payments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_patient_payments_changed", "record_invoice_patient_payments_changelog", "set_invoice_patient_payments_updated_at", "set_invoice_patient_payments_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_patient_payments_changed", "record_invoice_patient_payments_changelog", "set_invoice_patient_payments_updated_at", "set_invoice_patient_payments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_patient_payments\"", "created_at": 1782423653.3776784, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_patient_payments"]}, "source.tamanu_source_dbt.tamanu.invoice_payments": {"database": "app", "schema": "public", "name": "invoice_payments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_payments.yml", "original_file_path": "models\\sources\\invoice_payments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_payments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_payments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_payments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Individual payment against an invoice.\r\n\r\nInvoices can be paid in installments, by different parties, etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_payments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "invoice_id": {"name": "invoice_id", "description": "The [invoice](#!/source/source.tamanu.tamanu.invoices).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_payments__invoice_id"]}, "date": {"name": "date", "description": "Local date for the record in invoice_payments.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "receipt_number": {"name": "receipt_number", "description": "Receipt number. Usually auto-generated.", "meta": {"masking": {"kind": "integer", "range": "10000000-99999999"}}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "10000000-99999999"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_payments__receipt_number"]}, "amount": {"name": "amount", "description": "Amount paid.", "meta": {"masking": "money"}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {"masking": "money"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_payments__amount"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_payments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this invoice payment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_payments__updated_by_user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_payments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_invoice_payments_changed", "record_invoice_payments_changelog", "set_invoice_payments_updated_at", "set_invoice_payments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_payments_changed", "record_invoice_payments_changelog", "set_invoice_payments_updated_at", "set_invoice_payments_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_invoice_payments_changed", "record_invoice_payments_changelog", "set_invoice_payments_updated_at", "set_invoice_payments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_payments\"", "created_at": 1782423653.3944669, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_payments"]}, "source.tamanu_source_dbt.tamanu.invoice_price_lists": {"database": "app", "schema": "public", "name": "invoice_price_lists", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_price_lists.yml", "original_file_path": "models\\sources\\invoice_price_lists.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_price_lists", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_price_lists"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_price_lists", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Contains price list definitions used for invoice line item pricing. Each price list represents a set of pricing rules that can be applied to different types of invoices, patients, or services.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_price_lists.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_price_lists.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_price_lists.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_price_lists.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_price_lists.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "code": {"name": "code", "description": "Unique identifier code for the price list. Used for referencing the price list in business logic and integrations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__code"]}, "name": {"name": "name", "description": "Human-readable name of the price list, displayed in user interfaces and reports.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__name"]}, "rules": {"name": "rules", "description": "JSON configuration containing the pricing rules and logic for this price list. Defines how prices are calculated or retrieved for invoice line items.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_lists__rules"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_price_lists.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_invoice_price_lists_changed", "record_invoice_price_lists_changelog", "set_invoice_price_lists_updated_at", "set_invoice_price_lists_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_price_lists_changed", "record_invoice_price_lists_changelog", "set_invoice_price_lists_updated_at", "set_invoice_price_lists_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_price_lists_changed", "record_invoice_price_lists_changelog", "set_invoice_price_lists_updated_at", "set_invoice_price_lists_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_price_lists\"", "created_at": 1782423653.4086695, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_price_lists"]}, "source.tamanu_source_dbt.tamanu.invoice_price_list_items": {"database": "app", "schema": "public", "name": "invoice_price_list_items", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_price_list_items.yml", "original_file_path": "models\\sources\\invoice_price_list_items.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_price_list_items", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_price_list_items"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_price_list_items", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Contains individual pricing entries for specific products within a price list. Each record defines the price or pricing configuration for a particular product in the context of a specific price list.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_price_list_items.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_price_list_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_price_list_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_price_list_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_price_list_items.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "invoice_price_list_id": {"name": "invoice_price_list_id", "description": "Foreign key reference to the invoice_price_lists table. Links this pricing item to its parent price list.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__invoice_price_list_id"]}, "invoice_product_id": {"name": "invoice_product_id", "description": "Foreign key reference to the invoice products/services that can be priced. Identifies which product or service this pricing item applies to.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__invoice_product_id"]}, "price": {"name": "price", "description": "The price amount for this product in the context of this price list. Stored as a numeric value representing the cost in the system's base currency.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__price"]}, "is_hidden": {"name": "is_hidden", "description": "Determines whether the related invoice product should be hidden from searches on the frontend and also whether it should be automatically added to the invoice.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_price_list_items__is_hidden"]}}, "meta": {"triggers": ["notify_invoice_price_list_items_changed", "record_invoice_price_list_items_changelog", "set_invoice_price_list_items_updated_at", "set_invoice_price_list_items_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_price_list_items_changed", "record_invoice_price_list_items_changelog", "set_invoice_price_list_items_updated_at", "set_invoice_price_list_items_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_invoice_price_list_items_changed", "record_invoice_price_list_items_changelog", "set_invoice_price_list_items_updated_at", "set_invoice_price_list_items_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_price_list_items\"", "created_at": 1782423653.4166589, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_price_list_items"]}, "source.tamanu_source_dbt.tamanu.invoice_products": {"database": "app", "schema": "public", "name": "invoice_products", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\invoice_products.yml", "original_file_path": "models\\sources\\invoice_products.yml", "unique_id": "source.tamanu_source_dbt.tamanu.invoice_products", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "invoice_products"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "invoice_products", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Products which can be invoiced.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "name": {"name": "name", "description": "Name of the product.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__name"]}, "insurable": {"name": "insurable", "description": "Whether or not discounts can be applied to a product", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__insurable"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in invoice_products.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in invoice_products.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in invoice_products.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in invoice_products.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in invoice_products.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "category": {"name": "category", "description": "The category of the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__category"]}, "source_record_type": {"name": "source_record_type", "description": "The underlying database model of the source record for the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__source_record_type"]}, "source_record_id": {"name": "source_record_id", "description": "The id of the source record for the product.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.invoice_products__source_record_id"]}}, "meta": {"triggers": ["notify_invoice_products_changed", "record_invoice_products_changelog", "set_invoice_products_updated_at", "set_invoice_products_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_invoice_products_changed", "record_invoice_products_changelog", "set_invoice_products_updated_at", "set_invoice_products_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_invoice_products_changed", "record_invoice_products_changelog", "set_invoice_products_updated_at", "set_invoice_products_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"invoice_products\"", "created_at": 1782423653.421347, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__invoice_products"]}, "source.tamanu_source_dbt.tamanu.ips_requests": {"database": "app", "schema": "public", "name": "ips_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\ips_requests.yml", "original_file_path": "models\\sources\\ips_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.ips_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "ips_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "ips_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Queue of requests to generate [International Patient Summaries](https://international-patient-summary.net/) (IPS).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in ips_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in ips_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in ips_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in ips_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__patient_id"]}, "created_by": {"name": "created_by", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who created this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__created_by"]}, "status": {"name": "status", "description": "Processing status.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__status"]}, "email": {"name": "email", "description": "Email to send the generated IPS to.", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__email"]}, "error": {"name": "error", "description": "If processing fails, the error.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.ips_requests__error"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in ips_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_ips_requests_changed", "record_ips_requests_changelog", "set_ips_requests_updated_at", "set_ips_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_ips_requests_changed", "record_ips_requests_changelog", "set_ips_requests_updated_at", "set_ips_requests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_ips_requests_changed", "record_ips_requests_changelog", "set_ips_requests_updated_at", "set_ips_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"ips_requests\"", "created_at": 1782423653.421347, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__ips_requests"]}, "source.tamanu_source_dbt.tamanu.lab_requests": {"database": "app", "schema": "public", "name": "lab_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_requests.yml", "original_file_path": "models\\sources\\lab_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Lab requests are the entrypoint of laboratory workflows in Tamanu.\r\n\r\nEach row is a request for a laboratory to perform a group of tests on a sample taken from a patient.\r\n\r\nIt will be updated over the course of the workflow to various statuses, starting with\r\n`reception_pending` (lab has not received the request yet), up to `published` (lab has completed the\r\ntests and has attached verified results).\r\n\r\nSee also: `lab_request_attachments`, `lab_request_logs`, `lab_results`, `lab_tests`,\r\n`lab_test_panels`, and related tables to those.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "sample_time": {"name": "sample_time", "description": "When the sample was collected.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time"]}, "requested_date": {"name": "requested_date", "description": "When the request was submitted.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date"]}, "urgent": {"name": "urgent", "description": "Deprecated.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__urgent"]}, "specimen_attached": {"name": "specimen_attached", "description": "Whether a specimen is attached.\r\n\r\nThis implies `specimen_type_id`.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_attached"]}, "status": {"name": "status", "description": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__status"]}, "senaite_id": {"name": "senaite_id", "description": "When the [SENAITE](https://www.senaite.com/) integration is enabled, this is filled to the SENAITE\r\nID for the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__senaite_id"]}, "sample_id": {"name": "sample_id", "description": "When the [SENAITE](https://www.senaite.com/) integration is enabled, this is filled to the SENAITE\r\nID for the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_id"]}, "requested_by_id": {"name": "requested_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_by_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) the request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__encounter_id"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ncategory of this request's test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_category_id"]}, "display_id": {"name": "display_id", "description": "Short unique identifier used on the frontend.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__display_id"]}, "lab_test_priority_id": {"name": "lab_test_priority_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_priority_id"]}, "lab_test_laboratory_id": {"name": "lab_test_laboratory_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id"]}, "sample_time_legacy": {"name": "sample_time_legacy", "description": "[Deprecated] When the sample was collected.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__sample_time_legacy"]}, "requested_date_legacy": {"name": "requested_date_legacy", "description": "[Deprecated] When the request was submitted.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__requested_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reason_for_cancellation": {"name": "reason_for_cancellation", "description": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__reason_for_cancellation"]}, "published_date": {"name": "published_date", "description": "When this lab request's results were published.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__published_date"]}, "department_id": {"name": "department_id", "description": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) the request comes from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__department_id"]}, "lab_test_panel_request_id": {"name": "lab_test_panel_request_id", "description": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id"]}, "lab_sample_site_id": {"name": "lab_sample_site_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing where\r\non the patient the sample was taken.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__lab_sample_site_id"]}, "specimen_type_id": {"name": "specimen_type_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__specimen_type_id"]}, "collected_by_id": {"name": "collected_by_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__collected_by_id"]}, "results_interpretation": {"name": "results_interpretation", "description": "Free-text interpretation and clinical commentary on the laboratory test results.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_requests__results_interpretation"]}}, "meta": {"triggers": ["notify_lab_requests_changed", "record_lab_requests_changelog", "set_lab_requests_updated_at", "set_lab_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_requests_changed", "record_lab_requests_changelog", "set_lab_requests_updated_at", "set_lab_requests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_requests_changed", "record_lab_requests_changelog", "set_lab_requests_updated_at", "set_lab_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_requests\"", "created_at": 1782423653.4681742, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_requests"]}, "source.tamanu_source_dbt.tamanu.lab_request_attachments": {"database": "app", "schema": "public", "name": "lab_request_attachments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_request_attachments.yml", "original_file_path": "models\\sources\\lab_request_attachments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_request_attachments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_request_attachments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_request_attachments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Attachments (uploaded documents) to a lab request.\r\n\r\nThis could be forms for authorisation or consent, notes, instructions, etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_request_attachments.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_request_attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_request_attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_request_attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "attachment_id": {"name": "attachment_id", "description": "The [attachment](#!/source/source.tamanu.tamanu.attachments) (obtained by uploading the file).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_attachments__attachment_id"]}, "lab_request_id": {"name": "lab_request_id", "description": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_attachments__lab_request_id"]}, "title": {"name": "title", "description": "Short name of the attachment.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_attachments__title"]}, "replaced_by_id": {"name": "replaced_by_id", "description": "Another lab request attachment which replaces this one.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_attachments__replaced_by_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_request_attachments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_request_attachments_changed", "record_lab_request_attachments_changelog", "set_lab_request_attachments_updated_at", "set_lab_request_attachments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_request_attachments_changed", "record_lab_request_attachments_changelog", "set_lab_request_attachments_updated_at", "set_lab_request_attachments_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_request_attachments_changed", "record_lab_request_attachments_changelog", "set_lab_request_attachments_updated_at", "set_lab_request_attachments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_request_attachments\"", "created_at": 1782423653.4840493, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_request_attachments"]}, "source.tamanu_source_dbt.tamanu.lab_request_logs": {"database": "app", "schema": "public", "name": "lab_request_logs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_request_logs.yml", "original_file_path": "models\\sources\\lab_request_logs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_request_logs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_request_logs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_request_logs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This is a log of who changed the status of a lab request when.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_request_logs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_request_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_request_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_request_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "status": {"name": "status", "description": "The status the lab request was updated to.", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__status"]}, "lab_request_id": {"name": "lab_request_id", "description": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__lab_request_id"]}, "updated_by_id": {"name": "updated_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this lab request.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_request_logs__updated_by_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_request_logs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_request_logs_changed", "record_lab_request_logs_changelog", "set_lab_request_logs_updated_at", "set_lab_request_logs_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_request_logs_changed", "record_lab_request_logs_changelog", "set_lab_request_logs_updated_at", "set_lab_request_logs_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_request_logs_changed", "record_lab_request_logs_changelog", "set_lab_request_logs_updated_at", "set_lab_request_logs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_request_logs\"", "created_at": 1782423653.4997735, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_request_logs"]}, "source.tamanu_source_dbt.tamanu.lab_tests": {"database": "app", "schema": "public", "name": "lab_tests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_tests.yml", "original_file_path": "models\\sources\\lab_tests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_tests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_tests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_tests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A single test as part of a [lab request](#!/source/source.tamanu.tamanu.lab_requests).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_tests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_tests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_tests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_tests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in lab_tests.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "result": {"name": "result", "description": "The result of the test.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__result"]}, "lab_request_id": {"name": "lab_request_id", "description": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this test is part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_request_id"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_type_id"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__category_id"]}, "lab_test_method_id": {"name": "lab_test_method_id", "description": "Reference to the method ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__lab_test_method_id"]}, "laboratory_officer": {"name": "laboratory_officer", "description": "Name of the lab officer performing the test.", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__laboratory_officer"]}, "completed_date": {"name": "completed_date", "description": "Datetime at which the test was completed.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date"]}, "verification": {"name": "verification", "description": "Free-form field for a verification indication.\r\n\r\nMay be a verifying or supervising officer's name, a department, lab notes...", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__verification"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in lab_tests.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "completed_date_legacy": {"name": "completed_date_legacy", "description": "[Deprecated] Timestamp at which the test was completed.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_tests__completed_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_tests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_tests_changed", "record_lab_tests_changelog", "set_lab_tests_updated_at", "set_lab_tests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_tests_changed", "record_lab_tests_changelog", "set_lab_tests_updated_at", "set_lab_tests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_tests_changed", "record_lab_tests_changelog", "set_lab_tests_updated_at", "set_lab_tests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_tests\"", "created_at": 1782423653.5158617, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_tests"]}, "source.tamanu_source_dbt.tamanu.lab_test_panels": {"database": "app", "schema": "public", "name": "lab_test_panels", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_test_panels.yml", "original_file_path": "models\\sources\\lab_test_panels.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panels", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_test_panels"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_test_panels", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A panel is a collection of lab test types, usually standardised.\r\n\r\nFor example the BMP (basic metabolic panel) is a panel of 8 blood tests. Instead of ordering all 8\r\ntests individually, a clinician can order the panel all at once. This may also used to more\r\nefficiently use samples.\r\n\r\nThis table defines the available test panels, and\r\n[`lab_test_panel_lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_panel_lab_test_types)\r\ncontains the actual test types that are part of each panel. See\r\n[`lab_test_panel_requests`](#!/source/source.tamanu.tamanu.lab_test_panel_requests) for requesting\r\npanels specifically, and [`lab_test_requests`](#!/source/source.tamanu.tamanu.lab_test_requests) for\r\nrequesting lab tests in general.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panels.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_test_panels.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_test_panels.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_test_panels.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of the test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__name"]}, "code": {"name": "code", "description": "Internal Tamanu code of the panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__code"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_panels.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "external_code": {"name": "external_code", "description": "External code, such as for interfacing with LIMS.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__external_code"]}, "category_id": {"name": "category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panels__category_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_test_panels.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_test_panels_changed", "record_lab_test_panels_changelog", "set_lab_test_panels_updated_at", "set_lab_test_panels_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_test_panels_changed", "record_lab_test_panels_changelog", "set_lab_test_panels_updated_at", "set_lab_test_panels_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_lab_test_panels_changed", "record_lab_test_panels_changelog", "set_lab_test_panels_updated_at", "set_lab_test_panels_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_test_panels\"", "created_at": 1782423653.5419252, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panels"]}, "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types": {"database": "app", "schema": "public", "name": "lab_test_panel_lab_test_types", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_test_panel_lab_test_types.yml", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_test_panel_lab_test_types"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_test_panel_lab_test_types", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "The lab tests contained in a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about lab test\r\npanels, and [`lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_types) for the test types.", "columns": {"created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_panel_id"]}, "lab_test_type_id": {"name": "lab_test_type_id", "description": "The [test type](#!/source/source.tamanu.tamanu.lab_test_types).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_type_id"]}, "order": {"name": "order", "description": "The position of this test within the panel, used to control the display\r\nand processing order of lab tests in a lab test panel. Lower values are\r\nshown and processed before higher values.", "meta": {}, "data_type": "integer", "constraints": [], "quote": true, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_lab_test_types__order"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_test_panel_lab_test_types.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_test_panel_lab_test_types_changed", "record_lab_test_panel_lab_test_types_changelog", "set_lab_test_panel_lab_test_types_updated_at", "set_lab_test_panel_lab_test_types_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_test_panel_lab_test_types_changed", "record_lab_test_panel_lab_test_types_changelog", "set_lab_test_panel_lab_test_types_updated_at", "set_lab_test_panel_lab_test_types_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_lab_test_panel_lab_test_types_changed", "record_lab_test_panel_lab_test_types_changelog", "set_lab_test_panel_lab_test_types_updated_at", "set_lab_test_panel_lab_test_types_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_test_panel_lab_test_types\"", "created_at": 1782423653.54745, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panel_lab_test_types"]}, "source.tamanu_source_dbt.tamanu.lab_test_panel_requests": {"database": "app", "schema": "public", "name": "lab_test_panel_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_test_panel_requests.yml", "original_file_path": "models\\sources\\lab_test_panel_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panel_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_test_panel_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_test_panel_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A request for a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about those.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_panel_requests.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_test_panel_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_test_panel_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_test_panel_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "lab_test_panel_id": {"name": "lab_test_panel_id", "description": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_requests__lab_test_panel_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this lab test panel request is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_panel_requests__encounter_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_test_panel_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_lab_test_panel_requests_changed", "record_lab_test_panel_requests_changelog", "set_lab_test_panel_requests_updated_at", "set_lab_test_panel_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_test_panel_requests_changed", "record_lab_test_panel_requests_changelog", "set_lab_test_panel_requests_updated_at", "set_lab_test_panel_requests_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_lab_test_panel_requests_changed", "record_lab_test_panel_requests_changelog", "set_lab_test_panel_requests_updated_at", "set_lab_test_panel_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_test_panel_requests\"", "created_at": 1782423653.563204, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_panel_requests"]}, "source.tamanu_source_dbt.tamanu.lab_test_types": {"database": "app", "schema": "public", "name": "lab_test_types", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\lab_test_types.yml", "original_file_path": "models\\sources\\lab_test_types.yml", "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_types", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "lab_test_types"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "lab_test_types", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A kind of test that's possible to request.\r\n\r\nThis includes information about the test itself, and also parameters around result formatting, like\r\ndata type, expected ranges, etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in lab_test_types.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in lab_test_types.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Internal Tamanu code of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__code"]}, "name": {"name": "name", "description": "Human-friendly name of the test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__name"]}, "unit": {"name": "unit", "description": "Unit the test result is measured in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__unit"]}, "male_min": {"name": "male_min", "description": "Minimum typical range for males.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__male_min"]}, "male_max": {"name": "male_max", "description": "Maximum typical range for males.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__male_max"]}, "female_min": {"name": "female_min", "description": "Minimum typical range for females.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__female_min"]}, "female_max": {"name": "female_max", "description": "Maximum typical range for females.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__female_max"]}, "range_text": {"name": "range_text", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__range_text"]}, "result_type": {"name": "result_type", "description": "Input type of result.\r\n\r\nOne of:\r\n- `FreeText`\r\n- `Number`\r\n- `Select`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__result_type"]}, "options": {"name": "options", "description": "Comma-separated list of options. Unused.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__options"]}, "lab_test_category_id": {"name": "lab_test_category_id", "description": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__lab_test_category_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in lab_test_types.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in lab_test_types.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "external_code": {"name": "external_code", "description": "External code for the test (such as for LIMS).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__external_code"]}, "is_sensitive": {"name": "is_sensitive", "description": "Used to indicate if the lab test type is sensitive and should be hidden accordingly.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.lab_test_types__is_sensitive"]}}, "meta": {"triggers": ["notify_lab_test_types_changed", "record_lab_test_types_changelog", "set_lab_test_types_updated_at", "set_lab_test_types_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_lab_test_types_changed", "record_lab_test_types_changelog", "set_lab_test_types_updated_at", "set_lab_test_types_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_lab_test_types_changed", "record_lab_test_types_changelog", "set_lab_test_types_updated_at", "set_lab_test_types_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"lab_test_types\"", "created_at": 1782423653.5791855, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__lab_test_types"]}, "source.tamanu_source_dbt.tamanu.local_system_facts": {"database": "app", "schema": "public", "name": "local_system_facts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\local_system_facts.yml", "original_file_path": "models\\sources\\local_system_facts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.local_system_facts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "local_system_facts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "local_system_facts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A set of values that are proper to this installation of Tamanu.\r\n\r\nThese are never synchronised.\r\nUsage is entirely internal to Tamanu and should never be used externally.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in local_system_facts.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in local_system_facts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in local_system_facts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in local_system_facts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "key": {"name": "key", "description": "Key of the fact.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.local_system_facts__key"]}, "value": {"name": "value", "description": "Value of the fact.\r\n\r\nThis is `text`, but may be interpreted as other things, e.g. JSON objects or numbers.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.local_system_facts__value"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"local_system_facts\"", "created_at": 1782423653.5791855, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__local_system_facts"]}, "source.tamanu_source_dbt.tamanu.locations": {"database": "app", "schema": "public", "name": "locations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\locations.yml", "original_file_path": "models\\sources\\locations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.locations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "locations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "locations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information on the hospital locations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in locations.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in locations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in locations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in locations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code for location", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__code"]}, "name": {"name": "name", "description": "Full readable name for location", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__name"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__facility_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in locations.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "location_group_id": {"name": "location_group_id", "description": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__location_group_id"]}, "max_occupancy": {"name": "max_occupancy", "description": "The maximum number of patients that can be in this location", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.locations__max_occupancy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in locations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_locations_changed", "record_locations_changelog", "set_locations_updated_at", "set_locations_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_locations_changed", "record_locations_changelog", "set_locations_updated_at", "set_locations_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_locations_changed", "record_locations_changelog", "set_locations_updated_at", "set_locations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"locations\"", "created_at": 1782423653.594891, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__locations"]}, "source.tamanu_source_dbt.tamanu.location_assignments": {"database": "app", "schema": "public", "name": "location_assignments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\location_assignments.yml", "original_file_path": "models\\sources\\location_assignments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.location_assignments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "location_assignments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "location_assignments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Individual location assignment records representing specific time periods when healthcare staff are scheduled to work at particular locations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in location_assignments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) assigned to this location.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__user_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) where the user is assigned.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__location_id"]}, "date": {"name": "date", "description": "Local date for the record in location_assignments.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "start_time": {"name": "start_time", "description": "Start time of the assignment period.", "meta": {}, "data_type": "time without time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__start_time"]}, "end_time": {"name": "end_time", "description": "End time of the assignment period.", "meta": {}, "data_type": "time without time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__end_time"]}, "template_id": {"name": "template_id", "description": "Reference to the [location assignment template](#!/source/source.tamanu.tamanu.location_assignment_templates) that generated this assignment.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignments__template_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in location_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in location_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in location_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in location_assignments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_location_assignments_changed", "record_location_assignments_changelog", "set_location_assignments_updated_at", "set_location_assignments_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_location_assignments_changed", "record_location_assignments_changelog", "set_location_assignments_updated_at", "set_location_assignments_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_location_assignments_changed", "record_location_assignments_changelog", "set_location_assignments_updated_at", "set_location_assignments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"location_assignments\"", "created_at": 1782423653.594891, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__location_assignments"]}, "source.tamanu_source_dbt.tamanu.location_assignment_templates": {"database": "app", "schema": "public", "name": "location_assignment_templates", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\location_assignment_templates.yml", "original_file_path": "models\\sources\\location_assignment_templates.yml", "unique_id": "source.tamanu_source_dbt.tamanu.location_assignment_templates", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "location_assignment_templates"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "location_assignment_templates", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Templates for recurring location assignments that define when healthcare staff are scheduled to work at specific locations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in location_assignment_templates.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) assigned to this location.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__user_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) where the user is assigned.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__location_id"]}, "date": {"name": "date", "description": "Local date for the record in location_assignment_templates.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "start_time": {"name": "start_time", "description": "Start time of the daily assignment period.", "meta": {}, "data_type": "time without time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__start_time"]}, "end_time": {"name": "end_time", "description": "End time of the daily assignment period.", "meta": {}, "data_type": "time without time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__end_time"]}, "repeat_end_date": {"name": "repeat_end_date", "description": "Date when the repeating assignments should stop being generated.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__repeat_end_date"]}, "repeat_frequency": {"name": "repeat_frequency", "description": "Number of frequency units between each assignment (e.g., every 2 weeks).", "meta": {}, "data_type": "smallint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__repeat_frequency"]}, "repeat_unit": {"name": "repeat_unit", "description": "Frequency unit for repeating assignments.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_assignment_templates__repeat_unit"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in location_assignment_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in location_assignment_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in location_assignment_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in location_assignment_templates.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_location_assignment_templates_changed", "record_location_assignment_templates_changelog", "set_location_assignment_templates_updated_at", "set_location_assignment_templates_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_location_assignment_templates_changed", "record_location_assignment_templates_changelog", "set_location_assignment_templates_updated_at", "set_location_assignment_templates_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_location_assignment_templates_changed", "record_location_assignment_templates_changelog", "set_location_assignment_templates_updated_at", "set_location_assignment_templates_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"location_assignment_templates\"", "created_at": 1782423653.6108842, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__location_assignment_templates"]}, "source.tamanu_source_dbt.tamanu.location_groups": {"database": "app", "schema": "public", "name": "location_groups", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\location_groups.yml", "original_file_path": "models\\sources\\location_groups.yml", "unique_id": "source.tamanu_source_dbt.tamanu.location_groups", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "location_groups"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "location_groups", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A group of locations managed as a single unit (e.g. a ward in hospital)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in location_groups.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in location_groups.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in location_groups.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in location_groups.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in location_groups.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "name": {"name": "name", "description": "Full readable name for location group", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__name"]}, "code": {"name": "code", "description": "Code for location group", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__code"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location group is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__facility_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in location_groups.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_bookable": {"name": "is_bookable", "description": "Controls whether and where this location group appears in the booking calendar: \r\n- `all`: shown on both views \r\n- `weekly`: shown only on weekly view\r\n- `daily`: shown only on daily view\r\n- `no`: hidden from calendar (default)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.location_groups__is_bookable"]}}, "meta": {"triggers": ["notify_location_groups_changed", "record_location_groups_changelog", "set_location_groups_updated_at", "set_location_groups_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_location_groups_changed", "record_location_groups_changelog", "set_location_groups_updated_at", "set_location_groups_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_location_groups_changed", "record_location_groups_changelog", "set_location_groups_updated_at", "set_location_groups_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"location_groups\"", "created_at": 1782423653.626641, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__location_groups"]}, "source.tamanu_source_dbt.tamanu.medication_administration_records": {"database": "app", "schema": "public", "name": "medication_administration_records", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\medication_administration_records.yml", "original_file_path": "models\\sources\\medication_administration_records.yml", "unique_id": "source.tamanu_source_dbt.tamanu.medication_administration_records", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "medication_administration_records"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "medication_administration_records", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records of medication administrations to patients, tracking when medications prescribed in the system were given, not given, or otherwise administered.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_administration_records.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "status": {"name": "status", "description": "Status of the medication administration.\r\n\r\nOne of:\r\n- `GIVEN` - The medication was administered to the patient\r\n- `NOT_GIVEN` - The medication was not administered to the patient", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__status"]}, "due_at": {"name": "due_at", "description": "The scheduled date and time when the medication administration was planned to occur, based on the prescription's frequency and start date.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__due_at"]}, "recorded_at": {"name": "recorded_at", "description": "The timestamp indicating when the administration status (e.g., `GIVEN` or `NOT_GIVEN`) was actually recorded in the system. May be null if the status has not yet been recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__recorded_at"]}, "recorded_by_user_id": {"name": "recorded_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) who recorded that the medication was given or not given.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__recorded_by_user_id"]}, "prescription_id": {"name": "prescription_id", "description": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions) that this administration record is associated with. Links this administration event to the specific medication order it fulfills.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__prescription_id"]}, "is_auto_generated": {"name": "is_auto_generated", "description": "Indicates whether this administration record was automatically generated by the system based on the prescription's frequency and schedule. This is typically true for scheduled medications and false for one-time or as-needed medications.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__is_auto_generated"]}, "changing_status_reason": {"name": "changing_status_reason", "description": "Optional free text field that allows healthcare professionals to document the reason for changing the status of a medication administration record. This is particularly useful when changing a previously recorded status to a different one.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__changing_status_reason"]}, "reason_not_given_id": {"name": "reason_not_given_id", "description": "Reference to the reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why the medication was not administered to the patient. Only applicable when status is `NOT_GIVEN`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__reason_not_given_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in medication_administration_records.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in medication_administration_records.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in medication_administration_records.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in medication_administration_records.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_error": {"name": "is_error", "description": "Indicates whether this medication administration record is marked as error.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__is_error"]}, "error_notes": {"name": "error_notes", "description": "Detailed description of any errors or discrepancies associated with this medication administration record.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__error_notes"]}, "changing_not_given_info_reason": {"name": "changing_not_given_info_reason", "description": "Optional free text field that allows healthcare professionals to document the reason for modifying information about why a medication was not given. This is used when updating or changing the details of a previously recorded 'not given' status, providing an audit trail of why the information was changed.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__changing_not_given_info_reason"]}, "is_edited": {"name": "is_edited", "description": "Indicates whether this medication administration record has been manually edited after its initial creation or recording.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_records__is_edited"]}}, "meta": {"triggers": ["notify_medication_administration_records_changed", "record_medication_administration_records_changelog", "set_medication_administration_records_updated_at", "set_medication_administration_records_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_medication_administration_records_changed", "record_medication_administration_records_changelog", "set_medication_administration_records_updated_at", "set_medication_administration_records_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_medication_administration_records_changed", "record_medication_administration_records_changelog", "set_medication_administration_records_updated_at", "set_medication_administration_records_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"medication_administration_records\"", "created_at": 1782423653.6420605, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__medication_administration_records"]}, "source.tamanu_source_dbt.tamanu.medication_administration_record_doses": {"database": "app", "schema": "public", "name": "medication_administration_record_doses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\medication_administration_record_doses.yml", "original_file_path": "models\\sources\\medication_administration_record_doses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.medication_administration_record_doses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "medication_administration_record_doses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "medication_administration_record_doses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Stores details about individual doses given as part of a medication administration record. A single administration event may involve multiple distinct doses (e.g., taking two tablets).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_administration_record_doses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "dose_amount": {"name": "dose_amount", "description": "The amount or quantity of the medication administered in this specific dose entry.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__dose_amount"]}, "given_time": {"name": "given_time", "description": "The precise date and time when this specific dose was administered to the patient. This may differ slightly from the overall `administered_at` time in the parent record if multiple doses were given sequentially.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__given_time"]}, "given_by_user_id": {"name": "given_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) who physically administered this dose to the patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__given_by_user_id"]}, "recorded_by_user_id": {"name": "recorded_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) who recorded the details of this specific dose administration in the system. This may or may not be the same user who physically administered the dose (`given_by_user_id`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__recorded_by_user_id"]}, "mar_id": {"name": "mar_id", "description": "Reference to the MAR [medication administration record](#!/model/model.public.medication_administration_records) to which this dose belongs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__mar_id"]}, "is_removed": {"name": "is_removed", "description": "Indicates whether this dose record has been removed or voided.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__is_removed"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in medication_administration_record_doses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in medication_administration_record_doses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in medication_administration_record_doses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in medication_administration_record_doses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reason_for_removal": {"name": "reason_for_removal", "description": "A text field explaining why this dose record was removed or voided.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_removal"]}, "dose_index": {"name": "dose_index", "description": "A sequential number indicating the order of this dose within a multi-dose administration. Helps track the sequence when multiple doses are given in a single administration event.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__dose_index"]}, "reason_for_change": {"name": "reason_for_change", "description": "A text field documenting the reason for any modifications made to this dose record after it was initially recorded. This helps maintain an audit trail of changes and ensures proper documentation of why dose details were updated.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_change"]}}, "meta": {"triggers": ["notify_medication_administration_record_doses_changed", "record_medication_administration_record_doses_changelog", "set_medication_administration_record_doses_updated_at", "set_medication_administration_record_doses_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_medication_administration_record_doses_changed", "record_medication_administration_record_doses_changelog", "set_medication_administration_record_doses_updated_at", "set_medication_administration_record_doses_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_medication_administration_record_doses_changed", "record_medication_administration_record_doses_changelog", "set_medication_administration_record_doses_updated_at", "set_medication_administration_record_doses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"medication_administration_record_doses\"", "created_at": 1782423653.6420605, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__medication_administration_record_doses"]}, "source.tamanu_source_dbt.tamanu.medication_dispenses": {"database": "app", "schema": "public", "name": "medication_dispenses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\medication_dispenses.yml", "original_file_path": "models\\sources\\medication_dispenses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.medication_dispenses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "medication_dispenses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "medication_dispenses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records of medication dispensing events, tracking when medications from pharmacy orders are physically dispensed to patients. Each record represents a single dispensing event for a specific prescription within a pharmacy order.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in medication_dispenses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "pharmacy_order_prescription_id": {"name": "pharmacy_order_prescription_id", "description": "Reference to the [pharmacy_order_prescription](#!/source/source.tamanu.tamanu.pharmacy_order_prescriptions) that this dispense record fulfills. Links this dispensing event to the specific medication order being filled.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__pharmacy_order_prescription_id"]}, "quantity": {"name": "quantity", "description": "The quantity of medication units dispensed to the patient in each dispensing.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__quantity"]}, "instructions": {"name": "instructions", "description": "Additional instructions provided to the patient when dispensing the medication, such as dosage guidance, timing, storage requirements, or special considerations for administration.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__instructions"]}, "dispensed_by_user_id": {"name": "dispensed_by_user_id", "description": "Reference to the [user](#!/model/model.public.users) (typically a pharmacist or pharmacy staff member) who dispensed the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_by_user_id"]}, "dispensed_at": {"name": "dispensed_at", "description": "The timestamp indicating when the medication was physically dispensed to the patient.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.medication_dispenses__dispensed_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in medication_dispenses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in medication_dispenses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in medication_dispenses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in medication_dispenses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_medication_dispenses_changed", "record_medication_dispenses_changelog", "set_medication_dispenses_updated_at", "set_medication_dispenses_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_medication_dispenses_changed", "record_medication_dispenses_changelog", "set_medication_dispenses_updated_at", "set_medication_dispenses_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_medication_dispenses_changed", "record_medication_dispenses_changelog", "set_medication_dispenses_updated_at", "set_medication_dispenses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"medication_dispenses\"", "created_at": 1782423653.657818, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__medication_dispenses"]}, "source.tamanu_source_dbt.tamanu.notes": {"database": "app", "schema": "public", "name": "notes", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\notes.yml", "original_file_path": "models\\sources\\notes.yml", "unique_id": "source.tamanu_source_dbt.tamanu.notes", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "notes"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "notes", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Notes recorded by clinicians or system generated.\r\n\r\nAlso see the deprecated [`note_items`](#!/source/source.tamanu.tamanu.note_items),\r\n[`note_pages`](#!/source/source.tamanu.tamanu.note_pages), and the even older\r\n[`notes_legacy`](#!/source/source.tamanu.tamanu.notes_legacy).\r\n\r\nThis is the current version (3) of the notes system.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in notes.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in notes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in notes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in notes.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "record_id": {"name": "record_id", "description": "Polymorphic relationship to the record to which the note is attached (id).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__record_id"]}, "record_type": {"name": "record_type", "description": "Polymorphic relationship to the record to which the note is attached (type).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__record_type"]}, "date": {"name": "date", "description": "Local date for the record in notes.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in notes.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in notes.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in notes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "author_id": {"name": "author_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__author_id"]}, "on_behalf_of_id": {"name": "on_behalf_of_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note, if it wasn't the user who published it.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__on_behalf_of_id"]}, "content": {"name": "content", "description": "The content of the note recorded.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__content"]}, "revised_by_id": {"name": "revised_by_id", "description": "Reference to the [note](#!/source/source.tamanu.tamanu.notes) that is being revised.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__revised_by_id"]}, "note_type_id": {"name": "note_type_id", "description": "Reference to the note type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = noteType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes__note_type_id"]}}, "meta": {"triggers": ["notify_notes_changed", "record_notes_changelog", "set_notes_updated_at", "set_notes_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_notes_changed", "record_notes_changelog", "set_notes_updated_at", "set_notes_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_notes_changed", "record_notes_changelog", "set_notes_updated_at", "set_notes_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"notes\"", "created_at": 1782423653.6737561, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__notes"]}, "source.tamanu_source_dbt.tamanu.notes_legacy": {"database": "app", "schema": "public", "name": "notes_legacy", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\notes_legacy.yml", "original_file_path": "models\\sources\\notes_legacy.yml", "unique_id": "source.tamanu_source_dbt.tamanu.notes_legacy", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "notes_legacy"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "notes_legacy", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Legacy notes", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in notes_legacy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in notes_legacy.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in notes_legacy.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in notes_legacy.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "record_id": {"name": "record_id", "description": "Legacy notes record_id", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__record_id"]}, "record_type": {"name": "record_type", "description": "Legacy notes record_type", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__record_type"]}, "date": {"name": "date", "description": "Local date for the record in notes_legacy.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "note_type": {"name": "note_type", "description": "Legacy notes note_type", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__note_type"]}, "content": {"name": "content", "description": "Legacy notes content", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__content"]}, "author_id": {"name": "author_id", "description": "Legacy notes author_id", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__author_id"]}, "on_behalf_of_id": {"name": "on_behalf_of_id", "description": "Legacy notes on_behalf_of_id", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notes_legacy__on_behalf_of_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in notes_legacy.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_notes_legacy_changed", "record_notes_legacy_changelog", "set_notes_legacy_updated_at", "set_notes_legacy_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_notes_legacy_changed", "record_notes_legacy_changelog", "set_notes_legacy_updated_at", "set_notes_legacy_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_notes_legacy_changed", "record_notes_legacy_changelog", "set_notes_legacy_updated_at", "set_notes_legacy_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"notes_legacy\"", "created_at": 1782423653.691519, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__notes_legacy"]}, "source.tamanu_source_dbt.tamanu.note_items": {"database": "app", "schema": "public", "name": "note_items", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\note_items.yml", "original_file_path": "models\\sources\\note_items.yml", "unique_id": "source.tamanu_source_dbt.tamanu.note_items", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "note_items"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "note_items", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Version 2 of note management.\r\n\r\nIn this version, notes were split between note pages and actual note (item) content.\r\n\r\nDeprecated.\r\n\r\nSee also [`note_pages`](#!/source/source.tamanu.tamanu.note_pages).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in note_items.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in note_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in note_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in note_items.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note_page_id": {"name": "note_page_id", "description": "The [note page](#!/source/source.tamanu.tamanu.note_pages) this item belongs to.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__note_page_id"]}, "revised_by_id": {"name": "revised_by_id", "description": "Reference to the [note_item](#!/source/source.tamanu.tamanu.note_items) that is revised.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__revised_by_id"]}, "author_id": {"name": "author_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note item.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__author_id"]}, "on_behalf_of_id": {"name": "on_behalf_of_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note item, if different from `author_id`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__on_behalf_of_id"]}, "content": {"name": "content", "description": "Text content of the note.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_items__content"]}, "date": {"name": "date", "description": "Local date for the record in note_items.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in note_items.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in note_items.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_note_items_changed", "record_note_items_changelog", "set_note_items_updated_at", "set_note_items_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical", "deprecated"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_note_items_changed", "record_note_items_changelog", "set_note_items_updated_at", "set_note_items_updated_at_sync_tick"]}, "tags": ["clinical", "deprecated"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical", "deprecated"], "meta": {"triggers": ["notify_note_items_changed", "record_note_items_changelog", "set_note_items_updated_at", "set_note_items_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"note_items\"", "created_at": 1782423653.7055428, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__note_items"]}, "source.tamanu_source_dbt.tamanu.note_pages": {"database": "app", "schema": "public", "name": "note_pages", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\note_pages.yml", "original_file_path": "models\\sources\\note_pages.yml", "unique_id": "source.tamanu_source_dbt.tamanu.note_pages", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "note_pages"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "note_pages", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Version 2 of note management.\r\n\r\nIn this version, notes were split between note pages and actual note (item) content.\r\n\r\nDeprecated.\r\n\r\nSee also [`note_items`](#!/source/source.tamanu.tamanu.note_items).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in note_pages.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in note_pages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in note_pages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in note_pages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note_type": {"name": "note_type", "description": "Type of the note page.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_pages__note_type"]}, "record_id": {"name": "record_id", "description": "Polymorphic relationship to the record to which the note is attached (id).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_pages__record_id"]}, "record_type": {"name": "record_type", "description": "Polymorphic relationship to the record to which the note is attached (type).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.note_pages__record_type"]}, "date": {"name": "date", "description": "Local date for the record in note_pages.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in note_pages.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in note_pages.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in note_pages.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_note_pages_changed", "record_note_pages_changelog", "set_note_pages_updated_at", "set_note_pages_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical", "deprecated"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_note_pages_changed", "record_note_pages_changelog", "set_note_pages_updated_at", "set_note_pages_updated_at_sync_tick"]}, "tags": ["clinical", "deprecated"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical", "deprecated"], "meta": {"triggers": ["notify_note_pages_changed", "record_note_pages_changelog", "set_note_pages_updated_at", "set_note_pages_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"note_pages\"", "created_at": 1782423653.7055428, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__note_pages"]}, "source.tamanu_source_dbt.tamanu.notifications": {"database": "app", "schema": "public", "name": "notifications", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\notifications.yml", "original_file_path": "models\\sources\\notifications.yml", "unique_id": "source.tamanu_source_dbt.tamanu.notifications", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "notifications"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "notifications", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Notifications for the clinician dashboard", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in notifications.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "type": {"name": "type", "description": "Type of the notification\r\n\r\nOne of:\r\n- `imaging_request`\r\n- `lab_request`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__type"]}, "status": {"name": "status", "description": "Status of the notification\r\n\r\nOne of:\r\n- `unread`\r\n- `read`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__status"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) that get the notification.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__user_id"]}, "patient_id": {"name": "patient_id", "description": "Related patient of the notification", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__patient_id"]}, "created_time": {"name": "created_time", "description": "When the notification was created", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__created_time"]}, "metadata": {"name": "metadata", "description": "Metadata of the notification", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.notifications__metadata"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in notifications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in notifications.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_notifications_changed", "record_notifications_changelog", "set_notifications_updated_at", "set_notifications_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_notifications_changed", "record_notifications_changelog", "set_notifications_updated_at", "set_notifications_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_notifications_changed", "record_notifications_changelog", "set_notifications_updated_at", "set_notifications_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"notifications\"", "created_at": 1782423653.7212975, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__notifications"]}, "source.tamanu_source_dbt.tamanu.one_time_logins": {"database": "app", "schema": "public", "name": "one_time_logins", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\one_time_logins.yml", "original_file_path": "models\\sources\\one_time_logins.yml", "unique_id": "source.tamanu_source_dbt.tamanu.one_time_logins", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "one_time_logins"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "one_time_logins", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "One time logins are used for password resets.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in one_time_logins.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) for whom this one time login is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.one_time_logins__user_id"]}, "token": {"name": "token", "description": "A random value to use as the login code.\r\n\r\nThis is sent to the user in an email and then entered in a form to reset their password.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.one_time_logins__token"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in one_time_logins.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in one_time_logins.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in one_time_logins.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "expires_at": {"name": "expires_at", "description": "Beyond this time, the one time login can no longer be used.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.one_time_logins__expires_at"]}, "used_at": {"name": "used_at", "description": "When this token was used.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.one_time_logins__used_at"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"one_time_logins\"", "created_at": 1782423653.7212975, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__one_time_logins"]}, "source.tamanu_source_dbt.tamanu.patients": {"database": "app", "schema": "public", "name": "patients", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patients.yml", "original_file_path": "models\\sources\\patients.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patients", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patients"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patients", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "display_id": {"name": "display_id", "description": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__display_id"]}, "first_name": {"name": "first_name", "description": "First name of patient", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__first_name"]}, "middle_name": {"name": "middle_name", "description": "Middle name of patient", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__middle_name"]}, "last_name": {"name": "last_name", "description": "Last name of patient", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__last_name"]}, "cultural_name": {"name": "cultural_name", "description": "Cultural name of patient", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__cultural_name"]}, "email": {"name": "email", "description": "Email address of patient", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__email"]}, "date_of_birth": {"name": "date_of_birth", "description": "Date of birth of patient", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth"]}, "sex": {"name": "sex", "description": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`", "meta": {}, "data_type": "user-defined", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__sex"]}, "village_id": {"name": "village_id", "description": "Tamanu village identifier defined in the reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__village_id"]}, "additional_details": {"name": "additional_details", "description": "[Deprecated] Additional details of the patient", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__additional_details"]}, "date_of_death": {"name": "date_of_death", "description": "Date and time of death of patient", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death"]}, "merged_into_id": {"name": "merged_into_id", "description": "Tamanu identifier for the patient the patient record was merged into", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__merged_into_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patients.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "date_of_death_legacy": {"name": "date_of_death_legacy", "description": "[Deprecated] Timestamp of death of patient", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_death_legacy"]}, "date_of_birth_legacy": {"name": "date_of_birth_legacy", "description": "[Deprecated] Timestamp of birth of patient", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patients__date_of_birth_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patients.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patients_changed", "record_patients_changelog", "set_patients_updated_at", "set_patients_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patients_changed", "record_patients_changelog", "set_patients_updated_at", "set_patients_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"triggers": ["notify_patients_changed", "record_patients_changelog", "set_patients_updated_at", "set_patients_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patients\"", "created_at": 1782423653.7421248, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patients"]}, "source.tamanu_source_dbt.tamanu.patient_additional_data": {"database": "app", "schema": "public", "name": "patient_additional_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_additional_data.yml", "original_file_path": "models\\sources\\patient_additional_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_additional_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_additional_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_additional_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Core or adjunct patient data that doesn't fit elsewhere, but is only downloaded to a facility once a\r\npatient is marked for sync.\r\n\r\nThis is often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`, `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and specify custom/non-standard data to be stored against patients.", "columns": {"created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_additional_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_additional_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_additional_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "place_of_birth": {"name": "place_of_birth", "description": "Free-form place of birth (typically a place name or country).", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__place_of_birth"]}, "primary_contact_number": {"name": "primary_contact_number", "description": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {"masking": "phone"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "phone"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__primary_contact_number"]}, "secondary_contact_number": {"name": "secondary_contact_number", "description": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {"masking": "phone"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "phone"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number"]}, "marital_status": {"name": "marital_status", "description": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__marital_status"]}, "city_town": {"name": "city_town", "description": "Patient current address city or town.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__city_town"]}, "street_village": {"name": "street_village", "description": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured.", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__street_village"]}, "educational_level": {"name": "educational_level", "description": "Highest educational attainment.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__educational_level"]}, "social_media": {"name": "social_media", "description": "Free-form social media contact.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__social_media"]}, "blood_type": {"name": "blood_type", "description": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__blood_type"]}, "title": {"name": "title", "description": "Patient name: title.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__title"]}, "ethnicity_id": {"name": "ethnicity_id", "description": "Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__ethnicity_id"]}, "nationality_id": {"name": "nationality_id", "description": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nationality_id"]}, "country_id": {"name": "country_id", "description": "Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_id"]}, "division_id": {"name": "division_id", "description": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__division_id"]}, "subdivision_id": {"name": "subdivision_id", "description": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__subdivision_id"]}, "medical_area_id": {"name": "medical_area_id", "description": "Reference to patient administrative medical area of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__medical_area_id"]}, "nursing_zone_id": {"name": "nursing_zone_id", "description": "Reference to patient administrative nursing zone of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id"]}, "settlement_id": {"name": "settlement_id", "description": "Reference to patient residence settlement ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__settlement_id"]}, "occupation_id": {"name": "occupation_id", "description": "Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__occupation_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_additional_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_id"]}, "birth_certificate": {"name": "birth_certificate", "description": "Birth certificate identifier.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__birth_certificate"]}, "driving_license": {"name": "driving_license", "description": "Driving licence identifier.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__driving_license"]}, "passport": {"name": "passport", "description": "Passport number.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__passport"]}, "religion_id": {"name": "religion_id", "description": "Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__religion_id"]}, "patient_billing_type_id": {"name": "patient_billing_type_id", "description": "Reference to patient billing type.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id"]}, "country_of_birth_id": {"name": "country_of_birth_id", "description": "Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id"]}, "registered_by_id": {"name": "registered_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who registered the patient in Tamanu.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__registered_by_id"]}, "emergency_contact_name": {"name": "emergency_contact_name", "description": "Name of emergency contact.", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name"]}, "emergency_contact_number": {"name": "emergency_contact_number", "description": "Phone number of emergency contact.", "meta": {"masking": "phone"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "phone"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number"]}, "mother_id": {"name": "mother_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__mother_id"]}, "father_id": {"name": "father_id", "description": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__father_id"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_additional_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "updated_at_by_field": {"name": "updated_at_by_field", "description": "JSON object recording the updated datetime for individual columns.\r\n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields are edited separately in\r\ndifferent facilities. The default sync strategy is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict, but this can lead to discarding important data in the case of PADs. This field\r\nis used to implement per-field \"last edit wins\" instead.", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_additional_data.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "health_center_id": {"name": "health_center_id", "description": "Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__health_center_id"]}, "secondary_village_id": {"name": "secondary_village_id", "description": "Reference to patient administrative village of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\nSee also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__secondary_village_id"]}, "insurer_id": {"name": "insurer_id", "description": "Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_id"]}, "insurer_policy_number": {"name": "insurer_policy_number", "description": "Policy number of patient insurance.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number"]}}, "meta": {"triggers": ["notify_patient_additional_data_changed", "record_patient_additional_data_changelog", "set_patient_additional_data_updated_at", "set_patient_additional_data_updated_at_by_field", "set_patient_additional_data_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_additional_data_changed", "record_patient_additional_data_changelog", "set_patient_additional_data_updated_at", "set_patient_additional_data_updated_at_by_field", "set_patient_additional_data_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"triggers": ["notify_patient_additional_data_changed", "record_patient_additional_data_changelog", "set_patient_additional_data_updated_at", "set_patient_additional_data_updated_at_by_field", "set_patient_additional_data_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_additional_data\"", "created_at": 1782423653.7531674, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_additional_data"]}, "source.tamanu_source_dbt.tamanu.patient_allergies": {"database": "app", "schema": "public", "name": "patient_allergies", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_allergies.yml", "original_file_path": "models\\sources\\patient_allergies.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_allergies", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_allergies"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_allergies", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of allergies known of the patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Allergies\".\r\n\r\nSee also: `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`, `public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_allergies.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_allergies.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_allergies.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_allergies.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form description of this allergy.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__note"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this allergy was recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__recorded_date"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__patient_id"]}, "practitioner_id": {"name": "practitioner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this allergy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__practitioner_id"]}, "allergy_id": {"name": "allergy_id", "description": "Reference to an allergy ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__allergy_id"]}, "recorded_date_legacy": {"name": "recorded_date_legacy", "description": "[Deprecated] Timestamp at which this allergy was recorded.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__recorded_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_allergies.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reaction_id": {"name": "reaction_id", "description": "Reference to an allergic reaction ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_allergies__reaction_id"]}}, "meta": {"triggers": ["notify_patient_allergies_changed", "record_patient_allergies_changelog", "set_patient_allergies_updated_at", "set_patient_allergies_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_allergies_changed", "record_patient_allergies_changelog", "set_patient_allergies_updated_at", "set_patient_allergies_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_allergies_changed", "record_patient_allergies_changelog", "set_patient_allergies_updated_at", "set_patient_allergies_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_allergies\"", "created_at": 1782423653.7531674, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_allergies"]}, "source.tamanu_source_dbt.tamanu.patient_birth_data": {"database": "app", "schema": "public", "name": "patient_birth_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_birth_data.yml", "original_file_path": "models\\sources\\patient_birth_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_birth_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_birth_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_birth_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information about the birth of the patient, if their birth was recorded into Tamanu.\r\n\r\nThis is specifically data about the newborn, and only the birth-relevant data.\r\nOther patient data is found in the normal tables i.e. `patients`, `patient_additional_data`, etc.", "columns": {"created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_birth_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_birth_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_birth_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_birth_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__patient_id"]}, "birth_weight": {"name": "birth_weight", "description": "Weight in kg at birth.", "meta": {"masking": {"kind": "float", "range": "2-10"}}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "2-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_weight"]}, "birth_length": {"name": "birth_length", "description": "Length in cm at birth.", "meta": {"masking": {"kind": "float", "range": "10-100"}}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "10-100"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_length"]}, "birth_delivery_type": {"name": "birth_delivery_type", "description": "Type of delivery.\r\n\r\nOne of:\r\n- `normal_vaginal_delivery`\r\n- `breech`\r\n- `emergency_c_section`\r\n- `elective_c_section`\r\n- `vacuum_extraction`\r\n- `forceps`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type"]}, "gestational_age_estimate": {"name": "gestational_age_estimate", "description": "Gestational age estimate (weeks).", "meta": {"masking": {"kind": "float", "range": "30-40"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "30-40"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate"]}, "apgar_score_one_minute": {"name": "apgar_score_one_minute", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) one minute after birth.", "meta": {"masking": {"kind": "integer", "range": "0-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute"]}, "apgar_score_five_minutes": {"name": "apgar_score_five_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) five minutes after birth.", "meta": {"masking": {"kind": "integer", "range": "0-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes"]}, "apgar_score_ten_minutes": {"name": "apgar_score_ten_minutes", "description": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) ten minutes after birth.", "meta": {"masking": {"kind": "integer", "range": "0-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes"]}, "time_of_birth": {"name": "time_of_birth", "description": "Datetime of birth.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__time_of_birth"]}, "birth_type": {"name": "birth_type", "description": "`single` or `plural` birth.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_type"]}, "attendant_at_birth": {"name": "attendant_at_birth", "description": "The type of the attendant at birth.\r\n\r\nOne of:\r\n- `doctor`\r\n- `midwife`\r\n- `nurse`\r\n- `traditional_birth_attentdant`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth"]}, "name_of_attendant_at_birth": {"name": "name_of_attendant_at_birth", "description": "Name of attendant at birth.", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth"]}, "birth_facility_id": {"name": "birth_facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) the birth was recorded at.\r\n\r\nThis is only required when `registered_birth_place` is `health_facility`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__birth_facility_id"]}, "registered_birth_place": {"name": "registered_birth_place", "description": "Type of the actual birth place.\r\n\r\nOne of:\r\n- `health_facility`\r\n- `home`\r\n- `other`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__registered_birth_place"]}, "time_of_birth_legacy": {"name": "time_of_birth_legacy", "description": "[Deprecated] Time of birth.", "meta": {"masking": "datetime"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_birth_data__time_of_birth_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_birth_data.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_birth_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}}, "meta": {"triggers": ["notify_patient_birth_data_changed", "record_patient_birth_data_changelog", "set_patient_birth_data_updated_at", "set_patient_birth_data_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_birth_data_changed", "record_patient_birth_data_changelog", "set_patient_birth_data_updated_at", "set_patient_birth_data_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_birth_data_changed", "record_patient_birth_data_changelog", "set_patient_birth_data_updated_at", "set_patient_birth_data_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_birth_data\"", "created_at": 1782423653.7691927, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_birth_data"]}, "source.tamanu_source_dbt.tamanu.patient_care_plans": {"database": "app", "schema": "public", "name": "patient_care_plans", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_care_plans.yml", "original_file_path": "models\\sources\\patient_care_plans.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_care_plans", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_care_plans"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_care_plans", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of current care plans the patient is on.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Care plans\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_conditions`, `public.patient_family_histories`,\r\n`public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_care_plans.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_care_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_care_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_care_plans.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in patient_care_plans.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__patient_id"]}, "examiner_id": {"name": "examiner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) who prescribed this care plan.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__examiner_id"]}, "care_plan_id": {"name": "care_plan_id", "description": "Reference to the care plan ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_care_plans__care_plan_id"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in patient_care_plans.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_care_plans.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_care_plans_changed", "record_patient_care_plans_changelog", "set_patient_care_plans_updated_at", "set_patient_care_plans_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_care_plans_changed", "record_patient_care_plans_changelog", "set_patient_care_plans_updated_at", "set_patient_care_plans_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_care_plans_changed", "record_patient_care_plans_changelog", "set_patient_care_plans_updated_at", "set_patient_care_plans_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_care_plans\"", "created_at": 1782423653.785062, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_care_plans"]}, "source.tamanu_source_dbt.tamanu.patient_communications": {"database": "app", "schema": "public", "name": "patient_communications", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_communications.yml", "original_file_path": "models\\sources\\patient_communications.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_communications", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_communications"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_communications", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Messages being sent to a patient, via a variety of channels.\r\n\r\nThis is a multiplexed queue to send emails, SMS, IM messages, etc specifically to patients.\r\n\r\nProcessed by the `PatientEmailCommunicationProcessor` scheduled task.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_communications.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_communications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_communications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_communications.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "type": {"name": "type", "description": "The type of communication.\r\n\r\nThis affects the template or action being taken.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__type"]}, "channel": {"name": "channel", "description": "The channel to send the message with.\r\n\r\nOne of:\r\n- Email\r\n- Sms\r\n- WhatsApp\r\n- Telegram", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__channel"]}, "subject": {"name": "subject", "description": "Subject line (short summary of the message).\r\n\r\nThis is the subject line of an email, or equivalent for other channels.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__subject"]}, "content": {"name": "content", "description": "Content of the message.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__content"]}, "status": {"name": "status", "description": "Processing status of the communication.\r\n\r\nOne of:\r\n- `Queued`\r\n- `Processed`\r\n- `Sent`\r\n- `Error`\r\n- `Delivered`\r\n- `Bad Format`", "meta": {}, "data_type": "user-defined", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__status"]}, "error": {"name": "error", "description": "If the communication sending fails, this is the error.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__error"]}, "retry_count": {"name": "retry_count", "description": "How many times the sending has been retried.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__retry_count"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients) that communication is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__patient_id"]}, "destination": {"name": "destination", "description": "Destination address to send this message to.\r\n\r\nIf this is not provided here, it will be derived from the patient, such as using the\r\n[`patient_contacts`](#!/source/source.tamanu.tamanu.patient_contacts) table.", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__destination"]}, "attachment": {"name": "attachment", "description": "The attachment as a string.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__attachment"]}, "hash": {"name": "hash", "description": "Hash of original data that went into creating the row, for purposes of deduplication.\r\n\r\nThe hashing is done with the `hashtext` postgres function.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_communications__hash"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_communications.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_communications_changed", "record_patient_communications_changelog", "set_patient_communications_updated_at", "set_patient_communications_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_communications_changed", "record_patient_communications_changelog", "set_patient_communications_updated_at", "set_patient_communications_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_communications_changed", "record_patient_communications_changelog", "set_patient_communications_updated_at", "set_patient_communications_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_communications\"", "created_at": 1782423653.785062, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_communications"]}, "source.tamanu_source_dbt.tamanu.patient_conditions": {"database": "app", "schema": "public", "name": "patient_conditions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_conditions.yml", "original_file_path": "models\\sources\\patient_conditions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_conditions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_conditions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_conditions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of ongoing conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Ongoing conditions\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`,\r\n`public.patient_family_histories`, `public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form description of this condition.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__note"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__recorded_date"]}, "resolved": {"name": "resolved", "description": "Whether the condition has resolved.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolved"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__patient_id"]}, "examiner_id": {"name": "examiner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording this\r\ncondition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__examiner_id"]}, "condition_id": {"name": "condition_id", "description": "Reference to a diagnosis describing this issue ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__condition_id"]}, "recorded_date_legacy": {"name": "recorded_date_legacy", "description": "[Deprecated] Timestamp at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__recorded_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_conditions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "resolution_date": {"name": "resolution_date", "description": "Datetime at which this issue was resolved.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_date"]}, "resolution_practitioner_id": {"name": "resolution_practitioner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording the\r\nresolution of this condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_practitioner_id"]}, "resolution_note": {"name": "resolution_note", "description": "Free-form description or notes about the resolution of this condition.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_conditions__resolution_note"]}}, "meta": {"triggers": ["notify_patient_conditions_changed", "record_patient_conditions_changelog", "set_patient_conditions_updated_at", "set_patient_conditions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_conditions_changed", "record_patient_conditions_changelog", "set_patient_conditions_updated_at", "set_patient_conditions_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_conditions_changed", "record_patient_conditions_changelog", "set_patient_conditions_updated_at", "set_patient_conditions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_conditions\"", "created_at": 1782423653.800931, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_conditions"]}, "source.tamanu_source_dbt.tamanu.patient_contacts": {"database": "app", "schema": "public", "name": "patient_contacts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_contacts.yml", "original_file_path": "models\\sources\\patient_contacts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_contacts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_contacts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_contacts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Describes how a patient may be contacted, via email, SMS, or IM apps.\r\n\r\nAt present, this is used for:\r\n- display in the application (all methods)\r\n- emailing the patient (`method=Email`)\r\n- sending Telegram reminders for appointments (`method=Telegram`)", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_contacts.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_contacts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_contacts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_contacts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Free-form name of the contact method.\r\n\r\nThis could be the name of the patient, or a relationship if the contact method is via another person\r\n(e.g. `Spouse`, `Parent`, `Caregiver`), or a logical keyword if multiple contacts of the same method\r\nare provided (e.g. `Main`, `Primary`, `Work`, `Home`), etc.", "meta": {"masking": "name"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__name"]}, "method": {"name": "method", "description": "What application the contact uses:\r\n- `Email`\r\n- `Sms`\r\n- `WhatsApp`\r\n- `Telegram`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__method"]}, "connection_details": {"name": "connection_details", "description": "JSON structure containing the details of the contact.\r\n\r\nIts schema varies based on the `method`.", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__connection_details"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__patient_id"]}, "relationship_id": {"name": "relationship_id", "description": "If the contact method is via another person.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_contacts__relationship_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_contacts.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientContact", "triggers": ["notify_patient_contacts_changed", "record_patient_contacts_changelog", "set_patient_contacts_updated_at", "set_patient_contacts_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientContact", "triggers": ["notify_patient_contacts_changed", "record_patient_contacts_changelog", "set_patient_contacts_updated_at", "set_patient_contacts_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"js_class": "PatientContact", "triggers": ["notify_patient_contacts_changed", "record_patient_contacts_changelog", "set_patient_contacts_updated_at", "set_patient_contacts_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_contacts\"", "created_at": 1782423653.8168378, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_contacts"]}, "source.tamanu_source_dbt.tamanu.patient_death_data": {"database": "app", "schema": "public", "name": "patient_death_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_death_data.yml", "original_file_path": "models\\sources\\patient_death_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_death_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_death_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_death_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Information about a patient's death.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_death_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients) who died.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__patient_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who is recording this death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__clinician_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where this death is being recorded.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__facility_id"]}, "manner": {"name": "manner", "description": "A descriptive text specifying the manner of death.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner"]}, "recent_surgery": {"name": "recent_surgery", "description": "Whether the deceased patient had a recent surgery, if any.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__recent_surgery"]}, "last_surgery_date": {"name": "last_surgery_date", "description": "Datetime of the most recent surgery the patient received, if any.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_date"]}, "last_surgery_reason_id": {"name": "last_surgery_reason_id", "description": "Reference to a `diagnosis` ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) for the\r\nreason of the most recent surgery the patient received, if any.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id"]}, "external_cause_date": {"name": "external_cause_date", "description": "Datetime of external cause of death, if applicable.", "meta": {"masking": "date"}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_date"]}, "external_cause_location": {"name": "external_cause_location", "description": "Physical location of external cause of death, if applicable.", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_location"]}, "external_cause_notes": {"name": "external_cause_notes", "description": "Free-form description of the location of external cause of death, if applicable.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_notes"]}, "was_pregnant": {"name": "was_pregnant", "description": "Whether the deceased was pregnant.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__was_pregnant"]}, "pregnancy_contributed": {"name": "pregnancy_contributed", "description": "Whether the pregnancy contributed to the death.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed"]}, "fetal_or_infant": {"name": "fetal_or_infant", "description": "Whether the deceased was themselves a foetus or infant.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__fetal_or_infant"]}, "stillborn": {"name": "stillborn", "description": "Whether the deceased was themselves stillborn.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__stillborn"]}, "birth_weight": {"name": "birth_weight", "description": "If the deceased was a foetus, stillborn, or infant, their birth weight.", "meta": {"masking": {"kind": "integer", "range": "1-10"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "1-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__birth_weight"]}, "within_day_of_birth": {"name": "within_day_of_birth", "description": "If the deceased was a foetus, stillborn, or infant, whether their passing was on the day of their birth.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__within_day_of_birth"]}, "hours_survived_since_birth": {"name": "hours_survived_since_birth", "description": "If the deceased was an infant, how many days since the birth passed before their death.", "meta": {"masking": {"kind": "integer", "range": "1-50"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "1-50"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth"]}, "carrier_age": {"name": "carrier_age", "description": "If the deceased was a foetus, stillborn, or infant, the age of the carrier.", "meta": {"masking": {"kind": "integer", "range": "20-50"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "20-50"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_age"]}, "carrier_pregnancy_weeks": {"name": "carrier_pregnancy_weeks", "description": "If the deceased was a foetus, stillborn, or infant, how many weeks pregnant their carrier was.", "meta": {"masking": {"kind": "integer", "range": "0-40"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_death_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_death_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_death_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "outside_health_facility": {"name": "outside_health_facility", "description": "Whether the death occurred outside of the facility.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__outside_health_facility"]}, "primary_cause_time_after_onset": {"name": "primary_cause_time_after_onset", "description": "The time in minutes after onset of the primary cause of death, if known.", "meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset"]}, "primary_cause_condition_id": {"name": "primary_cause_condition_id", "description": "Reference to the primary cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if known.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id"]}, "antecedent_cause1_time_after_onset": {"name": "antecedent_cause1_time_after_onset", "description": "The time in minutes after onset of an antecedent (1) cause of death, if applicable.", "meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_time_after_onset"]}, "antecedent_cause1_condition_id": {"name": "antecedent_cause1_condition_id", "description": "Reference to an antecedent (1) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id"]}, "antecedent_cause2_time_after_onset": {"name": "antecedent_cause2_time_after_onset", "description": "The time in minutes after onset of an antecedent (2) cause of death, if applicable.", "meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_time_after_onset"]}, "antecedent_cause2_condition_id": {"name": "antecedent_cause2_condition_id", "description": "Reference to an antecedent (2) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id"]}, "external_cause_date_legacy": {"name": "external_cause_date_legacy", "description": "[Deprecated] Timestamp of external cause of death, if applicable.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__external_cause_date_legacy"]}, "last_surgery_date_legacy": {"name": "last_surgery_date_legacy", "description": "[Deprecated] Timestamp of the most recent surgery the patient received, if any.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__last_surgery_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_death_data.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_final": {"name": "is_final", "description": "Whether this date record is final.\r\n\r\nIn Tamanu, this is set by a supervisor after review, and cannot be reversed; it causes all fields to\r\nbecome read-only. The only way to undo this record is through a `death_revert_logs`.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__is_final"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patient_death_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "antecedent_cause3_time_after_onset": {"name": "antecedent_cause3_time_after_onset", "description": "The time in minutes after onset of an antecedent (3) cause of death, if applicable.", "meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "0-40000"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_time_after_onset"]}, "autopsy_requested": {"name": "autopsy_requested", "description": "Whether an autopsy was requested.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__autopsy_requested"]}, "autopsy_findings_used": {"name": "autopsy_findings_used", "description": "If an autopsy was requested, whether the findings were used in the death certification.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__autopsy_findings_used"]}, "manner_of_death_description": {"name": "manner_of_death_description", "description": "If an external cause occurred, a text description on how and if applicable, notes of poisoning agent.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__manner_of_death_description"]}, "pregnancy_moment": {"name": "pregnancy_moment", "description": "The status of the pregnancy of the deceased, if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__pregnancy_moment"]}, "multiple_pregnancy": {"name": "multiple_pregnancy", "description": "Whether the deceased infant happened in a multiple pregnancy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__multiple_pregnancy"]}, "mother_condition_description": {"name": "mother_condition_description", "description": "A text description stating the conditions of mother that affected the fetus/newborn, if the death was perinatal.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__mother_condition_description"]}, "antecedent_cause3_condition_id": {"name": "antecedent_cause3_condition_id", "description": "Reference to an antecedent (3) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_condition_id"]}}, "meta": {"js_class": "PatientDeathData", "triggers": ["notify_patient_death_data_changed", "record_patient_death_data_changelog", "set_patient_death_data_updated_at", "set_patient_death_data_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientDeathData", "triggers": ["notify_patient_death_data_changed", "record_patient_death_data_changelog", "set_patient_death_data_updated_at", "set_patient_death_data_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"js_class": "PatientDeathData", "triggers": ["notify_patient_death_data_changed", "record_patient_death_data_changelog", "set_patient_death_data_updated_at", "set_patient_death_data_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_death_data\"", "created_at": 1782423653.8487334, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_death_data"]}, "source.tamanu_source_dbt.tamanu.patient_facilities": {"database": "app", "schema": "public", "name": "patient_facilities", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_facilities.yml", "original_file_path": "models\\sources\\patient_facilities.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_facilities", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_facilities"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_facilities", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Tracks which patients are of interest to which facilities.\r\n\r\nThis is used to refine sync data: only patient data related to these patients is synced to a\r\nfacility (plus general data, and some exceptions apply like vaccine data under some conditions).\r\n\r\nIn Tamanu, this can be set manually on the facility server (via the \"mark for sync\" button), or\r\ncentrally (via some labs / vaccine programs, or via bulk-imports).\r\n\r\n_(\"Joe Patient attends X Clinic\" is clinical info; even though an entry in patient facilities\r\ndoesn't necessarily imply this, it often does.)_", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_facilities.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_facilities__facility_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_facilities__patient_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_facilities.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientFacility", "triggers": ["notify_patient_facilities_changed", "record_patient_facilities_changelog", "set_patient_facilities_updated_at", "set_patient_facilities_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientFacility", "triggers": ["notify_patient_facilities_changed", "record_patient_facilities_changelog", "set_patient_facilities_updated_at", "set_patient_facilities_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"js_class": "PatientFacility", "triggers": ["notify_patient_facilities_changed", "record_patient_facilities_changelog", "set_patient_facilities_updated_at", "set_patient_facilities_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_facilities\"", "created_at": 1782423653.8487334, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_facilities"]}, "source.tamanu_source_dbt.tamanu.patient_family_histories": {"database": "app", "schema": "public", "name": "patient_family_histories", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_family_histories.yml", "original_file_path": "models\\sources\\patient_family_histories.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_family_histories", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_family_histories"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_family_histories", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of family history conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Family history\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_issues`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_family_histories.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_family_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_family_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_family_histories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form description of this issue.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__note"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__recorded_date"]}, "relationship": {"name": "relationship", "description": "Free-form description of the family relationship.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__relationship"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__patient_id"]}, "practitioner_id": {"name": "practitioner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this history.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__practitioner_id"]}, "diagnosis_id": {"name": "diagnosis_id", "description": "Reference to a diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))\r\ndescribing this issue.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__diagnosis_id"]}, "recorded_date_legacy": {"name": "recorded_date_legacy", "description": "[Deprecated] Timestamp at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_family_histories__recorded_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_family_histories.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientFamilyHistory", "triggers": ["notify_patient_family_histories_changed", "record_patient_family_histories_changelog", "set_patient_family_histories_updated_at", "set_patient_family_histories_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientFamilyHistory", "triggers": ["notify_patient_family_histories_changed", "record_patient_family_histories_changelog", "set_patient_family_histories_updated_at", "set_patient_family_histories_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"js_class": "PatientFamilyHistory", "triggers": ["notify_patient_family_histories_changed", "record_patient_family_histories_changelog", "set_patient_family_histories_updated_at", "set_patient_family_histories_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_family_histories\"", "created_at": 1782423653.864566, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_family_histories"]}, "source.tamanu_source_dbt.tamanu.patient_field_definitions": {"database": "app", "schema": "public", "name": "patient_field_definitions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_field_definitions.yml", "original_file_path": "models\\sources\\patient_field_definitions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_definitions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_field_definitions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_field_definitions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Custom inputs to be included in the Tamanu patient details screens.\r\n\r\nThese are grouped using [categories](#!/source/source.tamanu.tamanu.patient_field_definition_categories).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_field_definitions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_field_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_field_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_field_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of the input.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definitions__name"]}, "field_type": {"name": "field_type", "description": "Input field type.\r\n\r\nOne of:\r\n- `string`\r\n- `number`\r\n- `select`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definitions__field_type"]}, "options": {"name": "options", "description": "When `type = 'select'`, the list of options for this select.\r\n\r\nPostgreSQL array of strings.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definitions__options"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patient_field_definitions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "category_id": {"name": "category_id", "description": "The [category](#!/source/source.tamanu.tamanu.patient_field_definition_categories) this field is in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definitions__category_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_field_definitions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_field_definitions_changed", "record_patient_field_definitions_changelog", "set_patient_field_definitions_updated_at", "set_patient_field_definitions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_field_definitions_changed", "record_patient_field_definitions_changelog", "set_patient_field_definitions_updated_at", "set_patient_field_definitions_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_patient_field_definitions_changed", "record_patient_field_definitions_changelog", "set_patient_field_definitions_updated_at", "set_patient_field_definitions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_field_definitions\"", "created_at": 1782423653.8802962, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_field_definitions"]}, "source.tamanu_source_dbt.tamanu.patient_field_definition_categories": {"database": "app", "schema": "public", "name": "patient_field_definition_categories", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_field_definition_categories.yml", "original_file_path": "models\\sources\\patient_field_definition_categories.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_definition_categories", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_field_definition_categories"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_field_definition_categories", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Groupings for [patient field definitions](#!/source/source.tamanu.tamanu.patient_field_definitions).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_field_definition_categories.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_field_definition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_field_definition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_field_definition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of category.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_definition_categories__name"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_field_definition_categories.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_field_definition_categories_changed", "record_patient_field_definition_categories_changelog", "set_patient_field_definition_categories_updated_at", "set_patient_field_definition_categories_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_field_definition_categories_changed", "record_patient_field_definition_categories_changelog", "set_patient_field_definition_categories_updated_at", "set_patient_field_definition_categories_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_patient_field_definition_categories_changed", "record_patient_field_definition_categories_changelog", "set_patient_field_definition_categories_updated_at", "set_patient_field_definition_categories_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_field_definition_categories\"", "created_at": 1782423653.8802962, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_field_definition_categories"]}, "source.tamanu_source_dbt.tamanu.patient_field_values": {"database": "app", "schema": "public", "name": "patient_field_values", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_field_values.yml", "original_file_path": "models\\sources\\patient_field_values.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_values", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_field_values"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_field_values", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Values recorded in custom patient fields.\r\n\r\nThe `id` column is generated to enforce one value row per field definition per patient.", "columns": {"created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_field_values.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_field_values.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_field_values.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "value": {"name": "value", "description": "Value.", "meta": {"masking": "string"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__value"]}, "definition_id": {"name": "definition_id", "description": "The [field definition](#!/source/source.tamanu.tamanu.patient_field_definitions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__definition_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_field_values__patient_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_field_values.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_field_values.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}}, "meta": {"triggers": ["notify_patient_field_values_changed", "record_patient_field_values_changelog", "set_patient_field_values_updated_at", "set_patient_field_values_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_field_values_changed", "record_patient_field_values_changelog", "set_patient_field_values_updated_at", "set_patient_field_values_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"triggers": ["notify_patient_field_values_changed", "record_patient_field_values_changelog", "set_patient_field_values_updated_at", "set_patient_field_values_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_field_values\"", "created_at": 1782423653.8962967, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_field_values"]}, "source.tamanu_source_dbt.tamanu.patient_issues": {"database": "app", "schema": "public", "name": "patient_issues", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_issues.yml", "original_file_path": "models\\sources\\patient_issues.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_issues", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_issues"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_issues", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "List of \"other issues\" known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Other patient issues\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_issues.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_issues.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_issues.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_issues.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "note": {"name": "note", "description": "Free-form description of this issue.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__note"]}, "recorded_date": {"name": "recorded_date", "description": "Datetime at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__recorded_date"]}, "type": {"name": "type", "description": "If set to `Warning`, an alert will pop up when visiting the patient.", "meta": {}, "data_type": "user-defined", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__type"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__patient_id"]}, "recorded_date_legacy": {"name": "recorded_date_legacy", "description": "[Deprecated] Timestamp at which this issue was recorded.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_issues__recorded_date_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_issues.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientIssue", "triggers": ["notify_patient_issues_changed", "record_patient_issues_changelog", "set_patient_issues_updated_at", "set_patient_issues_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientIssue", "triggers": ["notify_patient_issues_changed", "record_patient_issues_changelog", "set_patient_issues_updated_at", "set_patient_issues_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"js_class": "PatientIssue", "triggers": ["notify_patient_issues_changed", "record_patient_issues_changelog", "set_patient_issues_updated_at", "set_patient_issues_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_issues\"", "created_at": 1782423653.9120193, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_issues"]}, "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions": {"database": "app", "schema": "public", "name": "patient_ongoing_prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_ongoing_prescriptions.yml", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_ongoing_prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_ongoing_prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of patient to prescription", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_ongoing_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_ongoing_prescriptions__patient_id"]}, "prescription_id": {"name": "prescription_id", "description": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_ongoing_prescriptions__prescription_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_ongoing_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_ongoing_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_ongoing_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_ongoing_prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_patient_ongoing_prescriptions_changed", "record_patient_ongoing_prescriptions_changelog", "set_patient_ongoing_prescriptions_updated_at", "set_patient_ongoing_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_ongoing_prescriptions_changed", "record_patient_ongoing_prescriptions_changelog", "set_patient_ongoing_prescriptions_updated_at", "set_patient_ongoing_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_patient_ongoing_prescriptions_changed", "record_patient_ongoing_prescriptions_changelog", "set_patient_ongoing_prescriptions_updated_at", "set_patient_ongoing_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_ongoing_prescriptions\"", "created_at": 1782423653.9120193, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_ongoing_prescriptions"]}, "source.tamanu_source_dbt.tamanu.patient_program_registrations": {"database": "app", "schema": "public", "name": "patient_program_registrations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_program_registrations.yml", "original_file_path": "models\\sources\\patient_program_registrations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_program_registrations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_program_registrations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_program_registrations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table with information about the program registrations of a patient. This is helpful\r\nto enroll a specific patient within a program that will be followed for an extended\r\nperiod of time.\r\n\r\n**This table is append-only.**\r\nA new record is created every time there is a change to the status of a registration. \r\n\r\nAt the moment, this implies that when merging two patients, both with a registration to the same\r\nregistry, the merged patient ends up with two registrations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registrations.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_program_registrations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_program_registrations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_program_registrations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in patient_program_registrations.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "registration_status": {"name": "registration_status", "description": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registration_status"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [Patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__patient_id"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__program_registry_id"]}, "clinical_status_id": {"name": "clinical_status_id", "description": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__clinician_id"]}, "registering_facility_id": {"name": "registering_facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) this program\r\nregistration is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__facility_id"]}, "village_id": {"name": "village_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=village`) this program registration is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__village_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_program_registrations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "deactivated_clinician_id": {"name": "deactivated_clinician_id", "description": "The clinician that removed the patient from the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id"]}, "deactivated_date": {"name": "deactivated_date", "description": "The date that the patient from the program registry.", "meta": {"masking": "date"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registrations__deactivated_date"]}}, "meta": {"triggers": ["notify_patient_program_registrations_changed", "record_patient_program_registrations_changelog", "set_patient_program_registrations_updated_at", "set_patient_program_registrations_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_program_registrations_changed", "record_patient_program_registrations_changelog", "set_patient_program_registrations_updated_at", "set_patient_program_registrations_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_program_registrations_changed", "record_patient_program_registrations_changelog", "set_patient_program_registrations_updated_at", "set_patient_program_registrations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_program_registrations\"", "created_at": 1782423653.951484, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registrations"]}, "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions": {"database": "app", "schema": "public", "name": "patient_program_registration_conditions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_program_registration_conditions.yml", "original_file_path": "models\\sources\\patient_program_registration_conditions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_program_registration_conditions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_program_registration_conditions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of conditions related to patients in a program registration.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_program_registration_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_program_registration_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in patient_program_registration_conditions.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "deletion_date": {"name": "deletion_date", "description": "Date field which is a timestamp of record being deleted in patient_program_registration_conditions.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deletion_date"]}, "program_registry_condition_id": {"name": "program_registry_condition_id", "description": "Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id"]}, "clinician_id": {"name": "clinician_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id"]}, "deletion_clinician_id": {"name": "deletion_clinician_id", "description": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) that removed the condition.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_program_registration_conditions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "reason_for_change": {"name": "reason_for_change", "description": "Optional field for recording the reason for changing the condition.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change"]}, "patient_program_registration_id": {"name": "patient_program_registration_id", "description": "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\nof the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id"]}, "program_registry_condition_category_id": {"name": "program_registry_condition_category_id", "description": "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\nof the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id"]}}, "meta": {"triggers": ["notify_patient_program_registration_conditions_changed", "record_patient_program_registration_conditions_changelog", "set_patient_program_registration_conditions_updated_at", "set_patient_program_registration_conditions_updated_at_sync_tic"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_patient_program_registration_conditions_changed", "record_patient_program_registration_conditions_changelog", "set_patient_program_registration_conditions_updated_at", "set_patient_program_registration_conditions_updated_at_sync_tic"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_patient_program_registration_conditions_changed", "record_patient_program_registration_conditions_changelog", "set_patient_program_registration_conditions_updated_at", "set_patient_program_registration_conditions_updated_at_sync_tic"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_program_registration_conditions\"", "created_at": 1782423653.9668748, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_program_registration_conditions"]}, "source.tamanu_source_dbt.tamanu.patient_secondary_ids": {"database": "app", "schema": "public", "name": "patient_secondary_ids", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_secondary_ids.yml", "original_file_path": "models\\sources\\patient_secondary_ids.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_secondary_ids", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_secondary_ids"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_secondary_ids", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Alternative IDs to be checked for when searching for patient by ID.\r\n\r\nFor example, driver licence or passport numbers, or other national or local health numbers, if there\r\nare disparate systems or the country is in a transitional period.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_secondary_ids.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_secondary_ids.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_secondary_ids.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_secondary_ids.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "value": {"name": "value", "description": "Value of the identifier.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_secondary_ids__value"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in patient_secondary_ids.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "type_id": {"name": "type_id", "description": "Reference to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\nwith `type=secondaryIdType`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_secondary_ids__type_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere may be zero or more `patient_secondary_ids` per patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_secondary_ids__patient_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in patient_secondary_ids.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"js_class": "PatientSecondaryId", "triggers": ["notify_patient_secondary_ids_changed", "record_patient_secondary_ids_changelog", "set_patient_secondary_ids_updated_at", "set_patient_secondary_ids_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientSecondaryId", "triggers": ["notify_patient_secondary_ids_changed", "record_patient_secondary_ids_changelog", "set_patient_secondary_ids_updated_at", "set_patient_secondary_ids_updated_at_sync_tick"]}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"js_class": "PatientSecondaryId", "triggers": ["notify_patient_secondary_ids_changed", "record_patient_secondary_ids_changelog", "set_patient_secondary_ids_updated_at", "set_patient_secondary_ids_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_secondary_ids\"", "created_at": 1782423653.9726195, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_secondary_ids"]}, "source.tamanu_source_dbt.tamanu.patient_vrs_data": {"database": "app", "schema": "public", "name": "patient_vrs_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\patient_vrs_data.yml", "original_file_path": "models\\sources\\patient_vrs_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.patient_vrs_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "patient_vrs_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "patient_vrs_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Data for Fiji's VRS integration only.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in patient_vrs_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in patient_vrs_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in patient_vrs_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in patient_vrs_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "id_type": {"name": "id_type", "description": "TBC", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__id_type"]}, "identifier": {"name": "identifier", "description": "TBC", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__identifier"]}, "unmatched_village_name": {"name": "unmatched_village_name", "description": "if we don't have a matching village, persist the unmatched name here", "meta": {"masking": "place"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "place"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__unmatched_village_name"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__patient_id"]}, "is_deleted_by_remote": {"name": "is_deleted_by_remote", "description": "TBC", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.patient_vrs_data__is_deleted_by_remote"]}}, "meta": {"js_class": "PatientVRSData", "triggers": []}, "source_meta": {}, "tags": ["patient"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"js_class": "PatientVRSData", "triggers": []}, "tags": ["patient"]}, "patch_path": null, "unrendered_config": {"tags": ["patient"], "meta": {"js_class": "PatientVRSData", "triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"patient_vrs_data\"", "created_at": 1782423653.9777715, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__patient_vrs_data"]}, "source.tamanu_source_dbt.tamanu.permissions": {"database": "app", "schema": "public", "name": "permissions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\permissions.yml", "original_file_path": "models\\sources\\permissions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.permissions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "permissions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "permissions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "These are associations of permissions to roles.\r\n\r\nPermissions are modeled on the concept of a sentence like\r\n\r\n```\r\nROLE can VERB the NOUN\r\nROLE can VERB the NOUN which is specifically the OBJECT ID\r\n```\r\n\r\nSee also the [`roles`](#!/source/source.tamanu.tamanu.roles) and\r\n[`users`](#!/source/source.tamanu.tamanu.users) tables.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in permissions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in permissions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in permissions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in permissions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "role_id": {"name": "role_id", "description": "The [`role`](#!/source/source.tamanu.tamanu.roles) authorised for this permission.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.permissions__role_id"]}, "noun": {"name": "noun", "description": "The subject of the action/permission, usually the model or resource being affected.\r\n\r\nNouns are defined in `PascalCase` and are singular.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.permissions__noun"]}, "verb": {"name": "verb", "description": "The action verb for this permission.\r\n\r\nSome common verbs include: `create`, `read`, `write`, `list`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.permissions__verb"]}, "object_id": {"name": "object_id", "description": "An optional object ID to specialise the permission.\r\n\r\nIf this is not set the permission is generally for the entire class of objects, if it _is_ set then\r\nthe permission is _only_ for the specific object.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.permissions__object_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in permissions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_permissions_changed", "record_permissions_changelog", "set_permissions_updated_at", "set_permissions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_permissions_changed", "record_permissions_changelog", "set_permissions_updated_at", "set_permissions_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_permissions_changed", "record_permissions_changelog", "set_permissions_updated_at", "set_permissions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"permissions\"", "created_at": 1782423653.987115, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__permissions"]}, "source.tamanu_source_dbt.tamanu.pharmacy_orders": {"database": "app", "schema": "public", "name": "pharmacy_orders", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\pharmacy_orders.yml", "original_file_path": "models\\sources\\pharmacy_orders.yml", "unique_id": "source.tamanu_source_dbt.tamanu.pharmacy_orders", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "pharmacy_orders"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "pharmacy_orders", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "An order for prescriptions placed by Tamanu to a Pharmacy", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in pharmacy_orders.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "ordering_clinician_id": {"name": "ordering_clinician_id", "description": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who placed the order.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__ordering_clinician_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) for the order.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__encounter_id"]}, "comments": {"name": "comments", "description": "Comments provided by the clinician when placing the order.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__comments"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in pharmacy_orders.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in pharmacy_orders.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in pharmacy_orders.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in pharmacy_orders.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_discharge_prescription": {"name": "is_discharge_prescription", "description": "If the patient is being discharged with this prescription.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__is_discharge_prescription"]}, "date": {"name": "date", "description": "Local date for the record in pharmacy_orders.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where the pharmacy order was placed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_orders__facility_id"]}}, "meta": {"triggers": ["notify_pharmacy_orders_changed", "record_pharmacy_orders_changelog", "set_pharmacy_orders_updated_at", "set_pharmacy_orders_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_pharmacy_orders_changed", "record_pharmacy_orders_changelog", "set_pharmacy_orders_updated_at", "set_pharmacy_orders_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_pharmacy_orders_changed", "record_pharmacy_orders_changelog", "set_pharmacy_orders_updated_at", "set_pharmacy_orders_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"pharmacy_orders\"", "created_at": 1782423653.99649, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__pharmacy_orders"]}, "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions": {"database": "app", "schema": "public", "name": "pharmacy_order_prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\pharmacy_order_prescriptions.yml", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "pharmacy_order_prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "pharmacy_order_prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Individual prescriptions that are included in a [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in pharmacy_order_prescriptions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "pharmacy_order_id": {"name": "pharmacy_order_id", "description": "Reference to the [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__pharmacy_order_id"]}, "prescription_id": {"name": "prescription_id", "description": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__prescription_id"]}, "ongoing_prescription_id": {"name": "ongoing_prescription_id", "description": "When this pharmacy order prescription was created from an ongoing prescription (send to pharmacy flow), references the ongoing [prescription](#!/source/source.tamanu.tamanu.prescriptions). Null for encounter-based pharmacy orders.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__ongoing_prescription_id"]}, "display_id": {"name": "display_id", "description": "Human-readable request number for this prescription order. A new request number is generated each time a prescription is sent to pharmacy.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__display_id"]}, "quantity": {"name": "quantity", "description": "Quantity of medication ordered.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__quantity"]}, "repeats": {"name": "repeats", "description": "Number of repeats for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__repeats"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in pharmacy_order_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in pharmacy_order_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in pharmacy_order_prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "is_completed": {"name": "is_completed", "description": "Indicates whether this prescription has been fully completed. Set to `true` when all repeats have been dispensed for a discharge prescription (outpatient medication). Used to filter completed prescriptions from active medication request lists.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.pharmacy_order_prescriptions__is_completed"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in pharmacy_order_prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_pharmacy_order_prescriptions_changed", "record_pharmacy_order_prescriptions_changelog", "set_pharmacy_order_prescriptions_updated_at", "set_pharmacy_order_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_pharmacy_order_prescriptions_changed", "record_pharmacy_order_prescriptions_changelog", "set_pharmacy_order_prescriptions_updated_at", "set_pharmacy_order_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_pharmacy_order_prescriptions_changed", "record_pharmacy_order_prescriptions_changelog", "set_pharmacy_order_prescriptions_updated_at", "set_pharmacy_order_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"pharmacy_order_prescriptions\"", "created_at": 1782423654.0046787, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__pharmacy_order_prescriptions"]}, "source.tamanu_source_dbt.tamanu.portal_one_time_tokens": {"database": "app", "schema": "public", "name": "portal_one_time_tokens", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\portal_one_time_tokens.yml", "original_file_path": "models\\sources\\portal_one_time_tokens.yml", "unique_id": "source.tamanu_source_dbt.tamanu.portal_one_time_tokens", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "portal_one_time_tokens"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "portal_one_time_tokens", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A table that stores one-time tokens for portal users. These tokens are used for secure operations such as login, password reset, and other temporary authentication requirements. Each token is associated with a specific portal user and has an expiration date.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in portal_one_time_tokens.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in portal_one_time_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in portal_one_time_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in portal_one_time_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "portal_user_id": {"name": "portal_user_id", "description": "Foreign key that references the id of the portal user to whom this token belongs. When the user is deleted, all associated tokens are automatically deleted (CASCADE).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_one_time_tokens__portal_user_id"]}, "type": {"name": "type", "description": "Specifies the purpose of the token\r\nOne of:\r\n- `login` (default)\r\n- `password-reset`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_one_time_tokens__type"]}, "token": {"name": "token", "description": "The unique, secure token string that is used for verification. This token should be generated with strong cryptographic methods to ensure security.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_one_time_tokens__token"]}, "expires_at": {"name": "expires_at", "description": "The timestamp at which this token expires and becomes invalid. Tokens should have a limited lifespan appropriate to their purpose, typically ranging from a few minutes to 24 hours depending on the token type.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_one_time_tokens__expires_at"]}}, "meta": {"triggers": ["record_portal_one_time_tokens_changelog"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["record_portal_one_time_tokens_changelog"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["record_portal_one_time_tokens_changelog"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"portal_one_time_tokens\"", "created_at": 1782423654.0119154, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__portal_one_time_tokens"]}, "source.tamanu_source_dbt.tamanu.portal_survey_assignments": {"database": "app", "schema": "public", "name": "portal_survey_assignments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\portal_survey_assignments.yml", "original_file_path": "models\\sources\\portal_survey_assignments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.portal_survey_assignments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "portal_survey_assignments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "portal_survey_assignments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Assignments of surveys to patients for completion through the patient portal.\r\n\r\nThis table tracks which surveys have been assigned to which patients for self-completion through\r\nthe patient portal application. Patients can log into the portal to view their assigned surveys\r\nand complete them independently. Surveys can be assigned to patients for various purposes such as\r\nhealth assessments, follow-up questionnaires, or program evaluations.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in portal_survey_assignments.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in portal_survey_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in portal_survey_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in portal_survey_assignments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) who has been assigned the survey.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__patient_id"]}, "survey_id": {"name": "survey_id", "description": "Reference to the [survey](#!/source/source.tamanu.tamanu.surveys) that has been assigned to the patient.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__survey_id"]}, "status": {"name": "status", "description": "The current status of the survey assignment in the patient portal.\r\n\r\nOne of:\r\n- `assigned` - Survey has been assigned but the patient has not yet started it in the portal\r\n- `in_progress` - Patient has started the survey in the portal but not completed it\r\n- `completed` - Survey has been fully completed by the patient through the portal\r\n- `expired` - Survey assignment has expired and can no longer be completed in the portal", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__status"]}, "assigned_by_id": {"name": "assigned_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who assigned the survey to the patient.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__assigned_by_id"]}, "survey_response_id": {"name": "survey_response_id", "description": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) containing the patient's answers from the portal.\r\n\r\nThis field is only populated when the survey has been completed through the patient portal and a response has been recorded.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__survey_response_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in portal_survey_assignments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "assigned_at": {"name": "assigned_at", "description": "Timestamp when the survey was assigned to the patient for completion through the patient portal.\r\n\r\nThis field is provided a value by the Tamanu web frontend when a survey assignment is created.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__assigned_at"]}, "facility_id": {"name": "facility_id", "description": "The facility that the survey was assigned from", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_survey_assignments__facility_id"]}}, "meta": {"triggers": ["notify_portal_survey_assignments_changed", "record_portal_survey_assignments_changelog", "set_portal_survey_assignments_updated_at", "set_portal_survey_assignments_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_portal_survey_assignments_changed", "record_portal_survey_assignments_changelog", "set_portal_survey_assignments_updated_at", "set_portal_survey_assignments_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_portal_survey_assignments_changed", "record_portal_survey_assignments_changelog", "set_portal_survey_assignments_updated_at", "set_portal_survey_assignments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"portal_survey_assignments\"", "created_at": 1782423654.021868, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__portal_survey_assignments"]}, "source.tamanu_source_dbt.tamanu.portal_users": {"database": "app", "schema": "public", "name": "portal_users", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\portal_users.yml", "original_file_path": "models\\sources\\portal_users.yml", "unique_id": "source.tamanu_source_dbt.tamanu.portal_users", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "portal_users"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "portal_users", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This table manages user accounts for patients who can access the patient portal. It establishes the relationship between patients and their portal login credentials, tracking their registration status and access permissions. Each record represents a patient's portal account with authentication and role information.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in portal_users.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in portal_users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in portal_users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in portal_users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "patient_id": {"name": "patient_id", "description": "Foreign key reference to the patients table. Links the portal user account to a specific patient record in the system. This field is required and establishes the one-to-one relationship between a patient and their portal access.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_users__patient_id"]}, "email": {"name": "email", "description": "Unique email address used for patient portal authentication and communication. This serves as the primary identifier for login purposes and must be unique across all patient portal accounts. The field is optional to allow for patients who may not have email addresses, or who have not yet completed the\r\nregistration flow.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_users__email"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in portal_users.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "status": {"name": "status", "description": "Current registration status of the patient portal account. Possible values are 'pending' (default, when account is first created) and 'registered' (when patient has completed the registration process). This field tracks the progression of patient portal onboarding and account activation.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.portal_users__status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in portal_users.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_portal_users_changed", "record_portal_users_changelog", "set_portal_users_updated_at", "set_portal_users_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_portal_users_changed", "record_portal_users_changelog", "set_portal_users_updated_at", "set_portal_users_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_portal_users_changed", "record_portal_users_changelog", "set_portal_users_updated_at", "set_portal_users_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"portal_users\"", "created_at": 1782423654.029865, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__portal_users"]}, "source.tamanu_source_dbt.tamanu.prescriptions": {"database": "app", "schema": "public", "name": "prescriptions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\prescriptions.yml", "original_file_path": "models\\sources\\prescriptions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.prescriptions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "prescriptions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "prescriptions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records prescriptions for medications.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in prescriptions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in prescriptions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in prescriptions.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "notes": {"name": "notes", "description": "Free-form note about the prescription.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__notes"]}, "end_date": {"name": "end_date", "description": "When the prescription ends.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__end_date"]}, "indication": {"name": "indication", "description": "The [indication of use](https://en.wikipedia.org/wiki/Indication_(medicine)) for the medicine.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__indication"]}, "route": {"name": "route", "description": "Administration route for the medication.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__route"]}, "medication_id": {"name": "medication_id", "description": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__medication_id"]}, "prescriber_id": {"name": "prescriber_id", "description": "[Who](#!/source/source.tamanu.tamanu.users) prescribed the medication.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__prescriber_id"]}, "quantity": {"name": "quantity", "description": "Quantity of medicine to dispense.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__quantity"]}, "discontinued": {"name": "discontinued", "description": "Whether the prescription was discontinued.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinued"]}, "discontinuing_clinician_id": {"name": "discontinuing_clinician_id", "description": "If the prescription was discontinued, who did it.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinuing_clinician_id"]}, "discontinuing_reason": {"name": "discontinuing_reason", "description": "If the prescription was discontinued, why that happened.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinuing_reason"]}, "repeats": {"name": "repeats", "description": "How many times this prescription can be repeatedly dispensed without a new prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__repeats"]}, "discontinued_date": {"name": "discontinued_date", "description": "If the prescription was discontinued, when that happened.", "meta": {"masking": "date"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__discontinued_date"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in prescriptions.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "end_date_legacy": {"name": "end_date_legacy", "description": "[Deprecated] When the prescription ends.", "meta": {"masking": "date"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__end_date_legacy"]}, "is_ongoing": {"name": "is_ongoing", "description": "A flag to determine whether or not the current prescription is ongoing", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_ongoing"]}, "is_prn": {"name": "is_prn", "description": "A flag to determine whether or not the current prescription is prn", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_prn"]}, "is_variable_dose": {"name": "is_variable_dose", "description": "A flag to determine whether or not the current prescription is variable does", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_variable_dose"]}, "dose_amount": {"name": "dose_amount", "description": "Numeric field to record dose amount", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__dose_amount"]}, "units": {"name": "units", "description": "The units of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__units"]}, "frequency": {"name": "frequency", "description": "The frequency of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__frequency"]}, "start_date": {"name": "start_date", "description": "The start date of the prescription", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__start_date"]}, "duration_value": {"name": "duration_value", "description": "The duration value of the prescription", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__duration_value"]}, "duration_unit": {"name": "duration_unit", "description": "The duration unit of the prescription", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__duration_unit"]}, "is_phone_order": {"name": "is_phone_order", "description": "A flag to determine whether or not the current prescription is phone order", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__is_phone_order"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in prescriptions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "ideal_times": {"name": "ideal_times", "description": "Ideal times which are specified by prescriber", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__ideal_times"]}, "pharmacy_notes": {"name": "pharmacy_notes", "description": "Free-form pharmacy note of the prescription.", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__pharmacy_notes"]}, "display_pharmacy_notes_in_mar": {"name": "display_pharmacy_notes_in_mar", "description": "A flag to determine whether to display 'Pharmacy notes' on the medication administration record", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.prescriptions__display_pharmacy_notes_in_mar"]}}, "meta": {"triggers": ["notify_prescriptions_changed", "record_prescriptions_changelog", "set_prescriptions_updated_at", "set_prescriptions_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_prescriptions_changed", "record_prescriptions_changelog", "set_prescriptions_updated_at", "set_prescriptions_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_prescriptions_changed", "record_prescriptions_changelog", "set_prescriptions_updated_at", "set_prescriptions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"prescriptions\"", "created_at": 1782423654.0377426, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__prescriptions"]}, "source.tamanu_source_dbt.tamanu.procedures": {"database": "app", "schema": "public", "name": "procedures", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\procedures.yml", "original_file_path": "models\\sources\\procedures.yml", "unique_id": "source.tamanu_source_dbt.tamanu.procedures", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "procedures"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "procedures", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Record of each procedure in progress or completed.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedures.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in procedures.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in procedures.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in procedures.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "completed": {"name": "completed", "description": "Whether the procedure has completed.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed"]}, "date": {"name": "date", "description": "Local date for the record in procedures.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "end_time": {"name": "end_time", "description": "When the procedure ended, if it's completed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time"]}, "note": {"name": "note", "description": "Free-form description of the procedure.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__note"]}, "completed_note": {"name": "completed_note", "description": "Free-form notes at completion of the procedure.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__completed_note"]}, "encounter_id": {"name": "encounter_id", "description": "The [encounter](#!/source/source.tamanu.tamanu.encounters) this procedure is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__encounter_id"]}, "location_id": {"name": "location_id", "description": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the procedure happens in.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__location_id"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__procedure_type_id"]}, "anaesthetic_id": {"name": "anaesthetic_id", "description": "Reference to the anaesthetic ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetic_id"]}, "physician_id": {"name": "physician_id", "description": "Reference to the [physician](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__physician_id"]}, "anaesthetist_id": {"name": "anaesthetist_id", "description": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__anaesthetist_id"]}, "start_time": {"name": "start_time", "description": "When the procedure started.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time"]}, "date_legacy": {"name": "date_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in procedures.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_legacy"]}, "start_time_legacy": {"name": "start_time_legacy", "description": "[Deprecated] When the procedure started.", "meta": {"masking": "datetime"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__start_time_legacy"]}, "end_time_legacy": {"name": "end_time_legacy", "description": "[Deprecated] When the procedure ended.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__end_time_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in procedures.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "department_id": {"name": "department_id", "description": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) where the procedure is performed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__department_id"]}, "assistant_anaesthetist_id": {"name": "assistant_anaesthetist_id", "description": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id"]}, "time_in": {"name": "time_in", "description": "The time when the patient entered the procedure room or when the procedure setup began.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_in"]}, "time_out": {"name": "time_out", "description": "The time when the patient left the procedure room or when the procedure cleanup was completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedures__time_out"]}}, "meta": {"triggers": ["notify_procedures_changed", "record_procedures_changelog", "set_procedures_updated_at", "set_procedures_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_procedures_changed", "record_procedures_changelog", "set_procedures_updated_at", "set_procedures_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_procedures_changed", "record_procedures_changelog", "set_procedures_updated_at", "set_procedures_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"procedures\"", "created_at": 1782423654.0640173, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__procedures"]}, "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians": {"database": "app", "schema": "public", "name": "procedure_assistant_clinicians", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\procedure_assistant_clinicians.yml", "original_file_path": "models\\sources\\procedure_assistant_clinicians.yml", "unique_id": "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "procedure_assistant_clinicians"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "procedure_assistant_clinicians", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Junction table that links procedures to their assistant clinicians. Records which users served as assistant clinicians for specific procedures.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedure_assistant_clinicians.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "procedure_id": {"name": "procedure_id", "description": "Reference to the [procedure](#!/source/source.tamanu.tamanu.procedures) this assistant clinician is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_assistant_clinicians__procedure_id"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who served as an assistant clinician for the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_assistant_clinicians__user_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in procedure_assistant_clinicians.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in procedure_assistant_clinicians.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in procedure_assistant_clinicians.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in procedure_assistant_clinicians.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_procedure_assistant_clinicians_changed", "record_procedure_assistant_clinicians_changelog", "set_procedure_assistant_clinicians_updated_at", "set_procedure_assistant_clinicians_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_procedure_assistant_clinicians_changed", "record_procedure_assistant_clinicians_changelog", "set_procedure_assistant_clinicians_updated_at", "set_procedure_assistant_clinicians_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_procedure_assistant_clinicians_changed", "record_procedure_assistant_clinicians_changelog", "set_procedure_assistant_clinicians_updated_at", "set_procedure_assistant_clinicians_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"procedure_assistant_clinicians\"", "created_at": 1782423654.0640173, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__procedure_assistant_clinicians"]}, "source.tamanu_source_dbt.tamanu.procedure_survey_responses": {"database": "app", "schema": "public", "name": "procedure_survey_responses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\procedure_survey_responses.yml", "original_file_path": "models\\sources\\procedure_survey_responses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.procedure_survey_responses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "procedure_survey_responses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "procedure_survey_responses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Junction table linking procedures to their associated survey responses.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedure_survey_responses.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "procedure_id": {"name": "procedure_id", "description": "Reference to the [procedure](#!/source/source.tamanu.tamanu.procedures) this survey response is associated with.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_survey_responses__procedure_id"]}, "survey_response_id": {"name": "survey_response_id", "description": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) linked to the procedure.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_survey_responses__survey_response_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in procedure_survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in procedure_survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in procedure_survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in procedure_survey_responses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_procedure_survey_responses_changed", "record_procedure_survey_responses_changelog", "set_procedure_survey_responses_updated_at", "set_procedure_survey_responses_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_procedure_survey_responses_changed", "record_procedure_survey_responses_changelog", "set_procedure_survey_responses_updated_at", "set_procedure_survey_responses_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_procedure_survey_responses_changed", "record_procedure_survey_responses_changelog", "set_procedure_survey_responses_updated_at", "set_procedure_survey_responses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"procedure_survey_responses\"", "created_at": 1782423654.0640173, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__procedure_survey_responses"]}, "source.tamanu_source_dbt.tamanu.procedure_type_surveys": {"database": "app", "schema": "public", "name": "procedure_type_surveys", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\procedure_type_surveys.yml", "original_file_path": "models\\sources\\procedure_type_surveys.yml", "unique_id": "source.tamanu_source_dbt.tamanu.procedure_type_surveys", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "procedure_type_surveys"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "procedure_type_surveys", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association between procedure types and surveys\r\n\r\nThis link is used to populate an embedded survey in the procedure modal", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in procedure_type_surveys.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "procedure_type_id": {"name": "procedure_type_id", "description": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=procedureType`)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_type_surveys__procedure_type_id"]}, "survey_id": {"name": "survey_id", "description": "Reference to a [survey](#!/source/source.tamanu.tamanu.surveys).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.procedure_type_surveys__survey_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in procedure_type_surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in procedure_type_surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in procedure_type_surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in procedure_type_surveys.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_procedure_type_surveys_changed", "record_procedure_type_surveys_changelog", "set_procedure_type_surveys_updated_at", "set_procedure_type_surveys_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_procedure_type_surveys_changed", "record_procedure_type_surveys_changelog", "set_procedure_type_surveys_updated_at", "set_procedure_type_surveys_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_procedure_type_surveys_changed", "record_procedure_type_surveys_changelog", "set_procedure_type_surveys_updated_at", "set_procedure_type_surveys_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"procedure_type_surveys\"", "created_at": 1782423654.079943, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__procedure_type_surveys"]}, "source.tamanu_source_dbt.tamanu.programs": {"database": "app", "schema": "public", "name": "programs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\programs.yml", "original_file_path": "models\\sources\\programs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.programs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "programs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "programs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Groups of [surveys](#!/source/source.tamanu.tamanu.surveys) or [program registries](#!/source/source.tamanu.tamanu.program_registries).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in programs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in programs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in programs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in programs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Machine-friendly code.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.programs__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.programs__name"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in programs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_programs_changed", "record_programs_changelog", "set_programs_updated_at", "set_programs_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_programs_changed", "record_programs_changelog", "set_programs_updated_at", "set_programs_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_programs_changed", "record_programs_changelog", "set_programs_updated_at", "set_programs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"programs\"", "created_at": 1782423654.079943, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__programs"]}, "source.tamanu_source_dbt.tamanu.program_data_elements": {"database": "app", "schema": "public", "name": "program_data_elements", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_data_elements.yml", "original_file_path": "models\\sources\\program_data_elements.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_data_elements", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_data_elements"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_data_elements", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Describes how a survey question gets stored.\r\n\r\nSee [survey screen components](#!/source/source.tamanu.tamanu.survey_screen_components), which\r\ndescribes how the question is displayed.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_data_elements.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_data_elements.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_data_elements.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_data_elements.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Machine-friendly short name for the question.\r\n\r\nThis is also used to refer to questions within criteria and such.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__code"]}, "name": {"name": "name", "description": "Human-friendly name", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__name"]}, "indicator": {"name": "indicator", "description": "Another name for the data element.\r\n\r\nIt's named `indicator` from mimicry of Tupaia.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__indicator"]}, "default_text": {"name": "default_text", "description": "Default value.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__default_text"]}, "default_options": {"name": "default_options", "description": "Default options if this is a dropdown.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__default_options"]}, "type": {"name": "type", "description": "Type of the field.\r\n\r\nTypes are here: ", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__type"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_data_elements.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visualisation_config": {"name": "visualisation_config", "description": "JSON visualisation configuration.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_data_elements__visualisation_config"]}}, "meta": {"triggers": ["notify_program_data_elements_changed", "record_program_data_elements_changelog", "set_program_data_elements_updated_at", "set_program_data_elements_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_data_elements_changed", "record_program_data_elements_changelog", "set_program_data_elements_updated_at", "set_program_data_elements_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_program_data_elements_changed", "record_program_data_elements_changelog", "set_program_data_elements_updated_at", "set_program_data_elements_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_data_elements\"", "created_at": 1782423654.079943, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_data_elements"]}, "source.tamanu_source_dbt.tamanu.program_registries": {"database": "app", "schema": "public", "name": "program_registries", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_registries.yml", "original_file_path": "models\\sources\\program_registries.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_registries", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_registries"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_registries", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of program registries.\r\n\r\nThis provides functionality to track a patient population defined by a particular disease or\r\ncondition, and follow this population over time.\r\n\r\nThis table defines the different registries available to track users with.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registries.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_registries.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_registries.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_registries.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Machine-friendly identifier.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__name"]}, "currently_at_type": {"name": "currently_at_type", "description": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__currently_at_type"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registries.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_id": {"name": "program_id", "description": "Reference to a [program](#!/source/source.tamanu.tamanu.programs).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registries__program_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_registries.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_program_registries_changed", "record_program_registries_changelog", "set_program_registries_updated_at", "set_program_registries_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_registries_changed", "record_program_registries_changelog", "set_program_registries_updated_at", "set_program_registries_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_program_registries_changed", "record_program_registries_changelog", "set_program_registries_updated_at", "set_program_registries_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_registries\"", "created_at": 1782423654.0960724, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registries"]}, "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses": {"database": "app", "schema": "public", "name": "program_registry_clinical_statuses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_registry_clinical_statuses.yml", "original_file_path": "models\\sources\\program_registry_clinical_statuses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_registry_clinical_statuses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_registry_clinical_statuses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of clinical statuses used in program registries.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_clinical_statuses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_registry_clinical_statuses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_registry_clinical_statuses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_registry_clinical_statuses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code (identifier) for the clinical status.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__code"]}, "name": {"name": "name", "description": "The name of the clinical status.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__name"]}, "color": {"name": "color", "description": "A color for the clinical status.\r\n\r\nOne of:\r\n- `purple`\r\n- `pink`\r\n- `orange`\r\n- `yellow`\r\n- `blue`\r\n- `green`\r\n- `grey`\r\n- `red`\r\n- `brown`\r\n- `teal`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__color"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_clinical_statuses.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe status is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_clinical_statuses__program_registry_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_registry_clinical_statuses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_program_registry_clinical_statuses_changed", "record_program_registry_clinical_statuses_changelog", "set_program_registry_clinical_statuses_updated_at", "set_program_registry_clinical_statuses_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_registry_clinical_statuses_changed", "record_program_registry_clinical_statuses_changelog", "set_program_registry_clinical_statuses_updated_at", "set_program_registry_clinical_statuses_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_program_registry_clinical_statuses_changed", "record_program_registry_clinical_statuses_changelog", "set_program_registry_clinical_statuses_updated_at", "set_program_registry_clinical_statuses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_registry_clinical_statuses\"", "created_at": 1782423654.1119041, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_clinical_statuses"]}, "source.tamanu_source_dbt.tamanu.program_registry_conditions": {"database": "app", "schema": "public", "name": "program_registry_conditions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_registry_conditions.yml", "original_file_path": "models\\sources\\program_registry_conditions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_conditions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_registry_conditions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_registry_conditions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of program registry conditions.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_conditions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_registry_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_registry_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_registry_conditions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code (identifier) for the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__code"]}, "name": {"name": "name", "description": "The name of the condition.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_conditions.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe condition is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_conditions__program_registry_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_registry_conditions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_program_registry_conditions_changed", "record_program_registry_conditions_changelog", "set_program_registry_conditions_updated_at", "set_program_registry_conditions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_registry_conditions_changed", "record_program_registry_conditions_changelog", "set_program_registry_conditions_updated_at", "set_program_registry_conditions_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_program_registry_conditions_changed", "record_program_registry_conditions_changelog", "set_program_registry_conditions_updated_at", "set_program_registry_conditions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_registry_conditions\"", "created_at": 1782423654.1119041, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_conditions"]}, "source.tamanu_source_dbt.tamanu.program_registry_condition_categories": {"database": "app", "schema": "public", "name": "program_registry_condition_categories", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\program_registry_condition_categories.yml", "original_file_path": "models\\sources\\program_registry_condition_categories.yml", "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_condition_categories", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "program_registry_condition_categories"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "program_registry_condition_categories", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Categories to be set against patient program registry conditions. The categories are configured through the program importer for each program registry. There is a hard-loaded list that is seeded by default in the database for each program registry.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in program_registry_condition_categories.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in program_registry_condition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in program_registry_condition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in program_registry_condition_categories.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "The code for the category.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__code"]}, "name": {"name": "name", "description": "The name for the category.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in program_registry_condition_categories.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "program_registry_id": {"name": "program_registry_id", "description": "The id of the program registry.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.program_registry_condition_categories__program_registry_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in program_registry_condition_categories.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_program_registry_condition_categories_changed", "record_program_registry_condition_categories_changelog", "set_program_registry_condition_categories_updated_at", "set_program_registry_condition_categories_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_program_registry_condition_categories_changed", "record_program_registry_condition_categories_changelog", "set_program_registry_condition_categories_updated_at", "set_program_registry_condition_categories_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_program_registry_condition_categories_changed", "record_program_registry_condition_categories_changelog", "set_program_registry_condition_categories_updated_at", "set_program_registry_condition_categories_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"program_registry_condition_categories\"", "created_at": 1782423654.1276143, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__program_registry_condition_categories"]}, "source.tamanu_source_dbt.tamanu.reference_data": {"database": "app", "schema": "public", "name": "reference_data", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_data.yml", "original_file_path": "models\\sources\\reference_data.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_data", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_data"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "User imported reference data for the environment grouped by type.\r\n\r\n- Catch-all for simple reference data types - there are a LOT of kinds of reference data that exist as just an ID, a \r\nstring label, and occasionally a code; these are all grouped into this table to avoid overcomplicating the schema.\r\n- Occasionally a type of simple reference data will gain some complexity, at which point it will be refactored/migrated \r\nout to use its own table.\r\n- Simple reference data types include a code, type, name and visibility status.\r\n- Example types include `diagnosis`, `procedures`", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_data.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Code of the data item (short value, alphanumerics and hyphens).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__code"]}, "type": {"name": "type", "description": "Class of the data (referred to in code).\r\n\r\nWhenever this table is referred to in a relationship, it's to a specific `type` here. For example a\r\ntable might have a `diagnosis_id`, which is a reference to this table, for specifically only the\r\nrows with `type = diagnosis`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__type"]}, "name": {"name": "name", "description": "Actual data", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__name"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in reference_data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_data.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "system_required": {"name": "system_required", "description": "Indicates if this record is system-managed and cannot be modified by users", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data__system_required"]}}, "meta": {"triggers": ["notify_reference_data_changed", "record_reference_data_changelog", "set_reference_data_updated_at", "set_reference_data_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_data_changed", "record_reference_data_changelog", "set_reference_data_updated_at", "set_reference_data_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_reference_data_changed", "record_reference_data_changelog", "set_reference_data_updated_at", "set_reference_data_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_data\"", "created_at": 1782423654.1276143, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_data"]}, "source.tamanu_source_dbt.tamanu.reference_data_relations": {"database": "app", "schema": "public", "name": "reference_data_relations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_data_relations.yml", "original_file_path": "models\\sources\\reference_data_relations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_data_relations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_data_relations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_data_relations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Entity hierarchy for reference data.\r\n\r\nSome reference datas can be organised in a hierarchy. This is how that's done.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_data_relations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_data_relations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_data_relations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_data_relations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "reference_data_id": {"name": "reference_data_id", "description": "The [reference data](#!/source/source.tamanu.tamanu.reference_data) item.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data_relations__reference_data_id"]}, "reference_data_parent_id": {"name": "reference_data_parent_id", "description": "Another [reference data](#!/source/source.tamanu.tamanu.reference_data) item which is the parent of this one.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data_relations__reference_data_parent_id"]}, "type": {"name": "type", "description": "The type of hierarchy being described.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_data_relations__type"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_data_relations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_reference_data_relations_changed", "record_reference_data_relations_changelog", "set_reference_data_relations_updated_at", "set_reference_data_relations_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_data_relations_changed", "record_reference_data_relations_changelog", "set_reference_data_relations_updated_at", "set_reference_data_relations_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_reference_data_relations_changed", "record_reference_data_relations_changelog", "set_reference_data_relations_updated_at", "set_reference_data_relations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_data_relations\"", "created_at": 1782423654.1434772, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_data_relations"]}, "source.tamanu_source_dbt.tamanu.reference_drugs": {"database": "app", "schema": "public", "name": "reference_drugs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_drugs.yml", "original_file_path": "models\\sources\\reference_drugs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_drugs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_drugs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_drugs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Additional information about referenceData that is of the type \u201cdrug\u201d", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_drugs.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "reference_data_id": {"name": "reference_data_id", "description": "Id of the associated reference data", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__reference_data_id"]}, "route": {"name": "route", "description": "Route of the drug", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__route"]}, "units": {"name": "units", "description": "Units of the drug", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__units"]}, "notes": {"name": "notes", "description": "Notes of the drug", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__notes"]}, "is_sensitive": {"name": "is_sensitive", "description": "Whether the drug is sensitive and requires special handling", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drugs__is_sensitive"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_drugs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_drugs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_drugs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_drugs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_reference_drugs_changed", "record_reference_drugs_changelog", "set_reference_drugs_updated_at", "set_reference_drugs_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_drugs_changed", "record_reference_drugs_changelog", "set_reference_drugs_updated_at", "set_reference_drugs_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_reference_drugs_changed", "record_reference_drugs_changelog", "set_reference_drugs_updated_at", "set_reference_drugs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_drugs\"", "created_at": 1782423654.1434772, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_drugs"]}, "source.tamanu_source_dbt.tamanu.reference_drug_facilities": {"database": "app", "schema": "public", "name": "reference_drug_facilities", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_drug_facilities.yml", "original_file_path": "models\\sources\\reference_drug_facilities.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_drug_facilities", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_drug_facilities"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_drug_facilities", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Tracks the availability status of drugs at specific facilities.\r\n\r\n- Links reference drugs to facilities with their availability status\r\n- Allows facilities to manage which drugs are available, unavailable, or have limited stock\r\n- Used for medication dispensing workflows to determine drug availability at a facility", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_drug_facilities.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "reference_drug_id": {"name": "reference_drug_id", "description": "Foreign key reference to the associated drug in the reference_drugs table", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drug_facilities__reference_drug_id"]}, "facility_id": {"name": "facility_id", "description": "Foreign key reference to the facility where this drug availability applies", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drug_facilities__facility_id"]}, "quantity": {"name": "quantity", "description": "The numeric quantity of the drug available at this facility. Stored as an INTEGER:\r\n- Positive integer: Number of units available (e.g., 10, 50, 100)\r\n- 0: Drug is out of stock\r\n- NULL: Quantity is not tracked or unknown (used when stock_status is 'unknown' or 'unavailable')", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drug_facilities__quantity"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_drug_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_drug_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_drug_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_drug_facilities.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "stock_status": {"name": "stock_status", "description": "Indicates the stock availability status of the drug at this facility. Stored as a STRING with the following valid values:\r\n- 'in_stock': Drug is available (quantity > 0)\r\n- 'out_of_stock': Drug is not available but tracked (quantity = 0)\r\n- 'unavailable': Drug is not available at this facility (quantity IS NULL)\r\n- 'unknown': Stock status is unknown or not tracked (quantity IS NULL)\r\n\r\nThis column is stored separately from quantity and is enforced by database constraints to maintain consistency:\r\n- 'in_stock' requires quantity > 0\r\n- 'out_of_stock' requires quantity = 0\r\n- 'unknown' or 'unavailable' require quantity IS NULL", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_drug_facilities__stock_status"]}}, "meta": {"triggers": ["notify_reference_drug_facilities_changed", "record_reference_drug_facilities_changelog", "set_reference_drug_facilities_updated_at", "set_reference_drug_facilities_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_drug_facilities_changed", "record_reference_drug_facilities_changelog", "set_reference_drug_facilities_updated_at", "set_reference_drug_facilities_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_reference_drug_facilities_changed", "record_reference_drug_facilities_changelog", "set_reference_drug_facilities_updated_at", "set_reference_drug_facilities_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_drug_facilities\"", "created_at": 1782423654.1434772, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_drug_facilities"]}, "source.tamanu_source_dbt.tamanu.reference_medication_templates": {"database": "app", "schema": "public", "name": "reference_medication_templates", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\reference_medication_templates.yml", "original_file_path": "models\\sources\\reference_medication_templates.yml", "unique_id": "source.tamanu_source_dbt.tamanu.reference_medication_templates", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "reference_medication_templates"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "reference_medication_templates", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Stores templates for medications, allowing for pre-defined medication orders.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in reference_medication_templates.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "reference_data_id": {"name": "reference_data_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) for this medication template.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__reference_data_id"]}, "medication_id": {"name": "medication_id", "description": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) for the specific drug in this template.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__medication_id"]}, "is_variable_dose": {"name": "is_variable_dose", "description": "Boolean indicating if the medication is to be administered \"pro re nata\" (as needed).", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__is_variable_dose"]}, "is_prn": {"name": "is_prn", "description": "Boolean indicating if the medication dose is variable.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__is_prn"]}, "dose_amount": {"name": "dose_amount", "description": "The amount of medication per dose.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__dose_amount"]}, "units": {"name": "units", "description": "The unit for the dose amount (e.g., mg, mL).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__units"]}, "frequency": {"name": "frequency", "description": "How often the medication should be administered (e.g., BID, TID, QID).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__frequency"]}, "route": {"name": "route", "description": "The route of administration for the medication (e.g., Oral, IV, IM).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__route"]}, "duration_value": {"name": "duration_value", "description": "The numeric value for the duration the medication should be taken (e.g., 7, 14).", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__duration_value"]}, "duration_unit": {"name": "duration_unit", "description": "The unit for the medication duration (e.g., days, weeks, months).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__duration_unit"]}, "notes": {"name": "notes", "description": "Additional notes or instructions for the medication template.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__notes"]}, "discharge_quantity": {"name": "discharge_quantity", "description": "The quantity of medication to be dispensed upon patient discharge.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__discharge_quantity"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in reference_medication_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in reference_medication_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in reference_medication_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in reference_medication_templates.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "is_ongoing": {"name": "is_ongoing", "description": "A boolean indicating if the medication is ongoing", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.reference_medication_templates__is_ongoing"]}}, "meta": {"triggers": ["notify_reference_medication_templates_changed", "record_reference_medication_templates_changelog", "set_reference_medication_templates_updated_at", "set_reference_medication_templates_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_reference_medication_templates_changed", "record_reference_medication_templates_changelog", "set_reference_medication_templates_updated_at", "set_reference_medication_templates_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_reference_medication_templates_changed", "record_reference_medication_templates_changelog", "set_reference_medication_templates_updated_at", "set_reference_medication_templates_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"reference_medication_templates\"", "created_at": 1782423654.15925, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__reference_medication_templates"]}, "source.tamanu_source_dbt.tamanu.referrals": {"database": "app", "schema": "public", "name": "referrals", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\referrals.yml", "original_file_path": "models\\sources\\referrals.yml", "unique_id": "source.tamanu_source_dbt.tamanu.referrals", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "referrals"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "referrals", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "[Referrals](https://en.wikipedia.org/wiki/Referral_(medicine)).\r\n\r\nReferrals use a confusing mix of data in the `referrals` table and\r\n[`survey_response_answers`](#!/source/source.tamanu.tamanu.survey_response_answers) identified by\r\nthe text of the question they are for. \r\n\r\nSome additional data is captured in\r\n[survey response answers](#!/source/source.tamanu.tamanu.survey_response_answers), but this is\r\nvariable and not enforced through any validation:\r\n- Where the person is being referred to can be captured by a range of questions, sometimes with a\r\n list of hard coded facility name options, or location groups, or departments.\r\n- Who the referral is \"completed by\" can be captured by a question either the name\r\n 'Referring doctor' or 'Referral completed by'.\r\n- Some referrals are the product of a previous screening survey. In some cases (e.g. Samoa) there is\r\n a SurveyLink question that captures which survey led to this referral, in others (e.g. Nauru)\r\n there is no such question so the two survey responses cannot be reliably linked.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in referrals.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in referrals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in referrals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in referrals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "referred_facility": {"name": "referred_facility", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__referred_facility"]}, "initiating_encounter_id": {"name": "initiating_encounter_id", "description": "Reference to the [initiating encounter](#!/source/source.tamanu.tamanu.encounters).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__initiating_encounter_id"]}, "completing_encounter_id": {"name": "completing_encounter_id", "description": "Unused.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__completing_encounter_id"]}, "survey_response_id": {"name": "survey_response_id", "description": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) with more data.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__survey_response_id"]}, "status": {"name": "status", "description": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.referrals__status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in referrals.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_referrals_changed", "record_referrals_changelog", "set_referrals_updated_at", "set_referrals_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_referrals_changed", "record_referrals_changelog", "set_referrals_updated_at", "set_referrals_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_referrals_changed", "record_referrals_changelog", "set_referrals_updated_at", "set_referrals_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"referrals\"", "created_at": 1782423654.1753094, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__referrals"]}, "source.tamanu_source_dbt.tamanu.refresh_tokens": {"database": "app", "schema": "public", "name": "refresh_tokens", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\refresh_tokens.yml", "original_file_path": "models\\sources\\refresh_tokens.yml", "unique_id": "source.tamanu_source_dbt.tamanu.refresh_tokens", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "refresh_tokens"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "refresh_tokens", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Refresh tokens are used by API clients to refresh their authentication quickly, within a timeout.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in refresh_tokens.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "refresh_id": {"name": "refresh_id", "description": "Random value given to the client to use as this refresh token.", "meta": {"masking": "string"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__refresh_id"]}, "device_id": {"name": "device_id", "description": "Unique device ID from the client.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__device_id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) being authenticated as.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__user_id"]}, "expires_at": {"name": "expires_at", "description": "When the refresh token expires.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.refresh_tokens__expires_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in refresh_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in refresh_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in refresh_tokens.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"refresh_tokens\"", "created_at": 1782423654.1911376, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__refresh_tokens"]}, "source.tamanu_source_dbt.tamanu.report_definitions": {"database": "app", "schema": "public", "name": "report_definitions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\report_definitions.yml", "original_file_path": "models\\sources\\report_definitions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.report_definitions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "report_definitions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "report_definitions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A name for a report.\r\n\r\nThis is what you see when selecting a report to generate in Tamanu.\r\n\r\nThe actual data is in [versions](#!/source/source.tamanu.tamanu.report_definition_versions).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in report_definitions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in report_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in report_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in report_definitions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Human-friendly name of the report.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definitions__name"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in report_definitions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "db_schema": {"name": "db_schema", "description": "The name of the database schema (namespace) which is queried.\r\n\r\nDefaults to `reporting`, which are standardised and normalised views designed specifically for\r\nreporting; sometimes this is set to `public` to query the raw database directly.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definitions__db_schema"]}}, "meta": {"triggers": ["notify_report_definitions_changed", "record_report_definitions_changelog", "set_report_definitions_updated_at", "set_report_definitions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_report_definitions_changed", "record_report_definitions_changelog", "set_report_definitions_updated_at", "set_report_definitions_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_report_definitions_changed", "record_report_definitions_changelog", "set_report_definitions_updated_at", "set_report_definitions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"report_definitions\"", "created_at": 1782423654.1911376, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__report_definitions"]}, "source.tamanu_source_dbt.tamanu.report_definition_versions": {"database": "app", "schema": "public", "name": "report_definition_versions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\report_definition_versions.yml", "original_file_path": "models\\sources\\report_definition_versions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.report_definition_versions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "report_definition_versions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "report_definition_versions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A report definition containing the actual executable SQL query.\r\n\r\nReport versions are immutable and changes to a report create a new version.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in report_definition_versions.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in report_definition_versions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in report_definition_versions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in report_definition_versions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "version_number": {"name": "version_number", "description": "The version number.\r\n\r\nVersion numbers are incrementing integers i.e 1,2,3,4.\r\n\r\nThe active version is determined by the highest `status = 'published'` version number", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__version_number"]}, "notes": {"name": "notes", "description": "Free-form description or usage notes.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__notes"]}, "status": {"name": "status", "description": "Status of this version of the report.\r\n\r\nOne of:\r\n- `draft`\r\n- `published`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__status"]}, "query": {"name": "query", "description": "The SQL query.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__query"]}, "query_options": {"name": "query_options", "description": "JSON config containing additional options for the query.\r\n\r\n- Form fields to allow customisation of the query when generating reports (query replacements)\r\n- Default date range e.g. last 30 days\r\n- Context for executing query e.g. this facility or all facilities (facility or central server)", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__query_options"]}, "report_definition_id": {"name": "report_definition_id", "description": "The [report definition](#!/source/source.tamanu.tamanu.report_definitions).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__report_definition_id"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who saved this report version.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_definition_versions__user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in report_definition_versions.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_report_definition_versions_changed", "record_report_definition_versions_changelog", "set_report_definition_versions_updated_at", "set_report_definition_versions_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_report_definition_versions_changed", "record_report_definition_versions_changelog", "set_report_definition_versions_updated_at", "set_report_definition_versions_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_report_definition_versions_changed", "record_report_definition_versions_changelog", "set_report_definition_versions_updated_at", "set_report_definition_versions_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"report_definition_versions\"", "created_at": 1782423654.2067974, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__report_definition_versions"]}, "source.tamanu_source_dbt.tamanu.report_requests": {"database": "app", "schema": "public", "name": "report_requests", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\report_requests.yml", "original_file_path": "models\\sources\\report_requests.yml", "unique_id": "source.tamanu_source_dbt.tamanu.report_requests", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "report_requests"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "report_requests", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Queued requests for reports by users.\r\n\r\nReports can be generated on-demand on the server a user is connected to, or it can be queued and\r\nexecuted at the server's leisure, and then sent attached to an email.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in report_requests.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in report_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in report_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in report_requests.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "report_type": {"name": "report_type", "description": "If the report is defined in code, this is the code of that report.\r\n\r\nMost reports are now created in SQL, but there are still a number of legacy reports that are\r\nhardcoded in the Tamanu source code, and this is how they're referenced.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__report_type"]}, "recipients": {"name": "recipients", "description": "JSON array of email addresses.\r\n\r\nSome legacy data may exist that specifies this as a comma-separated values.", "meta": {"masking": "email"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__recipients"]}, "parameters": {"name": "parameters", "description": "JSON parameters for the report.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__parameters"]}, "status": {"name": "status", "description": "Processing status of the report request.\r\n\r\nOne of:\r\n- `Received`\r\n- `Processing`\r\n- `Processed`\r\n- `Error`", "meta": {}, "data_type": "character varying(31)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__status"]}, "requested_by_user_id": {"name": "requested_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) requesting this report generation.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__requested_by_user_id"]}, "error": {"name": "error", "description": "If the report fails to process, the error.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__error"]}, "process_started_time": {"name": "process_started_time", "description": "When processing started.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__process_started_time"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this report request is from.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__facility_id"]}, "export_format": {"name": "export_format", "description": "The format the report results must be exported as.\r\n\r\nOne of:\r\n- `xlsx`\r\n- `csv`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__export_format"]}, "report_definition_version_id": {"name": "report_definition_version_id", "description": "The [report version](#!/source/source.tamanu.tamanu.report_definition_versions) being generated.\r\n\r\nNote that this is a version, not a report. If a report is updated after a request is queued, the\r\n\"old\" version will be executed. Additionally, new versions must be synced to facilities to be usable.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.report_requests__report_definition_version_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in report_requests.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_report_requests_changed", "record_report_requests_changelog", "set_report_requests_updated_at", "set_report_requests_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_report_requests_changed", "record_report_requests_changelog", "set_report_requests_updated_at", "set_report_requests_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["notify_report_requests_changed", "record_report_requests_changelog", "set_report_requests_updated_at", "set_report_requests_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"report_requests\"", "created_at": 1782423654.2226448, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__report_requests"]}, "source.tamanu_source_dbt.tamanu.roles": {"database": "app", "schema": "public", "name": "roles", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\roles.yml", "original_file_path": "models\\sources\\roles.yml", "unique_id": "source.tamanu_source_dbt.tamanu.roles", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "roles"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "roles", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "These are sets of permissions that are given to users to determine what they can do in Tamanu.\r\n\r\nThe actual permissions are associated to the role in the\r\n[`permissions`](#!/source/source.tamanu.tamanu.permissions) table.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in roles.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in roles.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in roles.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in roles.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Readable name for the role.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.roles__name"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in roles.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_roles_changed", "record_roles_changelog", "set_roles_updated_at", "set_roles_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_roles_changed", "record_roles_changelog", "set_roles_updated_at", "set_roles_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_roles_changed", "record_roles_changelog", "set_roles_updated_at", "set_roles_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"roles\"", "created_at": 1782423654.2387738, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__roles"]}, "source.tamanu_source_dbt.tamanu.scheduled_vaccines": {"database": "app", "schema": "public", "name": "scheduled_vaccines", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\scheduled_vaccines.yml", "original_file_path": "models\\sources\\scheduled_vaccines.yml", "unique_id": "source.tamanu_source_dbt.tamanu.scheduled_vaccines", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "scheduled_vaccines"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "scheduled_vaccines", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A vaccine schedule listing all vaccines expected to be given to a child as part of a country wide Expanded Program of \r\nImmunisation can be incorporated into Tamanu to show each dose and due date on the front end of the system. \r\n\r\nFirst dose of a vaccine should use `weeks_from_birth_due` whilst subsequent doses should use \r\n`weeks_from_last_vaccination_due`.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in scheduled_vaccines.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in scheduled_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in scheduled_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in scheduled_vaccines.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "category": {"name": "category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__category"]}, "label": {"name": "label", "description": "Contents of the label column is what will be displayed on the front end of Tamanu \r\nunder fields labelled 'Vaccine'. This is where the vaccine name is listed. E.g. 'BCG'.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__label"]}, "dose_label": {"name": "dose_label", "description": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__dose_label"]}, "weeks_from_birth_due": {"name": "weeks_from_birth_due", "description": "This column is used to tell Tamanu how many weeks from the child's date of birth a vaccine is due. This will populate \r\nthe front end within the Vaccine schedule section in the column 'Due date'. For a vaccine to appear in the Vaccine \r\nschedule a dose must have a `weeksFromBirthDue` entered into the reference data. \r\n\r\nThis field should be used only for the first dose of the vaccine. Subsequent doses should use \r\n`weeks_from_last_vaccination_due`", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_birth_due"]}, "index": {"name": "index", "description": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__index"]}, "vaccine_id": {"name": "vaccine_id", "description": "Use the vaccineId column to link the id column of the Reference Data sheet Drug to the vaccine schedule. Copy the exact \r\nid from the id column in the reference data sheet Drug and paste it in the vaccineId column in the Scheduled Vaccine \r\nsheet.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__vaccine_id"]}, "weeks_from_last_vaccination_due": {"name": "weeks_from_last_vaccination_due", "description": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given. The order of a vaccine dose is defined at the `index` field. \r\n\r\nThis field should not be used for the first dose but for subsequent doses. First dose should use `weeks_from_birth_due`", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_last_vaccination_due"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in scheduled_vaccines.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in scheduled_vaccines.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "hide_from_certificate": {"name": "hide_from_certificate", "description": "Vaccines can be hidden from the vaccine certificate where required\r\n\r\nTo hide a vaccine from appearing on the vaccine certificate across the deployment, use column hideFromCertificate\r\n- true = vaccine will not appear on the vaccine certificate\r\n- blank / false = vaccine will appear on the vaccine certificate", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__hide_from_certificate"]}, "sort_index": {"name": "sort_index", "description": "Sort index defaults to 0", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.scheduled_vaccines__sort_index"]}}, "meta": {"triggers": ["notify_scheduled_vaccines_changed", "record_scheduled_vaccines_changelog", "set_scheduled_vaccines_updated_at", "set_scheduled_vaccines_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_scheduled_vaccines_changed", "record_scheduled_vaccines_changelog", "set_scheduled_vaccines_updated_at", "set_scheduled_vaccines_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_scheduled_vaccines_changed", "record_scheduled_vaccines_changelog", "set_scheduled_vaccines_updated_at", "set_scheduled_vaccines_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"scheduled_vaccines\"", "created_at": 1782423654.2425554, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__scheduled_vaccines"]}, "source.tamanu_source_dbt.tamanu.SequelizeMeta": {"database": "app", "schema": "public", "name": "SequelizeMeta", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\SequelizeMeta.yml", "original_file_path": "models\\sources\\SequelizeMeta.yml", "unique_id": "source.tamanu_source_dbt.tamanu.SequelizeMeta", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "SequelizeMeta"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "SequelizeMeta", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "This table tracks which migrations have been run. It is automatically managed by Sequelize (within Tamanu's `migrate`\r\nsubcommand), should never be edited manually", "columns": {"name": {"name": "name", "description": "Name of the migration", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.SequelizeMeta__name"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"SequelizeMeta\"", "created_at": 1782423654.254678, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__SequelizeMeta"]}, "source.tamanu_source_dbt.tamanu.settings": {"database": "app", "schema": "public", "name": "settings", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\settings.yml", "original_file_path": "models\\sources\\settings.yml", "unique_id": "source.tamanu_source_dbt.tamanu.settings", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "settings"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "settings", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Shared and synced configuration values.\r\n\r\nAlways set from the Central server / Admin interfaces and then synced to facilities.\r\n\r\nThose can change dynamically when a server/client is up, some settings are read at point of use and\r\nso change is applied \"immediately\", some settings are read once at server start but those should be\r\nrare and eventually eliminated as there's no facility within Tamanu to restart its own servers.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in settings.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in settings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in settings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in settings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "key": {"name": "key", "description": "Dotted JSON path.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.settings__key"]}, "value": {"name": "value", "description": "JSON value.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.settings__value"]}, "facility_id": {"name": "facility_id", "description": "The [facility](#!/source/source.tamanu.tamanu.facilities) this setting is scoped to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.settings__facility_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in settings.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "scope": {"name": "scope", "description": "Scope of the setting, which determines how it's applied.\r\n\r\nOne of:\r\n- `global`\r\n- `central`\r\n- `facility`", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.settings__scope"]}}, "meta": {"triggers": ["notify_settings_changed", "record_settings_changelog", "set_settings_updated_at", "set_settings_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_settings_changed", "record_settings_changelog", "set_settings_updated_at", "set_settings_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["notify_settings_changed", "record_settings_changelog", "set_settings_updated_at", "set_settings_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"settings\"", "created_at": 1782423654.254678, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__settings"]}, "source.tamanu_source_dbt.tamanu.signers": {"database": "app", "schema": "public", "name": "signers", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\signers.yml", "original_file_path": "models\\sources\\signers.yml", "unique_id": "source.tamanu_source_dbt.tamanu.signers", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "signers"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "signers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table of signing key and certificates for EUDCC and ICAO VDS certifications.\r\n\r\nIntroduced during the COVID-19 pandemic, these are standards which can be\r\nused to produce a QR code containing vaccine information and a digital signature\r\nwhich certifies that the vaccines were administered by a competent authority.\r\n\r\nDigital signatures are issued using a key which is rotated every three months,\r\nand which is itself signed by a Certificate Authority. A country's CA is trusted\r\nby verifying authorities such as the ICAO or EU. This completes the trust chain.\r\n\r\nTamanu generates keys and Certificate Signing Requests in this table. The secret\r\nkey material never leaves the server which generates it. CSRs are signed by the\r\ncountry Health CA, which then returns a Certificate, which is loaded in Tamanu.\r\n\r\nThere are two sets of dates associated with each Signing Key:\r\n- the validity period propagates to the Digital Signatures on the QR codes; and\r\n is generally set to 10 years.\r\n- the working period defines when the Signing Key is rotated.\r\n\r\nWhen a key is rotated, the secret material may be erased to ensure the key can\r\nnever be used again; the public information is kept forever.\r\n\r\nThere is always at most one row in this table which has a NULL `certificate`\r\nfield; this is the pending CSR.\r\n\r\nThe Signing Key in use is the row which has a NON-NULL `certificate`, a validity\r\nand working period encompassing the current time, a NON-NULL `private_key`, and\r\nis the newest within that set.\r\n\r\nSee also the `certifiable_vaccines` table.\r\n\r\nThis table is present on Facility Servers, but never populated.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in signers.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in signers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in signers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in signers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "country_code": {"name": "country_code", "description": "ISO country code for the Health CA.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__country_code"]}, "private_key": {"name": "private_key", "description": "Private key data.\r\n\r\nThis is stored encrypted at rest, using the configuration key `integrations.signer.keySecret`.", "meta": {"masking": "zero"}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {"masking": "zero"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__private_key"]}, "public_key": {"name": "public_key", "description": "Public key data.", "meta": {"masking": "zero"}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {"masking": "zero"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__public_key"]}, "request": {"name": "request", "description": "Certificate Signing Request.", "meta": {"masking": "empty"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__request"]}, "certificate": {"name": "certificate", "description": "Signed Certificate (signed by the Health CA).", "meta": {"masking": "empty"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__certificate"]}, "validity_period_start": {"name": "validity_period_start", "description": "Before that date, the key cannot be used, and signatures generated by it cannot be trusted.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__validity_period_start"]}, "validity_period_end": {"name": "validity_period_end", "description": "After that date, the key cannot be used, and signatures generated by it cannot be trusted.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__validity_period_end"]}, "signatures_issued": {"name": "signatures_issued", "description": "Counter of digital signatures issued from this key.\r\n\r\nThis can be used for statistical purposes or for usage policy. For example, one\r\ncould specify that kyes should be rotated every three months or every 1000\r\nsignatures, whichever comes first.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__signatures_issued"]}, "request_sent_at": {"name": "request_sent_at", "description": "Date at which the CSR was sent to be signed by the Health CA.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__request_sent_at"]}, "working_period_start": {"name": "working_period_start", "description": "Before that date, the key cannot be used.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__working_period_start"]}, "working_period_end": {"name": "working_period_end", "description": "After that date, the key cannot be used.\r\n\r\nAfter that date, the private key may also be nulled.\r\n\r\nThis is always less than or equal to `validity_period_end`.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.signers__working_period_end"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"signers\"", "created_at": 1782423654.270619, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__signers"]}, "source.tamanu_source_dbt.tamanu.socket_io_attachments": {"database": "app", "schema": "public", "name": "socket_io_attachments", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\socket_io_attachments.yml", "original_file_path": "models\\sources\\socket_io_attachments.yml", "unique_id": "source.tamanu_source_dbt.tamanu.socket_io_attachments", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "socket_io_attachments"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "socket_io_attachments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table used by Socket.IO to synchronise WebSocket sessions across server replicas.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in socket_io_attachments.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in socket_io_attachments.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "payload": {"name": "payload", "description": "Payload.", "meta": {}, "data_type": "bytea", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.socket_io_attachments__payload"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in socket_io_attachments.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"masking": "truncate", "triggers": ["notify_socket_io_attachments_changed", "record_socket_io_attachments_changelog", "set_socket_io_attachments_updated_at", "set_socket_io_attachments_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"masking": "truncate", "triggers": ["notify_socket_io_attachments_changed", "record_socket_io_attachments_changelog", "set_socket_io_attachments_updated_at", "set_socket_io_attachments_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"masking": "truncate", "triggers": ["notify_socket_io_attachments_changed", "record_socket_io_attachments_changelog", "set_socket_io_attachments_updated_at", "set_socket_io_attachments_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"socket_io_attachments\"", "created_at": 1782423654.270619, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__socket_io_attachments"]}, "source.tamanu_source_dbt.tamanu.surveys": {"database": "app", "schema": "public", "name": "surveys", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\surveys.yml", "original_file_path": "models\\sources\\surveys.yml", "unique_id": "source.tamanu_source_dbt.tamanu.surveys", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "surveys"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "surveys", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Surveys, aka custom forms that can be filled by practitioners.\r\n\r\nThese are composed of [screen components](#!/source/source.tamanu.tamanu.survey_screen_components).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in surveys.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in surveys.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "code": {"name": "code", "description": "Machine-friendly code.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__code"]}, "name": {"name": "name", "description": "Human-friendly name.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__name"]}, "program_id": {"name": "program_id", "description": "The [program](#!/source/source.tamanu.tamanu.programs) grouping this survey.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__program_id"]}, "survey_type": {"name": "survey_type", "description": "Type of survey.\r\n\r\nOne of:\r\n- `programs`\r\n- `referral`\r\n- `obsolete`\r\n- `vitals`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__survey_type"]}, "is_sensitive": {"name": "is_sensitive", "description": "Whether the data recorded in the survey is sensitive.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__is_sensitive"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in surveys.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "notifiable": {"name": "notifiable", "description": "Whether filling this survey sends a notification email.\r\n\r\nThese are sent by the `SurveyCompletionNotifierProcessor` scheduled task.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__notifiable"]}, "notify_email_addresses": {"name": "notify_email_addresses", "description": "If `notifiable` is true, where to send the notification.", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.surveys__notify_email_addresses"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in surveys.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_surveys_changed", "record_surveys_changelog", "set_surveys_updated_at", "set_surveys_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_surveys_changed", "record_surveys_changelog", "set_surveys_updated_at", "set_surveys_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_surveys_changed", "record_surveys_changelog", "set_surveys_updated_at", "set_surveys_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"surveys\"", "created_at": 1782423654.2864869, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__surveys"]}, "source.tamanu_source_dbt.tamanu.survey_responses": {"database": "app", "schema": "public", "name": "survey_responses", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\survey_responses.yml", "original_file_path": "models\\sources\\survey_responses.yml", "unique_id": "source.tamanu_source_dbt.tamanu.survey_responses", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "survey_responses"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "survey_responses", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A response to a survey (as recorded by a practitioner).\r\n\r\nTypically surveys are filled on behalf of patients as part of an encounter.\r\n\r\nBecause there are multiple distinct kinds of dates at play here:\r\n- `created_at`, `updated_at`, `deleted_at` are system data for syncing and cannot be relied on for realtime\r\n- `start_time`, `end_time` are real datetimes automatically recorded when starting and submitting a survey response\r\n- in survey response answers, there could be a data element for targeting the date of when exactly the data is recorded in real time.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_responses.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in survey_responses.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "start_time": {"name": "start_time", "description": "When the survey was started.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__start_time"]}, "end_time": {"name": "end_time", "description": "When the survey was completed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__end_time"]}, "result": {"name": "result", "description": "The numeric value that is the summary of the survey response.", "meta": {}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__result"]}, "survey_id": {"name": "survey_id", "description": "The [survey](#!/source/source.tamanu.tamanu.surveys) being responded to.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__survey_id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this survey response is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__encounter_id"]}, "result_text": {"name": "result_text", "description": "The textual value that is the summary of the survey response.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__result_text"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) recording this survey response.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__user_id"]}, "start_time_legacy": {"name": "start_time_legacy", "description": "[Deprecated] When the survey was started.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__start_time_legacy"]}, "end_time_legacy": {"name": "end_time_legacy", "description": "[Deprecated] When the survey was completed.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__end_time_legacy"]}, "notified": {"name": "notified", "description": "If the [survey](#!/source/source.tamanu.tamanu.surveys) is `notifiable`, whether this response's\r\nnotification has been sent.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__notified"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in survey_responses.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "metadata": {"name": "metadata", "description": "Metadata for a survey response, (eg: if a survey response is linked to another survey response)", "meta": {"masking": "empty"}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {"masking": "empty"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_responses__metadata"]}}, "meta": {"triggers": ["notify_survey_responses_changed", "record_survey_responses_changelog", "set_survey_responses_updated_at", "set_survey_responses_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_survey_responses_changed", "record_survey_responses_changelog", "set_survey_responses_updated_at", "set_survey_responses_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_survey_responses_changed", "record_survey_responses_changelog", "set_survey_responses_updated_at", "set_survey_responses_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"survey_responses\"", "created_at": 1782423654.3025956, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_responses"]}, "source.tamanu_source_dbt.tamanu.survey_response_answers": {"database": "app", "schema": "public", "name": "survey_response_answers", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\survey_response_answers.yml", "original_file_path": "models\\sources\\survey_response_answers.yml", "unique_id": "source.tamanu_source_dbt.tamanu.survey_response_answers", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "survey_response_answers"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "survey_response_answers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A single answer as part of a [survey response](#!/source/source.tamanu.tamanu.survey_responses).", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_response_answers.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in survey_response_answers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in survey_response_answers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in survey_response_answers.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "name": {"name": "name", "description": "Name of the question.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__name"]}, "body": {"name": "body", "description": "Value of the answer.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__body"]}, "response_id": {"name": "response_id", "description": "The [survey response](#!/source/source.tamanu.tamanu.survey_responses).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__response_id"]}, "data_element_id": {"name": "data_element_id", "description": "Reference to the [question](#!/source/source.tamanu.tamanu.program_data_elements).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__data_element_id"]}, "body_legacy": {"name": "body_legacy", "description": "[Deprecated] Value of the answer in old format.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_response_answers__body_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in survey_response_answers.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_survey_response_answers_changed", "record_survey_response_answers_changelog", "set_survey_response_answers_updated_at", "set_survey_response_answers_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_survey_response_answers_changed", "record_survey_response_answers_changelog", "set_survey_response_answers_updated_at", "set_survey_response_answers_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_survey_response_answers_changed", "record_survey_response_answers_changelog", "set_survey_response_answers_updated_at", "set_survey_response_answers_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"survey_response_answers\"", "created_at": 1782423654.3025956, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_response_answers"]}, "source.tamanu_source_dbt.tamanu.survey_screen_components": {"database": "app", "schema": "public", "name": "survey_screen_components", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\survey_screen_components.yml", "original_file_path": "models\\sources\\survey_screen_components.yml", "unique_id": "source.tamanu_source_dbt.tamanu.survey_screen_components", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "survey_screen_components"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "survey_screen_components", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Describes how a survey question gets displayed.\r\n\r\nSee [program data element](#!/source/source.tamanu.tamanu.program_data_elements), which describes\r\nhow the data from the question is stored.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in survey_screen_components.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in survey_screen_components.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in survey_screen_components.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in survey_screen_components.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "screen_index": {"name": "screen_index", "description": "Screen this component should appear on.\r\n\r\nSurveys can have multiple \"screens\" or pages, this index sets where this particular question sits.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__screen_index"]}, "component_index": {"name": "component_index", "description": "The absolute index (order) of the component in the survey.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__component_index"]}, "text": {"name": "text", "description": "Description or question of this component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__text"]}, "visibility_criteria": {"name": "visibility_criteria", "description": "JSON criteria that determines when this component is visible.\r\n\r\nA criteria is a list of other components' codes and the value that will make this question show up:\r\n\r\n```json\r\n{\r\n \"otherQuestion\": \"Yes\"\r\n}\r\n```\r\n\r\nThere can also be the special criterium `{\"hidden\": true}` which always hides the question, and the\r\nspecial key `\"_conjunction\": \"or\"` which makes it so _any one_ item in the list is sufficient to\r\nshow the question, instead of the default where _all_ items must match.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__visibility_criteria"]}, "validation_criteria": {"name": "validation_criteria", "description": "JSON criteria that determines whether the value entered in this component is accepted.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__validation_criteria"]}, "detail": {"name": "detail", "description": "Longer description or explanatory text of this component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__detail"]}, "config": {"name": "config", "description": "JSON additional config of the component.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__config"]}, "options": {"name": "options", "description": "JSON array of strings of options to be selected.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__options"]}, "calculation": {"name": "calculation", "description": "Math expression to do calculations on the entered value before it's saved.\r\n\r\nFor example `questionCode + 3`.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__calculation"]}, "survey_id": {"name": "survey_id", "description": "The [survey](#!/source/source.tamanu.tamanu.surveys).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__survey_id"]}, "data_element_id": {"name": "data_element_id", "description": "Reference to the [data element](#!/source/source.tamanu.tamanu.program_data_elements) configuring\r\nhow the data from the question is stored.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.survey_screen_components__data_element_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in survey_screen_components.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in survey_screen_components.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}}, "meta": {"triggers": ["notify_survey_screen_components_changed", "record_survey_screen_components_changelog", "set_survey_screen_components_updated_at", "set_survey_screen_components_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_survey_screen_components_changed", "record_survey_screen_components_changelog", "set_survey_screen_components_updated_at", "set_survey_screen_components_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_survey_screen_components_changed", "record_survey_screen_components_changelog", "set_survey_screen_components_updated_at", "set_survey_screen_components_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"survey_screen_components\"", "created_at": 1782423654.3186252, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__survey_screen_components"]}, "source.tamanu_source_dbt.tamanu.sync_device_ticks": {"database": "app", "schema": "public", "name": "sync_device_ticks", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_device_ticks.yml", "original_file_path": "models\\sources\\sync_device_ticks.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_device_ticks", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_device_ticks"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_device_ticks", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Cache of which syncing device is at which tick.\r\n\r\nThis is used internally as part of sync.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_device_ticks.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "persisted_at_sync_tick": {"name": "persisted_at_sync_tick", "description": "The sync tick.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_device_ticks__persisted_at_sync_tick"]}, "device_id": {"name": "device_id", "description": "The device that's at this sync tick.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_device_ticks__device_id"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_device_ticks\"", "created_at": 1782423654.3186252, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_device_ticks"]}, "source.tamanu_source_dbt.tamanu.sync_lookup": {"database": "app", "schema": "public", "name": "sync_lookup", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_lookup.yml", "original_file_path": "models\\sources\\sync_lookup.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_lookup", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_lookup"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_lookup", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Cache of records to use for sync.\r\n\r\nThis is used internally in the sync process.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_lookup.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "record_id": {"name": "record_id", "description": "The `id` field of the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__record_id"]}, "record_type": {"name": "record_type", "description": "The table name of the record.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__record_type"]}, "data": {"name": "data", "description": "All the fields of the record.", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__data"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in sync_lookup.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "patient_id": {"name": "patient_id", "description": "If the record has a [patient](#!/source/source.tamanu.tamanu.patients) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__patient_id"]}, "encounter_id": {"name": "encounter_id", "description": "If the record has an [encounter](#!/source/source.tamanu.tamanu.encounters) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__encounter_id"]}, "facility_id": {"name": "facility_id", "description": "If the record has a [facility](#!/source/source.tamanu.tamanu.facilitys) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__facility_id"]}, "is_lab_request": {"name": "is_lab_request", "description": "Whether the record is or is related to a lab request.\r\n\r\nThis is used to filter records efficiently during the sync process.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__is_lab_request"]}, "is_deleted": {"name": "is_deleted", "description": "Whether the record is deleted (`deleted_at` is not null).\r\n\r\nThis is used to sort and filter records efficiently during the sync process.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__is_deleted"]}, "updated_at_by_field_sum": {"name": "updated_at_by_field_sum", "description": "If the record has an `updatedAtByField`, the sum of those values.\r\n\r\nThis is used to sort and filter records efficiently during the sync process.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__updated_at_by_field_sum"]}, "pushed_by_device_id": {"name": "pushed_by_device_id", "description": "The unique device that pushed this record.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup__pushed_by_device_id"]}}, "meta": {"masking": "truncate", "triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"masking": "truncate", "triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"masking": "truncate", "triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_lookup\"", "created_at": 1782423654.3347328, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_lookup"]}, "source.tamanu_source_dbt.tamanu.sync_lookup_ticks": {"database": "app", "schema": "public", "name": "sync_lookup_ticks", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_lookup_ticks.yml", "original_file_path": "models\\sources\\sync_lookup_ticks.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_lookup_ticks", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_lookup_ticks"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_lookup_ticks", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Stores range of sync lookup ticks per sync.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_lookup_ticks.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "source_start_tick": {"name": "source_start_tick", "description": "Represents the previous lookup up to tick.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup_ticks__source_start_tick"]}, "lookup_end_tick": {"name": "lookup_end_tick", "description": "Represents the new sync tick at time of updating lookup-pending records.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_lookup_ticks__lookup_end_tick"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_lookup_ticks\"", "created_at": 1782423654.342576, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_lookup_ticks"]}, "source.tamanu_source_dbt.tamanu.sync_queued_devices": {"database": "app", "schema": "public", "name": "sync_queued_devices", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_queued_devices.yml", "original_file_path": "models\\sources\\sync_queued_devices.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_queued_devices", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_queued_devices"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_queued_devices", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Devices waiting their turn to be synced.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_queued_devices.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "last_seen_time": {"name": "last_seen_time", "description": "The last time the device has reached out to the syncing server.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__last_seen_time"]}, "facility_id_legacy": {"name": "facility_id_legacy", "description": "[Deprecated] Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this device is associated with.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__facility_id_legacy"]}, "last_synced_tick": {"name": "last_synced_tick", "description": "The sync tick the device is currently at.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__last_synced_tick"]}, "urgent": {"name": "urgent", "description": "A way for a device to bump its priority in the queue.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__urgent"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in sync_queued_devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in sync_queued_devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in sync_queued_devices.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "facility_ids": {"name": "facility_ids", "description": "Reference to the [facilities](#!/source/source.tamanu.tamanu.facilities) this device is associated with.", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_queued_devices__facility_ids"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_queued_devices\"", "created_at": 1782423654.342576, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_queued_devices"]}, "source.tamanu_source_dbt.tamanu.sync_sessions": {"database": "app", "schema": "public", "name": "sync_sessions", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\sync_sessions.yml", "original_file_path": "models\\sources\\sync_sessions.yml", "unique_id": "source.tamanu_source_dbt.tamanu.sync_sessions", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "sync_sessions"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "sync_sessions", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records of each user that can login to the site", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in sync_sessions.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in sync_sessions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in sync_sessions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in sync_sessions.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "start_time": {"name": "start_time", "description": "Timestamp when sync session started", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__start_time"]}, "last_connection_time": {"name": "last_connection_time", "description": "Timestamp when sync session made last connection", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__last_connection_time"]}, "snapshot_completed_at": {"name": "snapshot_completed_at", "description": "Timestamp when sync session snapshot was completed", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__snapshot_completed_at"]}, "debug_info": {"name": "debug_info", "description": "Debug information for the sync session", "meta": {}, "data_type": "json", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__debug_info"]}, "parameters": {"name": "parameters", "description": "Parameters for the sync session", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__parameters"]}, "completed_at": {"name": "completed_at", "description": "Timestamp when sync session was completed", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__completed_at"]}, "persist_completed_at": {"name": "persist_completed_at", "description": "Timestamp when sync session completion record is persisted", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__persist_completed_at"]}, "pull_since": {"name": "pull_since", "description": "Sync tick that the sync session pulled since", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__pull_since"]}, "pull_until": {"name": "pull_until", "description": "Sync tick that the sync session pulled until", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__pull_until"]}, "started_at_tick": {"name": "started_at_tick", "description": "Sync tick that the sync session started at", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__started_at_tick"]}, "snapshot_started_at": {"name": "snapshot_started_at", "description": "Timestamp the sync session snapshot started at", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__snapshot_started_at"]}, "errors": {"name": "errors", "description": "If a sync fails, the error(s).", "meta": {}, "data_type": "array", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.sync_sessions__errors"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"sync_sessions\"", "created_at": 1782423654.3506212, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__sync_sessions"]}, "source.tamanu_source_dbt.tamanu.tasks": {"database": "app", "schema": "public", "name": "tasks", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\tasks.yml", "original_file_path": "models\\sources\\tasks.yml", "unique_id": "source.tamanu_source_dbt.tamanu.tasks", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "tasks"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "tasks", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Tasks related to encounters", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in tasks.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this task is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__encounter_id"]}, "name": {"name": "name", "description": "Name of the task.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__name"]}, "due_time": {"name": "due_time", "description": "When the task is due.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__due_time"]}, "end_time": {"name": "end_time", "description": "When the repeating task is end.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__end_time"]}, "requested_by_user_id": {"name": "requested_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this task.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__requested_by_user_id"]}, "request_time": {"name": "request_time", "description": "When the task is requested.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__request_time"]}, "status": {"name": "status", "description": "Status of the task.\r\n\r\nOne of:\r\n- `todo`\r\n- `completed`\r\n- `non_completed`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__status"]}, "note": {"name": "note", "description": "Note of the task.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__note"]}, "frequency_value": {"name": "frequency_value", "description": "Frequency value of the task (if the task is repeating), must go with frequency unit.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__frequency_value"]}, "frequency_unit": {"name": "frequency_unit", "description": "Frequency unit of the task (if the task is repeating).\r\n\r\nOne of:\r\n- `minute`\r\n- `hour`\r\n- `day`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__frequency_unit"]}, "high_priority": {"name": "high_priority", "description": "Boolean specify if the task is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__high_priority"]}, "parent_task_id": {"name": "parent_task_id", "description": "Reference to the original [task](#!/source/source.tamanu.tamanu.tasks) that the task is repeated from if it is a repeating task.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__parent_task_id"]}, "completed_by_user_id": {"name": "completed_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as completed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__completed_by_user_id"]}, "completed_time": {"name": "completed_time", "description": "When the task is marked as completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__completed_time"]}, "completed_note": {"name": "completed_note", "description": "Completed note of the task.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__completed_note"]}, "not_completed_by_user_id": {"name": "not_completed_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as not completed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__not_completed_by_user_id"]}, "not_completed_time": {"name": "not_completed_time", "description": "When the task is marked as not completed.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__not_completed_time"]}, "not_completed_reason_id": {"name": "not_completed_reason_id", "description": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is not completed.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__not_completed_reason_id"]}, "todo_by_user_id": {"name": "todo_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as to-do.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__todo_by_user_id"]}, "todo_time": {"name": "todo_time", "description": "When the task is marked as to-do.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__todo_time"]}, "todo_note": {"name": "todo_note", "description": "To-do note of the task.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__todo_note"]}, "deleted_by_user_id": {"name": "deleted_by_user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who delete this task.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__deleted_by_user_id"]}, "deleted_time": {"name": "deleted_time", "description": "When the task is deleted.", "meta": {}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__deleted_time"]}, "deleted_reason_id": {"name": "deleted_reason_id", "description": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is deleted.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__deleted_reason_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in tasks.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in tasks.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in tasks.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "deleted_reason_for_sync_id": {"name": "deleted_reason_for_sync_id", "description": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is deleted if it is deleted by the system.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__deleted_reason_for_sync_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in tasks.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "duration_value": {"name": "duration_value", "description": "Numeric value specifying the expected duration of the task, must be used in conjunction with duration_unit.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__duration_value"]}, "duration_unit": {"name": "duration_unit", "description": "Unit of time for the task duration.\r\n\r\nOne of:\r\n- `hours`\r\n- `days`\r\n- `occurrences`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__duration_unit"]}, "task_type": {"name": "task_type", "description": "Type of the task.\r\n\r\nOne of:\r\n- `normal_task`\r\n- `medication_due_task`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.tasks__task_type"]}}, "meta": {"triggers": ["notify_tasks_changed", "record_tasks_changelog", "set_tasks_updated_at", "set_tasks_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_tasks_changed", "record_tasks_changelog", "set_tasks_updated_at", "set_tasks_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_tasks_changed", "record_tasks_changelog", "set_tasks_updated_at", "set_tasks_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"tasks\"", "created_at": 1782423654.3666897, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__tasks"]}, "source.tamanu_source_dbt.tamanu.task_designations": {"database": "app", "schema": "public", "name": "task_designations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\task_designations.yml", "original_file_path": "models\\sources\\task_designations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.task_designations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "task_designations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "task_designations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of designation to task.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in task_designations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "task_id": {"name": "task_id", "description": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_designations__task_id"]}, "designation_id": {"name": "designation_id", "description": "The task [task](#!/source/source.tamanu.tamanu.tasks)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_designations__designation_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in task_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in task_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in task_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in task_designations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_task_designations_changed", "record_task_designations_changelog", "set_task_designations_updated_at", "set_task_designations_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_task_designations_changed", "record_task_designations_changelog", "set_task_designations_updated_at", "set_task_designations_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_task_designations_changed", "record_task_designations_changelog", "set_task_designations_updated_at", "set_task_designations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"task_designations\"", "created_at": 1782423654.3666897, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__task_designations"]}, "source.tamanu_source_dbt.tamanu.task_templates": {"database": "app", "schema": "public", "name": "task_templates", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\task_templates.yml", "original_file_path": "models\\sources\\task_templates.yml", "unique_id": "source.tamanu_source_dbt.tamanu.task_templates", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "task_templates"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "task_templates", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Template of tasks which then can be created upon", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in task_templates.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "reference_data_id": {"name": "reference_data_id", "description": "The name of task template, referred to ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_templates__reference_data_id"]}, "high_priority": {"name": "high_priority", "description": "Boolean specify if the task template is high priority.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_templates__high_priority"]}, "frequency_value": {"name": "frequency_value", "description": "Frequency value of the task template (if the task is repeating), must go with frequency unit.", "meta": {}, "data_type": "numeric", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_templates__frequency_value"]}, "frequency_unit": {"name": "frequency_unit", "description": "Frequency unit of the task template (if the task is repeating).\r\n\r\nOne of:\r\n- `minute`\r\n- `hour`\r\n- `day`", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_templates__frequency_unit"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in task_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in task_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in task_templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in task_templates.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_task_templates_changed", "record_task_templates_changelog", "set_task_templates_updated_at", "set_task_templates_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_task_templates_changed", "record_task_templates_changelog", "set_task_templates_updated_at", "set_task_templates_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_task_templates_changed", "record_task_templates_changelog", "set_task_templates_updated_at", "set_task_templates_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"task_templates\"", "created_at": 1782423654.3666897, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__task_templates"]}, "source.tamanu_source_dbt.tamanu.task_template_designations": {"database": "app", "schema": "public", "name": "task_template_designations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\task_template_designations.yml", "original_file_path": "models\\sources\\task_template_designations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.task_template_designations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "task_template_designations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "task_template_designations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of designation to task template", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in task_template_designations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "task_template_id": {"name": "task_template_id", "description": "The task template ([Task Template](#!/source/source.tamanu.tamanu.task_templates)).", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_template_designations__task_template_id"]}, "designation_id": {"name": "designation_id", "description": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.task_template_designations__designation_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in task_template_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in task_template_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in task_template_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in task_template_designations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_task_template_designations_changed", "record_task_template_designations_changelog", "set_task_template_designations_updated_at", "set_task_template_designations_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_task_template_designations_changed", "record_task_template_designations_changelog", "set_task_template_designations_updated_at", "set_task_template_designations_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_task_template_designations_changed", "record_task_template_designations_changelog", "set_task_template_designations_updated_at", "set_task_template_designations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"task_template_designations\"", "created_at": 1782423654.3826401, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__task_template_designations"]}, "source.tamanu_source_dbt.tamanu.templates": {"database": "app", "schema": "public", "name": "templates", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\templates.yml", "original_file_path": "models\\sources\\templates.yml", "unique_id": "source.tamanu_source_dbt.tamanu.templates", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "templates"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "templates", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Templates used for patient letters and clinical notes etc.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in templates.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in templates.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "name": {"name": "name", "description": "Internal name of the template (used when importing).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__name"]}, "date_created": {"name": "date_created", "description": "When the template was created.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__date_created"]}, "title": {"name": "title", "description": "Title of the template (which will be rendered).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__title"]}, "body": {"name": "body", "description": "Body of the template (which will be rendered).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__body"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in templates.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "created_by_id": {"name": "created_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who created this template.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__created_by_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in templates.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "type": {"name": "type", "description": "Type of the template (referred to in code).", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.templates__type"]}}, "meta": {"triggers": ["notify_templates_changed", "record_templates_changelog", "set_templates_updated_at", "set_templates_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_templates_changed", "record_templates_changelog", "set_templates_updated_at", "set_templates_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_templates_changed", "record_templates_changelog", "set_templates_updated_at", "set_templates_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"templates\"", "created_at": 1782423654.3826401, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__templates"]}, "source.tamanu_source_dbt.tamanu.translated_strings": {"database": "app", "schema": "public", "name": "translated_strings", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\translated_strings.yml", "original_file_path": "models\\sources\\translated_strings.yml", "unique_id": "source.tamanu_source_dbt.tamanu.translated_strings", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "translated_strings"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "translated_strings", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Localisation and translation strings.\r\n\r\nThese are used for two distinct purposes:\r\n- to translate Tamanu in languages other than English\r\n- to adjust the wording of specific items in the UI", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in translated_strings.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "string_id": {"name": "string_id", "description": "The internal reference of the item being translated.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__string_id"]}, "language": {"name": "language", "description": "The language code.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__language"]}, "text": {"name": "text", "description": "The actual translated text.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.translated_strings__text"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in translated_strings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in translated_strings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in translated_strings.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in translated_strings.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_translated_strings_changed", "record_translated_strings_changelog", "set_translated_strings_updated_at", "set_translated_strings_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["reference"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_translated_strings_changed", "record_translated_strings_changelog", "set_translated_strings_updated_at", "set_translated_strings_updated_at_sync_tick"]}, "tags": ["reference"]}, "patch_path": null, "unrendered_config": {"tags": ["reference"], "meta": {"triggers": ["notify_translated_strings_changed", "record_translated_strings_changelog", "set_translated_strings_updated_at", "set_translated_strings_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"translated_strings\"", "created_at": 1782423654.398653, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__translated_strings"]}, "source.tamanu_source_dbt.tamanu.triages": {"database": "app", "schema": "public", "name": "triages", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\triages.yml", "original_file_path": "models\\sources\\triages.yml", "unique_id": "source.tamanu_source_dbt.tamanu.triages", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "triages"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "triages", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Triage data of patients waiting in an emergency department.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in triages.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in triages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in triages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in triages.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "arrival_time": {"name": "arrival_time", "description": "When the patient arrived.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time"]}, "triage_time": {"name": "triage_time", "description": "When the patient was triaged.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time"]}, "closed_time": {"name": "closed_time", "description": "When the patient was processed.", "meta": {"masking": "datetime"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time"]}, "score": {"name": "score", "description": "Classification done by the triage practitioner.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__score"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__encounter_id"]}, "practitioner_id": {"name": "practitioner_id", "description": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__practitioner_id"]}, "chief_complaint_id": {"name": "chief_complaint_id", "description": "Reference to the primary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__chief_complaint_id"]}, "secondary_complaint_id": {"name": "secondary_complaint_id", "description": "Reference to the secondary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__secondary_complaint_id"]}, "arrival_time_legacy": {"name": "arrival_time_legacy", "description": "[Deprecated] When the patient arrived.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_time_legacy"]}, "triage_time_legacy": {"name": "triage_time_legacy", "description": "[Deprecated] When the patient was triaged.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__triage_time_legacy"]}, "closed_time_legacy": {"name": "closed_time_legacy", "description": "[Deprecated] When the patient was processed.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__closed_time_legacy"]}, "arrival_mode_id": {"name": "arrival_mode_id", "description": "Reference to how the patient arrived ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = arrivalMode`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.triages__arrival_mode_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in triages.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_triages_changed", "record_triages_changelog", "set_triages_updated_at", "set_triages_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_triages_changed", "record_triages_changelog", "set_triages_updated_at", "set_triages_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_triages_changed", "record_triages_changelog", "set_triages_updated_at", "set_triages_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"triages\"", "created_at": 1782423654.4147348, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__triages"]}, "source.tamanu_source_dbt.tamanu.upcoming_vaccinations": {"database": "app", "schema": "public", "name": "upcoming_vaccinations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\upcoming_vaccinations.yml", "original_file_path": "models\\sources\\upcoming_vaccinations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.upcoming_vaccinations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "upcoming_vaccinations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "upcoming_vaccinations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A **view** which lists patients and next vaccine due for a given vaccine type.\r\n\r\nThe first dose of a vaccine type is based on weeks from birth due whilst subsequent doses are based on weeks from last \r\nvaccination due.\r\n\r\nAge limits in years and thresholds in days for scheduled status are configurable with the following defaults:\r\n\r\n- Age = 15\r\n- Status: Scheduled = 28\r\n- Status: Upcoming = 7\r\n- Status: Due = -7\r\n- Status: Overdue = -55\r\n- Status: Missed = -Infinity", "columns": {"patient_id": {"name": "patient_id", "description": "The [patient](#!/source/source.tamanu.tamanu.patients).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__patient_id"]}, "scheduled_vaccine_id": {"name": "scheduled_vaccine_id", "description": "Reference to the [scheduled vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id"]}, "vaccine_category": {"name": "vaccine_category", "description": "Vaccine category [Routine, Catch-up, Campaign, Other]", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_category"]}, "vaccine_id": {"name": "vaccine_id", "description": "Reference to the vaccine ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_id"]}, "due_date": {"name": "due_date", "description": "Due date of the scheduled vaccine.", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__due_date"]}, "days_till_due": {"name": "days_till_due", "description": "Number of days until the scheduled vaccine is due. Negative numbers indicates the number of days in the past the vaccine\r\nwas due.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__days_till_due"]}, "status": {"name": "status", "description": "Status of the upcoming vaccination listed ['DUE', 'OVERDUE', 'MISSED', 'SCHEDULED', 'UPCOMING']", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.upcoming_vaccinations__status"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"upcoming_vaccinations\"", "created_at": 1782423654.4147348, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__upcoming_vaccinations"]}, "source.tamanu_source_dbt.tamanu.users": {"database": "app", "schema": "public", "name": "users", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\users.yml", "original_file_path": "models\\sources\\users.yml", "unique_id": "source.tamanu_source_dbt.tamanu.users", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "users"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "users", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records of each user that can login to Tamanu.\r\n\r\nThis includes machine users.\r\n\r\nThere is one special user account with an all-zero `id`, which is the global \"system\" user. This is\r\nused as a pseudo identity where the Tamanu system itself takes an action that normally is performed\r\nby a human or API user.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in users.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "email": {"name": "email", "description": "Email address for user. This is used to login and receive emails.", "meta": {"masking": "email"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "email"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__email"]}, "password": {"name": "password", "description": "Hashed password for user login.\r\n\r\nThe value is encoded as a \"standard password hash\" with a `$[type]$[params]$[salt]$[hash]` general\r\nformat. This allows upgrading algorithms and parameters seamlessly. The current algorithm is bcrypt.\r\n\r\nThis may be null to prevent a user from being able to login.", "meta": {"masking": "nil"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "nil"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__password"]}, "display_name": {"name": "display_name", "description": "The human readable display name for the user.", "meta": {"masking": "name"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "name"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_name"]}, "role": {"name": "role", "description": "The role of the user, which sets their permission level.\r\n\r\nThe special values `admin` and `system` indicate a superadmin and a system user respectively.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__role"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in users.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "display_id": {"name": "display_id", "description": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number.", "meta": {"masking": "string"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__display_id"]}, "visibility_status": {"name": "visibility_status", "description": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`. in users.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__visibility_status"]}, "phone_number": {"name": "phone_number", "description": "Phone number for the user.\r\n\r\nThis is not currently available anywhere visible.", "meta": {"masking": "phone"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "phone"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__phone_number"]}, "device_registration_quota": {"name": "device_registration_quota", "description": "How many devices this user can register (when `features.deviceRegistrationQuota` is enabled).\r\n\r\nSee [`devices`](#!/source/source.tamanu.tamanu.devices) for more.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.users__device_registration_quota"]}}, "meta": {"triggers": ["notify_users_changed", "record_users_changelog", "set_users_updated_at", "set_users_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["administration"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_users_changed", "record_users_changelog", "set_users_updated_at", "set_users_updated_at_sync_tick"]}, "tags": ["administration"]}, "patch_path": null, "unrendered_config": {"tags": ["administration"], "meta": {"triggers": ["notify_users_changed", "record_users_changelog", "set_users_updated_at", "set_users_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"users\"", "created_at": 1782423654.437376, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__users"]}, "source.tamanu_source_dbt.tamanu.user_designations": {"database": "app", "schema": "public", "name": "user_designations", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_designations.yml", "original_file_path": "models\\sources\\user_designations.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_designations", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_designations"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_designations", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of user to designation", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_designations.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users)", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_designations__user_id"]}, "designation_id": {"name": "designation_id", "description": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_designations__designation_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_designations.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_designations.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_user_designations_changed", "record_user_designations_changelog", "set_user_designations_updated_at", "set_user_designations_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_designations_changed", "record_user_designations_changelog", "set_user_designations_updated_at", "set_user_designations_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_user_designations_changed", "record_user_designations_changelog", "set_user_designations_updated_at", "set_user_designations_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_designations\"", "created_at": 1782423654.4465659, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_designations"]}, "source.tamanu_source_dbt.tamanu.user_facilities": {"database": "app", "schema": "public", "name": "user_facilities", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_facilities.yml", "original_file_path": "models\\sources\\user_facilities.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_facilities", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_facilities"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_facilities", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Association of users to facilities.\r\n\r\nThis can be used to assign users to certain facilities, for authorisation purposes or for staff convenience.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_facilities.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_facilities.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "facility_id": {"name": "facility_id", "description": "The [facility](#!/source/source.tamanu.tamanu.facilities).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_facilities__facility_id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_facilities__user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_facilities.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_user_facilities_changed", "record_user_facilities_changelog", "set_user_facilities_updated_at", "set_user_facilities_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_facilities_changed", "record_user_facilities_changelog", "set_user_facilities_updated_at", "set_user_facilities_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["notify_user_facilities_changed", "record_user_facilities_changelog", "set_user_facilities_updated_at", "set_user_facilities_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_facilities\"", "created_at": 1782423654.447724, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_facilities"]}, "source.tamanu_source_dbt.tamanu.user_leaves": {"database": "app", "schema": "public", "name": "user_leaves", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_leaves.yml", "original_file_path": "models\\sources\\user_leaves.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_leaves", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_leaves"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_leaves", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Records user leave requests, including leave period and scheduling/removal metadata.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_leaves.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "start_date": {"name": "start_date", "description": "Start date of the leave.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_leaves__start_date"]}, "end_date": {"name": "end_date", "description": "End date of the leave.", "meta": {}, "data_type": "character(10)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_leaves__end_date"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested the leave.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_leaves__user_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_leaves.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_leaves.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_leaves.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_leaves.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_user_leaves_changed", "record_user_leaves_changelog", "set_user_leaves_updated_at", "set_user_leaves_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_leaves_changed", "record_user_leaves_changelog", "set_user_leaves_updated_at", "set_user_leaves_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_user_leaves_changed", "record_user_leaves_changelog", "set_user_leaves_updated_at", "set_user_leaves_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_leaves\"", "created_at": 1782423654.456676, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_leaves"]}, "source.tamanu_source_dbt.tamanu.user_localisation_caches": {"database": "app", "schema": "public", "name": "user_localisation_caches", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_localisation_caches.yml", "original_file_path": "models\\sources\\user_localisation_caches.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_localisation_caches", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_localisation_caches"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_localisation_caches", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Cached localisation data.\r\n\r\nLocalisation can be pretty expensive to retrieve, so this caches it per user.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_localisation_caches.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "localisation": {"name": "localisation", "description": "JSON data.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_localisation_caches__localisation"]}, "user_id": {"name": "user_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) this cache is for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_localisation_caches__user_id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_localisation_caches.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_localisation_caches.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_localisation_caches.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}}, "meta": {"masking": "truncate", "triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"masking": "truncate", "triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"masking": "truncate", "triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_localisation_caches\"", "created_at": 1782423654.4596734, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_localisation_caches"]}, "source.tamanu_source_dbt.tamanu.user_login_attempts": {"database": "app", "schema": "public", "name": "user_login_attempts", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_login_attempts.yml", "original_file_path": "models\\sources\\user_login_attempts.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_login_attempts", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_login_attempts"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_login_attempts", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A table that tracks user login attempts for the lockout feature.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_login_attempts.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_login_attempts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_login_attempts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_login_attempts.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "outcome": {"name": "outcome", "description": "A string specifying the outcome of the login attempt.", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_login_attempts__outcome"]}, "device_id": {"name": "device_id", "description": "The [device](#!/source/source.tamanu.tamanu.devices).", "meta": {"masking": "text"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_login_attempts__device_id"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_login_attempts__user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_login_attempts.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_user_login_attempts_changed", "record_user_login_attempts_changelog", "set_user_login_attempts_updated_at", "set_user_login_attempts_updated_at_sync_tick"]}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_login_attempts_changed", "record_user_login_attempts_changelog", "set_user_login_attempts_updated_at", "set_user_login_attempts_updated_at_sync_tick"]}, "tags": []}, "patch_path": null, "unrendered_config": {"tags": [], "meta": {"triggers": ["notify_user_login_attempts_changed", "record_user_login_attempts_changelog", "set_user_login_attempts_updated_at", "set_user_login_attempts_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_login_attempts\"", "created_at": 1782423654.4715202, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_login_attempts"]}, "source.tamanu_source_dbt.tamanu.user_preferences": {"database": "app", "schema": "public", "name": "user_preferences", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_preferences.yml", "original_file_path": "models\\sources\\user_preferences.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_preferences", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_preferences"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_preferences", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Per-user preferences.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_preferences.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_preferences.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_preferences.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_preferences.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users) these preferences are for.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_preferences__user_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in user_preferences.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "key": {"name": "key", "description": "Key of the user preference", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_preferences__key"]}, "facility_id": {"name": "facility_id", "description": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) that this preference applies to", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_preferences__facility_id"]}, "value": {"name": "value", "description": "Value of the user preference", "meta": {}, "data_type": "jsonb", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_preferences__value"]}}, "meta": {"triggers": ["notify_user_preferences_changed", "record_user_preferences_changelog", "set_user_preferences_updated_at", "set_user_preferences_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_user_preferences_changed", "record_user_preferences_changelog", "set_user_preferences_updated_at", "set_user_preferences_updated_at_sync_tick"]}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": ["notify_user_preferences_changed", "record_user_preferences_changelog", "set_user_preferences_updated_at", "set_user_preferences_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_preferences\"", "created_at": 1782423654.4715202, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_preferences"]}, "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients": {"database": "app", "schema": "public", "name": "user_recently_viewed_patients", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\user_recently_viewed_patients.yml", "original_file_path": "models\\sources\\user_recently_viewed_patients.yml", "unique_id": "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "user_recently_viewed_patients"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "user_recently_viewed_patients", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "A list of patients that a user has viewed recently.\r\n\r\nThis powers the \"quick access\" list in Tamanu to get back to patients that a user was last\r\ninteracting with.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in user_recently_viewed_patients.", "meta": {}, "data_type": "uuid", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in user_recently_viewed_patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in user_recently_viewed_patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in user_recently_viewed_patients.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "user_id": {"name": "user_id", "description": "The [user](#!/source/source.tamanu.tamanu.users).", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_recently_viewed_patients__user_id"]}, "patient_id": {"name": "patient_id", "description": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) that was viewed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.user_recently_viewed_patients__patient_id"]}}, "meta": {"triggers": []}, "source_meta": {}, "tags": ["system"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": []}, "tags": ["system"]}, "patch_path": null, "unrendered_config": {"tags": ["system"], "meta": {"triggers": []}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"user_recently_viewed_patients\"", "created_at": 1782423654.4715202, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__user_recently_viewed_patients"]}, "source.tamanu_source_dbt.tamanu.vitals": {"database": "app", "schema": "public", "name": "vitals", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\vitals.yml", "original_file_path": "models\\sources\\vitals.yml", "unique_id": "source.tamanu_source_dbt.tamanu.vitals", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "vitals"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "vitals", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "[Deprecated] Patient's observed vitals. This is now done as a survey response.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vitals.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in vitals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in vitals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in vitals.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date_recorded": {"name": "date_recorded", "description": "Local date and time of the event being recorded in vitals.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_recorded"]}, "temperature": {"name": "temperature", "description": "Observed patient's body temperature", "meta": {"masking": {"kind": "float", "range": "35-42"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "35-42"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__temperature"]}, "weight": {"name": "weight", "description": "Observed patient's body weight", "meta": {"masking": {"kind": "float", "range": "20-120"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "20-120"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__weight"]}, "height": {"name": "height", "description": "Observed patient's height", "meta": {"masking": {"kind": "float", "range": "50-220"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "50-220"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__height"]}, "sbp": {"name": "sbp", "description": "Observed patient's systolic blood pressure", "meta": {"masking": {"kind": "float", "range": "60-150"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "60-150"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__sbp"]}, "dbp": {"name": "dbp", "description": "Observed patient's diastolic blood pressure", "meta": {"masking": {"kind": "float", "range": "60-150"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "60-150"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__dbp"]}, "heart_rate": {"name": "heart_rate", "description": "Observed patient's heart rate", "meta": {"masking": {"kind": "float", "range": "60-200"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "60-200"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__heart_rate"]}, "respiratory_rate": {"name": "respiratory_rate", "description": "Observed patient's respiratory rate", "meta": {"masking": {"kind": "float", "range": "10-100"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "10-100"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__respiratory_rate"]}, "spo2": {"name": "spo2", "description": "Observed patient's SpO2 level or saturation of peripheral oxygen", "meta": {"masking": {"kind": "float", "range": "90-100"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "90-100"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__spo2"]}, "avpu": {"name": "avpu", "description": "Observed patient's AVPU (alert, verbal, pain, unresponsive) level", "meta": {}, "data_type": "user-defined", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__avpu"]}, "encounter_id": {"name": "encounter_id", "description": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this recording of vitals is a part of.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__encounter_id"]}, "gcs": {"name": "gcs", "description": "Observed patient's Glasgow coma scale (GCS)", "meta": {"masking": {"kind": "integer", "range": "3-15"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "3-15"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__gcs"]}, "hemoglobin": {"name": "hemoglobin", "description": "Observed patient's hemoglobin levels", "meta": {"masking": {"kind": "integer", "range": "10-30"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "integer", "range": "10-30"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__hemoglobin"]}, "fasting_blood_glucose": {"name": "fasting_blood_glucose", "description": "Observed patient's fasting blood glucose level", "meta": {"masking": {"kind": "float", "range": "4-10"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "4-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__fasting_blood_glucose"]}, "urine_ph": {"name": "urine_ph", "description": "Observed patient's urine pH", "meta": {"masking": {"kind": "float", "range": "3-10"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "3-10"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_ph"]}, "urine_leukocytes": {"name": "urine_leukocytes", "description": "Observed patient's urine leukocytes level", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_leukocytes"]}, "urine_nitrites": {"name": "urine_nitrites", "description": "Observed patient's urine nitrites", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_nitrites"]}, "urobilinogen": {"name": "urobilinogen", "description": "Observed patient's urobilinogen level", "meta": {"masking": {"kind": "float", "range": "0-1"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "0-1"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urobilinogen"]}, "urine_protein": {"name": "urine_protein", "description": "Observed patient's urine protein level", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_protein"]}, "blood_in_urine": {"name": "blood_in_urine", "description": "Observed patient's blood in urine", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__blood_in_urine"]}, "urine_specific_gravity": {"name": "urine_specific_gravity", "description": "Observed patient's urine_specific_gravity", "meta": {"masking": {"kind": "float", "range": "1.001-1.03"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "1.001-1.03"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_specific_gravity"]}, "urine_ketone": {"name": "urine_ketone", "description": "Observed patient's urine ketone level", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_ketone"]}, "urine_bilirubin": {"name": "urine_bilirubin", "description": "Observed patient's urine bilirubin level", "meta": {"masking": "text"}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {"masking": "text"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_bilirubin"]}, "urine_glucose": {"name": "urine_glucose", "description": "Observed patient's urine glucose levels", "meta": {"masking": {"kind": "float", "range": "0-300"}}, "data_type": "double precision", "constraints": [], "quote": null, "config": {"meta": {"masking": {"kind": "float", "range": "0-300"}}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__urine_glucose"]}, "date_recorded_legacy": {"name": "date_recorded_legacy", "description": "[Deprecated] date field which is a timestamp of the event being recorded in vitals.", "meta": {"masking": "datetime"}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {"masking": "datetime"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date_recorded_legacy"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in vitals.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}, "migrated_record": {"name": "migrated_record", "description": "Tamanu identifier for the survey response the vitals record was migrated to", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vitals__migrated_record"]}}, "meta": {"triggers": ["notify_vitals_changed", "record_vitals_changelog", "set_vitals_updated_at", "set_vitals_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical", "deprecated"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_vitals_changed", "record_vitals_changelog", "set_vitals_updated_at", "set_vitals_updated_at_sync_tick"]}, "tags": ["clinical", "deprecated"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical", "deprecated"], "meta": {"triggers": ["notify_vitals_changed", "record_vitals_changelog", "set_vitals_updated_at", "set_vitals_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"vitals\"", "created_at": 1782423654.4863465, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__vitals"]}, "source.tamanu_source_dbt.tamanu.vital_logs": {"database": "app", "schema": "public", "name": "vital_logs", "resource_type": "source", "package_name": "tamanu_source_dbt", "path": "models\\sources\\vital_logs.yml", "original_file_path": "models\\sources\\vital_logs.yml", "unique_id": "source.tamanu_source_dbt.tamanu.vital_logs", "fqn": ["tamanu_source_dbt", "sources", "tamanu", "vital_logs"], "source_name": "tamanu", "source_description": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication.", "loader": "", "identifier": "vital_logs", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Change logs for vitals survey responses.", "columns": {"id": {"name": "id", "description": "Tamanu internal identifier (generally a UUID) in vital_logs.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__id"]}, "created_at": {"name": "created_at", "description": "Timestamp of when record was created in vital_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__created_at"]}, "updated_at": {"name": "updated_at", "description": "Timestamp of when record was last updated in vital_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at"]}, "deleted_at": {"name": "deleted_at", "description": "Timestamp of when record was deleted in vital_logs.", "meta": {}, "data_type": "timestamp with time zone", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__deleted_at"]}, "date": {"name": "date", "description": "Local date for the record in vital_logs.", "meta": {"masking": "date"}, "data_type": "character(19)", "constraints": [], "quote": null, "config": {"meta": {"masking": "date"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__date"]}, "previous_value": {"name": "previous_value", "description": "Previous value before the logged change in vitals survey response.", "meta": {"masking": "string"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__previous_value"]}, "new_value": {"name": "new_value", "description": "New value after the logged change in vitals survey response.", "meta": {"masking": "string"}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {"masking": "string"}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__new_value"]}, "reason_for_change": {"name": "reason_for_change", "description": "Reason for the logged change in the vitals survey response.", "meta": {}, "data_type": "text", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__reason_for_change"]}, "recorded_by_id": {"name": "recorded_by_id", "description": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who made this change.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__recorded_by_id"]}, "answer_id": {"name": "answer_id", "description": "The [survey answer](#!/source/source.tamanu.tamanu.survey_response_answers) being changed.", "meta": {}, "data_type": "character varying(255)", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.vital_logs__answer_id"]}, "updated_at_sync_tick": {"name": "updated_at_sync_tick", "description": "Last tick that the record was updated. Used to figure out old vs new data when syncing in vital_logs.", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.tamanu_source_dbt.generic__updated_at_sync_tick"]}}, "meta": {"triggers": ["notify_vital_logs_changed", "record_vital_logs_changelog", "set_vital_logs_updated_at", "set_vital_logs_updated_at_sync_tick"]}, "source_meta": {}, "tags": ["clinical"], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": null, "loaded_at_query": null, "meta": {"triggers": ["notify_vital_logs_changed", "record_vital_logs_changelog", "set_vital_logs_updated_at", "set_vital_logs_updated_at_sync_tick"]}, "tags": ["clinical"]}, "patch_path": null, "unrendered_config": {"tags": ["clinical"], "meta": {"triggers": ["notify_vital_logs_changed", "record_vital_logs_changelog", "set_vital_logs_updated_at", "set_vital_logs_updated_at_sync_tick"]}, "loaded_at_field": null, "loaded_at_query": null}, "relation_name": "\"app\".\"public\".\"vital_logs\"", "created_at": 1782423654.5072966, "unrendered_database": null, "unrendered_schema": "public", "doc_blocks": ["doc.tamanu_source_dbt.table__vital_logs"]}}, "macros": {"macro.tamanu_source_dbt.is_analytics_target": {"name": "is_analytics_target", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\analytics.sql", "original_file_path": "macros\\analytics.sql", "unique_id": "macro.tamanu_source_dbt.is_analytics_target", "macro_sql": "{% macro is_analytics_target() %}\r\n {{ return(target.name.startswith('analytics')) }}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8725028, "supported_languages": null}, "macro.tamanu_source_dbt._get_current": {"name": "_get_current", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\datetime.sql", "original_file_path": "macros\\datetime.sql", "unique_id": "macro.tamanu_source_dbt._get_current", "macro_sql": "{%- macro _get_current(datetime_type, native_function) -%}\r\n {%- set var_name = 'test_current_' ~ datetime_type -%}\r\n {%- if var(var_name, none) -%}\r\n '{{ var(var_name) }}'::{{ datetime_type }}\r\n {%- else -%}\r\n {{ native_function }}\r\n {%- endif -%}\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8725028, "supported_languages": null}, "macro.tamanu_source_dbt.get_current_date": {"name": "get_current_date", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\datetime.sql", "original_file_path": "macros\\datetime.sql", "unique_id": "macro.tamanu_source_dbt.get_current_date", "macro_sql": "{%- macro get_current_date() -%}\r\n {{ _get_current('date', 'current_date') }}\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.tamanu_source_dbt._get_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8725028, "supported_languages": null}, "macro.tamanu_source_dbt.get_current_timestamp": {"name": "get_current_timestamp", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\datetime.sql", "original_file_path": "macros\\datetime.sql", "unique_id": "macro.tamanu_source_dbt.get_current_timestamp", "macro_sql": "{%- macro get_current_timestamp() -%}\r\n {{ _get_current('timestamp', 'now()') }}\r\n{%- endmacro -%}", "depends_on": {"macros": ["macro.tamanu_source_dbt._get_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8725028, "supported_languages": null}, "macro.tamanu_source_dbt.get_translations": {"name": "get_translations", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\default_translations.sql", "original_file_path": "macros\\default_translations.sql", "unique_id": "macro.tamanu_source_dbt.get_translations", "macro_sql": "\r\n\r\n\r\n{%- macro get_translations() -%}\r\n {%- set translations = {\r\n 'report.reporting.admissionDate': {'default': 'Admission date'},\r\n 'report.reporting.admissionDateTime': {'default': 'Admission date and time'},\r\n 'report.reporting.admissionStatus': {'default': 'Admission status'},\r\n 'report.reporting.admittingClinician': {'default': 'Admitting clinician'},\r\n 'report.reporting.appointmentClinician': {'default': 'Clinician'},\r\n 'report.reporting.appointmentCreatedBy': {'default': 'Appointment created by'},\r\n 'report.reporting.appointmentDateTime': {'default': 'Appointment date and time'},\r\n 'report.reporting.appointmentEndDateTime': {'default': 'Appointment end date and time'},\r\n 'report.reporting.appointmentIsCancelled': {'default': 'Appointment cancelled'},\r\n 'report.reporting.appointmentIsRepeating': {'default': 'Repeating appointment'},\r\n 'report.reporting.appointmentLocationGroup': {'default': 'Area'},\r\n 'report.reporting.appointmentPriority': {'default': 'Priority appointment'},\r\n 'report.reporting.appointmentRepeatingEndDate': {'default': 'Repeating appointment end date'},\r\n 'report.reporting.appointmentStatus': {'default': 'Appointment status'},\r\n 'report.reporting.appointmentType': {'default': 'Appointment type'},\r\n 'report.reporting.auditChangeNumber': {'default': 'Change number'},\r\n 'report.reporting.auditCreatedBy': {'default': 'Appointment created by'},\r\n 'report.reporting.auditModifiedBy': {'default': 'Appointment modified by'},\r\n 'report.reporting.auditModifiedDateTime': {'default': 'Appointment modified date & time'},\r\n 'report.reporting.auditPrevAppointmentDateTime': {'default': 'Previous appointment date & time'},\r\n 'report.reporting.auditPrevAppointmentType': {'default': 'Previous appointment type'},\r\n 'report.reporting.auditPrevClinician': {'default': 'Previous clinician'},\r\n 'report.reporting.auditPrevLocationGroup': {'default': 'Previous area'},\r\n 'report.reporting.auditPrevPriority': {'default': 'Previous priority appointment'},\r\n 'report.reporting.birthApgarScoreFiveMinutes': {'default': 'Apgar score at 5 min'},\r\n 'report.reporting.birthApgarScoreOneMinute': {'default': 'Apgar score at 1 min'},\r\n 'report.reporting.birthApgarScoreTenMinutes': {'default': 'Apgar score at 10 min'},\r\n 'report.reporting.birthAttendant': {'default': 'Name of attendant'},\r\n 'report.reporting.birthAttendantType': {'default': 'Attendant at birth'},\r\n 'report.reporting.birthDeliveryType': {'default': 'Delivery type'},\r\n 'report.reporting.birthFacility': {'default': 'Name of health facility (if selected)'},\r\n 'report.reporting.birthGestationalAgeEstimate': {'default': 'Gestational age (weeks)'},\r\n 'report.reporting.birthLength': {'default': 'Birth length (cm)'},\r\n 'report.reporting.birthRegisteredBy': {'default': 'Registered by'},\r\n 'report.reporting.birthRegisteredDateTime': {'default': 'Registration date'},\r\n 'report.reporting.birthTimeOfBirth': {'default': 'Time of birth'},\r\n 'report.reporting.birthType': {'default': 'Single/Plural birth'},\r\n 'report.reporting.birthWeight': {'default': 'Birth weight (kg)'},\r\n 'report.reporting.bookingClinician': {'default': 'Clinician'},\r\n 'report.reporting.bookingDuration': {'default': 'Booking duration'},\r\n 'report.reporting.bookingEndDateTime': {'default': 'Booking end date and time'},\r\n 'report.reporting.bookingLocation': {'default': 'Location'},\r\n 'report.reporting.bookingLocationGroup': {'default': 'Area'},\r\n 'report.reporting.bookingStartDateTime': {'default': 'Booking start date and time'},\r\n 'report.reporting.bookingStatus': {'default': 'Booking status'},\r\n 'report.reporting.bookingType': {'default': 'Booking type'},\r\n 'report.reporting.conditionOngoing': {'default': 'Ongoing condition'},\r\n 'report.reporting.conditionRecordedBy': {'default': 'Clinician'},\r\n 'report.reporting.conditionRecordedDate': {'default': 'Date recorded'},\r\n 'report.reporting.conditionResolvedBy': {'default': 'Clinician confirming resolution'},\r\n 'report.reporting.conditionResolvedDate': {'default': 'Date resolved'},\r\n 'report.reporting.deathAgeOfMother': {'default': 'Age of mother'},\r\n 'report.reporting.deathAntecedentCause1': {'default': 'Antecedent cause 1'},\r\n 'report.reporting.deathAntecedentCause2': {'default': 'Antecedent cause 2'},\r\n 'report.reporting.deathAttendingClinician': {'default': 'Attending clinician'},\r\n 'report.reporting.deathCompletedWeeksOfPregnancy': {'default': 'Completed weeks of pregnancy'},\r\n 'report.reporting.deathConditionInMother': {'default': 'Condition in mother affecting fetus or newborn'},\r\n 'report.reporting.deathExternalCauseDate': {'default': 'External cause date'},\r\n 'report.reporting.deathExternalCauseLocation': {'default': 'External cause location'},\r\n 'report.reporting.deathHadRecentSurgery': {'default': 'Had recent surgery'},\r\n 'report.reporting.deathHoursSurvivedSinceBirth': {'default': 'Hours survived since birth'},\r\n 'report.reporting.deathLastSurgeryDate': {'default': 'Last surgery date'},\r\n 'report.reporting.deathMannerOfDeath': {'default': 'Manner of death'},\r\n 'report.reporting.deathOtherCondition1': {'default': 'Other condition 1'},\r\n 'report.reporting.deathOtherCondition2': {'default': 'Other condition 2'},\r\n 'report.reporting.deathOtherCondition3': {'default': 'Other condition 3'},\r\n 'report.reporting.deathOtherCondition4': {'default': 'Other condition 4'},\r\n 'report.reporting.deathPlaceOfDeath': {'default': 'Place of death'},\r\n 'report.reporting.deathPregnancyContributed': {'default': 'Pregnancy contributed'},\r\n 'report.reporting.deathPrimaryCause': {'default': 'Primary cause of death'},\r\n 'report.reporting.deathReasonForSurgery': {'default': 'Reason for surgery'},\r\n 'report.reporting.deathTimeBetweenOnsetAndDeath': {'default': 'Time between onset and death'},\r\n 'report.reporting.deathWasFetalOrInfant': {'default': 'Was fetal or infant'},\r\n 'report.reporting.deathWasPregnant': {'default': 'Was pregnant'},\r\n 'report.reporting.deathWasStillborn': {'default': 'Was stillborn'},\r\n 'report.reporting.deathWithinDayOfBirth': {'default': 'Death within day of birth'},\r\n 'report.reporting.department': {'default': 'Department'},\r\n 'report.reporting.departments': {'default': 'Departments'},\r\n 'report.reporting.diagnoses': {'default': 'Diagnoses'},\r\n 'report.reporting.diagnosesPrimary': {'default': 'Primary diagnoses'},\r\n 'report.reporting.diagnosesSecondary': {'default': 'Secondary diagnoses'},\r\n 'report.reporting.diagnosis': {'default': 'Diagnosis'},\r\n 'report.reporting.diagnosisCertainty': {'default': 'Certainty'},\r\n 'report.reporting.diagnosisDateTime': {'default': 'Date & time'},\r\n 'report.reporting.diagnosisIsPrimary': {'default': 'Is primary'},\r\n 'report.reporting.dischargeDate': {'default': 'Discharged date'},\r\n 'report.reporting.dischargeDateTime': {'default': 'Discharge date and time'},\r\n 'report.reporting.dischargeDepartment': {'default': 'Discharging department'},\r\n 'report.reporting.dischargeDisposition': {'default': 'Discharge disposition'},\r\n 'report.reporting.dischargeLocation': {'default': 'Discharging location'},\r\n 'report.reporting.dischargeLocationGroup': {'default': 'Discharging area'},\r\n 'report.reporting.encounterClinician': {'default': 'Clinician'},\r\n 'report.reporting.encounterDepartmentHistory': {'default': 'Department history'},\r\n 'report.reporting.encounterDepartmentHistoryDateTimes': {'default': 'Department history date and times'},\r\n 'report.reporting.encounterDiet': {'default': 'Diet'},\r\n 'report.reporting.encounterEndDateTime': {'default': 'Encounter end date and time'},\r\n 'report.reporting.encounterIsDischarged': {'default': 'Discharges (has the patient been discharged)'},\r\n 'report.reporting.encounterIsHospitalAdmission': {'default': 'Hospital admission'},\r\n 'report.reporting.encounterLengthOfStay': {'default': 'Length of stay (days)'},\r\n 'report.reporting.encounterLocationGroupHistory': {'default': 'Area history'},\r\n 'report.reporting.encounterLocationGroupHistoryDateTimes': {'default': 'Area history date and times'},\r\n 'report.reporting.encounterLocationHistory': {'default': 'Location history'},\r\n 'report.reporting.encounterLocationHistoryDateTimes': {'default': 'Location history date and times'},\r\n 'report.reporting.encounterNonDischargeClinician': {'default': 'Non-discharge by clinicians'},\r\n 'report.reporting.encounterReasonForEncounter': {'default': 'Reason for encounter'},\r\n 'report.reporting.encounterStartDate': {'default': 'Encounter start date'},\r\n 'report.reporting.encounterStartDateTime': {'default': 'Encounter start date and time'},\r\n 'report.reporting.encounterStartTime': {'default': 'Encounter start time'},\r\n 'report.reporting.encounterSupervisingClinician': {'default': 'Supervising clinician'},\r\n 'report.reporting.encounterType': {'default': 'Type'},\r\n 'report.reporting.encounterTypeEmergency': {'default': 'Emergency encounter type'},\r\n 'report.reporting.encounterTypeInpatient': {'default': 'Inpatient encounter type'},\r\n 'report.reporting.encounterTypeOutpatient': {'default': 'Outpatient encounter type'},\r\n 'report.reporting.facility': {'default': 'Facility'},\r\n 'report.reporting.hospitalAdmissionCount': {'default': 'Number of admissions'},\r\n 'report.reporting.hospitalAverageLengthOfStay': {'default': 'Average length of stay'},\r\n 'report.reporting.hospitalBedOccupancyPercent': {'default': 'Bed occupancy (%)'},\r\n 'report.reporting.hospitalDeathCount': {'default': 'Number of deaths'},\r\n 'report.reporting.hospitalDischargeCount': {'default': 'Number of discharges'},\r\n 'report.reporting.hospitalPatientDayCount': {'default': 'Number of patient days'},\r\n 'report.reporting.hospitalTransfersIntoDepartmentCount': {'default': 'Number of transfers into department'},\r\n 'report.reporting.hospitalTransfersIntoLocationCount': {'default': 'Number of transfers into location'},\r\n 'report.reporting.hospitalTransfersOutOfDepartmentCount': {'default': 'Number of transfers out of department'},\r\n 'report.reporting.hospitalTransfersOutOfLocationCount': {'default': 'Number of transfers out of location'},\r\n 'report.reporting.imagingArea': {'default': 'Area to be imaged'},\r\n 'report.reporting.imagingCancellationReason': {'default': 'Reason for cancellation'},\r\n 'report.reporting.imagingCompletedDateTime': {'default': 'Completed date and time'},\r\n 'report.reporting.imagingCompletedRequests': {'default': 'Total requests completed'},\r\n 'report.reporting.imagingPendingRequests': {'default': 'Total requests with a status of pending'},\r\n 'report.reporting.imagingPriority': {'default': 'Priority'},\r\n 'report.reporting.imagingRequestDateTime': {'default': 'Request date and time'},\r\n 'report.reporting.imagingRequestId': {'default': 'Request ID'},\r\n 'report.reporting.imagingRequestingClinician': {'default': 'Requesting clinician'},\r\n 'report.reporting.imagingRequests': {'default': 'Imaging requests'},\r\n 'report.reporting.imagingStatus': {'default': 'Status'},\r\n 'report.reporting.imagingSupervisingClinician': {'default': 'Supervising clinician'},\r\n 'report.reporting.imagingTotalRequests': {'default': 'Total new requests'},\r\n 'report.reporting.imagingType': {'default': 'Imaging type'},\r\n 'report.reporting.insurerId': {'default': 'Insurer ID'},\r\n 'report.reporting.insurerName': {'default': 'Name of insurer'},\r\n 'report.reporting.invoiceInsurerAmount': {'default': 'Total insurer amount'},\r\n 'report.reporting.invoiceInsurerTotal': {'default': 'Insurer total'},\r\n 'report.reporting.invoiceInsurers': {'default': 'Insurer'},\r\n 'report.reporting.invoiceNumber': {'default': 'Invoice number'},\r\n 'report.reporting.invoicePatientAmount': {'default': 'Total patient amount'},\r\n 'report.reporting.invoicePatientDiscount': {'default': 'Total patient discount'},\r\n 'report.reporting.invoiceProductCategory': {'default': 'Category'},\r\n 'report.reporting.invoiceProductCategoryId': {'default': 'Category ID'},\r\n 'report.reporting.invoiceProductId': {'default': 'ID'},\r\n 'report.reporting.invoiceProductInsurable': {'default': 'Insurable'},\r\n 'report.reporting.invoiceProductLabExternalCode': {'default': 'Lab external code'},\r\n 'report.reporting.invoiceProductName': {'default': 'Product name'},\r\n 'report.reporting.invoiceProductVisibilityStatus': {'default': 'Visibility status'},\r\n 'report.reporting.invoiceRemainingInsurerBalance': {'default': 'Remaining balance (insurer payments)'},\r\n 'report.reporting.invoiceRemainingPatientBalance': {'default': 'Remaining balance (patient)'},\r\n 'report.reporting.invoiceTotalAmount': {'default': 'Total invoice amount'},\r\n 'report.reporting.labLaboratory': {'default': 'Laboratory'},\r\n 'report.reporting.labRequestCancellationReason': {'default': 'Reason for cancellation'},\r\n 'report.reporting.labRequestClinician': {'default': 'Requesting clinician'},\r\n 'report.reporting.labRequestCompletedDateTime': {'default': 'Completed date and time'},\r\n 'report.reporting.labRequestDateTime': {'default': 'Lab request date and time'},\r\n 'report.reporting.labRequestDates': {'default': 'Lab request dates'},\r\n 'report.reporting.labRequestDepartment': {'default': 'Requesting department'},\r\n 'report.reporting.labRequestId': {'default': 'Request ID'},\r\n 'report.reporting.labRequestNewCount': {'default': 'Total new requests'},\r\n 'report.reporting.labRequestPendingCount': {'default': 'Total requests with a status of results pending'},\r\n 'report.reporting.labRequestPriority': {'default': 'Priority'},\r\n 'report.reporting.labRequestPublishedCount': {'default': 'Total requests published'},\r\n 'report.reporting.labRequestPublishedDateTime': {'default': 'Lab request published date and time'},\r\n 'report.reporting.labRequestSampleCollectedBy': {'default': 'Sample collected by'},\r\n 'report.reporting.labRequestSampleCollectionDateTime': {'default': 'Sample collection date and time'},\r\n 'report.reporting.labRequestSampleSite': {'default': 'Site'},\r\n 'report.reporting.labRequestSpecimenType': {'default': 'Specimen type'},\r\n 'report.reporting.labRequestStatus': {'default': 'Status'},\r\n 'report.reporting.labRequests': {'default': 'Lab requests'},\r\n 'report.reporting.labTestCategory': {'default': 'Test category'},\r\n 'report.reporting.labTestCompletedDateTime': {'default': 'Lab test completed date and time'},\r\n 'report.reporting.labTestDate': {'default': 'Lab test date'},\r\n 'report.reporting.labTestPanel': {'default': 'Lab test panel'},\r\n 'report.reporting.labTestRequested': {'default': 'Test requested'},\r\n 'report.reporting.labTestResults': {'default': 'Result'},\r\n 'report.reporting.labTestType': {'default': 'Lab test type'},\r\n 'report.reporting.labTestVerification': {'default': 'Verification'},\r\n 'report.reporting.location': {'default': 'Location'},\r\n 'report.reporting.locationGroup': {'default': 'Area'},\r\n 'report.reporting.locationGroups': {'default': 'Areas'},\r\n 'report.reporting.locations': {'default': 'Locations'},\r\n 'report.reporting.logAccessAtFacility': {'default': 'Viewed at facility'},\r\n 'report.reporting.logAccessBy': {'default': 'Viewed by user'},\r\n 'report.reporting.logAccessDatetime': {'default': 'Date and time viewed'},\r\n 'report.reporting.logChangeBy': {'default': 'Edited by user'},\r\n 'report.reporting.logChangeDateTime': {'default': 'Date and time edited'},\r\n 'report.reporting.logChangeRecordCreatedDateTime': {'default': 'Date and time created'},\r\n 'report.reporting.medications': {'default': 'Medications'},\r\n 'report.reporting.noteEndDateTime': {'default': 'Notes end date and time'},\r\n 'report.reporting.noteStartDateTime': {'default': 'Notes start date and time'},\r\n 'report.reporting.notes': {'default': 'Notes'},\r\n 'report.reporting.patientAge': {'default': 'Age'},\r\n 'report.reporting.patientAllergies': {'default': 'Allergies'},\r\n 'report.reporting.patientBillingType': {'default': 'Billing type'},\r\n 'report.reporting.patientBirthCertificate': {'default': 'Birth certificate'},\r\n 'report.reporting.patientBloodType': {'default': 'Blood type'},\r\n 'report.reporting.patientCategory': {'default': 'Patient category'},\r\n 'report.reporting.patientConditions': {'default': 'Patient conditions'},\r\n 'report.reporting.patientContactNumber': {'default': 'Contact number'},\r\n 'report.reporting.patientCountryOfBirth': {'default': 'Country of birth'},\r\n 'report.reporting.patientCulturalName': {'default': 'Cultural name'},\r\n 'report.reporting.patientDateOfBirth': {'default': 'Date of birth'},\r\n 'report.reporting.patientDateOfDeath': {'default': 'Date of death'},\r\n 'report.reporting.patientDeceasedOrActive': {'default': 'Deceased/Active'},\r\n 'report.reporting.patientDisplayId': {'default': 'Patient ID'},\r\n 'report.reporting.patientDivision': {'default': 'Division'},\r\n 'report.reporting.patientDrivingLicense': {'default': 'Driving license'},\r\n 'report.reporting.patientEmergencyContactName': {'default': 'Emergency contact name'},\r\n 'report.reporting.patientEmergencyContactNumber': {'default': 'Emergency contact number'},\r\n 'report.reporting.patientEthnicity': {'default': 'Ethnicity'},\r\n 'report.reporting.patientFather': {'default': 'Father'},\r\n 'report.reporting.patientFemaleCount': {'default': 'Total patients (female)'},\r\n 'report.reporting.patientFirstName': {'default': 'First name'},\r\n 'report.reporting.patientInsurancePolicyNumber': {'default': 'Insurance policy number'},\r\n 'report.reporting.patientLastName': {'default': 'Last name'},\r\n 'report.reporting.patientMaleCount': {'default': 'Total patients (male)'},\r\n 'report.reporting.patientMaritalStatus': {'default': 'Marital status'},\r\n 'report.reporting.patientMedicalArea': {'default': 'Medical area'},\r\n 'report.reporting.patientMiddleName': {'default': 'Middle name'},\r\n 'report.reporting.patientMother': {'default': 'Mother'},\r\n 'report.reporting.patientName': {'default': 'Patient name'},\r\n 'report.reporting.patientNationality': {'default': 'Nationality'},\r\n 'report.reporting.patientOccupation': {'default': 'Occupation'},\r\n 'report.reporting.patientPassport': {'default': 'Passport'},\r\n 'report.reporting.patientPlaceOfBirth': {'default': 'Place of birth'},\r\n 'report.reporting.patientPrimaryContactNumber': {'default': 'Primary contact number'},\r\n 'report.reporting.patientRegisteredBy': {'default': 'Registered by'},\r\n 'report.reporting.patientRegistrationDate': {'default': 'Registration date'},\r\n 'report.reporting.patientRegistrationType': {'default': 'Registration type'},\r\n 'report.reporting.patientReligion': {'default': 'Religion'},\r\n 'report.reporting.patientSSN': {'default': 'Social security number'},\r\n 'report.reporting.patientSecondaryContactNumber': {'default': 'Secondary contact number'},\r\n 'report.reporting.patientSex': {'default': 'Sex'},\r\n 'report.reporting.patientStreetVillage': {'default': 'Street / Village'},\r\n 'report.reporting.patientSubDivision': {'default': 'Sub-division'},\r\n 'report.reporting.patientTitle': {'default': 'Title'},\r\n 'report.reporting.patientTotal': {'default': 'Total patients'},\r\n 'report.reporting.patientTotalBirthRegistrations': {'default': 'Total birth registrations'},\r\n 'report.reporting.patientTotalIncorrectRegistrationsForAgedUnder6Months': {'default': 'Total incorrect registrations for aged under 6 months'},\r\n 'report.reporting.patientTotalMerged': {'default': 'Total patients merged'},\r\n 'report.reporting.patientTotalPatientRegistrations': {'default': 'Total patient registrations'},\r\n 'report.reporting.patientTotalWithIncompleteName': {'default': 'Total patients with incomplete name'},\r\n 'report.reporting.patientTotalWithInvalidDateOfBirth': {'default': 'Total patients with invalid date of birth'},\r\n 'report.reporting.patientTotalWithMissingContact': {'default': 'Total patients with missing contact'},\r\n 'report.reporting.patientTotalWithMissingDateOfBirth': {'default': 'Total patients with missing date of birth'},\r\n 'report.reporting.patientTotalWithMissingLocation': {'default': 'Total patients with missing location'},\r\n 'report.reporting.patientVillage': {'default': 'Village'},\r\n 'report.reporting.paymentAmount': {'default': 'Applied payment (amount)'},\r\n 'report.reporting.paymentDate': {'default': 'Payment date'},\r\n 'report.reporting.paymentMethod': {'default': 'Method'},\r\n 'report.reporting.paymentReceiptNumber': {'default': 'Receipt number'},\r\n 'report.reporting.paymentReceivedBy': {'default': 'Tamanu user name'},\r\n 'report.reporting.prescriptionDate': {'default': 'Prescription date'},\r\n 'report.reporting.prescriptionDoseAmount': {'default': 'Dose amount'},\r\n 'report.reporting.prescriptionFrequency': {'default': 'Frequency'},\r\n 'report.reporting.prescriptionIsOngoing': {'default': 'Is ongoing'},\r\n 'report.reporting.prescriptionIsPRN': {'default': 'Is PRN'},\r\n 'report.reporting.prescriptionIsVariableDose': {'default': 'Is variable dose'},\r\n 'report.reporting.prescriptionMedication': {'default': 'Medication'},\r\n 'report.reporting.prescriptionMedicationCode': {'default': 'Code'},\r\n 'report.reporting.prescriptionQuantity': {'default': 'Quantity'},\r\n 'report.reporting.prescriptionRepeats': {'default': 'Repeats'},\r\n 'report.reporting.prescriptionRoute': {'default': 'Route'},\r\n 'report.reporting.prescriptionSelectedForDischarge': {'default': 'Prescription selected for discharge'},\r\n 'report.reporting.prescriptionUnits': {'default': 'Units'},\r\n 'report.reporting.procedure': {'default': 'Procedure'},\r\n 'report.reporting.procedureAnaesthetist': {'default': 'Procedure anaesthetist'},\r\n 'report.reporting.procedureAssistant': {'default': 'Procedure assistant'},\r\n 'report.reporting.procedureAssistantAnaesthetist': {'default': 'Procedure assistant anesthetist'},\r\n 'report.reporting.procedureClinician': {'default': 'Procedure clinician'},\r\n 'report.reporting.procedureDate': {'default': 'Procedure date'},\r\n 'report.reporting.procedureDuration': {'default': 'Procedure duration'},\r\n 'report.reporting.procedureEndDateTime': {'default': 'Procedure end (date and time)'},\r\n 'report.reporting.procedureFacility': {'default': 'Procedure facility'},\r\n 'report.reporting.procedureIsCompleted': {'default': 'Procedure marked as completed'},\r\n 'report.reporting.procedureLocation': {'default': 'Procedure location'},\r\n 'report.reporting.procedureLocationGroup': {'default': 'Procedure area'},\r\n 'report.reporting.procedureStartDateTime': {'default': 'Procedure start (date and time)'},\r\n 'report.reporting.procedureTimeIn': {'default': 'Procedure time in'},\r\n 'report.reporting.procedureTimeOut': {'default': 'Procedure time out'},\r\n 'report.reporting.procedures': {'default': 'Procedures'},\r\n 'report.reporting.referralCompletedBy': {'default': 'Referring doctor'},\r\n 'report.reporting.referralDate': {'default': 'Referral date'},\r\n 'report.reporting.referralType': {'default': 'Referral name'},\r\n 'report.reporting.registryClinicalStatus': {'default': 'Status'},\r\n 'report.reporting.registryCondition': {'default': 'Related Condition'},\r\n 'report.reporting.registryConditionCategories': {'default': 'Related condition categories'},\r\n 'report.reporting.registryConditionCategory': {'default': 'Related condition category'},\r\n 'report.reporting.registryConditionRecordedBy': {'default': 'Condition added by'},\r\n 'report.reporting.registryConditionRecordedDate': {'default': 'Date condition added'},\r\n 'report.reporting.registryConditions': {'default': 'Related conditions'},\r\n 'report.reporting.registryCurrentlyAt': {'default': 'Currently at'},\r\n 'report.reporting.registryDeactivatedBy': {'default': 'Deactivated by'},\r\n 'report.reporting.registryDeactivatedDate': {'default': 'Date of deactivation'},\r\n 'report.reporting.registryRegisteredBy': {'default': 'Registered by'},\r\n 'report.reporting.registryRegisteredDate': {'default': 'Date of registration'},\r\n 'report.reporting.registryRegisteringFacility': {'default': 'Registering facility'},\r\n 'report.reporting.registryRegistrationStatus': {'default': 'Registration status'},\r\n 'report.reporting.reportingDate': {'default': 'Date'},\r\n 'report.reporting.reportingMonth': {'default': 'Month'},\r\n 'report.reporting.requestingDepartment': {'default': 'Requesting department'},\r\n 'report.reporting.triageArrivalMode': {'default': 'Arrival mode'},\r\n 'report.reporting.triageCategory': {'default': 'Triage category'},\r\n 'report.reporting.triageRecordCount': {'default': 'Number of triage records'},\r\n 'report.reporting.triageWaitingTime': {'default': 'Time seen following triage/Waiting time (hh:mm:ss)'},\r\n 'report.reporting.userEmail': {'default': 'User email'},\r\n 'report.reporting.userName': {'default': 'User name'},\r\n 'report.reporting.userRole': {'default': 'User role'},\r\n 'report.reporting.vaccinationBatch': {'default': 'Batch'},\r\n 'report.reporting.vaccinationDate': {'default': 'Vaccination date'},\r\n 'report.reporting.vaccinationDueDate': {'default': 'Vaccination due date'},\r\n 'report.reporting.vaccinationGivenBy': {'default': 'Given by'},\r\n 'report.reporting.vaccinationGivenElseWhereCircumstances': {'default': 'If given elsewhere, Circumstances'},\r\n 'report.reporting.vaccinationGivenElsewhereCountry': {'default': 'If given elsewhere, Country'},\r\n 'report.reporting.vaccinationIsConsented': {'default': 'Consent given'},\r\n 'report.reporting.vaccinationModifiedBy': {'default': 'Record modified by'},\r\n 'report.reporting.vaccinationModifiedDate': {'default': 'Record modification date'},\r\n 'report.reporting.vaccinationNotGivenClinician': {'default': 'If not given, Supervising clinician'},\r\n 'report.reporting.vaccinationNotGivenDate': {'default': 'Date vaccine not given'},\r\n 'report.reporting.vaccinationNotGivenReason': {'default': 'If not given, Reason not given'},\r\n 'report.reporting.vaccinationRecordedBy': {'default': 'Recorded by'},\r\n 'report.reporting.vaccinationStatus': {'default': 'Vaccine status'},\r\n 'report.reporting.vaccinations': {'default': 'Vaccinations'},\r\n 'report.reporting.vaccineBrand': {'default': 'If category of Other, Vaccine brand'},\r\n 'report.reporting.vaccineCategory': {'default': 'Vaccine category'},\r\n 'report.reporting.vaccineDisease': {'default': 'If category of Other, Disease'},\r\n 'report.reporting.vaccineName': {'default': 'Vaccine name'},\r\n 'report.reporting.vaccineSchedule': {'default': 'Schedule'}\r\n } -%}\r\n {{- return(translations) -}}\r\n{%- endmacro -%}\r\n\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_default_translations": {"name": "get_default_translations", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\default_translations.sql", "original_file_path": "macros\\default_translations.sql", "unique_id": "macro.tamanu_source_dbt.get_default_translations", "macro_sql": "{%- macro get_default_translations() -%}\r\n {#- Backwards compatibility: return just default language -#}\r\n {%- set all_translations = get_translations() -%}\r\n {%- set default_only = {} -%}\r\n {%- for string_id, lang_dict in all_translations.items() -%}\r\n {%- do default_only.update({string_id: lang_dict.get('default', '')}) -%}\r\n {%- endfor -%}\r\n {{- return(default_only) -}}\r\n{%- endmacro -%}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.parameter": {"name": "parameter", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\parameter.sql", "original_file_path": "macros\\parameter.sql", "unique_id": "macro.tamanu_source_dbt.parameter", "macro_sql": "{%- macro parameter(parameter_name, default_value, data_type='text') -%}\r\n {%- if flags.WHICH == 'compile' %}\r\n :{{ parameter_name }}\r\n {%- else -%}\r\n {%- set param_value = var(parameter_name, default_value) -%}\r\n {%- if data_type is none -%}\r\n nullif('{{ param_value }}', '')\r\n {%- else -%}\r\n nullif('{{ param_value }}', '')::{{ data_type }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_nth_weekday": {"name": "get_nth_weekday", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.get_nth_weekday", "macro_sql": "{%- macro get_nth_weekday(nth_weekday) -%}\r\n case {{ nth_weekday }}\r\n when -1 then 'last '\r\n when 1 then 'first '\r\n when 2 then 'second '\r\n when 3 then 'third '\r\n when 4 then 'fourth ' \r\n else ''\r\n end\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_schedule_prefix": {"name": "get_schedule_prefix", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.get_schedule_prefix", "macro_sql": "{%- macro get_schedule_prefix(interval, frequency) -%}\r\n concat(\r\n case when \"{{ interval }}\" = 1 then\r\n case {{ frequency }}\r\n when 'WEEKLY' then 'Weekly on a '\r\n when 'MONTHLY' then 'Monthly on the '\r\n end\r\n else concat('Every ', \"{{ interval }}\",\r\n case {{ frequency }}\r\n when 'WEEKLY' then ' weeks on '\r\n when 'MONTHLY' then ' months on the '\r\n end\r\n )\r\n end\r\n )\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_day_name": {"name": "get_day_name", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.get_day_name", "macro_sql": "{%- macro get_day_name(day) -%}\r\n case {{ day }}\r\n when 'MO' then 'Monday'\r\n when 'TU' then 'Tuesday'\r\n when 'WE' then 'Wednesday'\r\n when 'TH' then 'Thursday'\r\n when 'FR' then 'Friday'\r\n when 'SA' then 'Saturday'\r\n when 'SU' then 'Sunday'\r\n else {{ day }}\r\n end\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.unnest_and_map": {"name": "unnest_and_map", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.unnest_and_map", "macro_sql": "{%- macro unnest_and_map(days_array) -%}\r\n array_to_string(\r\n array(select {{ get_day_name('unnest_day') }} from unnest({{ days_array }}) as unnest_day),\r\n ', '\r\n )\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_recurrence_description": {"name": "get_recurrence_description", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\schedules.sql", "original_file_path": "macros\\schedules.sql", "unique_id": "macro.tamanu_source_dbt.get_recurrence_description", "macro_sql": "{%- macro get_recurrence_description(interval, frequency, days_of_week, nth_weekday) -%}\r\n concat(\r\n {{ get_schedule_prefix(interval, frequency) }},\r\n {{ get_nth_weekday(nth_weekday) }},\r\n {{ unnest_and_map(days_of_week) }}\r\n )\r\n{%- endmacro -%}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_schedule_prefix", "macro.tamanu_source_dbt.get_nth_weekday", "macro.tamanu_source_dbt.unnest_and_map"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_survey_columns": {"name": "get_survey_columns", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\surveys.sql", "original_file_path": "macros\\surveys.sql", "unique_id": "macro.tamanu_source_dbt.get_survey_columns", "macro_sql": "{% macro get_survey_columns(survey_id) %}\r\n SELECT \r\n pde.id, \r\n replace(pde.code,'-','_') as code,\r\n pde.name \r\n FROM {{ source('tamanu', 'survey_screen_components') }} ssc\r\n JOIN {{ source('tamanu', 'program_data_elements') }} pde\r\n ON ssc.data_element_id = pde.id\r\n WHERE ssc.survey_id = '{{ survey_id }}'\r\n AND ssc.deleted_at IS null\r\n AND pde.type != 'Instruction'\r\n AND pde.deleted_at IS NULL\r\n ORDER BY ssc.screen_index, ssc.component_index\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_survey": {"name": "get_survey", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\surveys.sql", "original_file_path": "macros\\surveys.sql", "unique_id": "macro.tamanu_source_dbt.get_survey", "macro_sql": "{% macro get_survey(survey_id) %}\r\n {%- set query = get_survey_columns(survey_id) -%}\r\n {%- set columns = dbt_utils.get_query_results_as_dict(query) -%}\r\n SELECT \r\n sr.encounter_id,\r\n sra.response_id, \r\n e.patient_id,\r\n sr.start_datetime,\r\n sr.end_datetime,\r\n sr.result_text\r\n {%- for id, code in zip(columns['id'], columns['code']) %},\r\n MAX(CASE WHEN sra.data_element_id = '{{ id }}' THEN NULLIF(sra.body,'') END) AS \"{{ code }}\"\r\n {% endfor %}\r\n FROM {{ ref('survey_responses') }} sr \r\n JOIN {{ ref('survey_response_answers') }} sra \r\n ON sra.response_id = sr.id\r\n JOIN {{ ref('encounters')}} e\r\n ON e.id = sr.encounter_id\r\n WHERE sr.survey_id = '{{ survey_id }}'\r\n GROUP BY sra.response_id, sr.encounter_id, sr.start_datetime, sr.end_datetime, sr.result_text, e.patient_id\r\n{% endmacro %}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_survey_columns", "macro.dbt_utils.get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_surveys_list": {"name": "get_surveys_list", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\surveys.sql", "original_file_path": "macros\\surveys.sql", "unique_id": "macro.tamanu_source_dbt.get_surveys_list", "macro_sql": "{% macro get_surveys_list() %}\r\n {% set query %}\r\n SELECT \r\n id,\r\n name\r\n FROM {{ source('tamanu', 'surveys') }}\r\n WHERE deleted_at IS NULL\r\n AND visibility_status = 'current'\r\n {% endset %}\r\n \r\n {% set results = run_query(query) %}\r\n \r\n {% if execute %}\r\n {% for row in results %}\r\n {{ log(\"SURVEY_DATA:\" ~ row[0] ~ \"|\" ~ row[1], info=true) }}\r\n {% endfor %}\r\n {% endif %}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_survey_docs": {"name": "get_survey_docs", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\surveys.sql", "original_file_path": "macros\\surveys.sql", "unique_id": "macro.tamanu_source_dbt.get_survey_docs", "macro_sql": "{% macro get_survey_docs(survey_id) %}\r\n {%- set query = get_survey_columns(survey_id) -%}\r\n {% set results = run_query(query) %}\r\n \r\n {% if execute %}\r\n {% for row in results %}\r\n {{ log(\"COLUMN_DATA:\" ~ row[0] ~ \"|\" ~ row[1] ~ \"|\" ~ row[2], info=true) }}\r\n {% endfor %}\r\n {% endif %}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_survey_columns", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.translate_label": {"name": "translate_label", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\translations.sql", "original_file_path": "macros\\translations.sql", "unique_id": "macro.tamanu_source_dbt.translate_label", "macro_sql": "{%- macro translate_label(string_id, language=var(\"language\", \"default\")) -%}\r\n {%- set full_string_id = 'report.reporting.' ~ string_id -%}\r\n {%- set translations = get_translations() -%}\r\n\r\n {%- if full_string_id in translations -%}\r\n {%- set lang_dict = translations[full_string_id] -%}\r\n {{- lang_dict.get(language, lang_dict.get('default', string_id)) -}}\r\n {%- elif string_id in translations -%}\r\n {%- set lang_dict = translations[string_id] -%}\r\n {{- lang_dict.get(language, lang_dict.get('default', string_id)) -}}\r\n {%- else -%}\r\n {{- string_id -}}\r\n {%- endif -%}\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_translation_prefix": {"name": "get_translation_prefix", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\translations.sql", "original_file_path": "macros\\translations.sql", "unique_id": "macro.tamanu_source_dbt.get_translation_prefix", "macro_sql": "{%- macro get_translation_prefix(prefix_key) -%}\r\n {%- set mapping = {\r\n 'APPOINTMENT_STATUSES': 'appointment.property.status',\r\n 'ATTENDANT_OF_BIRTH_LABELS': 'birth.property.attendantOfBirth',\r\n 'ASSET_NAME_LABELS': 'asset.property.name',\r\n 'BIRTH_DELIVERY_TYPE_LABELS': 'birth.property.birthDeliveryType',\r\n 'BIRTH_TYPE_LABELS': 'birth.property.birthType',\r\n 'BLOOD_LABELS': 'patient.property.blood',\r\n 'DIAGNOSIS_CERTAINTY_LABELS': 'diagnosis.property.certainty',\r\n 'DRUG_ROUTE_LABELS': 'medication.property.route',\r\n 'EDUCATIONAL_ATTAINMENT_LABELS': 'patient.property.educationalAttainment',\r\n 'ENCOUNTER_TYPE_LABELS': 'encounter.property.type',\r\n 'IMAGING_TYPES': 'imaging.property.type',\r\n 'IMAGING_REQUEST_STATUS_LABELS': 'imaging.property.status',\r\n 'INJECTION_SITE_LABELS': 'vaccine.property.injectionSite',\r\n 'INVOICE_INSURER_PAYMENT_STATUS_LABELS': 'invoice.property.insurerPaymentStatus',\r\n 'INVOICE_ITEMS_CATEGORY_LABELS': 'invoice.property.itemCategory',\r\n 'INVOICE_PATIENT_PAYMENT_STATUSES_LABELS': 'invoice.property.patientPaymentStatus',\r\n 'INVOICE_STATUS_LABELS': 'invoice.property.status',\r\n 'LAB_REQUEST_STATUS_LABELS': 'lab.property.status',\r\n 'LOCATION_AVAILABILITY_STATUS_LABELS': 'bedManagement.property.status',\r\n 'MANNER_OF_DEATHS': 'death.property.mannerOfDeath',\r\n 'MARTIAL_STATUS_LABELS': 'patient.property.maritalStatus',\r\n 'NOTE_TYPE_LABELS': 'note.property.type',\r\n 'PATIENT_ISSUE_LABELS': 'patient.property.issue',\r\n 'PLACE_OF_BIRTH_LABELS': 'birth.property.placeOfBirth',\r\n 'PLACE_OF_DEATHS': 'death.property.placeOfDeath',\r\n 'PROGRAM_REGISTRATION_STATUS_LABELS': 'programRegistry.property.registrationStatus',\r\n 'REFERRAL_STATUS_LABELS': 'referral.property.status',\r\n 'REPEATS_LABELS': 'medication.property.repeats',\r\n 'REPEAT_FREQUENCY_LABELS': 'scheduling.property.repeatFrequency',\r\n 'REPEAT_FREQUENCY_UNIT_LABELS': 'scheduling.property.repeatFrequencyUnit',\r\n 'REPEAT_FREQUENCY_UNIT_PLURAL_LABELS': 'scheduling.property.repeatFrequencyUnitPlural',\r\n 'REPORT_DATA_SOURCE_LABELS': 'report.property.dataSource',\r\n 'REPORT_DB_SCHEMA_LABELS': 'report.property.schema',\r\n 'REPORT_DEFAULT_DATE_RANGES_LABELS': 'report.property.defaultDateRange',\r\n 'REPORT_STATUS_LABELS': 'report.property.status',\r\n 'SEX_LABELS': 'patient.property.sex',\r\n 'TASK_FREQUENCY_UNIT_LABELS': 'task.property.frequencyUnit',\r\n 'TASK_DURATION_UNIT_LABELS': 'task.property.durationUnit',\r\n 'SOCIAL_MEDIA_LABELS': 'patient.property.socialMedia',\r\n 'TEMPLATE_TYPE_LABELS': 'template.property.type',\r\n 'TITLE_LABELS': 'patient.property.title',\r\n 'VACCINE_CATEGORY_LABELS': 'vaccine.property.category',\r\n 'VACCINE_STATUS_LABELS': 'vaccine.property.status'\r\n } -%}\r\n \r\n {%- if prefix_key in mapping -%}\r\n {{- mapping[prefix_key] -}}\r\n {%- else -%}\r\n {{- exceptions.raise_compiler_error(\"Unknown translation prefix key: \" ~ prefix_key) -}}\r\n {%- endif -%}\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.get_translation_lookup": {"name": "get_translation_lookup", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\translations.sql", "original_file_path": "macros\\translations.sql", "unique_id": "macro.tamanu_source_dbt.get_translation_lookup", "macro_sql": "{%- macro get_translation_lookup(prefix_key=none, language=var(\"language\", \"default\")) -%}\r\n {%- if prefix_key is none -%}\r\n {%- set key_list = [] -%}\r\n {%- elif prefix_key is string -%}\r\n {%- set key_list = [prefix_key] -%}\r\n {%- else -%}\r\n {%- set key_list = prefix_key | list -%}\r\n {%- endif -%}\r\n {%- set ns = namespace(where_clauses=[]) -%}\r\n {%- for key in key_list -%}\r\n {%- set p = get_translation_prefix(key) -%}\r\n {%- set escaped = p.replace(\"'\", \"''\") -%}\r\n {%- set ns.where_clauses = ns.where_clauses + [\"string_id like '\" ~ escaped ~ \".%'\"] -%}\r\n {%- endfor -%}\r\n select\r\n string_id,\r\n {%- if language == 'default' %}\r\n max(text) filter (where language = 'default') as text\r\n {%- else %}\r\n coalesce(\r\n max(text) filter (where language = '{{ language }}'),\r\n max(text) filter (where language = 'default')\r\n ) as text\r\n {%- endif %}\r\n from {{ ref('translated_strings') }}\r\n {%- if ns.where_clauses | length > 0 %}\r\n where {{ ns.where_clauses | join('\\n or ') }}\r\n {%- endif %}\r\n group by string_id\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translation_prefix", "macro.dbt.replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.translate_column_value": {"name": "translate_column_value", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\translations.sql", "original_file_path": "macros\\translations.sql", "unique_id": "macro.tamanu_source_dbt.translate_column_value", "macro_sql": "{%- macro translate_column_value(prefix_key, column_name, language=var(\"language\", \"default\")) -%}\r\n {%- set translations = get_translations() -%}\r\n {%- set prefix = get_translation_prefix(prefix_key) -%}\r\n {%- set ns = namespace(has_translations=false) -%}\r\n {%- for string_id, lang_dict in translations.items() -%}\r\n {%- if string_id.startswith(prefix ~ '.') -%}\r\n {%- set ns.has_translations = true -%}\r\n {%- break -%}\r\n {%- endif -%}\r\n {%- endfor -%}\r\n {%- if ns.has_translations -%}\r\n case\r\n {%- for string_id, lang_dict in translations.items() -%}\r\n {%- if string_id.startswith(prefix ~ '.') -%}\r\n {%- set value = string_id.replace(prefix ~ '.', '') -%}\r\n {%- set translated_text = lang_dict.get(language, lang_dict.get('default', value)).replace(\"'\", \"''\") -%}\r\n when {{ column_name }} = '{{ value }}' then '{{ translated_text }}'\r\n {%- endif -%}\r\n {%- endfor %}\r\n else {{ column_name }}\r\n end\r\n {%- else -%}\r\n {{ column_name }}\r\n {%- endif -%}\r\n{%- endmacro -%}", "depends_on": {"macros": ["macro.tamanu_source_dbt.get_translations", "macro.tamanu_source_dbt.get_translation_prefix", "macro.dbt.replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.test_valid_visibility_status": {"name": "test_valid_visibility_status", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\data_tests\\test__valid_visibility_status.sql", "original_file_path": "macros\\data_tests\\test__valid_visibility_status.sql", "unique_id": "macro.tamanu_source_dbt.test_valid_visibility_status", "macro_sql": "{% test valid_visibility_status(model, column_name) %}\r\nSELECT *\r\nFROM {{ model }}\r\nWHERE {{ column_name }} NOT IN ('current', 'historical', 'merged')\r\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.8894963, "supported_languages": null}, "macro.tamanu_source_dbt.admissions_dataset": {"name": "admissions_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\admissions.sql", "original_file_path": "macros\\models\\admissions.sql", "unique_id": "macro.tamanu_source_dbt.admissions_dataset", "macro_sql": "{% macro admissions_dataset(is_sensitive=false) %}\r\n\r\nwith admission_encounters as (\r\n select\r\n e.id,\r\n e.patient_id,\r\n e.start_datetime,\r\n e.end_datetime,\r\n e.location_id,\r\n e.patient_billing_type_id,\r\n f.id as facility_id,\r\n f.name as facility_name\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l on l.id = e.location_id\r\n join {{ ref('facilities') }} f on f.id = l.facility_id\r\n where e.encounter_type = 'admission'\r\n and f.is_sensitive = {{ is_sensitive }}\r\n),\r\n\r\nencounter_history_consolidated as (\r\n select\r\n eh.encounter_id,\r\n eh.datetime,\r\n eh.change_type,\r\n eh.clinician_id,\r\n eh.department_id,\r\n eh.location_id,\r\n u.display_name as clinician_name,\r\n d.name as department_name,\r\n l.name as location_name,\r\n lg.id as location_group_id,\r\n lg.name as location_group_name,\r\n -- Window functions for ordering and lag operations\r\n row_number() over (\r\n partition by eh.encounter_id, ('encounter_type' = any(eh.change_type))\r\n order by eh.datetime\r\n ) as encounter_type_change_sequence,\r\n lag(lg.id) over (\r\n partition by eh.encounter_id\r\n order by eh.datetime\r\n ) as prev_location_group_id\r\n from admission_encounters ae\r\n left join {{ ref('encounter_history') }} eh\r\n on eh.encounter_id = ae.id\r\n and eh.encounter_type = 'admission'\r\n and (eh.change_type is null or eh.change_type && array['encounter_type', 'examiner', 'department', 'location'])\r\n left join {{ ref('users') }} u\r\n on u.id = eh.clinician_id\r\n left join {{ ref('departments') }} d\r\n on d.id = eh.department_id\r\n left join {{ ref('locations') }} l\r\n on l.id = eh.location_id\r\n left join {{ ref('location_groups') }} lg\r\n on lg.id = l.location_group_id\r\n),\r\n\r\n-- Clinician changes and admitting clinician logic\r\nclinician_data as (\r\n select\r\n encounter_id,\r\n bool_or('encounter_type' = any(change_type) and encounter_type_change_sequence = 1) as is_transfer,\r\n min(datetime) filter (where change_type is null or change_type && array['encounter_type', 'examiner']) as admission_datetime,\r\n array_agg(\r\n datetime\r\n order by datetime\r\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\r\n ) as clinician_datetimes,\r\n array_agg(\r\n clinician_id\r\n order by datetime\r\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\r\n ) as clinician_ids,\r\n array_agg(\r\n clinician_name\r\n order by datetime\r\n ) filter (where change_type is null or change_type && array['encounter_type', 'examiner']\r\n ) as clinician_names\r\n from encounter_history_consolidated\r\n group by encounter_id\r\n),\r\n\r\n-- Admitting clinician determination\r\nadmitting_clinicians as (\r\n select\r\n encounter_id,\r\n admission_datetime,\r\n case\r\n when is_transfer and array_length(clinician_ids, 1) > 1\r\n then clinician_ids[2]\r\n else clinician_ids[1]\r\n end as admitting_clinician_id,\r\n case\r\n when is_transfer and array_length(clinician_names, 1) > 1\r\n then clinician_names[2]\r\n else clinician_names[1]\r\n end as admitting_clinician_name\r\n from clinician_data\r\n),\r\n\r\n-- Department changes aggregation\r\ndepartment_changes as (\r\n select\r\n encounter_id,\r\n string_agg(\r\n to_char(datetime, '{{ var(\"datetime_without_seconds_format\") }}'),\r\n '; '\r\n order by datetime\r\n ) as department_datetimes,\r\n array_agg(\r\n department_id\r\n order by datetime\r\n ) as department_ids,\r\n string_agg(\r\n department_name, ', '\r\n order by datetime\r\n ) as departments\r\n from encounter_history_consolidated\r\n where change_type is null or change_type && array['encounter_type', 'department']\r\n group by encounter_id\r\n),\r\n\r\n-- Location changes aggregation\r\nlocation_changes as (\r\n select\r\n encounter_id,\r\n string_agg(\r\n to_char(datetime, '{{ var(\"datetime_without_seconds_format\") }}'),\r\n '; '\r\n order by datetime\r\n ) as location_datetimes,\r\n array_agg(\r\n location_id\r\n order by datetime\r\n ) as location_ids,\r\n string_agg(\r\n location_name, ', '\r\n order by datetime\r\n ) as locations\r\n from encounter_history_consolidated\r\n where change_type is null or change_type && array['encounter_type', 'location']\r\n group by encounter_id\r\n),\r\n\r\n-- Location group changes (deduplicated in single pass)\r\nlocation_group_changes as (\r\n select\r\n encounter_id,\r\n string_agg(\r\n to_char(datetime, '{{ var(\"datetime_without_seconds_format\") }}'),\r\n '; '\r\n order by datetime\r\n ) as location_group_datetimes,\r\n array_agg(\r\n location_group_id\r\n order by datetime\r\n ) as location_group_ids,\r\n string_agg(\r\n location_group_name, ', '\r\n order by datetime\r\n ) as location_groups\r\n from encounter_history_consolidated\r\n where (change_type is null or change_type && array['encounter_type', 'location'])\r\n and (location_group_id != prev_location_group_id or prev_location_group_id is null)\r\n group by encounter_id\r\n),\r\n\r\n-- Diagnoses aggregation\r\nencounter_diagnoses as (\r\n select\r\n ed.encounter_id,\r\n string_agg(\r\n case when ed.is_primary\r\n then rd.name || ' (' || rd.code || ')'\r\n end,\r\n '; '\r\n order by ed.datetime\r\n ) as primary_diagnoses,\r\n string_agg(\r\n case when not ed.is_primary\r\n then rd.name || ' (' || rd.code || ')'\r\n end,\r\n '; '\r\n order by ed.datetime\r\n ) as secondary_diagnoses\r\n from admission_encounters ae\r\n inner join {{ ref('encounter_diagnoses') }} ed\r\n on ed.encounter_id = ae.id\r\n inner join {{ ref('reference_data') }} rd\r\n on rd.id = ed.diagnosis_id\r\n where ed.certainty not in ('disproven', 'error')\r\n group by ed.encounter_id\r\n),\r\n\r\n-- Patient and reference data\r\npatient_data as (\r\n select\r\n ae.id as encounter_id,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n p.village_id,\r\n village.name as village_name,\r\n ae.patient_billing_type_id,\r\n bt.name as billing_type_name,\r\n ae.start_datetime,\r\n ae.end_datetime,\r\n ae.location_id,\r\n ae.facility_id,\r\n ae.facility_name\r\n from admission_encounters ae\r\n left join {{ ref('patients') }} p\r\n on p.id = ae.patient_id\r\n left join {{ ref('reference_data') }} village\r\n on village.id = p.village_id\r\n left join {{ ref('reference_data') }} bt\r\n on bt.id = ae.patient_billing_type_id\r\n)\r\n\r\nselect\r\n pd.patient_id,\r\n pd.display_id,\r\n pd.first_name,\r\n pd.last_name,\r\n pd.date_of_birth,\r\n date_part('year', age(ac.admission_datetime, pd.date_of_birth)) as age,\r\n initcap(pd.sex::text) as sex,\r\n pd.village_id,\r\n pd.village_name as village,\r\n pd.patient_billing_type_id as billing_type_id,\r\n pd.billing_type_name as billing_type,\r\n ac.admitting_clinician_id,\r\n ac.admitting_clinician_name as admitting_clinician,\r\n ac.admission_datetime,\r\n case\r\n when pd.end_datetime is null then 'active'\r\n else 'discharged'\r\n end as admission_status,\r\n pd.end_datetime as discharge_datetime,\r\n pd.facility_id,\r\n pd.facility_name as facility,\r\n dc.department_ids,\r\n dc.departments,\r\n dc.department_datetimes,\r\n lgc.location_group_ids,\r\n lgc.location_groups,\r\n lgc.location_group_datetimes,\r\n lc.location_ids,\r\n lc.locations,\r\n lc.location_datetimes,\r\n ed.primary_diagnoses,\r\n ed.secondary_diagnoses\r\nfrom patient_data pd\r\nleft join admitting_clinicians ac\r\n on ac.encounter_id = pd.encounter_id\r\nleft join department_changes dc\r\n on dc.encounter_id = pd.encounter_id\r\nleft join location_changes lc\r\n on lc.encounter_id = pd.encounter_id\r\nleft join location_group_changes lgc\r\n on lgc.encounter_id = pd.encounter_id\r\nleft join encounter_diagnoses ed\r\n on ed.encounter_id = pd.encounter_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.diagnoses_dataset": {"name": "diagnoses_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\diagnoses.sql", "original_file_path": "macros\\models\\diagnoses.sql", "unique_id": "macro.tamanu_source_dbt.diagnoses_dataset", "macro_sql": "{% macro diagnoses_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n e.id as encounter_id,\r\n p.id as patient_id,\r\n diagnosis.id as diagnosis_id,\r\n diagnosis.name as diagnosis,\r\n ed.datetime as diagnosis_datetime,\r\n p.first_name,\r\n p.last_name,\r\n p.display_id,\r\n date_part('year', age(ed.datetime::date, p.date_of_birth)) as age,\r\n p.sex,\r\n coalesce(pad.primary_contact_number, pad.secondary_contact_number) as contact_number,\r\n village.id as village_id,\r\n village.name as village,\r\n clinician.id as clinician_id,\r\n clinician.display_name as clinician,\r\n d.id as department_id,\r\n d.name as department,\r\n l.id as location_id,\r\n l.name as location,\r\n f.id as facility_id,\r\n f.name as facility,\r\n initcap(ed.certainty) as certainty,\r\n case when ed.is_primary = true then 'Yes' else 'No' end as is_primary\r\nfrom {{ ref('encounter_diagnoses') }} ed\r\njoin {{ ref('reference_data') }} diagnosis on diagnosis.id = ed.diagnosis_id\r\njoin {{ ref('encounters') }} e on e.id = ed.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\nleft join {{ ref('patient_additional_data') }} pad on pad.patient_id = p.id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('users') }} clinician on clinician.id = e.clinician_id\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\njoin {{ ref('locations') }} l on l.id = e.location_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.encounters_emergency_dataset": {"name": "encounters_emergency_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\encounters_emergency.sql", "original_file_path": "macros\\models\\encounters_emergency.sql", "unique_id": "macro.tamanu_source_dbt.encounters_emergency_dataset", "macro_sql": "{% macro encounters_emergency_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n t.id as triage_id,\r\n t.arrival_datetime,\r\n t.triage_datetime,\r\n t.closed_datetime,\r\n t.score,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n p.sex,\r\n p.village_id,\r\n village.name as village,\r\n e.id as encounter_id,\r\n e.encounter_type,\r\n arrival_mode.name as arrival_mode,\r\n chief_complaint.name as chief_complaint,\r\n secondary_complaint.name as secondary_complaint,\r\n clinician.display_name as clinician,\r\n t.clinician_id,\r\n f.id as facility_id,\r\n f.name as facility\r\nfrom {{ ref(\"triages\") }} t\r\njoin {{ ref(\"encounters\") }} e on e.id = t.encounter_id\r\njoin {{ ref(\"patients\") }} p on p.id = e.patient_id\r\nleft join {{ ref(\"locations\") }} l on l.id = e.location_id\r\njoin {{ ref(\"facilities\") }} f on f.id = l.facility_id and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref(\"reference_data\") }} village on village.id = p.village_id\r\nleft join {{ ref(\"reference_data\") }} arrival_mode on arrival_mode.id = t.arrival_mode_id\r\nleft join {{ ref(\"reference_data\") }} chief_complaint on chief_complaint.id = t.chief_complaint_id\r\nleft join {{ ref(\"reference_data\") }} secondary_complaint on secondary_complaint.id = t.secondary_complaint_id\r\nleft join {{ ref(\"users\") }} clinician on clinician.id = t.clinician_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.encounter_diets_dataset": {"name": "encounter_diets_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\encounter_diets.sql", "original_file_path": "macros\\models\\encounter_diets.sql", "unique_id": "macro.tamanu_source_dbt.encounter_diets_dataset", "macro_sql": "{% macro encounter_diets_dataset(is_sensitive=false) %}\r\n\r\nwith diets as (\r\n select\r\n ed.encounter_id,\r\n string_agg(\r\n rd.name, ', '\r\n order by rd.name\r\n ) as diets\r\n from {{ ref('encounter_diets') }} ed\r\n join {{ ref('reference_data') }} rd\r\n on rd.id = ed.diet_id\r\n group by ed.encounter_id\r\n),\r\n\r\nallergies as (\r\n select\r\n pa.patient_id,\r\n string_agg(\r\n rd.name, ', '\r\n order by rd.name\r\n ) as allergies\r\n from {{ ref('patient_allergies') }} pa\r\n join {{ ref('reference_data') }} rd\r\n on rd.id = pa.allergy_id\r\n group by pa.patient_id\r\n)\r\n\r\nselect\r\n e.id as encounter_id,\r\n p.id as patient_id,\r\n p.display_id,\r\n concat(p.first_name, ' ', p.last_name) as patient_name,\r\n e.start_datetime,\r\n case\r\n when age(current_date, p.date_of_birth) < interval '8 days'\r\n then concat(extract(day from age(current_date, p.date_of_birth)), ' days')\r\n when age(current_date, p.date_of_birth) >= interval '8 days'\r\n and age(current_date, p.date_of_birth) < interval '1 month'\r\n then concat(extract(week from age(current_date, p.date_of_birth)), ' weeks')\r\n when age(current_date, p.date_of_birth) >= interval '1 month'\r\n and age(current_date, p.date_of_birth) < interval '2 years'\r\n then concat(extract(month from age(current_date, p.date_of_birth)), ' months')\r\n when age(current_date, p.date_of_birth) >= interval '2 years'\r\n then concat(extract(year from age(current_date, p.date_of_birth)), ' years')\r\n end as age,\r\n l.id as location_id,\r\n l.name as location,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n d.diets,\r\n a.allergies\r\nfrom {{ ref('encounters') }} e\r\njoin {{ ref('patients') }} p\r\n on p.id = e.patient_id\r\njoin {{ ref('locations') }} l\r\n on l.id = e.location_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('location_groups') }} lg\r\n on lg.id = l.location_group_id\r\nleft join diets d\r\n on d.encounter_id = e.id\r\nleft join allergies a\r\n on a.patient_id = p.id\r\nwhere e.end_datetime is null\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.encounter_prescriptions_dataset": {"name": "encounter_prescriptions_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\encounter_prescriptions.sql", "original_file_path": "macros\\models\\encounter_prescriptions.sql", "unique_id": "macro.tamanu_source_dbt.encounter_prescriptions_dataset", "macro_sql": "{% macro encounter_prescriptions_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n ep.encounter_id,\r\n ep.prescription_id,\r\n pr.datetime,\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(pr.datetime, p.date_of_birth)) as age,\r\n p.sex,\r\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\r\n vil.id as village_id,\r\n vil.name as village,\r\n l.facility_id,\r\n f.name as facility,\r\n ep.is_selected_for_discharge,\r\n pr.medication_id,\r\n m.code as medication_code,\r\n m.name as medication,\r\n pr.route,\r\n pr.quantity,\r\n pr.repeats,\r\n pr.is_ongoing,\r\n pr.is_prn,\r\n pr.is_variable_dose,\r\n pr.dose_amount,\r\n pr.units,\r\n pr.frequency,\r\n pr.is_discontinued,\r\n pr.discontinued_by_id,\r\n pr.discontinuing_reason,\r\n pr.discontinued_datetime\r\nfrom {{ ref(\"encounter_prescriptions\") }} ep\r\njoin {{ ref(\"encounters\") }} e on e.id = ep.encounter_id\r\njoin {{ ref(\"patients\") }} p on p.id = e.patient_id\r\njoin {{ ref(\"prescriptions\") }} pr on pr.id = ep.prescription_id\r\njoin {{ ref(\"locations\") }} l on l.id = e.location_id\r\njoin {{ ref(\"facilities\") }} f \r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('patient_additional_data') }} pd on pd.patient_id = p.id\r\nleft join {{ ref('reference_data') }} vil on vil.id = p.village_id\r\njoin {{ ref(\"reference_data\")}} m on m.id = pr.medication_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.encounter_summary_report": {"name": "encounter_summary_report", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\encounter_summary.sql", "original_file_path": "macros\\models\\encounter_summary.sql", "unique_id": "macro.tamanu_source_dbt.encounter_summary_report", "macro_sql": "{% macro encounter_summary_report(date_field, is_sensitive=false) %}\r\n\r\nwith encounters_in_scope as (\r\n select\r\n e.id as encounter_id,\r\n e.start_datetime,\r\n e.end_datetime,\r\n e.patient_id,\r\n e.location_id,\r\n e.department_id,\r\n e.clinician_id,\r\n e.patient_billing_type_id,\r\n e.reason_for_encounter,\r\n f.id as facility_id,\r\n f.name as facility\r\n from {{ ref('encounters') }} e\r\n join {{ ref('locations') }} l\r\n on l.id = e.location_id\r\n join {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\n where\r\n e.patient_id != '{{ var(\"test_patient\") }}'\r\n {% if date_field == 'end_datetime' %}\r\n and e.end_datetime is not null\r\n {% endif %}\r\n and case\r\n when {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }} is null then true\r\n else e.{{ date_field }} >= {{ parameter('fromDate', default_value='2024-01-01', data_type='date') }}\r\n end\r\n and case\r\n when {{ parameter('toDate', default_value='2024-01-31', data_type='date') }} is null then true\r\n else e.{{ date_field }} <= {{ parameter('toDate', default_value='2024-01-31', data_type='date') }}\r\n end\r\n and case\r\n when {{ parameter('facilityId') }} is null then true\r\n else f.id = {{ parameter('facilityId') }}\r\n end\r\n and case\r\n when {{ parameter('patientBillingTypeId') }} is null then true\r\n else e.patient_billing_type_id = {{ parameter('patientBillingTypeId') }}\r\n end\r\n and case\r\n when {{ parameter('supervisingClinicianId') }} is null then true\r\n else e.clinician_id = {{ parameter('supervisingClinicianId') }}\r\n end\r\n),\r\n\r\nencounter_history_consolidated as (\r\n select\r\n eh.encounter_id,\r\n eh.datetime,\r\n eh.change_type,\r\n eh.updated_by_id,\r\n eh.clinician_id,\r\n eh.department_id,\r\n eh.location_id,\r\n eh.encounter_type,\r\n clinician.display_name as clinician_name,\r\n actor.display_name as updated_by_name,\r\n d.name as department_name,\r\n l.name as location_name,\r\n lg.id as location_group_id,\r\n lg.name as location_group_name,\r\n row_number() over (\r\n partition by eh.encounter_id, eh.change_type\r\n order by eh.datetime\r\n ) as change_sequence,\r\n lag(lg.id) over (\r\n partition by eh.encounter_id\r\n order by eh.datetime\r\n ) as prev_location_group_id\r\n from {{ ref('encounter_history') }} eh\r\n join encounters_in_scope eis\r\n on eis.encounter_id = eh.encounter_id\r\n join {{ ref('users') }} actor\r\n on actor.id = eh.updated_by_id\r\n join {{ ref('users') }} clinician\r\n on clinician.id = eh.clinician_id\r\n join {{ ref('departments') }} d\r\n on d.id = eh.department_id\r\n join {{ ref('locations') }} l\r\n on l.id = eh.location_id\r\n left join {{ ref('location_groups') }} lg\r\n on lg.id = l.location_group_id\r\n),\r\n\r\nencounter_changes as (\r\n select\r\n encounter_id,\r\n \r\n -- Location changes: tracks all location changes throughout the encounter\r\n array_agg(\r\n to_char(datetime, '{{ var(\"datetime_format\") }}')\r\n order by datetime\r\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_datetimes,\r\n array_agg(\r\n location_id\r\n order by datetime\r\n ) filter (where change_type isnull or 'location' = any(change_type)) as location_ids,\r\n string_agg(\r\n location_name, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'location' = any(change_type)) as locations,\r\n\r\n -- Location group changes: tracks location group changes (only when group actually changes)\r\n array_agg(\r\n to_char(datetime, '{{ var(\"datetime_format\") }}')\r\n order by datetime\r\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_datetimes,\r\n array_agg(\r\n location_group_id\r\n order by datetime\r\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_group_ids,\r\n string_agg(\r\n location_group_name, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or ('location' = any(change_type) and location_group_id is distinct from prev_location_group_id)) as location_groups,\r\n\r\n -- Department changes: tracks all department changes throughout the encounter\r\n array_agg(\r\n to_char(datetime, '{{ var(\"datetime_format\") }}')\r\n order by datetime\r\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_datetimes,\r\n array_agg(\r\n department_id\r\n order by datetime\r\n ) filter (where change_type isnull or 'department' = any(change_type)) as department_ids,\r\n string_agg(\r\n department_name, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'department' = any(change_type)) as departments,\r\n\r\n -- Encounter type changes: tracks encounter type progression (emergency types)\r\n string_agg(\r\n case\r\n when encounter_type = 'triage' then 'Triage'\r\n when encounter_type = 'observation' then 'Active ED care'\r\n when encounter_type = 'emergency' then 'Emergency short stay'\r\n end, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_emergency,\r\n\r\n -- Encounter type changes: tracks encounter type progression (inpatient types)\r\n string_agg(\r\n case\r\n when encounter_type = 'admission' then 'Hospital admission'\r\n end, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_inpatient,\r\n\r\n -- Encounter type changes: tracks encounter type progression (outpatient types)\r\n string_agg(\r\n case\r\n when encounter_type = 'clinic' then 'Clinic'\r\n when encounter_type = 'imaging' then 'Imaging'\r\n when encounter_type = 'surveyResponse' then 'Survey response'\r\n when encounter_type = 'vaccination' then 'Vaccination'\r\n end, ', '\r\n order by datetime\r\n ) filter (where change_type isnull or 'encounter_type' = any(change_type)) as encounter_type_outpatient,\r\n\r\n -- Encountering clinician: actor who created the initial encounter record (change_sequence = 1 ensures the creation row is used)\r\n min(updated_by_id) filter (where change_type is null and change_sequence = 1) as encountering_clinician_id,\r\n min(updated_by_name) filter (where change_type is null and change_sequence = 1) as encountering_clinician\r\n from encounter_history_consolidated\r\n group by encounter_id\r\n),\r\n\r\nencounter_diagnoses as (\r\n select\r\n ed.encounter_id,\r\n string_agg(\r\n concat(\r\n 'Name: ', d.name,\r\n ', Code: ', d.code,\r\n ', Is primary: ', case when ed.is_primary then 'primary' else 'secondary' end,\r\n ', Certainty: ', ed.certainty\r\n ),\r\n E'\\n'\r\n order by ed.is_primary desc, ed.datetime asc\r\n ) as diagnoses\r\n from {{ ref('encounter_diagnoses') }} ed\r\n join encounters_in_scope eis\r\n on eis.encounter_id = ed.encounter_id\r\n join {{ ref('reference_data') }} d\r\n on d.id = ed.diagnosis_id\r\n group by ed.encounter_id\r\n),\r\n\r\nencounter_prescriptions as (\r\n select\r\n ep.encounter_id,\r\n string_agg(\r\n concat(\r\n 'Name: ', m.name,\r\n ', Discontinued: ', case when p.is_discontinued then 'true' else 'false' end,\r\n ', Discontinuing reason: ', p.discontinuing_reason\r\n ),\r\n '' || E'\\n' || ''\r\n order by p.datetime\r\n ) as medications\r\n from {{ ref('encounter_prescriptions') }} ep\r\n join encounters_in_scope eis\r\n on eis.encounter_id = ep.encounter_id\r\n join {{ ref('prescriptions') }} p\r\n on p.id = ep.prescription_id\r\n join {{ ref('reference_data') }} m\r\n on m.id = p.medication_id\r\n group by ep.encounter_id\r\n),\r\n\r\nencounter_vaccinations as (\r\n select\r\n av.encounter_id,\r\n string_agg(\r\n concat(\r\n v.name,\r\n ', Label: ', sv.label,\r\n ', Schedule: ', sv.dose_label\r\n ),\r\n E'\\n'\r\n order by av.datetime\r\n ) as vaccinations\r\n from {{ ref('vaccine_administrations') }} av\r\n join encounters_in_scope eis\r\n on eis.encounter_id = av.encounter_id\r\n join {{ ref('vaccine_schedules') }} sv\r\n on sv.id = av.scheduled_vaccine_id\r\n join {{ ref('reference_data') }} v\r\n on v.id = sv.vaccine_id\r\n group by av.encounter_id\r\n),\r\n\r\nencounter_procedures as (\r\n select\r\n p.encounter_id,\r\n string_agg(\r\n concat(\r\n 'Name: ', proc.name,\r\n ', Date: ', to_char(p.date, '{{ var(\"date_format\") }}'),\r\n ', Location: ', loc.name,\r\n ', Notes: ', p.note,\r\n ', Completed notes: ', p.completed_note\r\n ),\r\n E'\\n'\r\n order by p.date\r\n ) as procedures\r\n from {{ ref('procedures') }} p\r\n join encounters_in_scope eis\r\n on eis.encounter_id = p.encounter_id\r\n left join {{ ref('reference_data') }} proc\r\n on proc.id = p.procedure_type_id\r\n left join {{ ref('locations') }} loc\r\n on loc.id = p.location_id\r\n group by p.encounter_id\r\n),\r\n\r\nencounter_lab_requests as (\r\n select\r\n lr.encounter_id,\r\n string_agg(\r\n coalesce(ltp.name, ltt.name), '' || E'\\n' || ''\r\n order by lr.collected_datetime\r\n ) as lab_requests\r\n from {{ ref('lab_requests') }} lr\r\n join encounters_in_scope eis\r\n on eis.encounter_id = lr.encounter_id\r\n left join {{ ref('lab_test_panel_requests') }} ltpr\r\n on ltpr.id = lr.lab_test_panel_request_id\r\n left join {{ ref('lab_test_panels') }} ltp\r\n on ltp.id = ltpr.lab_test_panel_id\r\n left join {{ ref('lab_tests') }} lt\r\n on lt.lab_request_id = lr.id\r\n and lr.lab_test_panel_request_id isnull\r\n left join {{ ref('lab_test_types') }} ltt\r\n on ltt.id = lt.lab_test_type_id\r\n where lr.status not in ('cancelled', 'deleted', 'entered-in-error')\r\n group by lr.encounter_id\r\n),\r\n\r\nnotes_raw as (\r\n select\r\n n.id,\r\n n.datetime,\r\n n.content,\r\n n.note_type_id,\r\n n.note_type,\r\n n.record_type,\r\n n.record_id,\r\n n.updated_note_id,\r\n n.visibility_status\r\n from {{ ref('notes') }} n\r\n left join {{ ref('imaging_requests') }} ir\r\n on n.record_type = 'ImagingRequest'\r\n and ir.id = n.record_id\r\n join encounters_in_scope eis\r\n on eis.encounter_id = coalesce(ir.encounter_id, n.record_id)\r\n where n.record_type in ('Encounter', 'ImagingRequest')\r\n),\r\n\r\nencounter_notes_deduped as (\r\n select\r\n id,\r\n datetime,\r\n content,\r\n note_type,\r\n record_id,\r\n visibility_status,\r\n row_number() over (partition by coalesce(updated_note_id, id) order by datetime desc) as row_number\r\n from notes_raw\r\n where\r\n record_type = 'Encounter'\r\n and note_type_id != 'notetype-system'\r\n),\r\n\r\nimaging_request_areas as (\r\n select\r\n ir.encounter_id,\r\n ira.imaging_request_id,\r\n case\r\n when ir.imaging_type = 'xRay' then 'X-Ray'\r\n when ir.imaging_type = 'ctScan' then 'CT Scan'\r\n when ir.imaging_type = 'ecg' then 'Electrocardiogram (ECG)'\r\n when ir.imaging_type = 'mri' then 'MRI'\r\n when ir.imaging_type = 'ultrasound' then 'Ultrasound'\r\n when ir.imaging_type = 'holterMonitor' then 'Holter Monitor'\r\n when ir.imaging_type = 'echocardiogram' then 'Echocardiogram'\r\n when ir.imaging_type = 'mammogram' then 'Mammogram'\r\n when ir.imaging_type = 'endoscopy' then 'Endoscopy'\r\n when ir.imaging_type = 'fluroscopy' then 'Fluroscopy'\r\n when ir.imaging_type = 'angiogram' then 'Angiogram'\r\n when ir.imaging_type = 'colonoscopy' then 'Colonoscopy'\r\n when ir.imaging_type = 'vascularStudy' then 'Vascular Study'\r\n when ir.imaging_type = 'stressTest' then 'Stress Test'\r\n else ir.imaging_type\r\n end as imaging_type,\r\n coalesce(\r\n string_agg(\r\n area.name, ', '\r\n order by area.name\r\n ),\r\n string_agg(case\r\n when n.note_type_id = 'notetype-areaToBeImaged' then n.content\r\n end, ', '\r\n order by n.datetime)\r\n ) as areas_to_be_imaged,\r\n string_agg(case\r\n when n.note_type_id = 'notetype-other' then n.content\r\n end, ','\r\n order by n.datetime) as notes\r\n from {{ ref('imaging_requests') }} ir\r\n join encounters_in_scope eis\r\n on eis.encounter_id = ir.encounter_id\r\n left join {{ ref('imaging_request_areas') }} ira\r\n on ira.imaging_request_id = ir.id\r\n left join {{ ref('reference_data') }} area\r\n on area.id = ira.area_id\r\n left join notes_raw n\r\n on n.record_id = ir.id\r\n and n.record_type = 'ImagingRequest'\r\n where ir.status not in ('cancelled', 'deleted', 'entered_in_error')\r\n group by ir.encounter_id, ira.imaging_request_id, ir.imaging_type\r\n),\r\n\r\nencounter_imaging_requests as (\r\n select\r\n encounter_id,\r\n string_agg(\r\n concat(imaging_type, ', Areas to be imaged: ', areas_to_be_imaged, ', Notes: ', notes), '' || E'\\n' || ''\r\n ) as imaging_requests\r\n from imaging_request_areas\r\n group by encounter_id\r\n),\r\n\r\nencounter_notes as (\r\n select\r\n n.record_id as encounter_id,\r\n string_agg(concat(\r\n 'Note type: ',\r\n n.note_type,\r\n ', Content: ', n.content,\r\n ', Note date: ', to_char(n.datetime, '{{ var(\"datetime_format\") }}')\r\n ),\r\n E'\\n'\r\n order by n.datetime) as notes\r\n from encounter_notes_deduped n\r\n where n.row_number = 1\r\n group by n.record_id\r\n),\r\n\r\ninvoice_data as (\r\n select\r\n i.encounter_id,\r\n max(\r\n case\r\n when i.status = 'finalised'\r\n then to_char(i.datetime, '{{ var(\"datetime_format\") }}')\r\n end\r\n ) as invoice_finalised_datetime,\r\n string_agg(distinct ip.category, ', ') as invoice_product_categories\r\n from {{ ref('invoices') }} i\r\n join encounters_in_scope eis\r\n on eis.encounter_id = i.encounter_id\r\n left join {{ ref('invoice_items') }} ii\r\n on ii.invoice_id = i.id\r\n left join {{ ref('invoice_products') }} ip\r\n on ip.id = ii.product_id\r\n group by i.encounter_id\r\n)\r\n\r\nselect\r\n p.display_id as \"{{ translate_label('patientDisplayId') }}\",\r\n p.first_name as \"{{ translate_label('patientFirstName') }}\",\r\n p.last_name as \"{{ translate_label('patientLastName') }}\",\r\n to_char(p.date_of_birth, '{{ var(\"date_format\") }}') as \"{{ translate_label('patientDateOfBirth') }}\",\r\n date_part('year', age(eis.start_datetime, p.date_of_birth)) as \"{{ translate_label('patientAge') }}\",\r\n p.sex as \"{{ translate_label('patientSex') }}\",\r\n eth.name as \"{{ translate_label('patientEthnicity') }}\",\r\n bt.name as \"{{ translate_label('patientBillingType') }}\",\r\n to_char(eis.start_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterStartDateTime') }}\",\r\n to_char(eis.end_datetime, '{{ var(\"datetime_format\") }}') as \"{{ translate_label('encounterEndDateTime') }}\",\r\n case\r\n when eis.end_datetime is not null then\r\n case\r\n when eis.end_datetime::date - eis.start_datetime::date < 1 then 1\r\n else eis.end_datetime::date - eis.start_datetime::date\r\n end\r\n end as \"{{ translate_label('encounterLengthOfStay') }}\",\r\n eis.facility as \"{{ translate_label('facility') }}\",\r\n ec.encounter_type_emergency as \"{{ translate_label('encounterTypeEmergency') }}\",\r\n ec.encounter_type_inpatient as \"{{ translate_label('encounterTypeInpatient') }}\",\r\n ec.encounter_type_outpatient as \"{{ translate_label('encounterTypeOutpatient') }}\",\r\n dd.name as \"{{ translate_label('dischargeDisposition') }}\",\r\n t.score as \"{{ translate_label('triageCategory') }}\",\r\n am.name as \"{{ translate_label('triageArrivalMode') }}\",\r\n case\r\n when t.closed_datetime notnull and t.triage_datetime notnull and t.closed_datetime > t.triage_datetime\r\n then concat(\r\n lpad((\r\n extract(day from (t.closed_datetime - t.triage_datetime)) * 24\r\n + extract(hour from (t.closed_datetime - t.triage_datetime))\r\n )::text, 2, '0'), ':',\r\n lpad(extract(minute from (t.closed_datetime - t.triage_datetime))::text, 2, '0'), ':',\r\n lpad(\r\n (extract(second from (t.closed_datetime - t.triage_datetime))::int)::text, 2, '0'\r\n )\r\n )\r\n end as \"{{ translate_label('triageWaitingTime') }}\",\r\n ec.encountering_clinician as \"{{ translate_label('encounterClinician') }}\",\r\n c.display_name as \"{{ translate_label('encounterSupervisingClinician') }}\",\r\n dp.name as \"{{ translate_label('dischargeDepartment') }}\",\r\n ec.department_datetimes[array_upper(ec.department_datetimes, 1)] as \"{{ translate_label('dischargeDateTime') }} of {{ translate_label('dischargeDepartment') }}\",\r\n lg.name as \"{{ translate_label('dischargeLocationGroup') }}\",\r\n ec.location_group_datetimes[array_upper(ec.location_group_datetimes, 1)] as \"{{ translate_label('dischargeDateTime') }} of {{ translate_label('dischargeLocationGroup') }}\",\r\n l.name as \"{{ translate_label('dischargeLocation') }}\",\r\n ec.location_datetimes[array_upper(ec.location_datetimes, 1)] as \"{{ translate_label('dischargeDateTime') }} of {{ translate_label('dischargeLocation') }}\",\r\n ec.departments as \"{{ translate_label('encounterDepartmentHistory') }}\",\r\n array_to_string(ec.department_datetimes, ', ') as \"{{ translate_label('encounterDepartmentHistoryDateTimes') }}\",\r\n ec.location_groups as \"{{ translate_label('encounterLocationGroupHistory') }}\",\r\n array_to_string(ec.location_group_datetimes, ', ') as \"{{ translate_label('encounterLocationGroupHistoryDateTimes') }}\",\r\n ec.locations as \"{{ translate_label('encounterLocationHistory') }}\",\r\n array_to_string(ec.location_datetimes, ', ') as \"{{ translate_label('encounterLocationHistoryDateTimes') }}\",\r\n eis.reason_for_encounter as \"{{ translate_label('encounterReasonForEncounter') }}\",\r\n ed.diagnoses as \"{{ translate_label('diagnoses') }}\",\r\n ep.medications as \"{{ translate_label('medications') }}\",\r\n ev.vaccinations as \"{{ translate_label('vaccinations') }}\",\r\n epr.procedures as \"{{ translate_label('procedures') }}\",\r\n elr.lab_requests as \"{{ translate_label('labRequests') }}\",\r\n eir.imaging_requests as \"{{ translate_label('imagingRequests') }}\",\r\n case\r\n when length(en.notes) > 32000\r\n then concat(\r\n 'THIS CELL HAS BEEN CROPPED AS IT EXCEEDED THE MAXIMUM LENGTH IN EXCEL - PLEASE SEE TAMANU FOR ',\r\n 'FULL NOTES HISTORY', '' || E'\\n' || '', left(en.notes, 32000)\r\n )\r\n else en.notes\r\n end as \"{{ translate_label('notes') }}\",\r\n invd.invoice_finalised_datetime as \"{{ translate_label('invoiceFinalisedDateTime') }}\",\r\n invd.invoice_product_categories as \"{{ translate_label('invoiceProductCategories') }}\"\r\nfrom encounters_in_scope eis\r\njoin {{ ref('patients') }} p\r\n on p.id = eis.patient_id\r\njoin {{ ref('locations') }} l\r\n on l.id = eis.location_id\r\njoin {{ ref('departments') }} dp\r\n on dp.id = eis.department_id\r\nleft join {{ ref('location_groups') }} lg\r\n on lg.id = l.location_group_id\r\nleft join {{ ref('users') }} c\r\n on c.id = eis.clinician_id\r\njoin encounter_changes ec\r\n on ec.encounter_id = eis.encounter_id\r\nleft join {{ ref('triages') }} t\r\n on t.encounter_id = eis.encounter_id\r\nleft join {{ ref('discharges') }} d\r\n on d.encounter_id = eis.encounter_id\r\nleft join {{ ref('patient_additional_data') }} pad\r\n on pad.patient_id = eis.patient_id\r\nleft join {{ ref('reference_data') }} eth\r\n on eth.id = pad.ethnicity_id\r\nleft join {{ ref('reference_data') }} bt\r\n on bt.id = eis.patient_billing_type_id\r\nleft join {{ ref('reference_data') }} am\r\n on am.id = t.arrival_mode_id\r\nleft join {{ ref('reference_data') }} dd\r\n on dd.id = d.disposition_id\r\nleft join encounter_diagnoses ed\r\n on ed.encounter_id = eis.encounter_id\r\nleft join encounter_prescriptions ep\r\n on ep.encounter_id = eis.encounter_id\r\nleft join encounter_vaccinations ev\r\n on ev.encounter_id = eis.encounter_id\r\nleft join encounter_procedures epr\r\n on epr.encounter_id = eis.encounter_id\r\nleft join encounter_lab_requests elr\r\n on elr.encounter_id = eis.encounter_id\r\nleft join encounter_imaging_requests eir\r\n on eir.encounter_id = eis.encounter_id\r\nleft join encounter_notes en\r\n on en.encounter_id = eis.encounter_id\r\nleft join invoice_data invd\r\n on invd.encounter_id = eis.encounter_id\r\nwhere\r\n case\r\n when {{ parameter('departmentId') }} is null then true\r\n else {{ parameter('departmentId') }} = any(ec.department_ids::text [])\r\n end\r\n and case\r\n when {{ parameter('locationGroupId') }} is null then true\r\n else {{ parameter('locationGroupId') }} = any(ec.location_group_ids::text [])\r\n end\r\norder by eis.{{ date_field }} desc\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.tamanu_source_dbt.parameter", "macro.tamanu_source_dbt.translate_label"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.imaging_requests_dataset": {"name": "imaging_requests_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\imaging_requests.sql", "original_file_path": "macros\\models\\imaging_requests.sql", "unique_id": "macro.tamanu_source_dbt.imaging_requests_dataset", "macro_sql": "{% macro imaging_requests_dataset(is_sensitive=false) %}\r\n\r\nwith results as (\r\n select\r\n imaging_request_id,\r\n min(datetime) as completed_datetime\r\n from {{ ref('imaging_results') }}\r\n group by imaging_request_id\r\n),\r\n\r\nimaging_area_notes as (\r\n select\r\n record_id as imaging_request_id,\r\n string_agg(content, ', ' order by datetime) as imaging_area\r\n from {{ ref('notes') }}\r\n where record_type = 'ImagingRequest'\r\n and note_type_id = 'notetype-areaToBeImaged'\r\n group by record_id\r\n),\r\n\r\nimaging_areas as (\r\n select\r\n ir.id as imaging_request_id,\r\n coalesce(\r\n string_agg(ia.name, ', ' order by ia.name),\r\n n.imaging_area\r\n ) as imaging_area\r\n from {{ ref('imaging_requests') }} ir\r\n left join {{ ref('imaging_request_areas') }} ira on ira.imaging_request_id = ir.id\r\n left join {{ ref('reference_data') }} ia on ia.id = ira.area_id\r\n left join imaging_area_notes n on n.imaging_request_id = ir.id\r\n group by ir.id, n.imaging_area\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(ir.datetime::date, p.date_of_birth)) as age,\r\n p.sex,\r\n v.id as village_id,\r\n v.name as village,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n ir.display_id as request_id,\r\n ir.datetime as requested_datetime,\r\n su.id as supervising_clinician_id,\r\n su.display_name as supervising_clinician,\r\n ru.id as requesting_clinician_id,\r\n ru.display_name as requesting_clinician,\r\n case\r\n when ir.priority = 'routine' then 'Routine'\r\n when ir.priority = 'urgent' then 'Urgent'\r\n when ir.priority = 'asap' then 'ASAP'\r\n when ir.priority = 'stat' then 'STAT'\r\n when ir.priority = 'today' then 'Today'\r\n else ir.priority\r\n end as priority,\r\n ir.imaging_type,\r\n areas.imaging_area,\r\n ir.status as status_id,\r\n case\r\n when ir.status = 'pending' then 'Pending'\r\n when ir.status = 'in_progress' then 'In progress'\r\n when ir.status = 'completed' then 'Completed'\r\n when ir.status = 'cancelled' then 'Cancelled'\r\n when ir.status = 'deleted' then 'Deleted'\r\n when ir.status = 'entered_in_error' then 'Entered in error'\r\n else 'Unknown'\r\n end as status,\r\n case\r\n when ir.status = 'completed' then irs.completed_datetime\r\n end as completed_datetime,\r\n case\r\n when ir.reason_for_cancellation = 'clinical' then 'Clinical reason'\r\n when ir.reason_for_cancellation = 'duplicate' then 'Duplicate'\r\n when ir.reason_for_cancellation = 'entered-in-error' then 'Entered in error'\r\n when ir.reason_for_cancellation = 'patient-discharged' then 'Patient discharged'\r\n when ir.reason_for_cancellation = 'patient-refused' then 'Patient refused'\r\n when ir.reason_for_cancellation = 'other' then 'Other'\r\n end as reason_for_cancellation\r\nfrom {{ ref('imaging_requests') }} ir\r\njoin {{ ref('encounters') }} e on e.id = ir.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('locations') }} l on l.id = e.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\nleft join {{ ref('users') }} su on su.id = e.clinician_id\r\nleft join {{ ref('users') }} ru on ru.id = ir.requested_by_id\r\nleft join imaging_areas areas on areas.imaging_request_id = ir.id\r\nleft join {{ ref('reference_data') }} v on v.id = p.village_id\r\nleft join results irs on irs.imaging_request_id = ir.id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.lab_requests_dataset": {"name": "lab_requests_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\lab_requests.sql", "original_file_path": "macros\\models\\lab_requests.sql", "unique_id": "macro.tamanu_source_dbt.lab_requests_dataset", "macro_sql": "{% macro lab_requests_dataset(is_sensitive=false) %}\r\n\r\nwith lab_test_data as (\r\n select\r\n lr.id as lab_request_id,\r\n string_agg(ltt.name, ', '\r\n order by ltt.name\r\n ) as tests,\r\n max(lt.completed_datetime) as completed_datetime\r\n from {{ ref('lab_requests') }} lr\r\n join {{ ref('lab_tests') }} lt on lt.lab_request_id = lr.id\r\n join {{ ref('lab_test_types') }} ltt on ltt.id = lt.lab_test_type_id\r\n where ltt.is_sensitive = {{ is_sensitive }}\r\n group by lr.id\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(lr.requested_datetime, p.date_of_birth)) as age,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.name as department,\r\n d.id as department_id,\r\n l.id as location_id,\r\n l.name as location,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n laboratory.id as laboratory_id,\r\n laboratory.name as laboratory,\r\n lr.display_id as request_id,\r\n case lr.status\r\n when 'reception_pending' then 'Reception pending'\r\n when 'results_pending' then 'Results pending'\r\n when 'to_be_verified' then 'To be verified'\r\n when 'verified' then 'Verified'\r\n when 'published' then 'Published'\r\n when 'cancelled' then 'Cancelled'\r\n when 'deleted' then 'Deleted'\r\n when 'sample-not-collected' then 'Sample not collected'\r\n when 'entered-in-error' then 'Entered in error'\r\n else lr.status\r\n end as status,\r\n lr.status as status_id,\r\n lr.requested_datetime,\r\n req_clinician.id as requested_by_id,\r\n req_clinician.display_name as requested_by,\r\n lr.department_id as requesting_department_id,\r\n req_department.name as requesting_department,\r\n lr.lab_test_priority_id as priority_id,\r\n priority.name as priority,\r\n category.id as lab_test_category_id,\r\n category.name as lab_test_category,\r\n ltp.name as lab_test_panel,\r\n lta.tests,\r\n lr.collected_datetime,\r\n lr.collected_by_id,\r\n collector.display_name as collected_by,\r\n lr.specimen_type_id,\r\n specimen.name as specimen_type,\r\n site.name as site,\r\n lta.completed_datetime,\r\n case lr.reason_for_cancellation\r\n when 'clinical' then 'Clinical reason'\r\n when 'duplicate' then 'Duplicate'\r\n when 'entered-in-error' then 'Entered in error'\r\n when 'patient-discharged' then 'Patient discharged'\r\n when 'patient-refused' then 'Patient refused'\r\n when 'other' then 'Other'\r\n else lr.reason_for_cancellation\r\n end as reason_for_cancellation\r\nfrom {{ ref('lab_requests') }} lr\r\njoin lab_test_data lta on lta.lab_request_id = lr.id\r\njoin {{ ref('encounters') }} e on e.id = lr.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('locations') }} l on l.id = e.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\nleft join {{ ref('facilities') }} f on f.id = l.facility_id\r\nleft join {{ ref('reference_data') }} laboratory on laboratory.id = lr.lab_test_laboratory_id\r\nleft join {{ ref('users') }} req_clinician on req_clinician.id = lr.requested_by_id\r\nleft join {{ ref('departments') }} req_department on req_department.id = lr.department_id\r\nleft join {{ ref('reference_data') }} priority on priority.id = lr.lab_test_priority_id\r\nleft join {{ ref('reference_data') }} category on category.id = lr.lab_test_category_id\r\nleft join {{ ref('users') }} collector on collector.id = lr.collected_by_id\r\nleft join {{ ref('reference_data') }} specimen on specimen.id = lr.specimen_type_id\r\nleft join {{ ref('reference_data') }} site on site.id = lr.lab_sample_site_id\r\nleft join {{ ref('lab_test_panel_requests') }} ltpr\r\n on ltpr.id = lr.lab_test_panel_request_id\r\nleft join {{ ref('lab_test_panels') }} ltp on ltp.id = ltpr.lab_test_panel_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.lab_tests_dataset": {"name": "lab_tests_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\lab_tests.sql", "original_file_path": "macros\\models\\lab_tests.sql", "unique_id": "macro.tamanu_source_dbt.lab_tests_dataset", "macro_sql": "{% macro lab_tests_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(lr.requested_datetime, p.date_of_birth::date)) as age,\r\n p.sex,\r\n village.id as village_id,\r\n village.name as village,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n req_dept.id as requesting_department_id,\r\n req_dept.name as requesting_department,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n l.id as location_id,\r\n l.name as location,\r\n lr.display_id as lab_request_id,\r\n lr.status as status_id,\r\n case lr.status\r\n when 'reception_pending' then 'Reception pending'\r\n when 'results_pending' then 'Results pending'\r\n when 'to_be_verified' then 'To be verified'\r\n when 'verified' then 'Verified'\r\n when 'published' then 'Published'\r\n when 'cancelled' then 'Cancelled'\r\n when 'deleted' then 'Deleted'\r\n when 'sample-not-collected' then 'Sample not collected'\r\n when 'entered-in-error' then 'Entered in error'\r\n else lr.status\r\n end as status,\r\n ltp.id as lab_test_panel_id,\r\n ltp.name as lab_test_panel,\r\n category.id as lab_test_category_id,\r\n category.name as lab_test_category,\r\n lr.requested_datetime,\r\n requester.id as requested_by_id,\r\n requester.display_name as requested_by,\r\n lr.published_datetime as lab_request_published_datetime,\r\n lt.date as lab_test_date,\r\n lt.result,\r\n lt.verification,\r\n ltt.id as lab_test_type_id,\r\n ltt.name as lab_test_type,\r\n lt.completed_datetime as lab_test_completed_datetime\r\nfrom {{ ref('lab_requests') }} lr\r\njoin {{ ref('encounters') }} e on e.id = lr.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\nleft join {{ ref('reference_data') }} village on village.id = p.village_id\r\nleft join {{ ref('locations') }} l on l.id = e.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\nleft join {{ ref('departments') }} req_dept on req_dept.id = lr.department_id\r\nleft join {{ ref('facilities') }} f on f.id = l.facility_id\r\nleft join {{ ref('users') }} requester on requester.id = lr.requested_by_id\r\nleft join {{ ref('lab_test_panel_requests') }} ltpr on ltpr.id = lr.lab_test_panel_request_id\r\nleft join {{ ref('lab_test_panels') }} ltp on ltp.id = ltpr.lab_test_panel_id\r\nleft join {{ ref('reference_data') }} category on category.id = lr.lab_test_category_id\r\njoin {{ ref('lab_tests') }} lt on lt.lab_request_id = lr.id\r\njoin {{ ref('lab_test_types') }} ltt on ltt.id = lt.lab_test_type_id\r\nwhere ltt.is_sensitive = {{ is_sensitive }}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.location_bookings_dataset": {"name": "location_bookings_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\location_bookings.sql", "original_file_path": "macros\\models\\location_bookings.sql", "unique_id": "macro.tamanu_source_dbt.location_bookings_dataset", "macro_sql": "{% macro location_bookings_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(a.start_datetime::date, p.date_of_birth)) as age,\r\n p.sex,\r\n vil.id as village_id,\r\n vil.name as village,\r\n billing.id as billing_type_id,\r\n billing.name as billing_type,\r\n a.start_datetime as booking_start_datetime,\r\n a.end_datetime as booking_end_datetime,\r\n a.status as booking_status,\r\n u.id as clinician_id,\r\n u.display_name as clinician,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n l.id as location_id,\r\n l.name as location,\r\n a.booking_type_id,\r\n bt.name as booking_type\r\nfrom {{ ref('location_bookings') }} a\r\njoin {{ ref('patients') }} p on p.id = a.patient_id\r\nleft join {{ ref('users') }} u on u.id = a.clinician_id\r\njoin {{ ref('locations') }} l on l.id = a.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\njoin {{ ref('facilities') }} f on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('patient_additional_data') }} pd on pd.patient_id = p.id\r\nleft join {{ ref('reference_data') }} billing on billing.id = pd.patient_billing_type_id\r\nleft join {{ ref('reference_data') }} vil on vil.id = p.village_id\r\nleft join {{ ref('reference_data') }} bt on bt.id = a.booking_type_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.base_history_from_log": {"name": "base_history_from_log", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\logs.sql", "original_file_path": "macros\\models\\logs.sql", "unique_id": "macro.tamanu_source_dbt.base_history_from_log", "macro_sql": "{%- macro base_history_from_log(table_name, schema_name='logs__tamanu', source_name='changes') -%}\r\n select \r\n id as changelog_id,\r\n logged_at,\r\n updated_by_user_id,\r\n record_created_at,\r\n record_updated_at,\r\n record_id,\r\n record_data\r\n from {{ source(schema_name, source_name) }}\r\n where table_name = '{{ table_name }}'\r\n and record_id not in (\r\n select id::text\r\n from {{ source('tamanu', table_name) }} t\r\n where t.deleted_at notnull\r\n )\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.medication_dispenses_dataset": {"name": "medication_dispenses_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\medication_dispenses.sql", "original_file_path": "macros\\models\\medication_dispenses.sql", "unique_id": "macro.tamanu_source_dbt.medication_dispenses_dataset", "macro_sql": "{% macro medication_dispenses_dataset(is_sensitive=false) %}\r\n\r\nselect\r\n md.id,\r\n md.quantity,\r\n md.dispensed_at,\r\n po.facility_id,\r\n f.name as facility,\r\n pr.medication_id,\r\n m.code as medication_code,\r\n m.name as medication\r\nfrom {{ ref('medication_dispenses') }} md\r\njoin {{ ref('pharmacy_order_prescriptions') }} pop\r\n on pop.id = md.pharmacy_order_prescription_id\r\njoin {{ ref('pharmacy_orders') }} po\r\n on po.id = pop.pharmacy_order_id\r\n-- prescription_id is not null on all pharmacy_order_prescriptions rows (enforced by source not_null test).\r\n-- ongoing_prescription_id is the nullable supplementary reference and is not used for the medication lookup\r\njoin {{ ref('prescriptions') }} pr\r\n on pr.id = pop.prescription_id\r\njoin {{ ref('reference_data') }} m\r\n on m.id = pr.medication_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = po.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.get_metadata_from_changes": {"name": "get_metadata_from_changes", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\metadata.sql", "original_file_path": "macros\\models\\metadata.sql", "unique_id": "macro.tamanu_source_dbt.get_metadata_from_changes", "macro_sql": "{%- macro get_metadata_from_changes(table_name) -%}\r\nwith change_logs as (\r\n select \r\n record_id,\r\n logged_at,\r\n least(record_created_at, logged_at) as created_datetime\r\n from {{ source('logs__tamanu', 'changes') }}\r\n where table_name = '{{ table_name }}'\r\n)\r\nselect \r\n record_id as id,\r\n min(created_datetime) as created_datetime,\r\n max(logged_at) as updated_datetime\r\nfrom change_logs\r\ngroup by record_id\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.outpatient_appointments_dataset": {"name": "outpatient_appointments_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\outpatient_appointments.sql", "original_file_path": "macros\\models\\outpatient_appointments.sql", "unique_id": "macro.tamanu_source_dbt.outpatient_appointments_dataset", "macro_sql": "{% macro outpatient_appointments_dataset(is_sensitive=false) %}\r\n\r\nwith appointment_creators as (\r\n select\r\n appointment_id,\r\n created_by_user_id\r\n from {{ ref('outpatient_appointments_change_logs') }}\r\n where change_sequence = 1\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(a.start_datetime, p.date_of_birth)) as age,\r\n p.sex,\r\n coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number,\r\n vil.id as village_id,\r\n vil.name as village,\r\n billing.id as billing_type_id,\r\n billing.name as billing_type,\r\n a.start_datetime as appointment_start_datetime,\r\n a.end_datetime as appointment_end_datetime,\r\n a.appointment_type_id,\r\n apt.name as appointment_type,\r\n a.status as appointment_status,\r\n u.id as clinician_id,\r\n u.display_name as clinician,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n a.priority,\r\n a.schedule_id,\r\n a.until_date,\r\n a.interval,\r\n a.days_of_week,\r\n a.frequency,\r\n a.nth_weekday,\r\n ac.created_by_user_id,\r\n creator.display_name as created_by\r\nfrom {{ ref('outpatient_appointments') }} a\r\njoin {{ ref('patients') }} p on p.id = a.patient_id\r\nleft join {{ ref('users') }} u on u.id = a.clinician_id\r\njoin {{ ref('location_groups') }} lg on lg.id = a.location_group_id\r\njoin {{ ref('facilities') }} f on f.id = lg.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('patient_additional_data') }} pd on pd.patient_id = p.id\r\nleft join {{ ref('reference_data') }} billing on billing.id = pd.patient_billing_type_id\r\nleft join {{ ref('reference_data') }} vil on vil.id = p.village_id\r\nleft join {{ ref('reference_data') }} apt on apt.id = a.appointment_type_id\r\nleft join appointment_creators ac on ac.appointment_id = a.id\r\nleft join {{ ref('users') }} creator on creator.id = ac.created_by_user_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.90598, "supported_languages": null}, "macro.tamanu_source_dbt.outpatient_appointments_audit_dataset": {"name": "outpatient_appointments_audit_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\outpatient_appointments_audit.sql", "original_file_path": "macros\\models\\outpatient_appointments_audit.sql", "unique_id": "macro.tamanu_source_dbt.outpatient_appointments_audit_dataset", "macro_sql": "{% macro outpatient_appointments_audit_dataset(is_sensitive=false) %}\r\n\r\n-- Outpatient Appointments Audit Dataset\r\n-- This dataset tracks changes/modifications to outpatient appointments\r\n-- Each row represents a modification event (excludes initial creation)\r\n--\r\n-- Included changes:\r\n-- - Status changed to 'Cancelled' (individual cancellations only)\r\n-- - Changes to: start/end datetime, clinician, location group, appointment type, priority\r\n--\r\n-- Excluded changes:\r\n-- - Initial appointment creation (change_sequence = 1)\r\n-- - Status-only changes (unless changing to 'Cancelled')\r\n-- - Appointments automatically cancelled when their schedule was cancelled\r\n-- (i.e., bulk cancellations via \"cancel this and all future appointments\")\r\n--\r\n-- change_number: starts from 1 for the first modification, increments for subsequent changes\r\n--\r\n-- Note: schedule_id never changes on existing appointments in Tamanu.\r\n-- When a schedule is modified, old appointments are cancelled and new ones are created.\r\n\r\nwith change_evaluation as (\r\n select\r\n cl.*,\r\n -- Determine if this change has meaningful field modifications\r\n case\r\n -- Status changed to Cancelled\r\n when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true\r\n -- Any non-status fields changed\r\n when (\r\n cl.prev_start_datetime is distinct from cl.start_datetime\r\n or cl.prev_end_datetime is distinct from cl.end_datetime\r\n or cl.prev_clinician_id is distinct from cl.clinician_id\r\n or cl.prev_location_group_id is distinct from cl.location_group_id\r\n or cl.prev_appointment_type_id is distinct from cl.appointment_type_id\r\n or cl.prev_is_high_priority is distinct from cl.is_high_priority\r\n ) then true\r\n else false\r\n end as is_meaningful_change\r\n from {{ ref('outpatient_appointments_change_logs') }} cl\r\n left join {{ source('tamanu', 'appointment_schedules') }} s on s.id = cl.schedule_id\r\n where\r\n -- Exclude appointments that were automatically cancelled when the schedule was cancelled\r\n -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule)\r\n not (\r\n cl.status = 'Cancelled'\r\n and s.cancelled_at_date is not null\r\n and cl.start_datetime::date > s.cancelled_at_date::date\r\n )\r\n),\r\n\r\nnumbered_changes as (\r\n select\r\n ce.*,\r\n -- Assign change number: starts from 1 for first modification\r\n row_number() over (\r\n partition by ce.appointment_id\r\n order by ce.modified_datetime\r\n ) as change_number\r\n from change_evaluation ce\r\n where ce.is_meaningful_change = true\r\n and ce.change_sequence > 1 -- Exclude initial creation\r\n)\r\n\r\nselect\r\n fc.change_id,\r\n fc.appointment_id,\r\n fc.change_number,\r\n -- Patient details\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n -- Current appointment details\r\n fc.start_datetime as appointment_start_datetime,\r\n fc.end_datetime as appointment_end_datetime,\r\n apt.name as appointment_type,\r\n fc.appointment_type_id,\r\n clinician.display_name as clinician,\r\n fc.clinician_id,\r\n lg.name as location_group,\r\n fc.location_group_id,\r\n case when fc.is_high_priority then 'Yes' else 'No' end as priority,\r\n fc.schedule_id,\r\n case\r\n when fc.schedule_id is not null then 'Yes'\r\n else 'No'\r\n end as is_repeating,\r\n -- Modification details\r\n creator.display_name as created_by,\r\n fc.created_by_user_id,\r\n modifier.display_name as modified_by,\r\n fc.modified_by_user_id,\r\n fc.modified_datetime,\r\n case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled,\r\n -- Previous appointment details (only shown if different from current)\r\n case\r\n when fc.prev_start_datetime is distinct from fc.start_datetime\r\n then fc.prev_start_datetime\r\n end as prev_start_datetime,\r\n case\r\n when fc.prev_end_datetime is distinct from fc.end_datetime\r\n then fc.prev_end_datetime\r\n end as prev_end_datetime,\r\n case\r\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\r\n then prev_apt.name\r\n end as prev_appointment_type,\r\n case\r\n when fc.prev_appointment_type_id is distinct from fc.appointment_type_id\r\n then fc.prev_appointment_type_id\r\n end as prev_appointment_type_id,\r\n case\r\n when fc.prev_clinician_id is distinct from fc.clinician_id\r\n then prev_clinician.display_name\r\n end as prev_clinician,\r\n case\r\n when fc.prev_clinician_id is distinct from fc.clinician_id\r\n then fc.prev_clinician_id\r\n end as prev_clinician_id,\r\n case\r\n when fc.prev_location_group_id is distinct from fc.location_group_id\r\n then prev_lg.name\r\n end as prev_location_group,\r\n case\r\n when fc.prev_location_group_id is distinct from fc.location_group_id\r\n then fc.prev_location_group_id\r\n end as prev_location_group_id,\r\n case\r\n when fc.prev_is_high_priority is not null\r\n and fc.prev_is_high_priority is distinct from fc.is_high_priority\r\n then case when fc.prev_is_high_priority then 'Yes' else 'No' end\r\n end as prev_priority,\r\n -- Facility details for filtering\r\n f.id as facility_id,\r\n f.name as facility\r\nfrom numbered_changes fc\r\njoin {{ ref('patients') }} p on p.id = fc.patient_id\r\nleft join {{ ref('users') }} clinician on clinician.id = fc.clinician_id\r\nleft join {{ ref('users') }} prev_clinician on prev_clinician.id = fc.prev_clinician_id\r\nleft join {{ ref('users') }} creator on creator.id = fc.created_by_user_id\r\nleft join {{ ref('users') }} modifier on modifier.id = fc.modified_by_user_id\r\njoin {{ ref('location_groups') }} lg on lg.id = fc.location_group_id\r\nleft join {{ ref('location_groups') }} prev_lg on prev_lg.id = fc.prev_location_group_id\r\nleft join {{ ref('reference_data') }} apt on apt.id = fc.appointment_type_id\r\nleft join {{ ref('reference_data') }} prev_apt on prev_apt.id = fc.prev_appointment_type_id\r\nleft join {{ source('tamanu', 'appointment_schedules') }} s on s.id = fc.schedule_id\r\n-- Join to facility for filtering by sensitivity\r\njoin {{ ref('facilities') }} f on f.id = lg.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9214313, "supported_languages": null}, "macro.tamanu_source_dbt.procedures_dataset": {"name": "procedures_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\procedures.sql", "original_file_path": "macros\\models\\procedures.sql", "unique_id": "macro.tamanu_source_dbt.procedures_dataset", "macro_sql": "{% macro procedures_dataset(is_sensitive=false) %}\r\n\r\nwith filtered_procedure as (\r\n select\r\n pc.*,\r\n eh.department_id,\r\n eh.encounter_type,\r\n row_number() over (\r\n partition by pc.id\r\n order by eh.datetime desc\r\n ) as encounter_history_record\r\n from {{ ref('procedures') }} pc\r\n left join {{ ref('encounter_history') }} eh\r\n on eh.encounter_id = pc.encounter_id\r\n and eh.datetime::date <= pc.date\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.date_of_birth,\r\n date_part('year', age(pc.date, p.date_of_birth)) as age,\r\n p.sex,\r\n nationality.name as nationality,\r\n encounter_facility.id as encounter_facility_id,\r\n encounter_facility.name as encounter_facility,\r\n encounter_department.id as encounter_department_id,\r\n encounter_department.name as encounter_department,\r\n case\r\n when coalesce(pc.encounter_type, e.encounter_type) = 'admission' then 'Hospital Admission'\r\n when coalesce(pc.encounter_type, e.encounter_type) = 'clinic' then 'Clinic'\r\n when coalesce(pc.encounter_type, e.encounter_type) in ('triage', 'observation', 'emergency') then 'Triage'\r\n end as encounter_type,\r\n e.start_datetime as encounter_start_datetime,\r\n e.end_datetime as encounter_end_datetime,\r\n procedure_facility.id as procedure_facility_id,\r\n procedure_facility.name as procedure_facility,\r\n procedure_area.id as procedure_area_id,\r\n procedure_area.name as procedure_area,\r\n procedure_location.id as procedure_location_id,\r\n procedure_location.name as procedure_location,\r\n procedure_type.id as procedure_type_id,\r\n procedure_type.name as procedure_type,\r\n pc.date as procedure_date,\r\n pc.start_time as procedure_start_time,\r\n pc.end_time as procedure_end_time,\r\n case\r\n when pc.end_time is not null and pc.start_time is not null then\r\n concat(\r\n lpad((\r\n case\r\n when pc.end_time < pc.start_time\r\n then\r\n (24 + extract(hour from pc.end_time) - extract(hour from pc.start_time))\r\n else\r\n extract(hour from (pc.end_time - pc.start_time))\r\n end\r\n )::text, 2, '0'), ':',\r\n lpad((\r\n case\r\n when pc.end_time < pc.start_time\r\n then\r\n (extract(minute from pc.end_time) - extract(minute from pc.start_time))\r\n else\r\n extract(minute from (pc.end_time - pc.start_time))\r\n end\r\n )::text, 2, '0')\r\n )\r\n end as procedure_duration,\r\n clinician.id as procedure_clinician_id,\r\n clinician.display_name as procedure_clinician,\r\n anaesthetist.id as procedure_anaesthetist_id,\r\n anaesthetist.display_name as procedure_anaesthetist,\r\n assistant_anaesthetist.id as procedure_assistant_anaesthetist_id,\r\n assistant_anaesthetist.display_name as procedure_assistant_anaesthetist,\r\n case\r\n when pc.is_completed then 'Y' else 'N'\r\n end as is_completed,\r\n pc.time_in,\r\n pc.time_out\r\nfrom filtered_procedure pc\r\njoin {{ ref('encounters') }} e on e.id = pc.encounter_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('reference_data') }} procedure_type on procedure_type.id = pc.procedure_type_id\r\njoin {{ ref('locations') }} procedure_location\r\n on procedure_location.id = pc.location_id\r\nleft join {{ ref('location_groups') }} procedure_area\r\n on procedure_area.id = procedure_location.location_group_id\r\njoin {{ ref('facilities') }} procedure_facility\r\n on procedure_facility.id = procedure_location.facility_id\r\n and procedure_facility.is_sensitive = {{ is_sensitive }}\r\njoin {{ ref('locations') }} encounter_location\r\n on encounter_location.id = e.location_id\r\njoin {{ ref('facilities') }} encounter_facility\r\n on encounter_facility.id = encounter_location.facility_id\r\n and encounter_facility.is_sensitive = {{ is_sensitive }}\r\njoin {{ ref('departments') }} encounter_department\r\n on encounter_department.id = coalesce(pc.department_id, e.department_id)\r\nleft join {{ ref('patient_additional_data') }} pd on pd.patient_id = p.id\r\nleft join {{ ref('reference_data') }} nationality on nationality.id = pd.nationality_id\r\nleft join {{ ref('users') }} assistant_anaesthetist on assistant_anaesthetist.id = pc.assistant_anaesthetist_id\r\nleft join {{ ref('users') }} anaesthetist on anaesthetist.id = pc.anaesthetist_id\r\nleft join {{ ref('users') }} clinician on clinician.id = pc.clinician_id\r\nwhere pc.encounter_history_record = 1\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9224424, "supported_languages": null}, "macro.tamanu_source_dbt.referrals_dataset": {"name": "referrals_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\referrals.sql", "original_file_path": "macros\\models\\referrals.sql", "unique_id": "macro.tamanu_source_dbt.referrals_dataset", "macro_sql": "{% macro referrals_dataset(is_sensitive=false) %}\r\n\r\nwith diagnoses as (\r\n select\r\n ed.encounter_id,\r\n string_agg(concat(d.name), '; ') as diagnoses\r\n from {{ ref('encounter_diagnoses') }} ed\r\n left join {{ ref('reference_data') }} d on d.id = ed.diagnosis_id\r\n group by ed.encounter_id\r\n)\r\n\r\nselect\r\n p.id as patient_id,\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.village_id,\r\n ed.diagnoses,\r\n s.name as referral_type,\r\n u.id as referring_doctor_id,\r\n u.display_name as referring_doctor_name,\r\n sr.end_datetime as referral_datetime,\r\n rf.status,\r\n d.name as department\r\nfrom {{ ref('referrals') }} rf\r\njoin {{ ref('encounters') }} e on e.id = rf.initiating_encounter_id\r\njoin {{ ref('locations') }} l on l.id = e.location_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\njoin {{ ref('survey_responses') }} sr on sr.id = rf.survey_response_id\r\njoin {{ ref('surveys') }} s on s.id = sr.survey_id\r\njoin {{ ref('patients') }} p on p.id = e.patient_id\r\njoin {{ ref('users') }} u on u.id = e.clinician_id\r\njoin {{ ref('departments') }} d on d.id = e.department_id\r\nleft join diagnoses ed on ed.encounter_id = rf.initiating_encounter_id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.tamanu_source_dbt.user_audit_dataset": {"name": "user_audit_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\user_audit.sql", "original_file_path": "macros\\models\\user_audit.sql", "unique_id": "macro.tamanu_source_dbt.user_audit_dataset", "macro_sql": "{% macro user_audit_dataset(is_sensitive=false) %}\r\n\r\nwith non_system_notes as (\r\n select distinct on (n.record_id)\r\n n.record_id,\r\n first_value(n.datetime) over w as first_note_datetime,\r\n last_value(n.datetime) over w as last_note_datetime,\r\n last_value(concat_ws(' on behalf of ', author.display_name, on_behalf.display_name)) over w as last_clinician\r\n from {{ ref('notes') }} n\r\n left join {{ ref('users') }} author on author.id = n.authored_by_id\r\n left join {{ ref('users') }} on_behalf on on_behalf.id = n.on_behalf_of_id\r\n where n.note_type_id != 'notetype-system'\r\n window w as (\r\n partition by n.record_id\r\n order by n.datetime\r\n rows between unbounded preceding and unbounded following\r\n )\r\n)\r\n\r\nselect\r\n u.id as user_id,\r\n u.display_name as user_name,\r\n r.name as user_role,\r\n p.id as patient_id,\r\n p.display_id,\r\n bt.name as patient_category,\r\n t.score as triage_category,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n l.id as location_id,\r\n l.name as location,\r\n e.start_datetime as encounter_start_datetime,\r\n e.end_datetime as encounter_end_datetime,\r\n n.first_note_datetime,\r\n n.last_note_datetime,\r\n case when e.end_datetime isnull then 'Patient not discharged'\r\n else 'Patient discharged'\r\n end as is_discharged,\r\n case when ds.note like 'Automatically discharged%' then n.last_clinician\r\n end as non_discharge_by_clinicians\r\nfrom {{ ref('encounters') }} e\r\nleft join {{ ref('users') }} u on u.id = e.clinician_id\r\nleft join {{ ref('roles') }} r on r.id = u.role\r\nleft join {{ ref('patients') }} p on p.id = e.patient_id\r\nleft join {{ ref('patient_additional_data') }} pad on pad.patient_id = e.patient_id\r\nleft join {{ ref('reference_data') }} bt\r\n on bt.id = coalesce(e.patient_billing_type_id, pad.patient_billing_type_id)\r\nleft join {{ ref('triages') }} t on t.encounter_id = e.id\r\njoin {{ ref('locations') }} l on l.id = e.location_id\r\nleft join {{ ref('location_groups') }} lg on lg.id = l.location_group_id\r\njoin {{ ref('facilities') }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref('departments') }} d on d.id = e.department_id\r\nleft join {{ ref('discharges') }} ds on ds.encounter_id = e.id\r\nleft join non_system_notes n on n.record_id = e.id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.tamanu_source_dbt.vaccinations_dataset": {"name": "vaccinations_dataset", "resource_type": "macro", "package_name": "tamanu_source_dbt", "path": "macros\\models\\vaccinations.sql", "original_file_path": "macros\\models\\vaccinations.sql", "unique_id": "macro.tamanu_source_dbt.vaccinations_dataset", "macro_sql": "{% macro vaccinations_dataset(is_sensitive=false) %}\r\n\r\nwith vaccine_administrations_metadata as (\r\n select\r\n id,\r\n max(updated_at) as updated_at\r\n from {{ ref(\"vaccine_administrations_change_logs\") }}\r\n group by id\r\n),\r\n\r\nadministered_circumstances as (\r\n select\r\n a.id,\r\n string_agg(rd_cir.name, '; ') as circumstance_name\r\n from {{ ref(\"vaccine_administrations\") }} a\r\n cross join lateral unnest(a.circumstance_ids) c (unnest_circumstance_id)\r\n left join {{ ref(\"reference_data\") }} rd_cir\r\n on rd_cir.id = c.unnest_circumstance_id\r\n group by a.id\r\n)\r\n\r\nselect\r\n p.display_id,\r\n p.first_name,\r\n p.last_name,\r\n p.id as patient_id,\r\n p.date_of_birth,\r\n date_part('year', age(p.date_of_birth)) as age,\r\n p.sex,\r\n p.village_id,\r\n rd_vil.name as village,\r\n f.id as facility_id,\r\n f.name as facility,\r\n d.id as department_id,\r\n d.name as department,\r\n lg.id as location_group_id,\r\n lg.name as location_group,\r\n l.id as location_id,\r\n l.name as location,\r\n av.scheduled_vaccine_id,\r\n case\r\n when av.is_given_elsewhere = true and av.datetime is null then null\r\n else av.datetime::date\r\n end as vaccination_date,\r\n sv.category as vaccine_category,\r\n sv.label as vaccine_name,\r\n case when sv.category = 'Other' then av.vaccine_brand end as vaccine_brand,\r\n case when sv.category = 'Other' then av.disease end as disease,\r\n case\r\n when av.status = 'GIVEN' then 'Given'\r\n when av.status = 'NOT_GIVEN' then 'Not given'\r\n when av.status = 'RECORDED_IN_ERROR' then 'Recorded in error'\r\n when av.status = 'HISTORICAL' then 'Historical'\r\n end as vaccine_status,\r\n sv.dose_label as vaccine_schedule,\r\n av.batch,\r\n case\r\n when av.status in ('GIVEN', 'NOT_GIVEN', 'RECORDED_IN_ERROR') then u.display_name\r\n end as recorded_by,\r\n case\r\n when av.is_given_elsewhere = true then ac.circumstance_name\r\n end as circumstances,\r\n case\r\n when av.status = 'NOT_GIVEN' then null\r\n when av.status = 'GIVEN' and av.is_given_elsewhere = true then null\r\n when av.status in ('HISTORICAL', 'RECORDED_IN_ERROR') and av.is_given_elsewhere = true then av.given_by\r\n when av.status = 'GIVEN' then av.given_by\r\n end as given_by,\r\n case when av.is_given_elsewhere = true then av.given_by end as given_elsewhere_by,\r\n case\r\n when av.status = 'NOT_GIVEN' then av.given_by\r\n end as not_given_clinician,\r\n case\r\n when av.status = 'NOT_GIVEN' then rd_reason.name\r\n end as not_given_reason,\r\n case\r\n when av.status = 'HISTORICAL' then u.display_name\r\n end as modified_by,\r\n vam.updated_at\r\nfrom {{ ref(\"vaccine_administrations\") }} av\r\njoin {{ ref(\"encounters\") }} e on e.id = av.encounter_id\r\njoin {{ ref(\"patients\") }} p on p.id = e.patient_id\r\nleft join vaccine_administrations_metadata vam on vam.id = av.id\r\njoin {{ ref(\"locations\") }} l on l.id = av.location_id\r\nleft join {{ ref(\"departments\") }} d on d.id = av.department_id\r\nleft join {{ ref(\"location_groups\") }} lg on lg.id = l.location_group_id\r\njoin {{ ref(\"facilities\") }} f\r\n on f.id = l.facility_id\r\n and f.is_sensitive = {{ is_sensitive }}\r\nleft join {{ ref(\"vaccine_schedules\") }} sv on sv.id = av.scheduled_vaccine_id\r\nleft join {{ ref(\"users\") }} u on u.id = av.recorded_by_id\r\nleft join {{ ref(\"reference_data\") }} rd_vil on rd_vil.id = p.village_id\r\nleft join {{ ref(\"reference_data\") }} rd_reason on rd_reason.id = av.not_given_reason_id\r\nleft join administered_circumstances ac on ac.id = av.id\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\catalog.sql", "original_file_path": "macros\\catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\catalog.sql", "original_file_path": "macros\\catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations.sql", "original_file_path": "macros\\relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations.sql", "original_file_path": "macros\\relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\timestamps.sql", "original_file_path": "macros\\timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\materializations\\incremental_strategies.sql", "original_file_path": "macros\\materializations\\incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\materializations\\incremental_strategies.sql", "original_file_path": "macros\\materializations\\incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\materializations\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9227786, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9385803, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\create.sql", "original_file_path": "macros\\relations\\materialized_view\\create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\describe.sql", "original_file_path": "macros\\relations\\materialized_view\\describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\drop.sql", "original_file_path": "macros\\relations\\materialized_view\\drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\refresh.sql", "original_file_path": "macros\\relations\\materialized_view\\refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\materialized_view\\rename.sql", "original_file_path": "macros\\relations\\materialized_view\\rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\table\\drop.sql", "original_file_path": "macros\\relations\\table\\drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\table\\rename.sql", "original_file_path": "macros\\relations\\table\\rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\table\\replace.sql", "original_file_path": "macros\\relations\\table\\replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\view\\drop.sql", "original_file_path": "macros\\relations\\view\\drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\view\\rename.sql", "original_file_path": "macros\\relations\\view\\rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.939074, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9549677, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9549677, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9549677, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9560492, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9560492, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9560492, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9570453, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\show.sql", "original_file_path": "macros\\adapters\\show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\show.sql", "original_file_path": "macros\\adapters\\show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.957712, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\show.sql", "original_file_path": "macros\\adapters\\show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9714596, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9714596, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9714596, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9714596, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9714596, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9724784, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9724784, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9724784, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\validate_sql.sql", "original_file_path": "macros\\adapters\\validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\validate_sql.sql", "original_file_path": "macros\\adapters\\validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\accepted_values.sql", "original_file_path": "macros\\generic_test_sql\\accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\not_null.sql", "original_file_path": "macros\\generic_test_sql\\not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\relationships.sql", "original_file_path": "macros\\generic_test_sql\\relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\unique.sql", "original_file_path": "macros\\generic_test_sql\\unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_database.sql", "original_file_path": "macros\\get_custom_name\\get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_database.sql", "original_file_path": "macros\\get_custom_name\\get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\aggregate.sql", "original_file_path": "macros\\materializations\\functions\\aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\function.sql", "original_file_path": "macros\\materializations\\functions\\function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": ["sql", "python"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\helpers.sql", "original_file_path": "macros\\materializations\\functions\\helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\helpers.sql", "original_file_path": "macros\\materializations\\functions\\helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9730291, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9879372, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9879372, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9879372, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\functions\\scalar.sql", "original_file_path": "macros\\materializations\\functions\\scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\materialized_view.sql", "original_file_path": "macros\\materializations\\models\\materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table.sql", "original_file_path": "macros\\materializations\\models\\table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": ["sql"]}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view.sql", "original_file_path": "macros\\materializations\\models\\view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\can_clone_table.sql", "original_file_path": "macros\\materializations\\models\\clone\\can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\can_clone_table.sql", "original_file_path": "macros\\materializations\\models\\clone\\can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\clone.sql", "original_file_path": "macros\\materializations\\models\\clone\\clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": ["sql"]}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\create_or_replace_clone.sql", "original_file_path": "macros\\materializations\\models\\clone\\create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\clone\\create_or_replace_clone.sql", "original_file_path": "macros\\materializations\\models\\clone\\create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423649.9885082, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\incremental.sql", "original_file_path": "macros\\materializations\\models\\incremental\\incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0066187, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\is_incremental.sql", "original_file_path": "macros\\materializations\\models\\incremental\\is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0076168, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0086164, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n\t {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n\t {% set unique_key_match = equals(source_unique_key, target_unique_key) | trim %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0096161, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0096161, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0106168, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0106168, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0116162, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0126162, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0126162, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.013616, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.013616, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0146163, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0156162, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0156162, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.016616, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.016616, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.016616, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.017616, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.017616, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.017616, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.017616, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.017616, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.017616, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0186164, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0186164, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0186164, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0186164, "supported_languages": null}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.019616, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0206225, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0206225, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0215285, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0215285, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0215285, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0215285, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0215285, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0215285, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0215285, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0226302, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0226302, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0236242, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\seed.sql", "original_file_path": "macros\\materializations\\seeds\\seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0256298, "supported_languages": ["sql"]}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0276299, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0276299, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0276299, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0286295, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0286295, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0286295, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0286295, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0286295, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_sql_cols = get_column_schema_from_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {#/*\n If a column has been added to the source it won't yet exist in the\n snapshotted table so we insert a null value as a placeholder for the column.\n */#}\n {%- for col in source_sql_cols -%}\n {%- if col.name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col.column) }},\n {%- else -%}\n NULL as {{ adapter.quote(col.column) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0326293, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0326293, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0336294, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0336294, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0346293, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0346293, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0346293, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0356295, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0356295, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0356295, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0366294, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": ["sql"]}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\test.sql", "original_file_path": "macros\\materializations\\tests\\test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": ["sql"]}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\unit.sql", "original_file_path": "macros\\materializations\\tests\\unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": ["sql"]}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\where_subquery.sql", "original_file_path": "macros\\materializations\\tests\\where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\where_subquery.sql", "original_file_path": "macros\\materializations\\tests\\where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.038635, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create.sql", "original_file_path": "macros\\relations\\create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create.sql", "original_file_path": "macros\\relations\\create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create_backup.sql", "original_file_path": "macros\\relations\\create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create_backup.sql", "original_file_path": "macros\\relations\\create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create_intermediate.sql", "original_file_path": "macros\\relations\\create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\create_intermediate.sql", "original_file_path": "macros\\relations\\create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop.sql", "original_file_path": "macros\\relations\\drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop_backup.sql", "original_file_path": "macros\\relations\\drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\drop_backup.sql", "original_file_path": "macros\\relations\\drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename.sql", "original_file_path": "macros\\relations\\rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename.sql", "original_file_path": "macros\\relations\\rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename.sql", "original_file_path": "macros\\relations\\rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename.sql", "original_file_path": "macros\\relations\\rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename_intermediate.sql", "original_file_path": "macros\\relations\\rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\rename_intermediate.sql", "original_file_path": "macros\\relations\\rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\replace.sql", "original_file_path": "macros\\relations\\replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\replace.sql", "original_file_path": "macros\\relations\\replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\schema.sql", "original_file_path": "macros\\relations\\schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\schema.sql", "original_file_path": "macros\\relations\\schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\column\\columns_spec_ddl.sql", "original_file_path": "macros\\relations\\column\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\alter.sql", "original_file_path": "macros\\relations\\materialized_view\\alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\create.sql", "original_file_path": "macros\\relations\\materialized_view\\create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\create.sql", "original_file_path": "macros\\relations\\materialized_view\\create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\drop.sql", "original_file_path": "macros\\relations\\materialized_view\\drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0543487, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\drop.sql", "original_file_path": "macros\\relations\\materialized_view\\drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\refresh.sql", "original_file_path": "macros\\relations\\materialized_view\\refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\refresh.sql", "original_file_path": "macros\\relations\\materialized_view\\refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\rename.sql", "original_file_path": "macros\\relations\\materialized_view\\rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\rename.sql", "original_file_path": "macros\\relations\\materialized_view\\rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\replace.sql", "original_file_path": "macros\\relations\\materialized_view\\replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\materialized_view\\replace.sql", "original_file_path": "macros\\relations\\materialized_view\\replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\create.sql", "original_file_path": "macros\\relations\\table\\create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\drop.sql", "original_file_path": "macros\\relations\\table\\drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\drop.sql", "original_file_path": "macros\\relations\\table\\drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\rename.sql", "original_file_path": "macros\\relations\\table\\rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\rename.sql", "original_file_path": "macros\\relations\\table\\rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\replace.sql", "original_file_path": "macros\\relations\\table\\replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\table\\replace.sql", "original_file_path": "macros\\relations\\table\\replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\create.sql", "original_file_path": "macros\\relations\\view\\create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\create.sql", "original_file_path": "macros\\relations\\view\\create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\create.sql", "original_file_path": "macros\\relations\\view\\create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\create.sql", "original_file_path": "macros\\relations\\view\\create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\drop.sql", "original_file_path": "macros\\relations\\view\\drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\drop.sql", "original_file_path": "macros\\relations\\view\\drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\rename.sql", "original_file_path": "macros\\relations\\view\\rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\rename.sql", "original_file_path": "macros\\relations\\view\\rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\relations\\view\\replace.sql", "original_file_path": "macros\\relations\\view\\replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\unit_test_sql\\get_fixture_sql.sql", "original_file_path": "macros\\unit_test_sql\\get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_append.sql", "original_file_path": "macros\\utils\\array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_append.sql", "original_file_path": "macros\\utils\\array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_concat.sql", "original_file_path": "macros\\utils\\array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_concat.sql", "original_file_path": "macros\\utils\\array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast.sql", "original_file_path": "macros\\utils\\cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast.sql", "original_file_path": "macros\\utils\\cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast_bool_to_text.sql", "original_file_path": "macros\\utils\\cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast_bool_to_text.sql", "original_file_path": "macros\\utils\\cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\concat.sql", "original_file_path": "macros\\utils\\concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\concat.sql", "original_file_path": "macros\\utils\\concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0704029, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date.sql", "original_file_path": "macros\\utils\\date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date.sql", "original_file_path": "macros\\utils\\date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_spine.sql", "original_file_path": "macros\\utils\\date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_spine.sql", "original_file_path": "macros\\utils\\date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_spine.sql", "original_file_path": "macros\\utils\\date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_spine.sql", "original_file_path": "macros\\utils\\date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_trunc.sql", "original_file_path": "macros\\utils\\date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_trunc.sql", "original_file_path": "macros\\utils\\date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\equals.sql", "original_file_path": "macros\\utils\\equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\equals.sql", "original_file_path": "macros\\utils\\equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\except.sql", "original_file_path": "macros\\utils\\except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\except.sql", "original_file_path": "macros\\utils\\except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\generate_series.sql", "original_file_path": "macros\\utils\\generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\generate_series.sql", "original_file_path": "macros\\utils\\generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\generate_series.sql", "original_file_path": "macros\\utils\\generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\generate_series.sql", "original_file_path": "macros\\utils\\generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\hash.sql", "original_file_path": "macros\\utils\\hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\hash.sql", "original_file_path": "macros\\utils\\hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\intersect.sql", "original_file_path": "macros\\utils\\intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\intersect.sql", "original_file_path": "macros\\utils\\intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\length.sql", "original_file_path": "macros\\utils\\length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\length.sql", "original_file_path": "macros\\utils\\length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\literal.sql", "original_file_path": "macros\\utils\\literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\literal.sql", "original_file_path": "macros\\utils\\literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\position.sql", "original_file_path": "macros\\utils\\position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\position.sql", "original_file_path": "macros\\utils\\position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\replace.sql", "original_file_path": "macros\\utils\\replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\replace.sql", "original_file_path": "macros\\utils\\replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\accepted_range.sql", "original_file_path": "macros\\generic_tests\\accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\accepted_range.sql", "original_file_path": "macros\\generic_tests\\accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\at_least_one.sql", "original_file_path": "macros\\generic_tests\\at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.0865302, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\at_least_one.sql", "original_file_path": "macros\\generic_tests\\at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\cardinality_equality.sql", "original_file_path": "macros\\generic_tests\\cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\cardinality_equality.sql", "original_file_path": "macros\\generic_tests\\cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equality.sql", "original_file_path": "macros\\generic_tests\\equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equality.sql", "original_file_path": "macros\\generic_tests\\equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equal_rowcount.sql", "original_file_path": "macros\\generic_tests\\equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equal_rowcount.sql", "original_file_path": "macros\\generic_tests\\equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\expression_is_true.sql", "original_file_path": "macros\\generic_tests\\expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\expression_is_true.sql", "original_file_path": "macros\\generic_tests\\expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\fewer_rows_than.sql", "original_file_path": "macros\\generic_tests\\fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\fewer_rows_than.sql", "original_file_path": "macros\\generic_tests\\fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "original_file_path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "original_file_path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_accepted_values.sql", "original_file_path": "macros\\generic_tests\\not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_accepted_values.sql", "original_file_path": "macros\\generic_tests\\not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_constant.sql", "original_file_path": "macros\\generic_tests\\not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_constant.sql", "original_file_path": "macros\\generic_tests\\not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_empty_string.sql", "original_file_path": "macros\\generic_tests\\not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_empty_string.sql", "original_file_path": "macros\\generic_tests\\not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_null_proportion.sql", "original_file_path": "macros\\generic_tests\\not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_null_proportion.sql", "original_file_path": "macros\\generic_tests\\not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\recency.sql", "original_file_path": "macros\\generic_tests\\recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\recency.sql", "original_file_path": "macros\\generic_tests\\recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n or most_recent is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1026108, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\relationships_where.sql", "original_file_path": "macros\\generic_tests\\relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\relationships_where.sql", "original_file_path": "macros\\generic_tests\\relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\sequential_values.sql", "original_file_path": "macros\\generic_tests\\sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\sequential_values.sql", "original_file_path": "macros\\generic_tests\\sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\unique_combination_of_columns.sql", "original_file_path": "macros\\generic_tests\\unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\unique_combination_of_columns.sql", "original_file_path": "macros\\generic_tests\\unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\log_info.sql", "original_file_path": "macros\\jinja_helpers\\log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\log_info.sql", "original_file_path": "macros\\jinja_helpers\\log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_log_format.sql", "original_file_path": "macros\\jinja_helpers\\pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_log_format.sql", "original_file_path": "macros\\jinja_helpers\\pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_time.sql", "original_file_path": "macros\\jinja_helpers\\pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_time.sql", "original_file_path": "macros\\jinja_helpers\\pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\slugify.sql", "original_file_path": "macros\\jinja_helpers\\slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\_is_ephemeral.sql", "original_file_path": "macros\\jinja_helpers\\_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\_is_relation.sql", "original_file_path": "macros\\jinja_helpers\\_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_surrogate_key.sql", "original_file_path": "macros\\sql\\generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_surrogate_key.sql", "original_file_path": "macros\\sql\\generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_column_values.sql", "original_file_path": "macros\\sql\\get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_column_values.sql", "original_file_path": "macros\\sql\\get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_filtered_columns_in_relation.sql", "original_file_path": "macros\\sql\\get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_filtered_columns_in_relation.sql", "original_file_path": "macros\\sql\\get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_query_results_as_dict.sql", "original_file_path": "macros\\sql\\get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_query_results_as_dict.sql", "original_file_path": "macros\\sql\\get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_pattern.sql", "original_file_path": "macros\\sql\\get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.118286, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_pattern.sql", "original_file_path": "macros\\sql\\get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.134265, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_prefix.sql", "original_file_path": "macros\\sql\\get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.134265, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_prefix.sql", "original_file_path": "macros\\sql\\get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.134265, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_single_value.sql", "original_file_path": "macros\\sql\\get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.134265, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_single_value.sql", "original_file_path": "macros\\sql\\get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.134265, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.134265, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.134265, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.134265, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_prefix_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_prefix_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\groupby.sql", "original_file_path": "macros\\sql\\groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\groupby.sql", "original_file_path": "macros\\sql\\groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck.sql", "original_file_path": "macros\\sql\\nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck.sql", "original_file_path": "macros\\sql\\nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck_table.sql", "original_file_path": "macros\\sql\\nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck_table.sql", "original_file_path": "macros\\sql\\nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\pivot.sql", "original_file_path": "macros\\sql\\pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\pivot.sql", "original_file_path": "macros\\sql\\pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_add.sql", "original_file_path": "macros\\sql\\safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_add.sql", "original_file_path": "macros\\sql\\safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_divide.sql", "original_file_path": "macros\\sql\\safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_divide.sql", "original_file_path": "macros\\sql\\safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_subtract.sql", "original_file_path": "macros\\sql\\safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_subtract.sql", "original_file_path": "macros\\sql\\safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\star.sql", "original_file_path": "macros\\sql\\star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1389194, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\star.sql", "original_file_path": "macros\\sql\\star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col in rename %} as {{ rename[col] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col in rename %} as {{ rename[col] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\surrogate_key.sql", "original_file_path": "macros\\sql\\surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\surrogate_key.sql", "original_file_path": "macros\\sql\\surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\union.sql", "original_file_path": "macros\\sql\\union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\union.sql", "original_file_path": "macros\\sql\\union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\unpivot.sql", "original_file_path": "macros\\sql\\unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\unpivot.sql", "original_file_path": "macros\\sql\\unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_host.sql", "original_file_path": "macros\\web\\get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_host.sql", "original_file_path": "macros\\web\\get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_parameter.sql", "original_file_path": "macros\\web\\get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_parameter.sql", "original_file_path": "macros\\web\\get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_path.sql", "original_file_path": "macros\\web\\get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_path.sql", "original_file_path": "macros\\web\\get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1782423650.1499565, "supported_languages": null}}, "docs": {"doc.tamanu_source_dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "overview.md", "original_file_path": "models\\overview.md", "unique_id": "doc.tamanu_source_dbt.__overview__", "block_contents": "# Tamanu Models Documentation\r\n\r\n## Purpose\r\nThis documentation serves as a guide to Tamanu's standard models for developers, data stewards, and analysts looking to understand and utilise the data structure for reporting and analytics.\r\n\r\n## Project Overview\r\nThis dbt project transforms Tamanu healthcare system data into optimised datasets following a structured data flow: **sources/logs \u2192 bases \u2192 datasets \u2192 reports**. The architecture supports both reporting and analytics use cases while maintaining data governance and privacy standards.\r\n\r\n## Model Architecture & Data Flow\r\n\r\n### Layer 1: Sources & Logs\r\n- **`models/sources`**: Raw operational database tables from the `public` schema\r\n- **`models/logs`**: System-generated audit and event data from the `logs` schema\r\n- **Purpose**: Foundation layer representing the operational database structure\r\n- **Status**: Read-only definitions managed externally\r\n\r\n### Layer 2: Bases\r\n- **`models/bases`**: Cleaned and filtered source data with soft-deleted records and test patients removed\r\n- **Purpose**: Clean, reliable foundation for all downstream transformations\r\n- **Usage**: Building block for datasets and reports\r\n\r\n### Layer 3: Datasets\r\n- **`models/datasets`**: Business-ready, denormalised views built on bases models\r\n- **Features**: User-friendly column names, joined data, calculated fields\r\n- **Purpose**: Optimised for data analysis and report development\r\n- **Target Audience**: Data analysts and report developers\r\n\r\n### Layer 4: Reports\r\n- **`models/reports`**: Final reporting layer with translations and formatting applied\r\n- **Features**: \r\n - Localised field labels using the translation system\r\n - Standardised date/time formatting\r\n - Optimised for end-user consumption\r\n- **Configuration**: Each report includes a corresponding `.json` config file in `models/reports/config/`\r\n\r\n## Deployment Targets\r\n\r\n### Reporting Schema\r\n**Command**: `dbt run --target reporting_release`\r\n- Complete functionality with all models and columns\r\n- Full data fidelity for comprehensive reporting\r\n- Used for standardised reports on Tamanu facility servers\r\n\r\n### Analytics Schema (Tupaia Integration)\r\n**Command**: `dbt run --target analytics_release --select tag:base`\r\n- Privacy-compliant deployment excluding direct identifiers\r\n- Automatically filters columns tagged with `direct_identifier`\r\n- Preserves all transformations and business logic\r\n- Optimised for aggregated analysis and population health insights\r\n\r\n## Data Classification System\r\n\r\n### Data Type Tags\r\n- **`administration`** - System operation data that changes during normal use (e.g., user passwords, email addresses)\r\n- **`clinical`** - Patient medical records, always attached to a Patient (often via an Encounter), always considered sensitive\r\n- **`financial`** - Patient billing, invoicing, and payment for services and goods provided, sometimes sensitive\r\n- **`log`** - System-generated records capturing events, actions, or state changes within the application\r\n- **`patient`** - Patient demographic information, can be masked or aggregated for privacy in reporting\r\n- **`reference`** - System-wide configuration and lists (diagnoses, facilities, locations, surveys, vaccination schedules), populated centrally and synced to all facilities, never sensitive/restricted\r\n- **`system`** - Internal Tamanu operation data (configuration, sync status, task queues), usually invisible to clinicians, sometimes sensitive, not available for reporting\r\n\r\n### Privacy Classification Tags\r\n- **`direct_identifier`** - Identifiers that can uniquely identify an individual on their own (e.g., full name, email, passport ID)\r\n - These identifiers are excluded from analytics deployments\r\n- **`quasi_identifier`** - Identifiers that are not uniquely identifying alone but can identify an individual when combined (e.g., sex, location)\r\n - These identifiers should be aggregated or generalised for data analysis\r\n\r\n### Operational Status Tags\r\n- **`deprecated`** - Models that are no longer in use; data from these models is usually migrated to another part of the database\r\n - These models will not be available for reporting\r\n\r\n## Extensions & Customisations\r\n\r\n### Survey Models\r\nSurvey models are not part of the standard model set but are available as extensions in individual project deployments. These handle:\r\n- Custom form-based data collection\r\n- Patient-specific survey responses\r\n- Program-specific data elements\r\n\r\nSurvey models follow the same architectural patterns as standard models when implemented.\r\n\r\n## Exploring the Documentation\r\n\r\n### Navigation Options\r\n\r\n#### Project Tab\r\nThe Project tab mirrors the directory structure of your dbt project, showing all models defined in the project as well as models imported from dbt packages.\r\n\r\n#### Database Tab\r\nThe Database tab presents models in a database explorer format, showing relations (tables and views) grouped into database schemas. Note that ephemeral models are not shown in this interface as they do not exist in the database.\r\n\r\n### Lineage Graph Exploration\r\nClick the blue icon on the bottom-right corner of any page to view the lineage graph of your models.\r\n\r\n#### Model Page Lineage\r\nOn individual model pages, you'll see the immediate parents and children of the model you're exploring. Click the **Expand** button at the top-right of the lineage pane to see all models that are used to build, or are built from, the current model.\r\n\r\n#### Interactive Graph Features\r\n- Use `--select` and `--exclude` model selection syntax to filter models in the graph\r\n- Right-click on models to interactively filter and explore the graph\r\n- Navigate through the complete data lineage to understand dependencies"}, "doc.tamanu_source_dbt.generic__metadata": {"name": "generic__metadata", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\generic.md", "original_file_path": "models\\bases\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__metadata", "block_contents": "Metadata information extracted from the change logs"}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id": {"name": "outpatient_appointments_change_logs__change_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_id", "block_contents": "Unique identifier for the change log entry (UUID from logs.changes)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id": {"name": "outpatient_appointments_change_logs__appointment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_id", "block_contents": "Reference to the [appointment](#!/model/model.tamanu_source_dbt.outpatient_appointments) that was modified."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime": {"name": "outpatient_appointments_change_logs__modified_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_datetime", "block_contents": "Timestamp when the change was logged (from logs.changes.logged_at)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id": {"name": "outpatient_appointments_change_logs__modified_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__modified_by_user_id", "block_contents": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who made the modification."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id": {"name": "outpatient_appointments_change_logs__created_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__created_by_user_id", "block_contents": "Reference to the [user](#!/model/model.tamanu_source_dbt.users) who originally created the appointment."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id": {"name": "outpatient_appointments_change_logs__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__patient_id", "block_contents": "Reference to the [patient](#!/model/model.tamanu_source_dbt.patients) associated with the appointment."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime": {"name": "outpatient_appointments_change_logs__start_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__start_datetime", "block_contents": "Current appointment start date and time (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime": {"name": "outpatient_appointments_change_logs__end_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__end_datetime", "block_contents": "Current appointment end date and time (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id": {"name": "outpatient_appointments_change_logs__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__clinician_id", "block_contents": "Current [clinician](#!/model/model.tamanu_source_dbt.users) ID (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id": {"name": "outpatient_appointments_change_logs__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__location_group_id", "block_contents": "Current [location group](#!/model/model.tamanu_source_dbt.location_groups)/area ID (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id": {"name": "outpatient_appointments_change_logs__appointment_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__appointment_type_id", "block_contents": "Current [appointment type](#!/model/model.tamanu_source_dbt.reference_data) ID (after the change)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority": {"name": "outpatient_appointments_change_logs__is_high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__is_high_priority", "block_contents": "Current priority status (after the change). Boolean indicating if the appointment is high priority."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__status": {"name": "outpatient_appointments_change_logs__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__status", "block_contents": "Current appointment status (after the change).\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`"}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id": {"name": "outpatient_appointments_change_logs__schedule_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__schedule_id", "block_contents": "Current recurring schedule ID (after the change). References appointment_schedules table."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime": {"name": "outpatient_appointments_change_logs__prev_start_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_start_datetime", "block_contents": "Previous appointment start date and time (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime": {"name": "outpatient_appointments_change_logs__prev_end_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_end_datetime", "block_contents": "Previous appointment end date and time (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id": {"name": "outpatient_appointments_change_logs__prev_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_clinician_id", "block_contents": "Previous clinician ID (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id": {"name": "outpatient_appointments_change_logs__prev_location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_location_group_id", "block_contents": "Previous location group/area ID (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id": {"name": "outpatient_appointments_change_logs__prev_appointment_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_appointment_type_id", "block_contents": "Previous appointment type ID (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority": {"name": "outpatient_appointments_change_logs__prev_is_high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_is_high_priority", "block_contents": "Previous priority status (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_status": {"name": "outpatient_appointments_change_logs__prev_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__prev_status", "block_contents": "Previous appointment status (before the change). Null for creation events (change_sequence = 1)."}, "doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_sequence": {"name": "outpatient_appointments_change_logs__change_sequence", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "bases\\outpatient_appointments_change_logs.md", "original_file_path": "models\\bases\\outpatient_appointments_change_logs.md", "unique_id": "doc.tamanu_source_dbt.outpatient_appointments_change_logs__change_sequence", "block_contents": "Sequential number of this change for the appointment.\r\n- 1 = initial creation event\r\n- 2+ = subsequent modifications\r\n\r\nUses ROW_NUMBER() partitioned by appointment_id and ordered by logged_at."}, "doc.tamanu_source_dbt.generic__department": {"name": "generic__department", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__department", "block_contents": "Full readable name of the department"}, "doc.tamanu_source_dbt.generic__departments": {"name": "generic__departments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__departments", "block_contents": "A comma separated list of names of the departments"}, "doc.tamanu_source_dbt.generic__department_id": {"name": "generic__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__department_id", "block_contents": "Reference to the [department](#!/source/tamanu-source-dbt.tamanu.departments)"}, "doc.tamanu_source_dbt.generic__department_ids": {"name": "generic__department_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__department_ids", "block_contents": "An array referencing the [department](#!/source/tamanu-source-dbt.tamanu.departments)"}, "doc.tamanu_source_dbt.generic__datetimes": {"name": "generic__datetimes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__datetimes", "block_contents": "A comma separated list of dates and times"}, "doc.tamanu_source_dbt.generic__diagnoses": {"name": "generic__diagnoses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__diagnoses", "block_contents": "Full list of diagnoses"}, "doc.tamanu_source_dbt.generic__medications": {"name": "generic__medications", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__medications", "block_contents": "Full list of medications"}, "doc.tamanu_source_dbt.generic__vaccinations": {"name": "generic__vaccinations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__vaccinations", "block_contents": "Full list of vaccinations"}, "doc.tamanu_source_dbt.generic__procedures": {"name": "generic__procedures", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__procedures", "block_contents": "Full list of procedures"}, "doc.tamanu_source_dbt.generic__lab_requests": {"name": "generic__lab_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__lab_requests", "block_contents": "Full list of lab requests"}, "doc.tamanu_source_dbt.generic__imaging_requests": {"name": "generic__imaging_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__imaging_requests", "block_contents": "Full list of imaging requests"}, "doc.tamanu_source_dbt.generic__notes": {"name": "generic__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__notes", "block_contents": "Full list of notes (cropped if exceeds 32,000 characters)"}, "doc.tamanu_source_dbt.generic__encounter_types": {"name": "generic__encounter_types", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__encounter_types", "block_contents": "Full list of encounter types an encounter has been"}, "doc.tamanu_source_dbt.generic__duration": {"name": "generic__duration", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__duration", "block_contents": "Duration"}, "doc.tamanu_source_dbt.generic__facility": {"name": "generic__facility", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__facility", "block_contents": "Full readable name of the facility"}, "doc.tamanu_source_dbt.generic__facility_id": {"name": "generic__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__facility_id", "block_contents": "Reference to the [facility](#!/source/tamanu-source-dbt.tamanu.facilities)"}, "doc.tamanu_source_dbt.generic__insurance_policy_number": {"name": "generic__insurance_policy_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__insurance_policy_number", "block_contents": "Insurance policy number of the patient."}, "doc.tamanu_source_dbt.generic__insurers": {"name": "generic__insurers", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__insurers", "block_contents": "List of insurers covering the patient."}, "doc.tamanu_source_dbt.generic__invoice_remaining_patient_balance": {"name": "generic__invoice_remaining_patient_balance", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_remaining_patient_balance", "block_contents": "Remaining balance to be paid by the patient."}, "doc.tamanu_source_dbt.generic__invoice_total_amount_paid": {"name": "generic__invoice_total_amount_paid", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_amount_paid", "block_contents": "Total amount paid."}, "doc.tamanu_source_dbt.generic__invoice_total_insurer_amount": {"name": "generic__invoice_total_insurer_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_insurer_amount", "block_contents": "Total amount covered by insurers."}, "doc.tamanu_source_dbt.generic__invoice_total_invoice_amount": {"name": "generic__invoice_total_invoice_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_invoice_amount", "block_contents": "Total invoicing amount."}, "doc.tamanu_source_dbt.generic__invoice_total_patient_amount": {"name": "generic__invoice_total_patient_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_patient_amount", "block_contents": "Total amount payable by the patient."}, "doc.tamanu_source_dbt.generic__invoice_total_patient_discount": {"name": "generic__invoice_total_patient_discount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__invoice_total_patient_discount", "block_contents": "Total discount applied to the patient."}, "doc.tamanu_source_dbt.generic__location": {"name": "generic__location", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location", "block_contents": "Full readable name of the location"}, "doc.tamanu_source_dbt.generic__location_group": {"name": "generic__location_group", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_group", "block_contents": "Full readable name of the location group"}, "doc.tamanu_source_dbt.generic__location_groups": {"name": "generic__location_groups", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_groups", "block_contents": "A comma separated list of names of the location groups"}, "doc.tamanu_source_dbt.generic__location_group_id": {"name": "generic__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_group_id", "block_contents": "Reference to the [group](#!/source/tamanu-source-dbt.tamanu.location_groups)"}, "doc.tamanu_source_dbt.generic__location_group_ids": {"name": "generic__location_group_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_group_ids", "block_contents": "An array referencing the [group](#!/source/tamanu-source-dbt.tamanu.location_groups)"}, "doc.tamanu_source_dbt.generic__location_id": {"name": "generic__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_id", "block_contents": "Reference to the [location](#!/source/tamanu-source-dbt.tamanu.locations)"}, "doc.tamanu_source_dbt.generic__location_ids": {"name": "generic__location_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__location_ids", "block_contents": "An array referencing the [location](#!/source/tamanu-source-dbt.tamanu.locations)"}, "doc.tamanu_source_dbt.generic__locations": {"name": "generic__locations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__locations", "block_contents": "A comma separated list of names of the locations"}, "doc.tamanu_source_dbt.generic__patient_conditions": {"name": "generic__patient_conditions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patient_conditions", "block_contents": "Full list of conditions"}, "doc.tamanu_source_dbt.generic__patient_is_deceased": {"name": "generic__patient_is_deceased", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patient_is_deceased", "block_contents": "Indicates whether the patient has been deceased."}, "doc.tamanu_source_dbt.generic__patient_is_discharged": {"name": "generic__patient_is_discharged", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patient_is_discharged", "block_contents": "Indicates whether the patient has been discharged."}, "doc.tamanu_source_dbt.generic__patients_age": {"name": "generic__patients_age", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patients_age", "block_contents": "Patient's age"}, "doc.tamanu_source_dbt.generic__patients_name": {"name": "generic__patients_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__patients_name", "block_contents": "Patient Name"}, "doc.tamanu_source_dbt.generic__reference_data": {"name": "generic__reference_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__reference_data", "block_contents": "Full readable name"}, "doc.tamanu_source_dbt.generic__social_security_number": {"name": "generic__social_security_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__social_security_number", "block_contents": "Social security number of the patient."}, "doc.tamanu_source_dbt.generic__tests": {"name": "generic__tests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__tests", "block_contents": "Full list of tests"}, "doc.tamanu_source_dbt.generic__user": {"name": "generic__user", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__user", "block_contents": "Display identifier for the user"}, "doc.tamanu_source_dbt.generic__admission_status": {"name": "generic__admission_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__admission_status", "block_contents": "The current status of the admission.\r\n\r\n- `active` indicates the patient is currently admitted\r\n- `discharged` indicates the patient has been discharged"}, "doc.tamanu_source_dbt.generic__length_of_stay": {"name": "generic__length_of_stay", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__length_of_stay", "block_contents": "Length of stay in days for the encounter (null if encounter is still active)"}, "doc.tamanu_source_dbt.generic__triage_wait_time": {"name": "generic__triage_wait_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\generic.md", "original_file_path": "models\\datasets\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__triage_wait_time", "block_contents": "Time between triage and being seen (HH:MM:SS format)"}, "doc.tamanu_source_dbt.ds__invoice_products": {"name": "ds__invoice_products", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__invoice_products.md", "original_file_path": "models\\datasets\\standard\\ds__invoice_products.md", "unique_id": "doc.tamanu_source_dbt.ds__invoice_products", "block_contents": "Invoice products pivoted with their prices across all price lists and insurance coverage across all insurance plans. One row per product."}, "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__change_number": {"name": "ds__outpatient_appointments_audit__change_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments_audit.md", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments_audit.md", "unique_id": "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__change_number", "block_contents": "Sequential change number for this appointment where initial creation is excluded. 1 = first modification, 2 = second modification, etc."}, "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_cancelled": {"name": "ds__outpatient_appointments_audit__is_cancelled", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments_audit.md", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments_audit.md", "unique_id": "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_cancelled", "block_contents": "Whether the appointment status is 'Cancelled'. Values: Yes/No."}, "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_repeating": {"name": "ds__outpatient_appointments_audit__is_repeating", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "datasets\\standard\\ds__outpatient_appointments_audit.md", "original_file_path": "models\\datasets\\standard\\ds__outpatient_appointments_audit.md", "unique_id": "doc.tamanu_source_dbt.ds__outpatient_appointments_audit__is_repeating", "block_contents": "Whether the appointment is part of a repeating schedule. Values: Yes (has schedule_id), No (no schedule_id)."}, "doc.tamanu_source_dbt.logs__table__accesses": {"name": "logs__table__accesses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__table__accesses", "block_contents": "Audit logs for users accessing records"}, "doc.tamanu_source_dbt.logs__accesses__id": {"name": "logs__accesses__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__id", "block_contents": "UUID"}, "doc.tamanu_source_dbt.logs__accesses__created_at": {"name": "logs__accesses__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__created_at", "block_contents": "Timestamp of when record was created"}, "doc.tamanu_source_dbt.logs__accesses__updated_at": {"name": "logs__accesses__updated_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__updated_at", "block_contents": "Timestamp of when record was last updated"}, "doc.tamanu_source_dbt.logs__accesses__deleted_at": {"name": "logs__accesses__deleted_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__deleted_at", "block_contents": "Timestamp of when record was deleted"}, "doc.tamanu_source_dbt.logs__accesses__user_id": {"name": "logs__accesses__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__user_id", "block_contents": "The user that accessed the records"}, "doc.tamanu_source_dbt.logs__accesses__record_id": {"name": "logs__accesses__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__record_id", "block_contents": "The ID of the accessed record"}, "doc.tamanu_source_dbt.logs__accesses__record_type": {"name": "logs__accesses__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__record_type", "block_contents": "The type of record accessed"}, "doc.tamanu_source_dbt.logs__accesses__facility_id": {"name": "logs__accesses__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__facility_id", "block_contents": "The facility that the record was accessed on"}, "doc.tamanu_source_dbt.logs__accesses__session_id": {"name": "logs__accesses__session_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__session_id", "block_contents": "The user session that the record was accessed on"}, "doc.tamanu_source_dbt.logs__accesses__device_id": {"name": "logs__accesses__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__device_id", "block_contents": "The id for the device that the user was accessing the record on"}, "doc.tamanu_source_dbt.logs__accesses__logged_at": {"name": "logs__accesses__logged_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__logged_at", "block_contents": "The time string of when the record was accessed"}, "doc.tamanu_source_dbt.logs__accesses__front_end_context": {"name": "logs__accesses__front_end_context", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__front_end_context", "block_contents": "A JSON object containing front end information about the record access"}, "doc.tamanu_source_dbt.logs__accesses__back_end_context": {"name": "logs__accesses__back_end_context", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__back_end_context", "block_contents": "A JSON object containing back end information about the record access"}, "doc.tamanu_source_dbt.logs__accesses__is_mobile": {"name": "logs__accesses__is_mobile", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__is_mobile", "block_contents": "Whether or not the user accessed the record from mobile"}, "doc.tamanu_source_dbt.logs__accesses__version": {"name": "logs__accesses__version", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__version", "block_contents": "The version of tamanu the record was created on"}, "doc.tamanu_source_dbt.logs__accesses__updated_at_sync_tick": {"name": "logs__accesses__updated_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\accesses.md", "original_file_path": "models\\logs\\accesses.md", "unique_id": "doc.tamanu_source_dbt.logs__accesses__updated_at_sync_tick", "block_contents": "TODO"}, "doc.tamanu_source_dbt.logs__table__changes": {"name": "logs__table__changes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__table__changes", "block_contents": "Contains a full log of all changes made to the core database records.\r\n\r\nThe changes are logged via triggers on source tables. The full row data is\r\nlogged in this table on every change to every row for every table that's covered.\r\nThese triggers are applied by Tamanu rather than being hardcoded in migrations.\r\n\r\nSome tables are excluded from logging. These are listed in the `NON_LOGGED_TABLES`\r\nconstant in the database package, and include the sync subsystem and other\r\ninternal system tables.\r\n\r\nNote that changes before this table was put in service will of course not have\r\nbeen logged."}, "doc.tamanu_source_dbt.logs__changes__id": {"name": "logs__changes__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__id", "block_contents": "The ID of the change log row. UUID"}, "doc.tamanu_source_dbt.logs__changes__table_oid": {"name": "logs__changes__table_oid", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__table_oid", "block_contents": "The Postgres OID of the table this change is from.\r\n\r\nPostgres OIDs are much more precise than `schema.name`, and are not susceptible\r\nto search path conflicts, so should be preferred for querying within the same\r\ndatabase. However, they are not easily relatable from outside the database, so\r\nthe schema and name fields are also recorded for those uses, plus human readers."}, "doc.tamanu_source_dbt.logs__changes__table_schema": {"name": "logs__changes__table_schema", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__table_schema", "block_contents": "The schema (~database namespace) of the table this change is from.\r\n\r\nThis will typically be `public`; as of writing tables from other schemas are not\r\nautomatically logged."}, "doc.tamanu_source_dbt.logs__changes__table_name": {"name": "logs__changes__table_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__table_name", "block_contents": "The name of the table this change is from."}, "doc.tamanu_source_dbt.logs__changes__logged_at": {"name": "logs__changes__logged_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__logged_at", "block_contents": "The timestamp this change was logged."}, "doc.tamanu_source_dbt.logs__changes__created_at": {"name": "logs__changes__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__created_at", "block_contents": "Then sequelize metadata for the records created time"}, "doc.tamanu_source_dbt.logs__changes__updated_by_user_id": {"name": "logs__changes__updated_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__updated_by_user_id", "block_contents": "The value of the `updated_by_user_id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on."}, "doc.tamanu_source_dbt.logs__changes__device_id": {"name": "logs__changes__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__device_id", "block_contents": "The `device_id` of the user behind the change"}, "doc.tamanu_source_dbt.logs__changes__version": {"name": "logs__changes__version", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__version", "block_contents": "The Tamanu version at time of change"}, "doc.tamanu_source_dbt.logs__changes__record_id": {"name": "logs__changes__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_id", "block_contents": "The value of the `id` field of the change data.\r\n\r\nThis is extracted from the data to make it easier to query on."}, "doc.tamanu_source_dbt.logs__changes__record_created_at": {"name": "logs__changes__record_created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_created_at", "block_contents": "The `created_at` metadata from record the changelog was recorded against"}, "doc.tamanu_source_dbt.logs__changes__record_updated_at": {"name": "logs__changes__record_updated_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_updated_at", "block_contents": "The `updated_at` metadata from record the changelog was recorded against"}, "doc.tamanu_source_dbt.logs__changes__record_deleted_at": {"name": "logs__changes__record_deleted_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_deleted_at", "block_contents": "The `deleted_at` metadata from record the changelog was recorded against"}, "doc.tamanu_source_dbt.logs__changes__record_data": {"name": "logs__changes__record_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__record_data", "block_contents": "The full row data of the change.\r\n\r\nNote that as this is `JSONB`, some type information may be lost. However, row\r\ndata in a Tamanu system is transported using JSON via the sync system anyway, so\r\nit is expected that all data trivially round-trips via JSON."}, "doc.tamanu_source_dbt.logs__changes__reason": {"name": "logs__changes__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__reason", "block_contents": "A string representing the reason for the change."}, "doc.tamanu_source_dbt.logs__changes__migration_context": {"name": "logs__changes__migration_context", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\changes.md", "original_file_path": "models\\logs\\changes.md", "unique_id": "doc.tamanu_source_dbt.logs__changes__migration_context", "block_contents": "Stores a JSON string (as type TEXT) with migration context information\r\nif the changelog was created from a migration."}, "doc.tamanu_source_dbt.logs__table__debug_logs": {"name": "logs__table__debug_logs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\debug_logs.md", "original_file_path": "models\\logs\\debug_logs.md", "unique_id": "doc.tamanu_source_dbt.logs__table__debug_logs", "block_contents": "Debugging logs stored in the database for easy reporting.\r\n\r\nTamanu has an associated tool called [Tamanu Alerts] which runs queries on the Tamanu database to\r\ndetermine alert conditions, especially for the Sync mechanisms. However, sometimes the information\r\nnecessary to determine an alert condition lives in logs, not in database tables. In those cases,\r\nthis table is used.\r\n\r\n[Tamanu Alerts]: https://docs.rs/bestool/latest/bestool/__help/tamanu/alerts/struct.AlertsArgs.html"}, "doc.tamanu_source_dbt.logs__debug_logs__id": {"name": "logs__debug_logs__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\debug_logs.md", "original_file_path": "models\\logs\\debug_logs.md", "unique_id": "doc.tamanu_source_dbt.logs__debug_logs__id", "block_contents": "UUID"}, "doc.tamanu_source_dbt.logs__debug_logs__type": {"name": "logs__debug_logs__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\debug_logs.md", "original_file_path": "models\\logs\\debug_logs.md", "unique_id": "doc.tamanu_source_dbt.logs__debug_logs__type", "block_contents": "Stable classifier for the log message."}, "doc.tamanu_source_dbt.logs__debug_logs__info": {"name": "logs__debug_logs__info", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\debug_logs.md", "original_file_path": "models\\logs\\debug_logs.md", "unique_id": "doc.tamanu_source_dbt.logs__debug_logs__info", "block_contents": "Arbitrary JSON log message.\r\n\r\nNot that unlike typical JSON-based log messages (only top-level string key to scalar value), this\r\ncan be nested arbitrarily deep, as it can include objects directly from the application."}, "doc.tamanu_source_dbt.logs__table__dhis2_pushes": {"name": "logs__table__dhis2_pushes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__table__dhis2_pushes", "block_contents": "Audit logs for DHIS2 integration pushes.\r\n\r\nThis table tracks the results of automated pushes of report data to DHIS2 instances.\r\nThe DHIS2IntegrationProcessor scheduled task processes configured reports and pushes\r\ntheir data to external DHIS2 systems. Each push attempt is logged here with details\r\nabout the success/failure status, import counts, and any conflicts encountered.\r\n\r\nThe table stores metadata about data synchronization operations including how many\r\nrecords were imported, updated, ignored, or deleted during each push operation."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__id": {"name": "logs__dhis2_pushes__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__id", "block_contents": "UUID primary key for the push log entry."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__created_at": {"name": "logs__dhis2_pushes__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__created_at", "block_contents": "Timestamp of when the push log entry was created."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__report_id": {"name": "logs__dhis2_pushes__report_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__report_id", "block_contents": "The ID of the report that was pushed to DHIS2."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__status": {"name": "logs__dhis2_pushes__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__status", "block_contents": "The status of the push operation: \"success\", \"failure\", or \"warning\"."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__imported": {"name": "logs__dhis2_pushes__imported", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__imported", "block_contents": "Number of records that were successfully imported to DHIS2."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__updated": {"name": "logs__dhis2_pushes__updated", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__updated", "block_contents": "Number of records that were updated in DHIS2."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__deleted": {"name": "logs__dhis2_pushes__deleted", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__deleted", "block_contents": "Number of records that were deleted from DHIS2."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__ignored": {"name": "logs__dhis2_pushes__ignored", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__ignored", "block_contents": "Number of records that were ignored during the push operation."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__updated_at": {"name": "logs__dhis2_pushes__updated_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__updated_at", "block_contents": "Timestamp of when the push log entry was last updated."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__deleted_at": {"name": "logs__dhis2_pushes__deleted_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__deleted_at", "block_contents": "Timestamp of when the push log entry was deleted (soft delete)."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__conflicts": {"name": "logs__dhis2_pushes__conflicts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__conflicts", "block_contents": "JSON array of conflict details encountered during the push operation."}, "doc.tamanu_source_dbt.logs__dhis2_pushes__message": {"name": "logs__dhis2_pushes__message", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\dhis2_pushes.md", "original_file_path": "models\\logs\\dhis2_pushes.md", "unique_id": "doc.tamanu_source_dbt.logs__dhis2_pushes__message", "block_contents": "Human-readable message describing the result of the push operation."}, "doc.tamanu_source_dbt.logs__table__fhir_writes": {"name": "logs__table__fhir_writes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__table__fhir_writes", "block_contents": "Full-request logs of writes (creates and modifies) coming over the FHIR API.\r\n\r\nFHIR is an extensive standard and we current support a small subset of it. There's an even tinier\r\nsubset of that which supports writes instead of just reads and searches. To avoid missing or losing\r\ndata which we could support accepting as writes in the future, and for development purposes, this\r\ntable logs the full request bodies for FHIR endpoints. This is not just the endpoints that we\r\ncurrently support, but all incoming write requests."}, "doc.tamanu_source_dbt.logs__fhir_writes__id": {"name": "logs__fhir_writes__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__id", "block_contents": "UUID"}, "doc.tamanu_source_dbt.logs__fhir_writes__created_at": {"name": "logs__fhir_writes__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__created_at", "block_contents": "When Tamanu received the request."}, "doc.tamanu_source_dbt.logs__fhir_writes__verb": {"name": "logs__fhir_writes__verb", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__verb", "block_contents": "HTTP verb (GET, POST, etc)"}, "doc.tamanu_source_dbt.logs__fhir_writes__url": {"name": "logs__fhir_writes__url", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__url", "block_contents": "HTTP URL"}, "doc.tamanu_source_dbt.logs__fhir_writes__body": {"name": "logs__fhir_writes__body", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__body", "block_contents": "Full request body"}, "doc.tamanu_source_dbt.logs__fhir_writes__headers": {"name": "logs__fhir_writes__headers", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__headers", "block_contents": "Selected request headers.\r\n\r\nSome headers are stripped for sensitivity."}, "doc.tamanu_source_dbt.logs__fhir_writes__user_id": {"name": "logs__fhir_writes__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\fhir_writes.md", "original_file_path": "models\\logs\\fhir_writes.md", "unique_id": "doc.tamanu_source_dbt.logs__fhir_writes__user_id", "block_contents": "The authenticated user for the API request."}, "doc.tamanu_source_dbt.logs__generic__schema": {"name": "logs__generic__schema", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\generic.md", "original_file_path": "models\\logs\\generic.md", "unique_id": "doc.tamanu_source_dbt.logs__generic__schema", "block_contents": "Contains logging tables across different domains."}, "doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick": {"name": "logs__generic__updated_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\generic.md", "original_file_path": "models\\logs\\generic.md", "unique_id": "doc.tamanu_source_dbt.logs__generic__updated_at_sync_tick", "block_contents": "Last tick that the record was updated. Used to figure out old vs new data when syncing"}, "doc.tamanu_source_dbt.logs__table__migrations": {"name": "logs__table__migrations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__table__migrations", "block_contents": "This table keeps track of when migrations are run.\r\n\r\nThe SequelizeMeta table in the public schema is internal migration state, and\r\nonly records which migrations are currently applied. This table instead logs\r\nwhenever migrations are performed, up and down, with additional timing info."}, "doc.tamanu_source_dbt.logs__migrations__id": {"name": "logs__migrations__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__id", "block_contents": "A randomly generated UUID."}, "doc.tamanu_source_dbt.logs__migrations__logged_at": {"name": "logs__migrations__logged_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__logged_at", "block_contents": "The local server time when the migration run happened."}, "doc.tamanu_source_dbt.logs__migrations__record_sync_tick": {"name": "logs__migrations__record_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__record_sync_tick", "block_contents": "TODO"}, "doc.tamanu_source_dbt.logs__migrations__device_id": {"name": "logs__migrations__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__device_id", "block_contents": "TODO"}, "doc.tamanu_source_dbt.logs__migrations__version": {"name": "logs__migrations__version", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__version", "block_contents": "TODO"}, "doc.tamanu_source_dbt.logs__migrations__direction": {"name": "logs__migrations__direction", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__direction", "block_contents": "What kind of migration operation this was (typically `up`)."}, "doc.tamanu_source_dbt.logs__migrations__migrations": {"name": "logs__migrations__migrations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__migrations", "block_contents": "The list of migrations applied during this operation."}, "doc.tamanu_source_dbt.logs__migrations__updated_at_sync_tick": {"name": "logs__migrations__updated_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "logs\\migrations.md", "original_file_path": "models\\logs\\migrations.md", "unique_id": "doc.tamanu_source_dbt.logs__migrations__updated_at_sync_tick", "block_contents": "TODO"}, "doc.tamanu_source_dbt.table__administered_vaccines": {"name": "table__administered_vaccines", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.table__administered_vaccines", "block_contents": "Table of vaccines administered to patients.\r\n\r\nVaccinations are recorded via the Vaccinations modal; they are selected\r\nfrom a list of Scheduled Vaccines and linked to a Patient via an Encounter."}, "doc.tamanu_source_dbt.administered_vaccines__id": {"name": "administered_vaccines__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__id", "block_contents": "Tamanu identifier for vaccine administrations recorded"}, "doc.tamanu_source_dbt.administered_vaccines__batch": {"name": "administered_vaccines__batch", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__batch", "block_contents": "Batch identifier of vaccine administrations recorded"}, "doc.tamanu_source_dbt.administered_vaccines__status": {"name": "administered_vaccines__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__status", "block_contents": "Status of vaccine administrations recorded. \r\n\r\nThe `RECORDED_IN_ERROR` status is assigned to vaccines initially recorded\r\nas `GIVEN` that are then deleted.\r\n\r\nThe `HISTORICAL` status is assigned to vaccines initially recorded as \r\n`NOT_GIVEN` that are then recorded as `GIVEN`. This `HISTORICAL` status \r\nkeeps a record that the vaccine was marked as `NOT_GIVEN` but hides this\r\nrecord from the frontend to avoid confusion or conflict with the `GIVEN`\r\nrecord."}, "doc.tamanu_source_dbt.administered_vaccines__reason": {"name": "administered_vaccines__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__reason", "block_contents": "Reason for vaccine administrations `NOT_GIVEN` status. This is a free text field"}, "doc.tamanu_source_dbt.administered_vaccines__injection_site": {"name": "administered_vaccines__injection_site", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__injection_site", "block_contents": "Injection site of the vaccine administrations recorded"}, "doc.tamanu_source_dbt.administered_vaccines__consent": {"name": "administered_vaccines__consent", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__consent", "block_contents": "Consent of the vaccine administrations recorded"}, "doc.tamanu_source_dbt.administered_vaccines__given_elsewhere": {"name": "administered_vaccines__given_elsewhere", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__given_elsewhere", "block_contents": "Checks if the vaccine was given elsewhere"}, "doc.tamanu_source_dbt.administered_vaccines__vaccine_name": {"name": "administered_vaccines__vaccine_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__vaccine_name", "block_contents": "Vaccine name of the vaccine administration recorded"}, "doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id": {"name": "administered_vaccines__scheduled_vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__scheduled_vaccine_id", "block_contents": "Reference to the [Scheduled Vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines) that was\r\nadministered."}, "doc.tamanu_source_dbt.administered_vaccines__encounter_id": {"name": "administered_vaccines__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__encounter_id", "block_contents": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) this vaccine was given in."}, "doc.tamanu_source_dbt.administered_vaccines__vaccine_brand": {"name": "administered_vaccines__vaccine_brand", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__vaccine_brand", "block_contents": "Vaccine brand of the vaccine administration recorded"}, "doc.tamanu_source_dbt.administered_vaccines__disease": {"name": "administered_vaccines__disease", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__disease", "block_contents": "Disease the vaccine addresses of the vaccine administration recorded"}, "doc.tamanu_source_dbt.administered_vaccines__recorder_id": {"name": "administered_vaccines__recorder_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__recorder_id", "block_contents": "Reference to the [User](#!/source/source.tamanu.tamanu.users) who recorded this vaccination.\r\nThis may differ from the User or person who administered the vaccine."}, "doc.tamanu_source_dbt.administered_vaccines__location_id": {"name": "administered_vaccines__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__location_id", "block_contents": "Reference to the [Location](#!/source/source.tamanu.tamanu.locations) at which the vaccine was\r\ngiven."}, "doc.tamanu_source_dbt.administered_vaccines__department_id": {"name": "administered_vaccines__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__department_id", "block_contents": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) at which the vaccine was\r\ngiven."}, "doc.tamanu_source_dbt.administered_vaccines__given_by": {"name": "administered_vaccines__given_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__given_by", "block_contents": "Free text field for the name of the health practitioner who administered the\r\nvaccine. This is defaulted to the `display_name` of the logged-in User, but can\r\nbe changed. It is not a requirement that the administerer is a Tamanu User."}, "doc.tamanu_source_dbt.administered_vaccines__consent_given_by": {"name": "administered_vaccines__consent_given_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__consent_given_by", "block_contents": "Free text field recording who gave consent for the vaccination.\r\nThis is usually the patient themselves, but may differ for children or dependent\r\npersons or other cases."}, "doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id": {"name": "administered_vaccines__not_given_reason_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__not_given_reason_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineNotGivenReason`).\r\n\r\nThese are presented as a dropdown for ease of recording and reporting, alongside the free-text field."}, "doc.tamanu_source_dbt.administered_vaccines__circumstance_ids": {"name": "administered_vaccines__circumstance_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\administered_vaccines.md", "original_file_path": "models\\sources\\administered_vaccines.md", "unique_id": "doc.tamanu_source_dbt.administered_vaccines__circumstance_ids", "block_contents": "Array of references to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=vaccineCircumstance`)."}, "doc.tamanu_source_dbt.table__appointments": {"name": "table__appointments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.table__appointments", "block_contents": "Table of appointments."}, "doc.tamanu_source_dbt.appointments__id": {"name": "appointments__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__id", "block_contents": "Tamanu identifier for appointment."}, "doc.tamanu_source_dbt.appointments__start_datetime": {"name": "appointments__start_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__start_datetime", "block_contents": "Start date and time of the appointment."}, "doc.tamanu_source_dbt.appointments__end_datetime": {"name": "appointments__end_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__end_datetime", "block_contents": "End date and time of the appointment."}, "doc.tamanu_source_dbt.appointments__start_time": {"name": "appointments__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__start_time", "block_contents": "When the appointment starts."}, "doc.tamanu_source_dbt.appointments__end_time": {"name": "appointments__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__end_time", "block_contents": "When the appointment ends."}, "doc.tamanu_source_dbt.appointments__patient_id": {"name": "appointments__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.appointments__clinician_id": {"name": "appointments__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__clinician_id", "block_contents": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that appointment."}, "doc.tamanu_source_dbt.appointments__location_id": {"name": "appointments__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__location_id", "block_contents": "The [location](#!/source/source.tamanu.tamanu.locations) where the appointment will take place."}, "doc.tamanu_source_dbt.appointments__schedule_id": {"name": "appointments__schedule_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__schedule_id", "block_contents": "Reference to the [appointment schedule](#!/source/source.tamanu.tamanu.appointment_schedules) in the case of repeating appointments."}, "doc.tamanu_source_dbt.appointments__status": {"name": "appointments__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__status", "block_contents": "The current status of the appointment record.\r\n\r\nOne of:\r\n- `Confirmed`\r\n- `Arrived`\r\n- `No-show`\r\n- `Cancelled`"}, "doc.tamanu_source_dbt.appointments__type_legacy": {"name": "appointments__type_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__type_legacy", "block_contents": "The legacy type of appointment.\r\n\r\nOne of:\r\n- `Standard`\r\n- `Emergency`\r\n- `Specialist`\r\n- `Other`"}, "doc.tamanu_source_dbt.appointments__start_time_legacy": {"name": "appointments__start_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__start_time_legacy", "block_contents": "[Deprecated] Start time."}, "doc.tamanu_source_dbt.appointments__end_time_legacy": {"name": "appointments__end_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__end_time_legacy", "block_contents": "[Deprecated] End time."}, "doc.tamanu_source_dbt.appointments__location_group_id": {"name": "appointments__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__location_group_id", "block_contents": "The [location group](#!/source/source.tamanu.tamanu.location_groups) where the appointment will take place."}, "doc.tamanu_source_dbt.appointments__booking_type_id": {"name": "appointments__booking_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__booking_type_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=bookingType`)."}, "doc.tamanu_source_dbt.appointments__appointment_type_id": {"name": "appointments__appointment_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__appointment_type_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=appointmentType`)."}, "doc.tamanu_source_dbt.appointments__is_high_priority": {"name": "appointments__is_high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__is_high_priority", "block_contents": "Boolean specify if the appointment is high priority."}, "doc.tamanu_source_dbt.appointments__encounter_id": {"name": "appointments__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) linked to this appointment"}, "doc.tamanu_source_dbt.appointments__additional_clinician_id": {"name": "appointments__additional_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__additional_clinician_id", "block_contents": "Reference to an additional [clinician](#!/source/source.tamanu.tamanu.users)"}, "doc.tamanu_source_dbt.appointments__link_encounter_id": {"name": "appointments__link_encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointments.md", "original_file_path": "models\\sources\\appointments.md", "unique_id": "doc.tamanu_source_dbt.appointments__link_encounter_id", "block_contents": "Reference to the related [encounter](#!/source/source.tamanu.tamanu.encounters) of the appointment"}, "doc.tamanu_source_dbt.table__appointment_procedure_types": {"name": "table__appointment_procedure_types", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_procedure_types.md", "original_file_path": "models\\sources\\appointment_procedure_types.md", "unique_id": "doc.tamanu_source_dbt.table__appointment_procedure_types", "block_contents": "Junction table linking appointments to procedure types, allowing multiple procedure types to be associated with a single appointment."}, "doc.tamanu_source_dbt.appointment_procedure_types__appointment_id": {"name": "appointment_procedure_types__appointment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_procedure_types.md", "original_file_path": "models\\sources\\appointment_procedure_types.md", "unique_id": "doc.tamanu_source_dbt.appointment_procedure_types__appointment_id", "block_contents": "Reference to the [appointment](#!/source/source.tamanu.tamanu.appointments) this procedure type is associated with."}, "doc.tamanu_source_dbt.appointment_procedure_types__procedure_type_id": {"name": "appointment_procedure_types__procedure_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_procedure_types.md", "original_file_path": "models\\sources\\appointment_procedure_types.md", "unique_id": "doc.tamanu_source_dbt.appointment_procedure_types__procedure_type_id", "block_contents": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`) associated with this appointment."}, "doc.tamanu_source_dbt.table__appointment_schedules": {"name": "table__appointment_schedules", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.table__appointment_schedules", "block_contents": "Defines recurrence rules for appointments."}, "doc.tamanu_source_dbt.appointment_schedules__until_date": {"name": "appointment_schedules__until_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__until_date", "block_contents": "The end date for the recurrence. No occurrences will be generated beyond this date. \r\nBoth `until_date` and `occurrence_count` cannot be null at the same time to ensure the recurrence has an end condition."}, "doc.tamanu_source_dbt.appointment_schedules__interval": {"name": "appointment_schedules__interval", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__interval", "block_contents": "The recurrence interval. For example:\r\n- For a `frequency` of `WEEKLY`, an `interval` of 1 means \"Once a week.\"\r\n- For a `frequency` of `MONTHLY`, an `interval` of 3 means \"Every 3 months.\""}, "doc.tamanu_source_dbt.appointment_schedules__frequency": {"name": "appointment_schedules__frequency", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__frequency", "block_contents": "How often the the recurrence occurs.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`"}, "doc.tamanu_source_dbt.appointment_schedules__days_of_week": {"name": "appointment_schedules__days_of_week", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__days_of_week", "block_contents": "Stores an array of ISO weekday abbreviations. \r\nGiven `WEEKLY` frequency `days_of_week` determines the weekday that the repeated appointment occurs on. \r\nGiven `MONTHLY` frequency `days_of_week` is combined with `nth_weekday` to determine the date in each month that the repeated appointment occurs on.\r\n\r\nOne of: \r\n- `MO`\r\n- `TU`\r\n- `WE`\r\n- `TH`\r\n- `FR`\r\n- `SA`\r\n- `SU`"}, "doc.tamanu_source_dbt.appointment_schedules__nth_weekday": {"name": "appointment_schedules__nth_weekday", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__nth_weekday", "block_contents": "Ordinal weekday for monthly recurrence interpreted with `days_of_week` for example:\r\n- `1` with `days_of_week = ['MO']` = First Monday of the month\r\n- `2` with `days_of_week = ['TU']` = Second Tuesday of the month\r\n- `-1` with `days_of_week = ['FR']` = Last Friday of the month"}, "doc.tamanu_source_dbt.appointment_schedules__occurrence_count": {"name": "appointment_schedules__occurrence_count", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__occurrence_count", "block_contents": "When this value is set, the recurrence ends after generating the specified number of occurrences\r\nAt least one of `occurrence_count` or `until_date` must be set."}, "doc.tamanu_source_dbt.appointment_schedules__is_fully_generated": {"name": "appointment_schedules__is_fully_generated", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__is_fully_generated", "block_contents": "Whether or not all repeating appointments have been created for a schedule"}, "doc.tamanu_source_dbt.appointment_schedules__generated_until_date": {"name": "appointment_schedules__generated_until_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__generated_until_date", "block_contents": "The date of the most recent appointment in a schedule, this is set after generation of the repeated appointment and then updated if it is necessary to generate further appointments."}, "doc.tamanu_source_dbt.appointment_schedules__cancelled_at_date": {"name": "appointment_schedules__cancelled_at_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\appointment_schedules.md", "original_file_path": "models\\sources\\appointment_schedules.md", "unique_id": "doc.tamanu_source_dbt.appointment_schedules__cancelled_at_date", "block_contents": "The date from which appointments in a schedule have been cancelled, this is set when cancelling 'this and all future appointments'."}, "doc.tamanu_source_dbt.table__assets": {"name": "table__assets", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.table__assets", "block_contents": "Table of assets used in the tamanu app ui and patient letters."}, "doc.tamanu_source_dbt.assets__id": {"name": "assets__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__id", "block_contents": "Tamanu identifier for the asset."}, "doc.tamanu_source_dbt.assets__name": {"name": "assets__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__name", "block_contents": "Name of the asset set by the user on upload."}, "doc.tamanu_source_dbt.assets__type": {"name": "assets__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__type", "block_contents": "This is the type of asset stored."}, "doc.tamanu_source_dbt.assets__data": {"name": "assets__data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__data", "block_contents": "Contains a binary version of image data uploaded by user."}, "doc.tamanu_source_dbt.assets__facility_id": {"name": "assets__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\assets.md", "original_file_path": "models\\sources\\assets.md", "unique_id": "doc.tamanu_source_dbt.assets__facility_id", "block_contents": "Reference to the [facilities](#!/source/source.tamanu.tamanu.facilities) this asset is associated with."}, "doc.tamanu_source_dbt.table__attachments": {"name": "table__attachments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.table__attachments", "block_contents": "Uploaded files.\r\n\r\nThese can be documents, photo IDs, patient letters...\r\n\r\nMost direct uploads will have a corresponding [`document_metadata`](#!/source/source.tamanu.tamanu.document_metadata),\r\nbut there's other ways to upload files, such as [for lab requests](#!/source/source.tamanu.tamanu.lab_request_attachments).\r\n\r\nUploaded files are not currently synced to facility servers. Instead, servers request the contents\r\nof documents just-in-time. This does require facility servers to be \"online\" but significantly\r\nreduces sync pressure."}, "doc.tamanu_source_dbt.attachments__name": {"name": "attachments__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.attachments__name", "block_contents": "The name for the attachment set on upload.\r\n\r\nTypically this is the filename."}, "doc.tamanu_source_dbt.attachments__type": {"name": "attachments__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.attachments__type", "block_contents": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file."}, "doc.tamanu_source_dbt.attachments__size": {"name": "attachments__size", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.attachments__size", "block_contents": "The file size in bytes."}, "doc.tamanu_source_dbt.attachments__data": {"name": "attachments__data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\attachments.md", "original_file_path": "models\\sources\\attachments.md", "unique_id": "doc.tamanu_source_dbt.attachments__data", "block_contents": "The file data."}, "doc.tamanu_source_dbt.table__certifiable_vaccines": {"name": "table__certifiable_vaccines", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.table__certifiable_vaccines", "block_contents": "Table of scheduled vaccines which can be certified via EUDCC or ICAO VDC.\r\n\r\nIntroduced during the COVID-19 pandemic, these are standards which can be\r\nused to produce a QR code containing vaccine information and a digital signature\r\nwhich certifies that the vaccines were administered by a competent authority.\r\n\r\nThis table both contains additional information about scheduled vaccines which is\r\nrequired for those to be certified, and signals that the vaccines listed may be\r\nincluded in certification QR codes.\r\n\r\nSee also the [`signers`](#!/source/source.tamanu.tamanu.signers) table."}, "doc.tamanu_source_dbt.certifiable_vaccines__vaccine_id": {"name": "certifiable_vaccines__vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__vaccine_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=vaccine`)\r\nfor the vaccine drug."}, "doc.tamanu_source_dbt.certifiable_vaccines__manufacturer_id": {"name": "certifiable_vaccines__manufacturer_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__manufacturer_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=manufacturer`)\r\nfor the organisation that manufactured the drug."}, "doc.tamanu_source_dbt.certifiable_vaccines__icd11_drug_code": {"name": "certifiable_vaccines__icd11_drug_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__icd11_drug_code", "block_contents": "Free-text for the ICD11 code for the drug."}, "doc.tamanu_source_dbt.certifiable_vaccines__icd11_disease_code": {"name": "certifiable_vaccines__icd11_disease_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__icd11_disease_code", "block_contents": "Free-text for the ICD11 code for the disease targeted by the drug."}, "doc.tamanu_source_dbt.certifiable_vaccines__vaccine_code": {"name": "certifiable_vaccines__vaccine_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__vaccine_code", "block_contents": "SNOMED CT or ATC code for the vaccine type."}, "doc.tamanu_source_dbt.certifiable_vaccines__target_code": {"name": "certifiable_vaccines__target_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__target_code", "block_contents": "SNOMED CT or ATC code for targeted disease."}, "doc.tamanu_source_dbt.certifiable_vaccines__eu_product_code": {"name": "certifiable_vaccines__eu_product_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__eu_product_code", "block_contents": "EU authorisation code for the vaccine product."}, "doc.tamanu_source_dbt.certifiable_vaccines__maximum_dosage": {"name": "certifiable_vaccines__maximum_dosage", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certifiable_vaccines.md", "original_file_path": "models\\sources\\certifiable_vaccines.md", "unique_id": "doc.tamanu_source_dbt.certifiable_vaccines__maximum_dosage", "block_contents": "Maximum number of doses. Defaults to 1."}, "doc.tamanu_source_dbt.table__certificate_notifications": {"name": "table__certificate_notifications", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.table__certificate_notifications", "block_contents": "Various medical certificates being sent to patients.\r\n\r\nThese rows are processed by the `CertificateNotificationProcessor` scheduled task, and generate a\r\n[`patient_communications`](#!/source/source.tamanu.tamanu.patient_communications) row.\r\n\r\nThe actual certificate itself is stored separately on the filesystem while it's generated."}, "doc.tamanu_source_dbt.certificate_notifications__type": {"name": "certificate_notifications__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__type", "block_contents": "Type of certificate being generated.\r\n\r\nThis dictates both from which resource the certificate is generated, and also the template being\r\nused for generating the certificate itself.\r\n\r\nOne of:\r\n- `covid_19_clearance`\r\n- `vaccination_certificate`\r\n- `icao.test`\r\n- `icao.vacc`"}, "doc.tamanu_source_dbt.certificate_notifications__require_signing": {"name": "certificate_notifications__require_signing", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__require_signing", "block_contents": "If the certificates requires cryptographic signing.\r\n\r\nSee [`certifiable_vaccines`](#!/source/source.tamanu.tamanu.certifiable_vaccines).\r\n\r\nOnly applicable to `icao.test` and `icao.vacc` types."}, "doc.tamanu_source_dbt.certificate_notifications__patient_id": {"name": "certificate_notifications__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__patient_id", "block_contents": "Reference to a [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.certificate_notifications__forward_address": {"name": "certificate_notifications__forward_address", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__forward_address", "block_contents": "An email address to send the generated certificate to."}, "doc.tamanu_source_dbt.certificate_notifications__lab_test_id": {"name": "certificate_notifications__lab_test_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__lab_test_id", "block_contents": "The [lab test](#!/source/source.tamanu.tamanu.lab_tests) this certificate is for, if applicable."}, "doc.tamanu_source_dbt.certificate_notifications__status": {"name": "certificate_notifications__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__status", "block_contents": "Processing status.\r\n\r\nOne of:\r\n- `Queued`\r\n- `Processed`\r\n- `Error`\r\n- `Ignore`"}, "doc.tamanu_source_dbt.certificate_notifications__error": {"name": "certificate_notifications__error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__error", "block_contents": "If the certificate generation fails, this is the error."}, "doc.tamanu_source_dbt.certificate_notifications__created_by": {"name": "certificate_notifications__created_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__created_by", "block_contents": "The name of the user who initiated the creation of this certificate."}, "doc.tamanu_source_dbt.certificate_notifications__lab_request_id": {"name": "certificate_notifications__lab_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__lab_request_id", "block_contents": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this certificate is for, if applicable."}, "doc.tamanu_source_dbt.certificate_notifications__printed_date": {"name": "certificate_notifications__printed_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__printed_date", "block_contents": "When this certificate was printed, if applicable."}, "doc.tamanu_source_dbt.certificate_notifications__facility_name": {"name": "certificate_notifications__facility_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__facility_name", "block_contents": "The name of the facility where the creation of this certificate was initiated."}, "doc.tamanu_source_dbt.certificate_notifications__language": {"name": "certificate_notifications__language", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\certificate_notifications.md", "original_file_path": "models\\sources\\certificate_notifications.md", "unique_id": "doc.tamanu_source_dbt.certificate_notifications__language", "block_contents": "Used to translate the certificate."}, "doc.tamanu_source_dbt.table__contributing_death_causes": {"name": "table__contributing_death_causes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\contributing_death_causes.md", "original_file_path": "models\\sources\\contributing_death_causes.md", "unique_id": "doc.tamanu_source_dbt.table__contributing_death_causes", "block_contents": "Contributing causes recorded with the patient's death data."}, "doc.tamanu_source_dbt.contributing_death_causes__time_after_onset": {"name": "contributing_death_causes__time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\contributing_death_causes.md", "original_file_path": "models\\sources\\contributing_death_causes.md", "unique_id": "doc.tamanu_source_dbt.contributing_death_causes__time_after_onset", "block_contents": "Time between onset of recorded cause and death in minutes."}, "doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id": {"name": "contributing_death_causes__patient_death_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\contributing_death_causes.md", "original_file_path": "models\\sources\\contributing_death_causes.md", "unique_id": "doc.tamanu_source_dbt.contributing_death_causes__patient_death_data_id", "block_contents": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record."}, "doc.tamanu_source_dbt.contributing_death_causes__condition_id": {"name": "contributing_death_causes__condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\contributing_death_causes.md", "original_file_path": "models\\sources\\contributing_death_causes.md", "unique_id": "doc.tamanu_source_dbt.contributing_death_causes__condition_id", "block_contents": "Reference to the condition ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diagnosis`)."}, "doc.tamanu_source_dbt.table__death_revert_logs": {"name": "table__death_revert_logs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.table__death_revert_logs", "block_contents": "Patient deaths can be reverted if they were recorded in error, this tracks those reverts.\r\n\r\nSee [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data)."}, "doc.tamanu_source_dbt.death_revert_logs__revert_time": {"name": "death_revert_logs__revert_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.death_revert_logs__revert_time", "block_contents": "When the reversion happened."}, "doc.tamanu_source_dbt.death_revert_logs__death_data_id": {"name": "death_revert_logs__death_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.death_revert_logs__death_data_id", "block_contents": "The [`patient_death_data`](#!/source/source.tamanu.tamanu.patient_death_data) record this is reverting."}, "doc.tamanu_source_dbt.death_revert_logs__patient_id": {"name": "death_revert_logs__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.death_revert_logs__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.death_revert_logs__reverted_by_id": {"name": "death_revert_logs__reverted_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\death_revert_logs.md", "original_file_path": "models\\sources\\death_revert_logs.md", "unique_id": "doc.tamanu_source_dbt.death_revert_logs__reverted_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who reverted this death record."}, "doc.tamanu_source_dbt.table__departments": {"name": "table__departments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\departments.md", "original_file_path": "models\\sources\\departments.md", "unique_id": "doc.tamanu_source_dbt.table__departments", "block_contents": "Basic department info with a reference to parent facility."}, "doc.tamanu_source_dbt.departments__code": {"name": "departments__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\departments.md", "original_file_path": "models\\sources\\departments.md", "unique_id": "doc.tamanu_source_dbt.departments__code", "block_contents": "Code for department."}, "doc.tamanu_source_dbt.departments__name": {"name": "departments__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\departments.md", "original_file_path": "models\\sources\\departments.md", "unique_id": "doc.tamanu_source_dbt.departments__name", "block_contents": "Full readable name for department."}, "doc.tamanu_source_dbt.departments__facility_id": {"name": "departments__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\departments.md", "original_file_path": "models\\sources\\departments.md", "unique_id": "doc.tamanu_source_dbt.departments__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this department is in."}, "doc.tamanu_source_dbt.table__devices": {"name": "table__devices", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.table__devices", "block_contents": "Devices that are authorised to login.\r\n\r\nDevices not in the table can only connect if the user they're\r\n**first** logging in as has enough quota (`device_registration_quota`\r\non the [`users`](#!/source/source.tamanu.tamanu.users) table.)\r\n\r\nThis check is not performed when `features.deviceRegistrationQuota` is disabled."}, "doc.tamanu_source_dbt.devices__last_seen_at": {"name": "devices__last_seen_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.devices__last_seen_at", "block_contents": "When this device last logged in."}, "doc.tamanu_source_dbt.devices__registered_by_id": {"name": "devices__registered_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.devices__registered_by_id", "block_contents": "Which user registered this device.\r\n\r\nThis is used for quota calculations."}, "doc.tamanu_source_dbt.devices__name": {"name": "devices__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.devices__name", "block_contents": "Optional descriptive name, to make it easier to map device IDs to real devices\r\nin debugging and troubleshooting situations."}, "doc.tamanu_source_dbt.devices__scopes": {"name": "devices__scopes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\devices.md", "original_file_path": "models\\sources\\devices.md", "unique_id": "doc.tamanu_source_dbt.devices__scopes", "block_contents": "Scopes the device is authorised to access.\r\n\r\nScopes allow access to parts of the API that are closed to other devices\r\notherwise. Some scopes are restricted by quota. Devices aren't allowed to\r\nrequest more scopes than they currently have, but may login without\r\nspecifying the full scopes they have."}, "doc.tamanu_source_dbt.table__discharges": {"name": "table__discharges", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.table__discharges", "block_contents": "Information about a discharge.\r\n\r\nA discharge is the end of the lifecycle for an encounter."}, "doc.tamanu_source_dbt.discharges__note": {"name": "discharges__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__note", "block_contents": "Free-form notes about the discharge.\r\n\r\nMay include treatment plan and follow-ups, written by the discharging clinician.\r\n\r\nSince v2.0, also see the [`notes`](#!/source/source.tamanu.tamanu.notes) table for encounter and discharge notes."}, "doc.tamanu_source_dbt.discharges__encounter_id": {"name": "discharges__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this discharge is for."}, "doc.tamanu_source_dbt.discharges__discharger_id": {"name": "discharges__discharger_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__discharger_id", "block_contents": "The [discharging clinician](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.discharges__disposition_id": {"name": "discharges__disposition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__disposition_id", "block_contents": "The discharge disposition or classification of the discharge ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.discharges__facility_name": {"name": "discharges__facility_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__facility_name", "block_contents": "Name of the discharging facility."}, "doc.tamanu_source_dbt.discharges__facility_address": {"name": "discharges__facility_address", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__facility_address", "block_contents": "Address of the discharging facility."}, "doc.tamanu_source_dbt.discharges__facility_town": {"name": "discharges__facility_town", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\discharges.md", "original_file_path": "models\\sources\\discharges.md", "unique_id": "doc.tamanu_source_dbt.discharges__facility_town", "block_contents": "Town of the discharging facility."}, "doc.tamanu_source_dbt.table__document_metadata": {"name": "table__document_metadata", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.table__document_metadata", "block_contents": "Information about an uploaded document or file, typically attached to an encounter or directly to a patient.\r\n\r\nThe actual file data is stored in [`attachments`](#!/source/source.tamanu.tamanu.attachments)."}, "doc.tamanu_source_dbt.document_metadata__name": {"name": "document_metadata__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__name", "block_contents": "Free-form name of the document.\r\n\r\nOften this is the filename."}, "doc.tamanu_source_dbt.document_metadata__type": {"name": "document_metadata__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__type", "block_contents": "The [media type](https://en.wikipedia.org/wiki/Media_type) of the file."}, "doc.tamanu_source_dbt.document_metadata__document_created_at": {"name": "document_metadata__document_created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_created_at", "block_contents": "When the document was created.\r\n\r\nHistorically (before v2.0) this was the \"created at\" timestamp of the file itself, as reported by\r\nthe OS. However that information is no longer available to Tamanu in most contexts, so this is now\r\nusually set to the upload time."}, "doc.tamanu_source_dbt.document_metadata__document_uploaded_at": {"name": "document_metadata__document_uploaded_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_uploaded_at", "block_contents": "When the document was uploaded."}, "doc.tamanu_source_dbt.document_metadata__document_owner": {"name": "document_metadata__document_owner", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_owner", "block_contents": "Name of the person who owns the document.\r\n\r\nTypically this is the uploader's name."}, "doc.tamanu_source_dbt.document_metadata__patient_id": {"name": "document_metadata__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) the document was uploaded to."}, "doc.tamanu_source_dbt.document_metadata__encounter_id": {"name": "document_metadata__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) the document was uploaded to."}, "doc.tamanu_source_dbt.document_metadata__attachment_id": {"name": "document_metadata__attachment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__attachment_id", "block_contents": "The [file data](#!/source/source.tamanu.tamanu.attachments)."}, "doc.tamanu_source_dbt.document_metadata__department_id": {"name": "document_metadata__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__department_id", "block_contents": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the document was uploaded from."}, "doc.tamanu_source_dbt.document_metadata__note": {"name": "document_metadata__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__note", "block_contents": "Free-form description of the document."}, "doc.tamanu_source_dbt.document_metadata__document_created_at_legacy": {"name": "document_metadata__document_created_at_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_created_at_legacy", "block_contents": "[Deprecated] When the document was created."}, "doc.tamanu_source_dbt.document_metadata__document_uploaded_at_legacy": {"name": "document_metadata__document_uploaded_at_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__document_uploaded_at_legacy", "block_contents": "[Deprecated] When the document was uploaded."}, "doc.tamanu_source_dbt.document_metadata__source": {"name": "document_metadata__source", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\document_metadata.md", "original_file_path": "models\\sources\\document_metadata.md", "unique_id": "doc.tamanu_source_dbt.document_metadata__source", "block_contents": "Where the document came from.\r\n\r\nOne of:\r\n- `patient_letter`\r\n- `uploaded`"}, "doc.tamanu_source_dbt.table__encounters": {"name": "table__encounters", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.table__encounters", "block_contents": "Tracks the basic information of the patient encounters within Tamanu from start to finish"}, "doc.tamanu_source_dbt.encounters__encounter_type": {"name": "encounters__encounter_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__encounter_type", "block_contents": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`"}, "doc.tamanu_source_dbt.encounters__start_date": {"name": "encounters__start_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__start_date", "block_contents": "The beginning of the encounter"}, "doc.tamanu_source_dbt.encounters__end_date": {"name": "encounters__end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__end_date", "block_contents": "The date encounter was discharged/ended"}, "doc.tamanu_source_dbt.encounters__reason_for_encounter": {"name": "encounters__reason_for_encounter", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__reason_for_encounter", "block_contents": "Free-form information about the encounter.\r\n\r\nCan include info like type of survey submitted, emergency diagnosis, etc."}, "doc.tamanu_source_dbt.encounters__device_id": {"name": "encounters__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__device_id", "block_contents": "Unique identifier for the device that created the encounter.\r\n\r\nDevice IDs are proper to each device and not globally recorded in e.g. a `devices` table."}, "doc.tamanu_source_dbt.encounters__start_date_legacy": {"name": "encounters__start_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__start_date_legacy", "block_contents": "[Deprecated] Start date."}, "doc.tamanu_source_dbt.encounters__end_date_legacy": {"name": "encounters__end_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__end_date_legacy", "block_contents": "[Deprecated] End date."}, "doc.tamanu_source_dbt.encounters__planned_location_id": {"name": "encounters__planned_location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__planned_location_id", "block_contents": "The [location](#!/source/source.tamanu.tamanu.locations) that the encounter will transfer to at the\r\n`planned_location_start_time`."}, "doc.tamanu_source_dbt.encounters__patient_id": {"name": "encounters__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.encounters__examiner_id": {"name": "encounters__examiner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__examiner_id", "block_contents": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.encounters__location_id": {"name": "encounters__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__location_id", "block_contents": "Reference to the current [location](#!/source/source.tamanu.tamanu.locations) this encounter is in."}, "doc.tamanu_source_dbt.encounters__department_id": {"name": "encounters__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__department_id", "block_contents": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) this encounter is in."}, "doc.tamanu_source_dbt.encounters__planned_location_start_time": {"name": "encounters__planned_location_start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__planned_location_start_time", "block_contents": "The time that the encounter will transfer to the planned location."}, "doc.tamanu_source_dbt.encounters__patient_billing_type_id": {"name": "encounters__patient_billing_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__patient_billing_type_id", "block_contents": "The billing type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient."}, "doc.tamanu_source_dbt.encounters__referral_source_id": {"name": "encounters__referral_source_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__referral_source_id", "block_contents": "The referral source ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of the patient."}, "doc.tamanu_source_dbt.encounters__discharge_draft": {"name": "encounters__discharge_draft", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__discharge_draft", "block_contents": "Draft data of the encounter"}, "doc.tamanu_source_dbt.encounters__estimated_end_date": {"name": "encounters__estimated_end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounters.md", "original_file_path": "models\\sources\\encounters.md", "unique_id": "doc.tamanu_source_dbt.encounters__estimated_end_date", "block_contents": "The estimated discharge date of the encounter"}, "doc.tamanu_source_dbt.table__encounter_diagnoses": {"name": "table__encounter_diagnoses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_diagnoses", "block_contents": "Records diagnoses made during an encounter"}, "doc.tamanu_source_dbt.encounter_diagnoses__certainty": {"name": "encounter_diagnoses__certainty", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__certainty", "block_contents": "The level of certainty of the recorded diagnosis.\r\n\r\nOne of:\r\n- `confirmed`\r\n- `disproven`\r\n- `emergency`\r\n- `error`\r\n- `suspected`\r\n\r\n`disproven` and `error` are excluded for reporting"}, "doc.tamanu_source_dbt.encounter_diagnoses__is_primary": {"name": "encounter_diagnoses__is_primary", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__is_primary", "block_contents": "A boolean indicating if this is a primary diagnosis"}, "doc.tamanu_source_dbt.encounter_diagnoses__encounter_id": {"name": "encounter_diagnoses__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diagnosis is for."}, "doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id": {"name": "encounter_diagnoses__diagnosis_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__diagnosis_id", "block_contents": "The diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.encounter_diagnoses__clinician_id": {"name": "encounter_diagnoses__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diagnoses.md", "original_file_path": "models\\sources\\encounter_diagnoses.md", "unique_id": "doc.tamanu_source_dbt.encounter_diagnoses__clinician_id", "block_contents": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) recording that diagnosis."}, "doc.tamanu_source_dbt.table__encounter_diets": {"name": "table__encounter_diets", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diets.md", "original_file_path": "models\\sources\\encounter_diets.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_diets", "block_contents": "A diet associated with an encounter.\r\n\r\nA patient can be placed on a diet for various medical purposes.\r\nDiets are specified in reference data."}, "doc.tamanu_source_dbt.encounter_diets__encounter_id": {"name": "encounter_diets__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diets.md", "original_file_path": "models\\sources\\encounter_diets.md", "unique_id": "doc.tamanu_source_dbt.encounter_diets__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this diet is for."}, "doc.tamanu_source_dbt.encounter_diets__diet_id": {"name": "encounter_diets__diet_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_diets.md", "original_file_path": "models\\sources\\encounter_diets.md", "unique_id": "doc.tamanu_source_dbt.encounter_diets__diet_id", "block_contents": "The diet ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = diet`)."}, "doc.tamanu_source_dbt.table__encounter_history": {"name": "table__encounter_history", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_history", "block_contents": "Records changes to an encounter's basic details."}, "doc.tamanu_source_dbt.encounter_history__encounter_id": {"name": "encounter_history__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__encounter_id", "block_contents": "Reference to the original [encounter](#!/source/source.tamanu.tamanu.encounters) this history is for."}, "doc.tamanu_source_dbt.encounter_history__department_id": {"name": "encounter_history__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__department_id", "block_contents": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) the encounter was in."}, "doc.tamanu_source_dbt.encounter_history__location_id": {"name": "encounter_history__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the encounter was in."}, "doc.tamanu_source_dbt.encounter_history__examiner_id": {"name": "encounter_history__examiner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__examiner_id", "block_contents": "Reference to the [examiner](#!/source/source.tamanu.tamanu.users) for the encounter."}, "doc.tamanu_source_dbt.encounter_history__encounter_type": {"name": "encounter_history__encounter_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__encounter_type", "block_contents": "The type of the encounter.\r\n\r\nOne of:\r\n- `admission`\r\n- `clinic`\r\n- `imaging`\r\n- `emergency`\r\n- `observation`\r\n- `triage`\r\n- `surveyResponse`\r\n- `vaccination`"}, "doc.tamanu_source_dbt.encounter_history__actor_id": {"name": "encounter_history__actor_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__actor_id", "block_contents": "[Who](#!/source/source.tamanu.tamanu.users) made the change."}, "doc.tamanu_source_dbt.encounter_history__change_type": {"name": "encounter_history__change_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_history.md", "original_file_path": "models\\sources\\encounter_history.md", "unique_id": "doc.tamanu_source_dbt.encounter_history__change_type", "block_contents": "The field which was changed.\r\n\r\nOne of:\r\n- `encounter_type`\r\n- `location`\r\n- `department`\r\n- `examiner`"}, "doc.tamanu_source_dbt.table__encounter_pause_prescriptions": {"name": "table__encounter_pause_prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_pause_prescriptions", "block_contents": "Records details about the prescription being paused, the duration and timing of the pause, and the clinician responsible for initiating the pause."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__encounter_prescription_id": {"name": "encounter_pause_prescriptions__encounter_prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__encounter_prescription_id", "block_contents": "References the unique identifier of the prescription being paused. This links to the `encounter_prescriptions` table to provide context about the specific prescription."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_duration": {"name": "encounter_pause_prescriptions__pause_duration", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_duration", "block_contents": "Describes the length of time for which the prescription is paused. This value works in conjunction with the `pause_time_unit` field to specify the duration (e.g., 5 days, 2 weeks)."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_time_unit": {"name": "encounter_pause_prescriptions__pause_time_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_time_unit", "block_contents": "Specifies the unit of time for the pause duration. Common values include days, weeks and it works in conjunction with the `pause_duration` field to define the total pause period."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_start_date": {"name": "encounter_pause_prescriptions__pause_start_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_start_date", "block_contents": "Indicates the date when the prescription pause begins. This field is used to track the start of the pause period."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_end_date": {"name": "encounter_pause_prescriptions__pause_end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pause_end_date", "block_contents": "Indicates the date when the prescription pause ends. This field is used to track the end of the pause period."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__notes": {"name": "encounter_pause_prescriptions__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__notes", "block_contents": "Provides additional information or context about the prescription pause."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__pausing_clinician_id": {"name": "encounter_pause_prescriptions__pausing_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__pausing_clinician_id", "block_contents": "References the unique identifier of the clinician responsible for initiating the pause."}, "doc.tamanu_source_dbt.encounter_pause_prescriptions__created_by": {"name": "encounter_pause_prescriptions__created_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescriptions.md", "original_file_path": "models\\sources\\encounter_pause_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescriptions__created_by", "block_contents": "References the unique identifier of the user who created the record."}, "doc.tamanu_source_dbt.table__encounter_pause_prescription_histories": {"name": "table__encounter_pause_prescription_histories", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_pause_prescription_histories", "block_contents": "This table tracks the history of paused prescriptions for encounters, including details about the action, user, and duration."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__encounter_prescription_id": {"name": "encounter_pause_prescription_histories__encounter_prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__encounter_prescription_id", "block_contents": "The ID of the prescription associated with the encounter."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action": {"name": "encounter_pause_prescription_histories__action", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action", "block_contents": "The type of action performed, such as \"pause\" or \"resume.\""}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_date": {"name": "encounter_pause_prescription_histories__action_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_date", "block_contents": "The date and time when the action was performed."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_user_id": {"name": "encounter_pause_prescription_histories__action_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__action_user_id", "block_contents": "The ID of the user who performed the action."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__notes": {"name": "encounter_pause_prescription_histories__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__notes", "block_contents": "Additional notes or comments of the paused prescription."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_duration": {"name": "encounter_pause_prescription_histories__pause_duration", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_duration", "block_contents": "The duration for which the prescription was paused."}, "doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_time_unit": {"name": "encounter_pause_prescription_histories__pause_time_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_pause_prescription_histories.md", "original_file_path": "models\\sources\\encounter_pause_prescription_histories.md", "unique_id": "doc.tamanu_source_dbt.encounter_pause_prescription_histories__pause_time_unit", "block_contents": "The unit of time for the pause duration, such as \"days\" or \"hours.\""}, "doc.tamanu_source_dbt.table__encounter_prescriptions": {"name": "table__encounter_prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_prescriptions.md", "original_file_path": "models\\sources\\encounter_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__encounter_prescriptions", "block_contents": "Association of encounter to prescription"}, "doc.tamanu_source_dbt.encounter_prescriptions__encounter_id": {"name": "encounter_prescriptions__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_prescriptions.md", "original_file_path": "models\\sources\\encounter_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_prescriptions__encounter_id", "block_contents": "The [encounter](#!/source/source.tamanu.tamanu.encounters)"}, "doc.tamanu_source_dbt.encounter_prescriptions__prescription_id": {"name": "encounter_prescriptions__prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_prescriptions.md", "original_file_path": "models\\sources\\encounter_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_prescriptions__prescription_id", "block_contents": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)"}, "doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge": {"name": "encounter_prescriptions__is_selected_for_discharge", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\encounter_prescriptions.md", "original_file_path": "models\\sources\\encounter_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.encounter_prescriptions__is_selected_for_discharge", "block_contents": "Whether the prescription is for when the patient is discharged."}, "doc.tamanu_source_dbt.table__facilities": {"name": "table__facilities", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.table__facilities", "block_contents": "Table of facilities.\r\n\r\nFacilities may be either or both of:\r\n\r\n- Any healthcare facility, like hospitals, clinics, mobile vaccination vans, laboratories, etc\r\n- A Tamanu Facility deployment.\r\n\r\nWhen syncing, patient and related records are scoped to a facility, according to the\r\n[`patient_facilities`](#!/source/source.tamanu.tamanu.patient_facilities) table."}, "doc.tamanu_source_dbt.facilities__code": {"name": "facilities__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__code", "block_contents": "Code (identifier) for the facility."}, "doc.tamanu_source_dbt.facilities__name": {"name": "facilities__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__name", "block_contents": "Full readable name."}, "doc.tamanu_source_dbt.facilities__division": {"name": "facilities__division", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__division", "block_contents": "Administrative division this facility lives in."}, "doc.tamanu_source_dbt.facilities__type": {"name": "facilities__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__type", "block_contents": "Type of the facility."}, "doc.tamanu_source_dbt.facilities__email": {"name": "facilities__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__email", "block_contents": "Administrative email address of the facility."}, "doc.tamanu_source_dbt.facilities__contact_number": {"name": "facilities__contact_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__contact_number", "block_contents": "Administrative contact number of the facility."}, "doc.tamanu_source_dbt.facilities__city_town": {"name": "facilities__city_town", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__city_town", "block_contents": "City or town of the facility."}, "doc.tamanu_source_dbt.facilities__street_address": {"name": "facilities__street_address", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__street_address", "block_contents": "Street address of the facility."}, "doc.tamanu_source_dbt.facilities__catchment_id": {"name": "facilities__catchment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__catchment_id", "block_contents": "Catchment area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.facilities__is_sensitive": {"name": "facilities__is_sensitive", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\facilities.md", "original_file_path": "models\\sources\\facilities.md", "unique_id": "doc.tamanu_source_dbt.facilities__is_sensitive", "block_contents": "If set to `true`, encounters created on this facility will only be viewable when logged into this facility"}, "doc.tamanu_source_dbt.generic__schema": {"name": "generic__schema", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__schema", "block_contents": "Contains the primary data for Tamanu.\r\n\r\nThis is the main namespace for Tamanu data. All contained here is generally regarded as the source\r\nof truth within Tamanu, with data in other schemas being ether auxiliary or derived from this in\r\nsome way.\r\n\r\nDespite the name, this schema is not accessible publicly via postgres, and requires authentication."}, "doc.tamanu_source_dbt.generic__id": {"name": "generic__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__id", "block_contents": "Tamanu internal identifier (generally a UUID)"}, "doc.tamanu_source_dbt.generic__created_at": {"name": "generic__created_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__created_at", "block_contents": "Timestamp of when record was created"}, "doc.tamanu_source_dbt.generic__updated_at": {"name": "generic__updated_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__updated_at", "block_contents": "Timestamp of when record was last updated"}, "doc.tamanu_source_dbt.generic__deleted_at": {"name": "generic__deleted_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__deleted_at", "block_contents": "Timestamp of when record was deleted"}, "doc.tamanu_source_dbt.generic__updated_by": {"name": "generic__updated_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__updated_by", "block_contents": "The identifier of the user logged on when the record was created, updated or deleted"}, "doc.tamanu_source_dbt.generic__date": {"name": "generic__date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__date", "block_contents": "Local date for the record"}, "doc.tamanu_source_dbt.generic__datetime": {"name": "generic__datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__datetime", "block_contents": "Local date and time for the record"}, "doc.tamanu_source_dbt.generic__start_datetime": {"name": "generic__start_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__start_datetime", "block_contents": "Local start date and time for the record"}, "doc.tamanu_source_dbt.generic__end_datetime": {"name": "generic__end_datetime", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__end_datetime", "block_contents": "Local end date and time for the record"}, "doc.tamanu_source_dbt.generic__date_legacy": {"name": "generic__date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__date_legacy", "block_contents": "[Deprecated] date field which is a timestamp of the event being recorded"}, "doc.tamanu_source_dbt.generic__date_recorded": {"name": "generic__date_recorded", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__date_recorded", "block_contents": "Local date and time of the event being recorded"}, "doc.tamanu_source_dbt.generic__date_recorded_legacy": {"name": "generic__date_recorded_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__date_recorded_legacy", "block_contents": "[Deprecated] date field which is a timestamp of the event being recorded"}, "doc.tamanu_source_dbt.generic__deletion_date": {"name": "generic__deletion_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__deletion_date", "block_contents": "Date field which is a timestamp of record being deleted"}, "doc.tamanu_source_dbt.generic__visibility_status": {"name": "generic__visibility_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__visibility_status", "block_contents": "The visibility status of the record.\r\n\r\n- `current` indicates the record is currently in use and should be visible and accessible to users\r\n on the User Interface.\r\n- `historical` indicates that the record is no longer in use and should not be visible nor\r\n accessible to users. However, the record may still be present in Reporting.\r\n- `merged` indicates that the record has been merged, is no longer in use and should not be visible\r\n nor accessible to users.\r\n\r\nThe default value is `current`."}, "doc.tamanu_source_dbt.generic__updated_at_sync_tick": {"name": "generic__updated_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\generic.md", "original_file_path": "models\\sources\\generic.md", "unique_id": "doc.tamanu_source_dbt.generic__updated_at_sync_tick", "block_contents": "Last tick that the record was updated. Used to figure out old vs new data when syncing"}, "doc.tamanu_source_dbt.table__imaging_area_external_codes": {"name": "table__imaging_area_external_codes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_area_external_codes.md", "original_file_path": "models\\sources\\imaging_area_external_codes.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_area_external_codes", "block_contents": "External codes for imaging areas (such as for [PACS](https://en.wikipedia.org/wiki/Picture_archiving_and_communication_system)).\r\n\r\nImaging areas are stored in [Reference Data](#!/source/source.tamanu.tamanu.reference_data), this\r\ntable adds additional (external) codes."}, "doc.tamanu_source_dbt.imaging_area_external_codes__area_id": {"name": "imaging_area_external_codes__area_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_area_external_codes.md", "original_file_path": "models\\sources\\imaging_area_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_area_external_codes__area_id", "block_contents": "Reference to the imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.imaging_area_external_codes__code": {"name": "imaging_area_external_codes__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_area_external_codes.md", "original_file_path": "models\\sources\\imaging_area_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_area_external_codes__code", "block_contents": "External code."}, "doc.tamanu_source_dbt.imaging_area_external_codes__description": {"name": "imaging_area_external_codes__description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_area_external_codes.md", "original_file_path": "models\\sources\\imaging_area_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_area_external_codes__description", "block_contents": "Human-friendly description for the area/code."}, "doc.tamanu_source_dbt.table__imaging_requests": {"name": "table__imaging_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_requests", "block_contents": "Imaging requests are the entrypoint of imaging workflows in Tamanu.\r\n\r\nEach row is a request for radiology to perform one or more imagings on a patient.\r\n\r\nImagings can have one or more [request areas](#!/source/source.tamanu.tamanu.imaging_request_areas)\r\nattached, and when completed will have [results](#!/source/source.tamanu.tamanu.imaging_results)."}, "doc.tamanu_source_dbt.imaging_requests__status": {"name": "imaging_requests__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__status", "block_contents": "The status of the request.\r\n\r\nOne of:\r\n- `pending`\r\n- `in_progress`\r\n- `completed`\r\n- `cancelled`\r\n- `deleted`\r\n- `entered_in_error`"}, "doc.tamanu_source_dbt.imaging_requests__requested_date": {"name": "imaging_requests__requested_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__requested_date", "block_contents": "When the imaging was requested."}, "doc.tamanu_source_dbt.imaging_requests__encounter_id": {"name": "imaging_requests__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this imaging request is a part of."}, "doc.tamanu_source_dbt.imaging_requests__requested_by_id": {"name": "imaging_requests__requested_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__requested_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this imaging."}, "doc.tamanu_source_dbt.imaging_requests__legacy_results": {"name": "imaging_requests__legacy_results", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__legacy_results", "block_contents": "[Deprecated] Description of the results.\r\n\r\nSince v1.24 this has moved to the [imaging results](#!/source/source.tamanu.tamanu.imaging_results) table."}, "doc.tamanu_source_dbt.imaging_requests__completed_by_id": {"name": "imaging_requests__completed_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__completed_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging."}, "doc.tamanu_source_dbt.imaging_requests__location_id": {"name": "imaging_requests__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) for this imaging request."}, "doc.tamanu_source_dbt.imaging_requests__imaging_type": {"name": "imaging_requests__imaging_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__imaging_type", "block_contents": "Type of imaging.\r\n\r\nOne of:\r\n- `angiogram`\r\n- `colonoscopy`\r\n- `ctScan`\r\n- `ecg`\r\n- `echocardiogram`\r\n- `endoscopy`\r\n- `fluroscopy`\r\n- `holterMonitor`\r\n- `mammogram`\r\n- `orthopantomography`\r\n- `mri`\r\n- `stressTest`\r\n- `ultrasound`\r\n- `vascularStudy`\r\n- `xRay`"}, "doc.tamanu_source_dbt.imaging_requests__requested_date_legacy": {"name": "imaging_requests__requested_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__requested_date_legacy", "block_contents": "[Deprecated] Timestamp when the imaging was requested."}, "doc.tamanu_source_dbt.imaging_requests__priority": {"name": "imaging_requests__priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__priority", "block_contents": "Priority of the request.\r\n\r\nThis is a customisable list; by default the values are `routine`, `urgent`, `asap`, `stat`."}, "doc.tamanu_source_dbt.imaging_requests__location_group_id": {"name": "imaging_requests__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__location_group_id", "block_contents": "Reference to the [location group](#!/source/source.tamanu.tamanu.location_groups) for this imaging request."}, "doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation": {"name": "imaging_requests__reason_for_cancellation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__reason_for_cancellation", "block_contents": "If the request is cancelled, why that is.\r\n\r\nThis is a customisable list; by default the values are `duplicate` and `entered-in-error`.\r\n\r\nThe 31-character limit was [arbitrary to avoid extremely long values set in error](https://github.com/beyondessential/tamanu/pull/3512/files#r1102169113)."}, "doc.tamanu_source_dbt.imaging_requests__display_id": {"name": "imaging_requests__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_requests.md", "original_file_path": "models\\sources\\imaging_requests.md", "unique_id": "doc.tamanu_source_dbt.imaging_requests__display_id", "block_contents": "Short unique identifier used on the frontend."}, "doc.tamanu_source_dbt.table__imaging_request_areas": {"name": "table__imaging_request_areas", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_request_areas.md", "original_file_path": "models\\sources\\imaging_request_areas.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_request_areas", "block_contents": "Areas to be imaged as part of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests)."}, "doc.tamanu_source_dbt.imaging_request_areas__imaging_request_id": {"name": "imaging_request_areas__imaging_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_request_areas.md", "original_file_path": "models\\sources\\imaging_request_areas.md", "unique_id": "doc.tamanu_source_dbt.imaging_request_areas__imaging_request_id", "block_contents": "The [imaging request](#!/source/source.tamanu.tamanu.imaging_requests)."}, "doc.tamanu_source_dbt.imaging_request_areas__area_id": {"name": "imaging_request_areas__area_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_request_areas.md", "original_file_path": "models\\sources\\imaging_request_areas.md", "unique_id": "doc.tamanu_source_dbt.imaging_request_areas__area_id", "block_contents": "The imaging area ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__imaging_results": {"name": "table__imaging_results", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_results", "block_contents": "Result of an [imaging request](#!/source/source.tamanu.tamanu.imaging_requests).\r\n\r\nIn practice, there is usually one or two results per request:\r\n- one containing a reference to a PACS image, when imaging integrations are enabled;\r\n- one containing notes from a doctor who analysed the image.\r\n\r\nHowever there is no limit; for example there may be multiple notes from multiple doctors."}, "doc.tamanu_source_dbt.imaging_results__imaging_request_id": {"name": "imaging_results__imaging_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__imaging_request_id", "block_contents": "Reference to the [imaging request](#!/source/source.tamanu.tamanu.imaging_requests)."}, "doc.tamanu_source_dbt.imaging_results__completed_by_id": {"name": "imaging_results__completed_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__completed_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who completed this imaging."}, "doc.tamanu_source_dbt.imaging_results__description": {"name": "imaging_results__description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__description", "block_contents": "Free-form description / notes about this imaging."}, "doc.tamanu_source_dbt.imaging_results__external_code": {"name": "imaging_results__external_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__external_code", "block_contents": "External code for this result, used with PACS integration (generally via FHIR)."}, "doc.tamanu_source_dbt.imaging_results__completed_at": {"name": "imaging_results__completed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__completed_at", "block_contents": "When this result was completed."}, "doc.tamanu_source_dbt.imaging_results__result_image_url": {"name": "imaging_results__result_image_url", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_results.md", "original_file_path": "models\\sources\\imaging_results.md", "unique_id": "doc.tamanu_source_dbt.imaging_results__result_image_url", "block_contents": "Link to external imaging result viewer."}, "doc.tamanu_source_dbt.table__imaging_type_external_codes": {"name": "table__imaging_type_external_codes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_type_external_codes.md", "original_file_path": "models\\sources\\imaging_type_external_codes.md", "unique_id": "doc.tamanu_source_dbt.table__imaging_type_external_codes", "block_contents": "Mapping table for imaging types to external codes."}, "doc.tamanu_source_dbt.imaging_type_external_codes__imaging_type_code": {"name": "imaging_type_external_codes__imaging_type_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_type_external_codes.md", "original_file_path": "models\\sources\\imaging_type_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_type_external_codes__imaging_type_code", "block_contents": "Tamanu's imaging type code."}, "doc.tamanu_source_dbt.imaging_type_external_codes__code": {"name": "imaging_type_external_codes__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_type_external_codes.md", "original_file_path": "models\\sources\\imaging_type_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_type_external_codes__code", "block_contents": "External code."}, "doc.tamanu_source_dbt.imaging_type_external_codes__description": {"name": "imaging_type_external_codes__description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\imaging_type_external_codes.md", "original_file_path": "models\\sources\\imaging_type_external_codes.md", "unique_id": "doc.tamanu_source_dbt.imaging_type_external_codes__description", "block_contents": "Description of code."}, "doc.tamanu_source_dbt.table__invoices": {"name": "table__invoices", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.table__invoices", "block_contents": "Invoices related to encounters."}, "doc.tamanu_source_dbt.invoices__display_id": {"name": "invoices__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__display_id", "block_contents": "Short unique identifier used on the frontend."}, "doc.tamanu_source_dbt.invoices__status": {"name": "invoices__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__status", "block_contents": "Status of the invoice.\r\n\r\nOne of:\r\n- `cancelled`\r\n- `in_progress`\r\n- `finalised`"}, "doc.tamanu_source_dbt.invoices__encounter_id": {"name": "invoices__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this invoice is a part of."}, "doc.tamanu_source_dbt.invoices__patient_payment_status": {"name": "invoices__patient_payment_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__patient_payment_status", "block_contents": "Payment status (patient portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`"}, "doc.tamanu_source_dbt.invoices__insurer_payment_status": {"name": "invoices__insurer_payment_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices.md", "original_file_path": "models\\sources\\invoices.md", "unique_id": "doc.tamanu_source_dbt.invoices__insurer_payment_status", "block_contents": "Payment status (insurer portion, if applicable).\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`"}, "doc.tamanu_source_dbt.table__invoices_invoice_insurance_plans": {"name": "table__invoices_invoice_insurance_plans", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices_invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.table__invoices_invoice_insurance_plans", "block_contents": "Junction table linking invoices to insurance contracts. This many-to-many relationship allows an invoice to be associated with multiple insurance contracts."}, "doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_id": {"name": "invoices_invoice_insurance_plans__invoice_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices_invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_id", "block_contents": "Reference to the [invoice](#!/source/source.tamanu.tamanu.invoices) that this insurance contract applies to."}, "doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_insurance_plan_id": {"name": "invoices_invoice_insurance_plans__invoice_insurance_plan_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoices_invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoices_invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoices_invoice_insurance_plans__invoice_insurance_plan_id", "block_contents": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans) being applied to the invoice."}, "doc.tamanu_source_dbt.table__invoice_discounts": {"name": "table__invoice_discounts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_discounts", "block_contents": "Invoice discount that is applied to the patient's portion of the discountable costs."}, "doc.tamanu_source_dbt.invoice_discounts__id": {"name": "invoice_discounts__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__id", "block_contents": "Tamanu identifier for invoice discounts"}, "doc.tamanu_source_dbt.invoice_discounts__invoice_id": {"name": "invoice_discounts__invoice_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__invoice_id", "block_contents": "The [invoice](#!/source/source.tamanu.tamanu.invoices)."}, "doc.tamanu_source_dbt.invoice_discounts__percentage": {"name": "invoice_discounts__percentage", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__percentage", "block_contents": "Percentage discount to apply to the invoice"}, "doc.tamanu_source_dbt.invoice_discounts__reason": {"name": "invoice_discounts__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__reason", "block_contents": "Reason the discount is given"}, "doc.tamanu_source_dbt.invoice_discounts__is_manual": {"name": "invoice_discounts__is_manual", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__is_manual", "block_contents": "Indicates if the discount was manually added or based on an assessment"}, "doc.tamanu_source_dbt.invoice_discounts__applied_by_user_id": {"name": "invoice_discounts__applied_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__applied_by_user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users) who applied this discount."}, "doc.tamanu_source_dbt.invoice_discounts__applied_time": {"name": "invoice_discounts__applied_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_discounts.md", "original_file_path": "models\\sources\\invoice_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_discounts__applied_time", "block_contents": "When this discount was applied."}, "doc.tamanu_source_dbt.table__invoice_insurance_plans": {"name": "table__invoice_insurance_plans", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_insurance_plans", "block_contents": "Table for insurance contracts used for invoicing."}, "doc.tamanu_source_dbt.invoice_insurance_plans__code": {"name": "invoice_insurance_plans__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plans__code", "block_contents": "Unique identifier code for the insurance contract."}, "doc.tamanu_source_dbt.invoice_insurance_plans__name": {"name": "invoice_insurance_plans__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plans__name", "block_contents": "Human-readable name of the insurance contract."}, "doc.tamanu_source_dbt.invoice_insurance_plans__default_coverage": {"name": "invoice_insurance_plans__default_coverage", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plans.md", "original_file_path": "models\\sources\\invoice_insurance_plans.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plans__default_coverage", "block_contents": "The default coverage (in percentage) of the insurance contract."}, "doc.tamanu_source_dbt.table__invoice_insurance_plan_items": {"name": "table__invoice_insurance_plan_items", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plan_items.md", "original_file_path": "models\\sources\\invoice_insurance_plan_items.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_insurance_plan_items", "block_contents": "Table for insurance contract items used for invoicing."}, "doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_insurance_plan_id": {"name": "invoice_insurance_plan_items__invoice_insurance_plan_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plan_items.md", "original_file_path": "models\\sources\\invoice_insurance_plan_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_insurance_plan_id", "block_contents": "Reference to the [insurance contract](#!/source/source.tamanu.tamanu.invoice_insurance_plans)."}, "doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_product_id": {"name": "invoice_insurance_plan_items__invoice_product_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plan_items.md", "original_file_path": "models\\sources\\invoice_insurance_plan_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plan_items__invoice_product_id", "block_contents": "Reference to the [invoice product](#!/source/source.tamanu.tamanu.invoice_products)."}, "doc.tamanu_source_dbt.invoice_insurance_plan_items__coverage_value": {"name": "invoice_insurance_plan_items__coverage_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurance_plan_items.md", "original_file_path": "models\\sources\\invoice_insurance_plan_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurance_plan_items__coverage_value", "block_contents": "The amount of coverage (in percentage) of the insurance contract item."}, "doc.tamanu_source_dbt.table__invoice_insurer_payments": {"name": "table__invoice_insurer_payments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_insurer_payments", "block_contents": "Extra metadata about a payment when it was done by a patient."}, "doc.tamanu_source_dbt.invoice_insurer_payments__invoice_payment_id": {"name": "invoice_insurer_payments__invoice_payment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurer_payments__invoice_payment_id", "block_contents": "The [payment](#!/source/source.tamanu.tamanu.invoice_payments)."}, "doc.tamanu_source_dbt.invoice_insurer_payments__insurer_id": {"name": "invoice_insurer_payments__insurer_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurer_payments__insurer_id", "block_contents": "The insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.invoice_insurer_payments__status": {"name": "invoice_insurer_payments__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurer_payments__status", "block_contents": "The status of this payment.\r\n\r\nOne of:\r\n- `unpaid`\r\n- `paid`\r\n- `partial`\r\n- `rejected`"}, "doc.tamanu_source_dbt.invoice_insurer_payments__reason": {"name": "invoice_insurer_payments__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_insurer_payments.md", "original_file_path": "models\\sources\\invoice_insurer_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_insurer_payments__reason", "block_contents": "The reason for the payment. Generally this is used for rejections."}, "doc.tamanu_source_dbt.table__invoice_items": {"name": "table__invoice_items", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_items", "block_contents": "Items (products) on invoices."}, "doc.tamanu_source_dbt.invoice_items__invoice_id": {"name": "invoice_items__invoice_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__invoice_id", "block_contents": "The [invoice](#!/source/source.tamanu.tamanu.invoices)."}, "doc.tamanu_source_dbt.invoice_items__order_date": {"name": "invoice_items__order_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__order_date", "block_contents": "When the item was ordered."}, "doc.tamanu_source_dbt.invoice_items__product_id": {"name": "invoice_items__product_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__product_id", "block_contents": "The [product](#!/source/source.tamanu.tamanu.invoice_products)."}, "doc.tamanu_source_dbt.invoice_items__quantity": {"name": "invoice_items__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__quantity", "block_contents": "Quantity ordered."}, "doc.tamanu_source_dbt.invoice_items__ordered_by_user_id": {"name": "invoice_items__ordered_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__ordered_by_user_id", "block_contents": "[Who](#!/source/source.tamanu.tamanu.users) ordered the item."}, "doc.tamanu_source_dbt.invoice_items__product_name_final": {"name": "invoice_items__product_name_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__product_name_final", "block_contents": "The final product name used on the invoice. Saved from the product name field when the invoice is finalised."}, "doc.tamanu_source_dbt.invoice_items__manual_entry_price": {"name": "invoice_items__manual_entry_price", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__manual_entry_price", "block_contents": "Manually entered price override for this item, if specified. When set, this takes precedence over the product's standard price."}, "doc.tamanu_source_dbt.invoice_items__note": {"name": "invoice_items__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__note", "block_contents": "Free-form note for this item."}, "doc.tamanu_source_dbt.invoice_items__source_record_type": {"name": "invoice_items__source_record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__source_record_type", "block_contents": "The underlying model that the source record belongs to."}, "doc.tamanu_source_dbt.invoice_items__source_record_id": {"name": "invoice_items__source_record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__source_record_id", "block_contents": "Foreign key relation for record type."}, "doc.tamanu_source_dbt.invoice_items__product_code_final": {"name": "invoice_items__product_code_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__product_code_final", "block_contents": "The final product code used on the invoice. Saved from the product code field when the invoice is finalised."}, "doc.tamanu_source_dbt.invoice_items__price_final": {"name": "invoice_items__price_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__price_final", "block_contents": "The final price per unit for this item on the invoice. This is determined by the manual_entry_price if provided, otherwise from the product's price when the invoice is finalised."}, "doc.tamanu_source_dbt.invoice_items__approved": {"name": "invoice_items__approved", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_items.md", "original_file_path": "models\\sources\\invoice_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_items__approved", "block_contents": "A boolean field that enables clinicians to track the approval status of individual invoice line items"}, "doc.tamanu_source_dbt.table__invoice_item_discounts": {"name": "table__invoice_item_discounts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_item_discounts", "block_contents": "Discounts applied to invoice items."}, "doc.tamanu_source_dbt.invoice_item_discounts__invoice_item_id": {"name": "invoice_item_discounts__invoice_item_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_discounts__invoice_item_id", "block_contents": "The [invoice item](#!/source/source.tamanu.tamanu.invoice_items)."}, "doc.tamanu_source_dbt.invoice_item_discounts__reason": {"name": "invoice_item_discounts__reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_discounts__reason", "block_contents": "Free-form reason for the discount."}, "doc.tamanu_source_dbt.invoice_item_discounts__amount": {"name": "invoice_item_discounts__amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_discounts__amount", "block_contents": "Discount amount of invoice items (can be percentage or a whole number)"}, "doc.tamanu_source_dbt.invoice_item_discounts__type": {"name": "invoice_item_discounts__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_discounts.md", "original_file_path": "models\\sources\\invoice_item_discounts.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_discounts__type", "block_contents": "Discount type of invoice items"}, "doc.tamanu_source_dbt.table__invoice_item_finalised_insurances": {"name": "table__invoice_item_finalised_insurances", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_finalised_insurances.md", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_item_finalised_insurances", "block_contents": "Finalised insurance coverage values for invoice items.\r\n\r\nThis table stores the insurance coverage amounts that were locked in when an invoice item is finalised, \r\npreserving the coverage percentage at that point in time even if the insurance plan's coverage changes later."}, "doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_item_id": {"name": "invoice_item_finalised_insurances__invoice_item_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_finalised_insurances.md", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_item_id", "block_contents": "The [invoice item](#!/source/source.tamanu.tamanu.invoice_items) this insurance coverage applies to."}, "doc.tamanu_source_dbt.invoice_item_finalised_insurances__coverage_value_final": {"name": "invoice_item_finalised_insurances__coverage_value_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_finalised_insurances.md", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_finalised_insurances__coverage_value_final", "block_contents": "The finalised coverage percentage for this invoice item.\r\n\r\nThis value is copied from the insurance plan's coverage at the time the invoice item is finalised,\r\npreserving it for the record even if the insurance plan's coverage percentage changes later."}, "doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_insurance_plan_id": {"name": "invoice_item_finalised_insurances__invoice_insurance_plan_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_item_finalised_insurances.md", "original_file_path": "models\\sources\\invoice_item_finalised_insurances.md", "unique_id": "doc.tamanu_source_dbt.invoice_item_finalised_insurances__invoice_insurance_plan_id", "block_contents": "The [insurance plan](#!/source/source.tamanu.tamanu.invoice_insurance_plans) providing the coverage."}, "doc.tamanu_source_dbt.table__invoice_patient_payments": {"name": "table__invoice_patient_payments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_patient_payments.md", "original_file_path": "models\\sources\\invoice_patient_payments.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_patient_payments", "block_contents": "Extra metadata about a payment when it was done by a patient."}, "doc.tamanu_source_dbt.invoice_patient_payments__invoice_payment_id": {"name": "invoice_patient_payments__invoice_payment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_patient_payments.md", "original_file_path": "models\\sources\\invoice_patient_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_patient_payments__invoice_payment_id", "block_contents": "The [payment](#!/source/source.tamanu.tamanu.invoice_payments)."}, "doc.tamanu_source_dbt.invoice_patient_payments__method_id": {"name": "invoice_patient_payments__method_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_patient_payments.md", "original_file_path": "models\\sources\\invoice_patient_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_patient_payments__method_id", "block_contents": "The method used to pay ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.invoice_patient_payments__cheque_number": {"name": "invoice_patient_payments__cheque_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_patient_payments.md", "original_file_path": "models\\sources\\invoice_patient_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_patient_payments__cheque_number", "block_contents": "The cheque number for cheque payments."}, "doc.tamanu_source_dbt.table__invoice_payments": {"name": "table__invoice_payments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_payments", "block_contents": "Individual payment against an invoice.\r\n\r\nInvoices can be paid in installments, by different parties, etc."}, "doc.tamanu_source_dbt.invoice_payments__invoice_id": {"name": "invoice_payments__invoice_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_payments__invoice_id", "block_contents": "The [invoice](#!/source/source.tamanu.tamanu.invoices)."}, "doc.tamanu_source_dbt.invoice_payments__receipt_number": {"name": "invoice_payments__receipt_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_payments__receipt_number", "block_contents": "Receipt number. Usually auto-generated."}, "doc.tamanu_source_dbt.invoice_payments__amount": {"name": "invoice_payments__amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_payments__amount", "block_contents": "Amount paid."}, "doc.tamanu_source_dbt.invoice_payments__updated_by_user_id": {"name": "invoice_payments__updated_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_payments.md", "original_file_path": "models\\sources\\invoice_payments.md", "unique_id": "doc.tamanu_source_dbt.invoice_payments__updated_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this invoice payment."}, "doc.tamanu_source_dbt.table__invoice_price_lists": {"name": "table__invoice_price_lists", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_lists.md", "original_file_path": "models\\sources\\invoice_price_lists.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_price_lists", "block_contents": "Contains price list definitions used for invoice line item pricing. Each price list represents a set of pricing rules that can be applied to different types of invoices, patients, or services."}, "doc.tamanu_source_dbt.invoice_price_lists__code": {"name": "invoice_price_lists__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_lists.md", "original_file_path": "models\\sources\\invoice_price_lists.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_lists__code", "block_contents": "Unique identifier code for the price list. Used for referencing the price list in business logic and integrations."}, "doc.tamanu_source_dbt.invoice_price_lists__name": {"name": "invoice_price_lists__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_lists.md", "original_file_path": "models\\sources\\invoice_price_lists.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_lists__name", "block_contents": "Human-readable name of the price list, displayed in user interfaces and reports."}, "doc.tamanu_source_dbt.invoice_price_lists__rules": {"name": "invoice_price_lists__rules", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_lists.md", "original_file_path": "models\\sources\\invoice_price_lists.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_lists__rules", "block_contents": "JSON configuration containing the pricing rules and logic for this price list. Defines how prices are calculated or retrieved for invoice line items."}, "doc.tamanu_source_dbt.table__invoice_price_list_items": {"name": "table__invoice_price_list_items", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_price_list_items", "block_contents": "Contains individual pricing entries for specific products within a price list. Each record defines the price or pricing configuration for a particular product in the context of a specific price list."}, "doc.tamanu_source_dbt.invoice_price_list_items__invoice_price_list_id": {"name": "invoice_price_list_items__invoice_price_list_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_list_items__invoice_price_list_id", "block_contents": "Foreign key reference to the invoice_price_lists table. Links this pricing item to its parent price list."}, "doc.tamanu_source_dbt.invoice_price_list_items__invoice_product_id": {"name": "invoice_price_list_items__invoice_product_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_list_items__invoice_product_id", "block_contents": "Foreign key reference to the invoice products/services that can be priced. Identifies which product or service this pricing item applies to."}, "doc.tamanu_source_dbt.invoice_price_list_items__price": {"name": "invoice_price_list_items__price", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_list_items__price", "block_contents": "The price amount for this product in the context of this price list. Stored as a numeric value representing the cost in the system's base currency."}, "doc.tamanu_source_dbt.invoice_price_list_items__is_hidden": {"name": "invoice_price_list_items__is_hidden", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_price_list_items.md", "original_file_path": "models\\sources\\invoice_price_list_items.md", "unique_id": "doc.tamanu_source_dbt.invoice_price_list_items__is_hidden", "block_contents": "Determines whether the related invoice product should be hidden from searches on the frontend and also whether it should be automatically added to the invoice."}, "doc.tamanu_source_dbt.table__invoice_products": {"name": "table__invoice_products", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.table__invoice_products", "block_contents": "Products which can be invoiced."}, "doc.tamanu_source_dbt.invoice_products__name": {"name": "invoice_products__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__name", "block_contents": "Name of the product."}, "doc.tamanu_source_dbt.invoice_products__category": {"name": "invoice_products__category", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__category", "block_contents": "The category of the product."}, "doc.tamanu_source_dbt.invoice_products__source_record_type": {"name": "invoice_products__source_record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__source_record_type", "block_contents": "The underlying database model of the source record for the product."}, "doc.tamanu_source_dbt.invoice_products__source_record_id": {"name": "invoice_products__source_record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__source_record_id", "block_contents": "The id of the source record for the product."}, "doc.tamanu_source_dbt.invoice_products__insurable": {"name": "invoice_products__insurable", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\invoice_products.md", "original_file_path": "models\\sources\\invoice_products.md", "unique_id": "doc.tamanu_source_dbt.invoice_products__insurable", "block_contents": "Whether or not discounts can be applied to a product"}, "doc.tamanu_source_dbt.table__ips_requests": {"name": "table__ips_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.table__ips_requests", "block_contents": "Queue of requests to generate [International Patient Summaries](https://international-patient-summary.net/) (IPS)."}, "doc.tamanu_source_dbt.ips_requests__patient_id": {"name": "ips_requests__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.ips_requests__created_by": {"name": "ips_requests__created_by", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__created_by", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who created this request."}, "doc.tamanu_source_dbt.ips_requests__status": {"name": "ips_requests__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__status", "block_contents": "Processing status."}, "doc.tamanu_source_dbt.ips_requests__email": {"name": "ips_requests__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__email", "block_contents": "Email to send the generated IPS to."}, "doc.tamanu_source_dbt.ips_requests__error": {"name": "ips_requests__error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\ips_requests.md", "original_file_path": "models\\sources\\ips_requests.md", "unique_id": "doc.tamanu_source_dbt.ips_requests__error", "block_contents": "If processing fails, the error."}, "doc.tamanu_source_dbt.table__lab_requests": {"name": "table__lab_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.table__lab_requests", "block_contents": "Lab requests are the entrypoint of laboratory workflows in Tamanu.\r\n\r\nEach row is a request for a laboratory to perform a group of tests on a sample taken from a patient.\r\n\r\nIt will be updated over the course of the workflow to various statuses, starting with\r\n`reception_pending` (lab has not received the request yet), up to `published` (lab has completed the\r\ntests and has attached verified results).\r\n\r\nSee also: `lab_request_attachments`, `lab_request_logs`, `lab_results`, `lab_tests`,\r\n`lab_test_panels`, and related tables to those."}, "doc.tamanu_source_dbt.lab_requests__sample_time": {"name": "lab_requests__sample_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__sample_time", "block_contents": "When the sample was collected."}, "doc.tamanu_source_dbt.lab_requests__requested_date": {"name": "lab_requests__requested_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__requested_date", "block_contents": "When the request was submitted."}, "doc.tamanu_source_dbt.lab_requests__urgent": {"name": "lab_requests__urgent", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__urgent", "block_contents": "Deprecated."}, "doc.tamanu_source_dbt.lab_requests__specimen_attached": {"name": "lab_requests__specimen_attached", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__specimen_attached", "block_contents": "Whether a specimen is attached.\r\n\r\nThis implies `specimen_type_id`."}, "doc.tamanu_source_dbt.lab_requests__status": {"name": "lab_requests__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__status", "block_contents": "The status of the request.\r\n\r\nOne of:\r\n- `reception_pending`\r\n- `results_pending`\r\n- `interim_results`\r\n- `to_be_verified`\r\n- `verified`\r\n- `published`\r\n- `cancelled`\r\n- `invalidated`\r\n- `deleted`\r\n- `sample-not-collected`\r\n- `entered-in-error`"}, "doc.tamanu_source_dbt.lab_requests__senaite_id": {"name": "lab_requests__senaite_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__senaite_id", "block_contents": "When the [SENAITE](https://www.senaite.com/) integration is enabled, this is filled to the SENAITE\r\nID for the request."}, "doc.tamanu_source_dbt.lab_requests__sample_id": {"name": "lab_requests__sample_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__sample_id", "block_contents": "When the [SENAITE](https://www.senaite.com/) integration is enabled, this is filled to the SENAITE\r\nID for the sample."}, "doc.tamanu_source_dbt.lab_requests__requested_by_id": {"name": "lab_requests__requested_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__requested_by_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who submitted the request."}, "doc.tamanu_source_dbt.lab_requests__encounter_id": {"name": "lab_requests__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__encounter_id", "block_contents": "Reference to the [Encounter](#!/source/source.tamanu.tamanu.encounters) the request is a part of."}, "doc.tamanu_source_dbt.lab_requests__lab_test_category_id": {"name": "lab_requests__lab_test_category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_test_category_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ncategory of this request's test."}, "doc.tamanu_source_dbt.lab_requests__display_id": {"name": "lab_requests__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__display_id", "block_contents": "Short unique identifier used on the frontend."}, "doc.tamanu_source_dbt.lab_requests__lab_test_priority_id": {"name": "lab_requests__lab_test_priority_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_test_priority_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\npriority of this request."}, "doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id": {"name": "lab_requests__lab_test_laboratory_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_test_laboratory_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\nlaboratory fulfilling this request."}, "doc.tamanu_source_dbt.lab_requests__sample_time_legacy": {"name": "lab_requests__sample_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__sample_time_legacy", "block_contents": "[Deprecated] When the sample was collected."}, "doc.tamanu_source_dbt.lab_requests__requested_date_legacy": {"name": "lab_requests__requested_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__requested_date_legacy", "block_contents": "[Deprecated] When the request was submitted."}, "doc.tamanu_source_dbt.lab_requests__reason_for_cancellation": {"name": "lab_requests__reason_for_cancellation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__reason_for_cancellation", "block_contents": "Why this request was cancelled.\r\n\r\nOne of:\r\n- `clinical`\r\n- `duplicate`\r\n- `entered-in-error`\r\n- `other`\r\n- `patient-discharged`\r\n- `patient-refused`"}, "doc.tamanu_source_dbt.lab_requests__department_id": {"name": "lab_requests__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__department_id", "block_contents": "Reference to the [Department](#!/source/source.tamanu.tamanu.departments) the request comes from."}, "doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id": {"name": "lab_requests__lab_test_panel_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_test_panel_request_id", "block_contents": "Reference to the [Test Panel Request](#!/source/source.tamanu.tamanu.lab_test_panel_requests)\r\nassociated with this request, if any."}, "doc.tamanu_source_dbt.lab_requests__lab_sample_site_id": {"name": "lab_requests__lab_sample_site_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__lab_sample_site_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing where\r\non the patient the sample was taken."}, "doc.tamanu_source_dbt.lab_requests__published_date": {"name": "lab_requests__published_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__published_date", "block_contents": "When this lab request's results were published."}, "doc.tamanu_source_dbt.lab_requests__specimen_type_id": {"name": "lab_requests__specimen_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__specimen_type_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) representing the\r\ntype of the specimen for the request, if specified."}, "doc.tamanu_source_dbt.lab_requests__collected_by_id": {"name": "lab_requests__collected_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__collected_by_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) who collected the sample."}, "doc.tamanu_source_dbt.lab_requests__results_interpretation": {"name": "lab_requests__results_interpretation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_requests.md", "original_file_path": "models\\sources\\lab_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_requests__results_interpretation", "block_contents": "Free-text interpretation and clinical commentary on the laboratory test results."}, "doc.tamanu_source_dbt.table__lab_request_attachments": {"name": "table__lab_request_attachments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.table__lab_request_attachments", "block_contents": "Attachments (uploaded documents) to a lab request.\r\n\r\nThis could be forms for authorisation or consent, notes, instructions, etc."}, "doc.tamanu_source_dbt.lab_request_attachments__attachment_id": {"name": "lab_request_attachments__attachment_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.lab_request_attachments__attachment_id", "block_contents": "The [attachment](#!/source/source.tamanu.tamanu.attachments) (obtained by uploading the file)."}, "doc.tamanu_source_dbt.lab_request_attachments__lab_request_id": {"name": "lab_request_attachments__lab_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.lab_request_attachments__lab_request_id", "block_contents": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests)."}, "doc.tamanu_source_dbt.lab_request_attachments__title": {"name": "lab_request_attachments__title", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.lab_request_attachments__title", "block_contents": "Short name of the attachment."}, "doc.tamanu_source_dbt.lab_request_attachments__replaced_by_id": {"name": "lab_request_attachments__replaced_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_attachments.md", "original_file_path": "models\\sources\\lab_request_attachments.md", "unique_id": "doc.tamanu_source_dbt.lab_request_attachments__replaced_by_id", "block_contents": "Another lab request attachment which replaces this one."}, "doc.tamanu_source_dbt.table__lab_request_logs": {"name": "table__lab_request_logs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_logs.md", "original_file_path": "models\\sources\\lab_request_logs.md", "unique_id": "doc.tamanu_source_dbt.table__lab_request_logs", "block_contents": "This is a log of who changed the status of a lab request when."}, "doc.tamanu_source_dbt.lab_request_logs__status": {"name": "lab_request_logs__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_logs.md", "original_file_path": "models\\sources\\lab_request_logs.md", "unique_id": "doc.tamanu_source_dbt.lab_request_logs__status", "block_contents": "The status the lab request was updated to."}, "doc.tamanu_source_dbt.lab_request_logs__lab_request_id": {"name": "lab_request_logs__lab_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_logs.md", "original_file_path": "models\\sources\\lab_request_logs.md", "unique_id": "doc.tamanu_source_dbt.lab_request_logs__lab_request_id", "block_contents": "Reference to the [lab request](#!/source/source.tamanu.tamanu.lab_requests)."}, "doc.tamanu_source_dbt.lab_request_logs__updated_by_id": {"name": "lab_request_logs__updated_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_request_logs.md", "original_file_path": "models\\sources\\lab_request_logs.md", "unique_id": "doc.tamanu_source_dbt.lab_request_logs__updated_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who updated this lab request."}, "doc.tamanu_source_dbt.table__lab_tests": {"name": "table__lab_tests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.table__lab_tests", "block_contents": "A single test as part of a [lab request](#!/source/source.tamanu.tamanu.lab_requests)."}, "doc.tamanu_source_dbt.lab_tests__result": {"name": "lab_tests__result", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__result", "block_contents": "The result of the test."}, "doc.tamanu_source_dbt.lab_tests__lab_request_id": {"name": "lab_tests__lab_request_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__lab_request_id", "block_contents": "The [lab request](#!/source/source.tamanu.tamanu.lab_requests) this test is part of."}, "doc.tamanu_source_dbt.lab_tests__lab_test_type_id": {"name": "lab_tests__lab_test_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__lab_test_type_id", "block_contents": "The [type](#!/source/source.tamanu.tamanu.lab_test_types) of the test."}, "doc.tamanu_source_dbt.lab_tests__category_id": {"name": "lab_tests__category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__category_id", "block_contents": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test."}, "doc.tamanu_source_dbt.lab_tests__lab_test_method_id": {"name": "lab_tests__lab_test_method_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__lab_test_method_id", "block_contents": "Reference to the method ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test."}, "doc.tamanu_source_dbt.lab_tests__laboratory_officer": {"name": "lab_tests__laboratory_officer", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__laboratory_officer", "block_contents": "Name of the lab officer performing the test."}, "doc.tamanu_source_dbt.lab_tests__completed_date": {"name": "lab_tests__completed_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__completed_date", "block_contents": "Datetime at which the test was completed."}, "doc.tamanu_source_dbt.lab_tests__verification": {"name": "lab_tests__verification", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__verification", "block_contents": "Free-form field for a verification indication.\r\n\r\nMay be a verifying or supervising officer's name, a department, lab notes..."}, "doc.tamanu_source_dbt.lab_tests__completed_date_legacy": {"name": "lab_tests__completed_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_tests.md", "original_file_path": "models\\sources\\lab_tests.md", "unique_id": "doc.tamanu_source_dbt.lab_tests__completed_date_legacy", "block_contents": "[Deprecated] Timestamp at which the test was completed."}, "doc.tamanu_source_dbt.table__lab_test_panels": {"name": "table__lab_test_panels", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.table__lab_test_panels", "block_contents": "A panel is a collection of lab test types, usually standardised.\r\n\r\nFor example the BMP (basic metabolic panel) is a panel of 8 blood tests. Instead of ordering all 8\r\ntests individually, a clinician can order the panel all at once. This may also used to more\r\nefficiently use samples.\r\n\r\nThis table defines the available test panels, and\r\n[`lab_test_panel_lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_panel_lab_test_types)\r\ncontains the actual test types that are part of each panel. See\r\n[`lab_test_panel_requests`](#!/source/source.tamanu.tamanu.lab_test_panel_requests) for requesting\r\npanels specifically, and [`lab_test_requests`](#!/source/source.tamanu.tamanu.lab_test_requests) for\r\nrequesting lab tests in general."}, "doc.tamanu_source_dbt.lab_test_panels__name": {"name": "lab_test_panels__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panels__name", "block_contents": "Name of the test panel."}, "doc.tamanu_source_dbt.lab_test_panels__code": {"name": "lab_test_panels__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panels__code", "block_contents": "Internal Tamanu code of the panel."}, "doc.tamanu_source_dbt.lab_test_panels__external_code": {"name": "lab_test_panels__external_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panels__external_code", "block_contents": "External code, such as for interfacing with LIMS."}, "doc.tamanu_source_dbt.lab_test_panels__category_id": {"name": "lab_test_panels__category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panels.md", "original_file_path": "models\\sources\\lab_test_panels.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panels__category_id", "block_contents": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test panel."}, "doc.tamanu_source_dbt.table__lab_test_panel_lab_test_types": {"name": "table__lab_test_panel_lab_test_types", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_lab_test_types.md", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.table__lab_test_panel_lab_test_types", "block_contents": "The lab tests contained in a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about lab test\r\npanels, and [`lab_test_types`](#!/source/source.tamanu.tamanu.lab_test_types) for the test types."}, "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_panel_id": {"name": "lab_test_panel_lab_test_types__lab_test_panel_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_lab_test_types.md", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_panel_id", "block_contents": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels)."}, "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_type_id": {"name": "lab_test_panel_lab_test_types__lab_test_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_lab_test_types.md", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__lab_test_type_id", "block_contents": "The [test type](#!/source/source.tamanu.tamanu.lab_test_types)."}, "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__order": {"name": "lab_test_panel_lab_test_types__order", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_lab_test_types.md", "original_file_path": "models\\sources\\lab_test_panel_lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_lab_test_types__order", "block_contents": "The position of this test within the panel, used to control the display\r\nand processing order of lab tests in a lab test panel. Lower values are\r\nshown and processed before higher values."}, "doc.tamanu_source_dbt.table__lab_test_panel_requests": {"name": "table__lab_test_panel_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_requests.md", "original_file_path": "models\\sources\\lab_test_panel_requests.md", "unique_id": "doc.tamanu_source_dbt.table__lab_test_panel_requests", "block_contents": "A request for a lab test panel.\r\n\r\nSee [`lab_test_panels`](#!/source/source.tamanu.tamanu.lab_test_panels) for more about those."}, "doc.tamanu_source_dbt.lab_test_panel_requests__lab_test_panel_id": {"name": "lab_test_panel_requests__lab_test_panel_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_requests.md", "original_file_path": "models\\sources\\lab_test_panel_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_requests__lab_test_panel_id", "block_contents": "The [test panel](#!/source/source.tamanu.tamanu.lab_test_panels)."}, "doc.tamanu_source_dbt.lab_test_panel_requests__encounter_id": {"name": "lab_test_panel_requests__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_panel_requests.md", "original_file_path": "models\\sources\\lab_test_panel_requests.md", "unique_id": "doc.tamanu_source_dbt.lab_test_panel_requests__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this lab test panel request is a part of."}, "doc.tamanu_source_dbt.table__lab_test_types": {"name": "table__lab_test_types", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.table__lab_test_types", "block_contents": "A kind of test that's possible to request.\r\n\r\nThis includes information about the test itself, and also parameters around result formatting, like\r\ndata type, expected ranges, etc."}, "doc.tamanu_source_dbt.lab_test_types__code": {"name": "lab_test_types__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__code", "block_contents": "Internal Tamanu code of the test."}, "doc.tamanu_source_dbt.lab_test_types__name": {"name": "lab_test_types__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__name", "block_contents": "Human-friendly name of the test."}, "doc.tamanu_source_dbt.lab_test_types__unit": {"name": "lab_test_types__unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__unit", "block_contents": "Unit the test result is measured in."}, "doc.tamanu_source_dbt.lab_test_types__male_min": {"name": "lab_test_types__male_min", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__male_min", "block_contents": "Minimum typical range for males."}, "doc.tamanu_source_dbt.lab_test_types__male_max": {"name": "lab_test_types__male_max", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__male_max", "block_contents": "Maximum typical range for males."}, "doc.tamanu_source_dbt.lab_test_types__female_min": {"name": "lab_test_types__female_min", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__female_min", "block_contents": "Minimum typical range for females."}, "doc.tamanu_source_dbt.lab_test_types__female_max": {"name": "lab_test_types__female_max", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__female_max", "block_contents": "Maximum typical range for females."}, "doc.tamanu_source_dbt.lab_test_types__range_text": {"name": "lab_test_types__range_text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__range_text", "block_contents": "Unused."}, "doc.tamanu_source_dbt.lab_test_types__result_type": {"name": "lab_test_types__result_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__result_type", "block_contents": "Input type of result.\r\n\r\nOne of:\r\n- `FreeText`\r\n- `Number`\r\n- `Select`"}, "doc.tamanu_source_dbt.lab_test_types__options": {"name": "lab_test_types__options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__options", "block_contents": "Comma-separated list of options. Unused."}, "doc.tamanu_source_dbt.lab_test_types__lab_test_category_id": {"name": "lab_test_types__lab_test_category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__lab_test_category_id", "block_contents": "Reference to the category ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) of this test."}, "doc.tamanu_source_dbt.lab_test_types__external_code": {"name": "lab_test_types__external_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__external_code", "block_contents": "External code for the test (such as for LIMS)."}, "doc.tamanu_source_dbt.lab_test_types__is_sensitive": {"name": "lab_test_types__is_sensitive", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\lab_test_types.md", "original_file_path": "models\\sources\\lab_test_types.md", "unique_id": "doc.tamanu_source_dbt.lab_test_types__is_sensitive", "block_contents": "Used to indicate if the lab test type is sensitive and should be hidden accordingly."}, "doc.tamanu_source_dbt.table__local_system_facts": {"name": "table__local_system_facts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\local_system_facts.md", "original_file_path": "models\\sources\\local_system_facts.md", "unique_id": "doc.tamanu_source_dbt.table__local_system_facts", "block_contents": "A set of values that are proper to this installation of Tamanu.\r\n\r\nThese are never synchronised.\r\nUsage is entirely internal to Tamanu and should never be used externally."}, "doc.tamanu_source_dbt.local_system_facts__key": {"name": "local_system_facts__key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\local_system_facts.md", "original_file_path": "models\\sources\\local_system_facts.md", "unique_id": "doc.tamanu_source_dbt.local_system_facts__key", "block_contents": "Key of the fact."}, "doc.tamanu_source_dbt.local_system_facts__value": {"name": "local_system_facts__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\local_system_facts.md", "original_file_path": "models\\sources\\local_system_facts.md", "unique_id": "doc.tamanu_source_dbt.local_system_facts__value", "block_contents": "Value of the fact.\r\n\r\nThis is `text`, but may be interpreted as other things, e.g. JSON objects or numbers."}, "doc.tamanu_source_dbt.table__locations": {"name": "table__locations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.table__locations", "block_contents": "Information on the hospital locations."}, "doc.tamanu_source_dbt.locations__code": {"name": "locations__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__code", "block_contents": "Code for location"}, "doc.tamanu_source_dbt.locations__name": {"name": "locations__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__name", "block_contents": "Full readable name for location"}, "doc.tamanu_source_dbt.locations__max_occupancy": {"name": "locations__max_occupancy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__max_occupancy", "block_contents": "The maximum number of patients that can be in this location"}, "doc.tamanu_source_dbt.locations__facility_id": {"name": "locations__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location is in."}, "doc.tamanu_source_dbt.locations__location_group_id": {"name": "locations__location_group_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\locations.md", "original_file_path": "models\\sources\\locations.md", "unique_id": "doc.tamanu_source_dbt.locations__location_group_id", "block_contents": "Reference to the [group](#!/source/source.tamanu.tamanu.location_groups) this location is in."}, "doc.tamanu_source_dbt.table__location_assignments": {"name": "table__location_assignments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.table__location_assignments", "block_contents": "Individual location assignment records representing specific time periods when healthcare staff are scheduled to work at particular locations."}, "doc.tamanu_source_dbt.location_assignments__user_id": {"name": "location_assignments__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) assigned to this location."}, "doc.tamanu_source_dbt.location_assignments__location_id": {"name": "location_assignments__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) where the user is assigned."}, "doc.tamanu_source_dbt.location_assignments__start_time": {"name": "location_assignments__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__start_time", "block_contents": "Start time of the assignment period."}, "doc.tamanu_source_dbt.location_assignments__end_time": {"name": "location_assignments__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__end_time", "block_contents": "End time of the assignment period."}, "doc.tamanu_source_dbt.location_assignments__template_id": {"name": "location_assignments__template_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignments.md", "original_file_path": "models\\sources\\location_assignments.md", "unique_id": "doc.tamanu_source_dbt.location_assignments__template_id", "block_contents": "Reference to the [location assignment template](#!/source/source.tamanu.tamanu.location_assignment_templates) that generated this assignment."}, "doc.tamanu_source_dbt.table__location_assignment_templates": {"name": "table__location_assignment_templates", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.table__location_assignment_templates", "block_contents": "Templates for recurring location assignments that define when healthcare staff are scheduled to work at specific locations."}, "doc.tamanu_source_dbt.location_assignment_templates__user_id": {"name": "location_assignment_templates__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) assigned to this location."}, "doc.tamanu_source_dbt.location_assignment_templates__location_id": {"name": "location_assignment_templates__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) where the user is assigned."}, "doc.tamanu_source_dbt.location_assignment_templates__start_time": {"name": "location_assignment_templates__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__start_time", "block_contents": "Start time of the daily assignment period."}, "doc.tamanu_source_dbt.location_assignment_templates__end_time": {"name": "location_assignment_templates__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__end_time", "block_contents": "End time of the daily assignment period."}, "doc.tamanu_source_dbt.location_assignment_templates__repeat_end_date": {"name": "location_assignment_templates__repeat_end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__repeat_end_date", "block_contents": "Date when the repeating assignments should stop being generated."}, "doc.tamanu_source_dbt.location_assignment_templates__repeat_frequency": {"name": "location_assignment_templates__repeat_frequency", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__repeat_frequency", "block_contents": "Number of frequency units between each assignment (e.g., every 2 weeks)."}, "doc.tamanu_source_dbt.location_assignment_templates__repeat_unit": {"name": "location_assignment_templates__repeat_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_assignment_templates.md", "original_file_path": "models\\sources\\location_assignment_templates.md", "unique_id": "doc.tamanu_source_dbt.location_assignment_templates__repeat_unit", "block_contents": "Frequency unit for repeating assignments.\r\n\r\nOne of:\r\n- `WEEKLY`\r\n- `MONTHLY`"}, "doc.tamanu_source_dbt.table__location_groups": {"name": "table__location_groups", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.table__location_groups", "block_contents": "A group of locations managed as a single unit (e.g. a ward in hospital)"}, "doc.tamanu_source_dbt.location_groups__name": {"name": "location_groups__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.location_groups__name", "block_contents": "Full readable name for location group"}, "doc.tamanu_source_dbt.location_groups__code": {"name": "location_groups__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.location_groups__code", "block_contents": "Code for location group"}, "doc.tamanu_source_dbt.location_groups__facility_id": {"name": "location_groups__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.location_groups__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this location group is in."}, "doc.tamanu_source_dbt.location_groups__is_bookable": {"name": "location_groups__is_bookable", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\location_groups.md", "original_file_path": "models\\sources\\location_groups.md", "unique_id": "doc.tamanu_source_dbt.location_groups__is_bookable", "block_contents": "Controls whether and where this location group appears in the booking calendar: \r\n- `all`: shown on both views \r\n- `weekly`: shown only on weekly view\r\n- `daily`: shown only on daily view\r\n- `no`: hidden from calendar (default)"}, "doc.tamanu_source_dbt.table__medication_administration_records": {"name": "table__medication_administration_records", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.table__medication_administration_records", "block_contents": "Records of medication administrations to patients, tracking when medications prescribed in the system were given, not given, or otherwise administered."}, "doc.tamanu_source_dbt.medication_administration_records__status": {"name": "medication_administration_records__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__status", "block_contents": "Status of the medication administration.\r\n\r\nOne of:\r\n- `GIVEN` - The medication was administered to the patient\r\n- `NOT_GIVEN` - The medication was not administered to the patient"}, "doc.tamanu_source_dbt.medication_administration_records__prescription_id": {"name": "medication_administration_records__prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__prescription_id", "block_contents": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions) that this administration record is associated with. Links this administration event to the specific medication order it fulfills."}, "doc.tamanu_source_dbt.medication_administration_records__due_at": {"name": "medication_administration_records__due_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__due_at", "block_contents": "The scheduled date and time when the medication administration was planned to occur, based on the prescription's frequency and start date."}, "doc.tamanu_source_dbt.medication_administration_records__recorded_at": {"name": "medication_administration_records__recorded_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__recorded_at", "block_contents": "The timestamp indicating when the administration status (e.g., `GIVEN` or `NOT_GIVEN`) was actually recorded in the system. May be null if the status has not yet been recorded."}, "doc.tamanu_source_dbt.medication_administration_records__recorded_by_user_id": {"name": "medication_administration_records__recorded_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__recorded_by_user_id", "block_contents": "Reference to the [user](#!/model/model.public.users) who recorded that the medication was given or not given."}, "doc.tamanu_source_dbt.medication_administration_records__reason_not_given_id": {"name": "medication_administration_records__reason_not_given_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__reason_not_given_id", "block_contents": "Reference to the reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why the medication was not administered to the patient. Only applicable when status is `NOT_GIVEN`."}, "doc.tamanu_source_dbt.medication_administration_records__is_auto_generated": {"name": "medication_administration_records__is_auto_generated", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__is_auto_generated", "block_contents": "Indicates whether this administration record was automatically generated by the system based on the prescription's frequency and schedule. This is typically true for scheduled medications and false for one-time or as-needed medications."}, "doc.tamanu_source_dbt.medication_administration_records__changing_status_reason": {"name": "medication_administration_records__changing_status_reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__changing_status_reason", "block_contents": "Optional free text field that allows healthcare professionals to document the reason for changing the status of a medication administration record. This is particularly useful when changing a previously recorded status to a different one."}, "doc.tamanu_source_dbt.medication_administration_records__is_error": {"name": "medication_administration_records__is_error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__is_error", "block_contents": "Indicates whether this medication administration record is marked as error."}, "doc.tamanu_source_dbt.medication_administration_records__error_notes": {"name": "medication_administration_records__error_notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__error_notes", "block_contents": "Detailed description of any errors or discrepancies associated with this medication administration record."}, "doc.tamanu_source_dbt.medication_administration_records__changing_not_given_info_reason": {"name": "medication_administration_records__changing_not_given_info_reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__changing_not_given_info_reason", "block_contents": "Optional free text field that allows healthcare professionals to document the reason for modifying information about why a medication was not given. This is used when updating or changing the details of a previously recorded 'not given' status, providing an audit trail of why the information was changed."}, "doc.tamanu_source_dbt.medication_administration_records__is_edited": {"name": "medication_administration_records__is_edited", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_records.md", "original_file_path": "models\\sources\\medication_administration_records.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_records__is_edited", "block_contents": "Indicates whether this medication administration record has been manually edited after its initial creation or recording."}, "doc.tamanu_source_dbt.table__medication_administration_record_doses": {"name": "table__medication_administration_record_doses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.table__medication_administration_record_doses", "block_contents": "Stores details about individual doses given as part of a medication administration record. A single administration event may involve multiple distinct doses (e.g., taking two tablets)."}, "doc.tamanu_source_dbt.medication_administration_record_doses__dose_amount": {"name": "medication_administration_record_doses__dose_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__dose_amount", "block_contents": "The amount or quantity of the medication administered in this specific dose entry."}, "doc.tamanu_source_dbt.medication_administration_record_doses__given_time": {"name": "medication_administration_record_doses__given_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__given_time", "block_contents": "The precise date and time when this specific dose was administered to the patient. This may differ slightly from the overall `administered_at` time in the parent record if multiple doses were given sequentially."}, "doc.tamanu_source_dbt.medication_administration_record_doses__given_by_user_id": {"name": "medication_administration_record_doses__given_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__given_by_user_id", "block_contents": "Reference to the [user](#!/model/model.public.users) who physically administered this dose to the patient."}, "doc.tamanu_source_dbt.medication_administration_record_doses__mar_id": {"name": "medication_administration_record_doses__mar_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__mar_id", "block_contents": "Reference to the MAR [medication administration record](#!/model/model.public.medication_administration_records) to which this dose belongs."}, "doc.tamanu_source_dbt.medication_administration_record_doses__recorded_by_user_id": {"name": "medication_administration_record_doses__recorded_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__recorded_by_user_id", "block_contents": "Reference to the [user](#!/model/model.public.users) who recorded the details of this specific dose administration in the system. This may or may not be the same user who physically administered the dose (`given_by_user_id`)."}, "doc.tamanu_source_dbt.medication_administration_record_doses__is_removed": {"name": "medication_administration_record_doses__is_removed", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__is_removed", "block_contents": "Indicates whether this dose record has been removed or voided."}, "doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_removal": {"name": "medication_administration_record_doses__reason_for_removal", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_removal", "block_contents": "A text field explaining why this dose record was removed or voided."}, "doc.tamanu_source_dbt.medication_administration_record_doses__dose_index": {"name": "medication_administration_record_doses__dose_index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__dose_index", "block_contents": "A sequential number indicating the order of this dose within a multi-dose administration. Helps track the sequence when multiple doses are given in a single administration event."}, "doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_change": {"name": "medication_administration_record_doses__reason_for_change", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_administration_record_doses.md", "original_file_path": "models\\sources\\medication_administration_record_doses.md", "unique_id": "doc.tamanu_source_dbt.medication_administration_record_doses__reason_for_change", "block_contents": "A text field documenting the reason for any modifications made to this dose record after it was initially recorded. This helps maintain an audit trail of changes and ensures proper documentation of why dose details were updated."}, "doc.tamanu_source_dbt.table__medication_dispenses": {"name": "table__medication_dispenses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.table__medication_dispenses", "block_contents": "Records of medication dispensing events, tracking when medications from pharmacy orders are physically dispensed to patients. Each record represents a single dispensing event for a specific prescription within a pharmacy order."}, "doc.tamanu_source_dbt.medication_dispenses__pharmacy_order_prescription_id": {"name": "medication_dispenses__pharmacy_order_prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__pharmacy_order_prescription_id", "block_contents": "Reference to the [pharmacy_order_prescription](#!/source/source.tamanu.tamanu.pharmacy_order_prescriptions) that this dispense record fulfills. Links this dispensing event to the specific medication order being filled."}, "doc.tamanu_source_dbt.medication_dispenses__quantity": {"name": "medication_dispenses__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__quantity", "block_contents": "The quantity of medication units dispensed to the patient in each dispensing."}, "doc.tamanu_source_dbt.medication_dispenses__instructions": {"name": "medication_dispenses__instructions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__instructions", "block_contents": "Additional instructions provided to the patient when dispensing the medication, such as dosage guidance, timing, storage requirements, or special considerations for administration."}, "doc.tamanu_source_dbt.medication_dispenses__dispensed_by_user_id": {"name": "medication_dispenses__dispensed_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__dispensed_by_user_id", "block_contents": "Reference to the [user](#!/model/model.public.users) (typically a pharmacist or pharmacy staff member) who dispensed the medication."}, "doc.tamanu_source_dbt.medication_dispenses__dispensed_at": {"name": "medication_dispenses__dispensed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\medication_dispenses.md", "original_file_path": "models\\sources\\medication_dispenses.md", "unique_id": "doc.tamanu_source_dbt.medication_dispenses__dispensed_at", "block_contents": "The timestamp indicating when the medication was physically dispensed to the patient."}, "doc.tamanu_source_dbt.table__notes": {"name": "table__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.table__notes", "block_contents": "Notes recorded by clinicians or system generated.\r\n\r\nAlso see the deprecated [`note_items`](#!/source/source.tamanu.tamanu.note_items),\r\n[`note_pages`](#!/source/source.tamanu.tamanu.note_pages), and the even older\r\n[`notes_legacy`](#!/source/source.tamanu.tamanu.notes_legacy).\r\n\r\nThis is the current version (3) of the notes system."}, "doc.tamanu_source_dbt.notes__record_id": {"name": "notes__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__record_id", "block_contents": "Polymorphic relationship to the record to which the note is attached (id)."}, "doc.tamanu_source_dbt.notes__record_type": {"name": "notes__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__record_type", "block_contents": "Polymorphic relationship to the record to which the note is attached (type)."}, "doc.tamanu_source_dbt.notes__content": {"name": "notes__content", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__content", "block_contents": "The content of the note recorded."}, "doc.tamanu_source_dbt.notes__author_id": {"name": "notes__author_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__author_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note."}, "doc.tamanu_source_dbt.notes__on_behalf_of_id": {"name": "notes__on_behalf_of_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__on_behalf_of_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note, if it wasn't the user who published it."}, "doc.tamanu_source_dbt.notes__revised_by_id": {"name": "notes__revised_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__revised_by_id", "block_contents": "Reference to the [note](#!/source/source.tamanu.tamanu.notes) that is being revised."}, "doc.tamanu_source_dbt.notes__note_type_id": {"name": "notes__note_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes.md", "original_file_path": "models\\sources\\notes.md", "unique_id": "doc.tamanu_source_dbt.notes__note_type_id", "block_contents": "Reference to the note type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = noteType`)."}, "doc.tamanu_source_dbt.table__notes_legacy": {"name": "table__notes_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.table__notes_legacy", "block_contents": "Legacy notes"}, "doc.tamanu_source_dbt.notes_legacy__record_id": {"name": "notes_legacy__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__record_id", "block_contents": "Legacy notes record_id"}, "doc.tamanu_source_dbt.notes_legacy__record_type": {"name": "notes_legacy__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__record_type", "block_contents": "Legacy notes record_type"}, "doc.tamanu_source_dbt.notes_legacy__note_type": {"name": "notes_legacy__note_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__note_type", "block_contents": "Legacy notes note_type"}, "doc.tamanu_source_dbt.notes_legacy__content": {"name": "notes_legacy__content", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__content", "block_contents": "Legacy notes content"}, "doc.tamanu_source_dbt.notes_legacy__author_id": {"name": "notes_legacy__author_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__author_id", "block_contents": "Legacy notes author_id"}, "doc.tamanu_source_dbt.notes_legacy__on_behalf_of_id": {"name": "notes_legacy__on_behalf_of_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notes_legacy.md", "original_file_path": "models\\sources\\notes_legacy.md", "unique_id": "doc.tamanu_source_dbt.notes_legacy__on_behalf_of_id", "block_contents": "Legacy notes on_behalf_of_id"}, "doc.tamanu_source_dbt.table__note_items": {"name": "table__note_items", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.table__note_items", "block_contents": "Version 2 of note management.\r\n\r\nIn this version, notes were split between note pages and actual note (item) content.\r\n\r\nDeprecated.\r\n\r\nSee also [`note_pages`](#!/source/source.tamanu.tamanu.note_pages)."}, "doc.tamanu_source_dbt.note_items__note_page_id": {"name": "note_items__note_page_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__note_page_id", "block_contents": "The [note page](#!/source/source.tamanu.tamanu.note_pages) this item belongs to."}, "doc.tamanu_source_dbt.note_items__revised_by_id": {"name": "note_items__revised_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__revised_by_id", "block_contents": "Reference to the [note_item](#!/source/source.tamanu.tamanu.note_items) that is revised."}, "doc.tamanu_source_dbt.note_items__author_id": {"name": "note_items__author_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__author_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who published this note item."}, "doc.tamanu_source_dbt.note_items__on_behalf_of_id": {"name": "note_items__on_behalf_of_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__on_behalf_of_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who wrote this note item, if different from `author_id`."}, "doc.tamanu_source_dbt.note_items__content": {"name": "note_items__content", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_items.md", "original_file_path": "models\\sources\\note_items.md", "unique_id": "doc.tamanu_source_dbt.note_items__content", "block_contents": "Text content of the note."}, "doc.tamanu_source_dbt.table__note_pages": {"name": "table__note_pages", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_pages.md", "original_file_path": "models\\sources\\note_pages.md", "unique_id": "doc.tamanu_source_dbt.table__note_pages", "block_contents": "Version 2 of note management.\r\n\r\nIn this version, notes were split between note pages and actual note (item) content.\r\n\r\nDeprecated.\r\n\r\nSee also [`note_items`](#!/source/source.tamanu.tamanu.note_items)."}, "doc.tamanu_source_dbt.note_pages__note_type": {"name": "note_pages__note_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_pages.md", "original_file_path": "models\\sources\\note_pages.md", "unique_id": "doc.tamanu_source_dbt.note_pages__note_type", "block_contents": "Type of the note page."}, "doc.tamanu_source_dbt.note_pages__record_id": {"name": "note_pages__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_pages.md", "original_file_path": "models\\sources\\note_pages.md", "unique_id": "doc.tamanu_source_dbt.note_pages__record_id", "block_contents": "Polymorphic relationship to the record to which the note is attached (id)."}, "doc.tamanu_source_dbt.note_pages__record_type": {"name": "note_pages__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\note_pages.md", "original_file_path": "models\\sources\\note_pages.md", "unique_id": "doc.tamanu_source_dbt.note_pages__record_type", "block_contents": "Polymorphic relationship to the record to which the note is attached (type)."}, "doc.tamanu_source_dbt.table__notifications": {"name": "table__notifications", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.table__notifications", "block_contents": "Notifications for the clinician dashboard"}, "doc.tamanu_source_dbt.notifications__type": {"name": "notifications__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__type", "block_contents": "Type of the notification\r\n\r\nOne of:\r\n- `imaging_request`\r\n- `lab_request`"}, "doc.tamanu_source_dbt.notifications__status": {"name": "notifications__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__status", "block_contents": "Status of the notification\r\n\r\nOne of:\r\n- `unread`\r\n- `read`"}, "doc.tamanu_source_dbt.notifications__user_id": {"name": "notifications__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) that get the notification."}, "doc.tamanu_source_dbt.notifications__created_time": {"name": "notifications__created_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__created_time", "block_contents": "When the notification was created"}, "doc.tamanu_source_dbt.notifications__patient_id": {"name": "notifications__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__patient_id", "block_contents": "Related patient of the notification"}, "doc.tamanu_source_dbt.notifications__metadata": {"name": "notifications__metadata", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\notifications.md", "original_file_path": "models\\sources\\notifications.md", "unique_id": "doc.tamanu_source_dbt.notifications__metadata", "block_contents": "Metadata of the notification"}, "doc.tamanu_source_dbt.table__one_time_logins": {"name": "table__one_time_logins", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.table__one_time_logins", "block_contents": "One time logins are used for password resets."}, "doc.tamanu_source_dbt.one_time_logins__user_id": {"name": "one_time_logins__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.one_time_logins__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users) for whom this one time login is for."}, "doc.tamanu_source_dbt.one_time_logins__token": {"name": "one_time_logins__token", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.one_time_logins__token", "block_contents": "A random value to use as the login code.\r\n\r\nThis is sent to the user in an email and then entered in a form to reset their password."}, "doc.tamanu_source_dbt.one_time_logins__expires_at": {"name": "one_time_logins__expires_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.one_time_logins__expires_at", "block_contents": "Beyond this time, the one time login can no longer be used."}, "doc.tamanu_source_dbt.one_time_logins__used_at": {"name": "one_time_logins__used_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\one_time_logins.md", "original_file_path": "models\\sources\\one_time_logins.md", "unique_id": "doc.tamanu_source_dbt.one_time_logins__used_at", "block_contents": "When this token was used."}, "doc.tamanu_source_dbt.table__patients": {"name": "table__patients", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.table__patients", "block_contents": "The central record for a patient.\r\n\r\n\u26a0\ufe0f The full contents of this table are synced to all devices, and in larger deployments this may be\r\nhundreds of thousands of records (or even millions), so it is critical to keep the row size small.\r\n\r\nOnly contains basic patient data (name, dob, etc.): the bare minimum to be able to find that patient\r\nin the system from the search page.\r\n\r\nThe remainder of the patient data is stored in the `patient_additional_data` table, which is only\r\nsynced to a device once it has marked that patient for sync (in the `patient_facility` table)."}, "doc.tamanu_source_dbt.patients__display_id": {"name": "patients__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__display_id", "block_contents": "Tamanu identifier for patients that is used on the front-end to refer to a patient.\r\n\r\nIt is usually the primary \"health system\" ID for this patient (ie something like a medicare number,\r\nnational healthcare number, etc), and may be imported from an external system or allocated by Tamanu\r\nitself.\r\n\r\nInformally this is called NHN or \"Display ID\" interchangeably.\r\n\r\nAdditional external IDs are tracked in the `patient_secondary_ids` table."}, "doc.tamanu_source_dbt.patients__first_name": {"name": "patients__first_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__first_name", "block_contents": "First name of patient"}, "doc.tamanu_source_dbt.patients__middle_name": {"name": "patients__middle_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__middle_name", "block_contents": "Middle name of patient"}, "doc.tamanu_source_dbt.patients__last_name": {"name": "patients__last_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__last_name", "block_contents": "Last name of patient"}, "doc.tamanu_source_dbt.patients__cultural_name": {"name": "patients__cultural_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__cultural_name", "block_contents": "Cultural name of patient"}, "doc.tamanu_source_dbt.patients__email": {"name": "patients__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__email", "block_contents": "Email address of patient"}, "doc.tamanu_source_dbt.patients__date_of_birth": {"name": "patients__date_of_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__date_of_birth", "block_contents": "Date of birth of patient"}, "doc.tamanu_source_dbt.patients__sex": {"name": "patients__sex", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__sex", "block_contents": "Sex of patient.\r\n\r\nOne of:\r\n- `male`\r\n- `female`\r\n- `other`"}, "doc.tamanu_source_dbt.patients__village_id": {"name": "patients__village_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__village_id", "block_contents": "Tamanu village identifier defined in the reference data"}, "doc.tamanu_source_dbt.patients__additional_details": {"name": "patients__additional_details", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__additional_details", "block_contents": "[Deprecated] Additional details of the patient"}, "doc.tamanu_source_dbt.patients__merged_into_id": {"name": "patients__merged_into_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__merged_into_id", "block_contents": "Tamanu identifier for the patient the patient record was merged into"}, "doc.tamanu_source_dbt.patients__date_of_death_legacy": {"name": "patients__date_of_death_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__date_of_death_legacy", "block_contents": "[Deprecated] Timestamp of death of patient"}, "doc.tamanu_source_dbt.patients__date_of_death": {"name": "patients__date_of_death", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__date_of_death", "block_contents": "Date and time of death of patient"}, "doc.tamanu_source_dbt.patients__date_of_birth_legacy": {"name": "patients__date_of_birth_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patients.md", "original_file_path": "models\\sources\\patients.md", "unique_id": "doc.tamanu_source_dbt.patients__date_of_birth_legacy", "block_contents": "[Deprecated] Timestamp of birth of patient"}, "doc.tamanu_source_dbt.table__patient_additional_data": {"name": "table__patient_additional_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.table__patient_additional_data", "block_contents": "Core or adjunct patient data that doesn't fit elsewhere, but is only downloaded to a facility once a\r\npatient is marked for sync.\r\n\r\nThis is often referred to as \"PAD\".\r\n\r\nSee also `patient_field_definition_categories`, `patient_field_definitions`, and `patient_field_values`,\r\nwhich define and specify custom/non-standard data to be stored against patients."}, "doc.tamanu_source_dbt.patient_additional_data__place_of_birth": {"name": "patient_additional_data__place_of_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__place_of_birth", "block_contents": "Free-form place of birth (typically a place name or country)."}, "doc.tamanu_source_dbt.patient_additional_data__primary_contact_number": {"name": "patient_additional_data__primary_contact_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__primary_contact_number", "block_contents": "Primary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`."}, "doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number": {"name": "patient_additional_data__secondary_contact_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__secondary_contact_number", "block_contents": "Secondary contact number.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`."}, "doc.tamanu_source_dbt.patient_additional_data__marital_status": {"name": "patient_additional_data__marital_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__marital_status", "block_contents": "Marital status.\r\n\r\nOne of:\r\n- `Defacto`\r\n- `Married`\r\n- `Single`\r\n- `Widow`\r\n- `Divorced`\r\n- `Separated`\r\n- `Unknown`"}, "doc.tamanu_source_dbt.patient_additional_data__city_town": {"name": "patient_additional_data__city_town", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__city_town", "block_contents": "Patient current address city or town.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured."}, "doc.tamanu_source_dbt.patient_additional_data__street_village": {"name": "patient_additional_data__street_village", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__street_village", "block_contents": "Patient current address street or village.\r\n\r\nThis may be free-form or chosen from a drop-down, depending on how Tamanu is configured."}, "doc.tamanu_source_dbt.patient_additional_data__educational_level": {"name": "patient_additional_data__educational_level", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__educational_level", "block_contents": "Highest educational attainment."}, "doc.tamanu_source_dbt.patient_additional_data__social_media": {"name": "patient_additional_data__social_media", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__social_media", "block_contents": "Free-form social media contact.\r\n\r\nNote that this may be complementary to the more structured data in `patient_contacts`."}, "doc.tamanu_source_dbt.patient_additional_data__blood_type": {"name": "patient_additional_data__blood_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__blood_type", "block_contents": "Blood type.\r\n\r\nOne of:\r\n- `A+`\r\n- `A-`\r\n- `AB-`\r\n- `AB+`\r\n- `B+`\r\n- `B-`\r\n- `O+`\r\n- `O-`"}, "doc.tamanu_source_dbt.patient_additional_data__title": {"name": "patient_additional_data__title", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__title", "block_contents": "Patient name: title."}, "doc.tamanu_source_dbt.patient_additional_data__ethnicity_id": {"name": "patient_additional_data__ethnicity_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__ethnicity_id", "block_contents": "Reference to patient ethnicity ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__nationality_id": {"name": "patient_additional_data__nationality_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__nationality_id", "block_contents": "Reference to patient nationality ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__country_id": {"name": "patient_additional_data__country_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__country_id", "block_contents": "Reference to patient country of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__division_id": {"name": "patient_additional_data__division_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__division_id", "block_contents": "Reference to patient administrative division of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__subdivision_id": {"name": "patient_additional_data__subdivision_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__subdivision_id", "block_contents": "Reference to patient administrative subdivision of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__medical_area_id": {"name": "patient_additional_data__medical_area_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__medical_area_id", "block_contents": "Reference to patient administrative medical area of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id": {"name": "patient_additional_data__nursing_zone_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__nursing_zone_id", "block_contents": "Reference to patient administrative nursing zone of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__settlement_id": {"name": "patient_additional_data__settlement_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__settlement_id", "block_contents": "Reference to patient residence settlement ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__occupation_id": {"name": "patient_additional_data__occupation_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__occupation_id", "block_contents": "Reference to patient occupation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__patient_id": {"name": "patient_additional_data__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_additional_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this."}, "doc.tamanu_source_dbt.patient_additional_data__birth_certificate": {"name": "patient_additional_data__birth_certificate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__birth_certificate", "block_contents": "Birth certificate identifier."}, "doc.tamanu_source_dbt.patient_additional_data__driving_license": {"name": "patient_additional_data__driving_license", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__driving_license", "block_contents": "Driving licence identifier."}, "doc.tamanu_source_dbt.patient_additional_data__passport": {"name": "patient_additional_data__passport", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__passport", "block_contents": "Passport number."}, "doc.tamanu_source_dbt.patient_additional_data__religion_id": {"name": "patient_additional_data__religion_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__religion_id", "block_contents": "Reference to patient religion ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id": {"name": "patient_additional_data__patient_billing_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__patient_billing_type_id", "block_contents": "Reference to patient billing type."}, "doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id": {"name": "patient_additional_data__country_of_birth_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__country_of_birth_id", "block_contents": "Reference to patient country of birth ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__registered_by_id": {"name": "patient_additional_data__registered_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__registered_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who registered the patient in Tamanu."}, "doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name": {"name": "patient_additional_data__emergency_contact_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__emergency_contact_name", "block_contents": "Name of emergency contact."}, "doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number": {"name": "patient_additional_data__emergency_contact_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__emergency_contact_number", "block_contents": "Phone number of emergency contact."}, "doc.tamanu_source_dbt.patient_additional_data__mother_id": {"name": "patient_additional_data__mother_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__mother_id", "block_contents": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of mother / parent."}, "doc.tamanu_source_dbt.patient_additional_data__father_id": {"name": "patient_additional_data__father_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__father_id", "block_contents": "Reference to [patient](#!/source/source.tamanu.tamanu.patients) ID of father / parent."}, "doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field": {"name": "patient_additional_data__updated_at_by_field", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__updated_at_by_field", "block_contents": "JSON object recording the updated datetime for individual columns.\r\n\r\nAs PADs contain a lot of disparate data, it's not uncommon that fields are edited separately in\r\ndifferent facilities. The default sync strategy is for the last edit to a whole row to \"win out\" in\r\ncase of a conflict, but this can lead to discarding important data in the case of PADs. This field\r\nis used to implement per-field \"last edit wins\" instead."}, "doc.tamanu_source_dbt.patient_additional_data__health_center_id": {"name": "patient_additional_data__health_center_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__health_center_id", "block_contents": "Reference to patient primary health center ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__insurer_id": {"name": "patient_additional_data__insurer_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__insurer_id", "block_contents": "Reference to patient insurer ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number": {"name": "patient_additional_data__insurer_policy_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__insurer_policy_number", "block_contents": "Policy number of patient insurance."}, "doc.tamanu_source_dbt.patient_additional_data__secondary_village_id": {"name": "patient_additional_data__secondary_village_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_additional_data.md", "original_file_path": "models\\sources\\patient_additional_data.md", "unique_id": "doc.tamanu_source_dbt.patient_additional_data__secondary_village_id", "block_contents": "Reference to patient administrative village of residence ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), secondary).\r\n\r\nSee also [`patients.village_id`](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.table__patient_allergies": {"name": "table__patient_allergies", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.table__patient_allergies", "block_contents": "List of allergies known of the patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Allergies\".\r\n\r\nSee also: `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`, `public.patient_issues`."}, "doc.tamanu_source_dbt.patient_allergies__note": {"name": "patient_allergies__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__note", "block_contents": "Free-form description of this allergy."}, "doc.tamanu_source_dbt.patient_allergies__recorded_date": {"name": "patient_allergies__recorded_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__recorded_date", "block_contents": "Datetime at which this allergy was recorded."}, "doc.tamanu_source_dbt.patient_allergies__patient_id": {"name": "patient_allergies__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_allergies__practitioner_id": {"name": "patient_allergies__practitioner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__practitioner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this allergy."}, "doc.tamanu_source_dbt.patient_allergies__allergy_id": {"name": "patient_allergies__allergy_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__allergy_id", "block_contents": "Reference to an allergy ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_allergies__recorded_date_legacy": {"name": "patient_allergies__recorded_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__recorded_date_legacy", "block_contents": "[Deprecated] Timestamp at which this allergy was recorded."}, "doc.tamanu_source_dbt.patient_allergies__reaction_id": {"name": "patient_allergies__reaction_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_allergies.md", "original_file_path": "models\\sources\\patient_allergies.md", "unique_id": "doc.tamanu_source_dbt.patient_allergies__reaction_id", "block_contents": "Reference to an allergic reaction ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__patient_birth_data": {"name": "table__patient_birth_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.table__patient_birth_data", "block_contents": "Information about the birth of the patient, if their birth was recorded into Tamanu.\r\n\r\nThis is specifically data about the newborn, and only the birth-relevant data.\r\nOther patient data is found in the normal tables i.e. `patients`, `patient_additional_data`, etc."}, "doc.tamanu_source_dbt.patient_birth_data__patient_id": {"name": "patient_birth_data__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere is at most one `patient_birth_data` row per patient.\r\n\r\nNote that the `id` column is generated from this column to enforce this."}, "doc.tamanu_source_dbt.patient_birth_data__birth_weight": {"name": "patient_birth_data__birth_weight", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_weight", "block_contents": "Weight in kg at birth."}, "doc.tamanu_source_dbt.patient_birth_data__birth_length": {"name": "patient_birth_data__birth_length", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_length", "block_contents": "Length in cm at birth."}, "doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type": {"name": "patient_birth_data__birth_delivery_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_delivery_type", "block_contents": "Type of delivery.\r\n\r\nOne of:\r\n- `normal_vaginal_delivery`\r\n- `breech`\r\n- `emergency_c_section`\r\n- `elective_c_section`\r\n- `vacuum_extraction`\r\n- `forceps`\r\n- `other`"}, "doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate": {"name": "patient_birth_data__gestational_age_estimate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__gestational_age_estimate", "block_contents": "Gestational age estimate (weeks)."}, "doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute": {"name": "patient_birth_data__apgar_score_one_minute", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__apgar_score_one_minute", "block_contents": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) one minute after birth."}, "doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes": {"name": "patient_birth_data__apgar_score_five_minutes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__apgar_score_five_minutes", "block_contents": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) five minutes after birth."}, "doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes": {"name": "patient_birth_data__apgar_score_ten_minutes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__apgar_score_ten_minutes", "block_contents": "[Apgar score](https://en.wikipedia.org/wiki/Apgar_score) ten minutes after birth."}, "doc.tamanu_source_dbt.patient_birth_data__time_of_birth": {"name": "patient_birth_data__time_of_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__time_of_birth", "block_contents": "Datetime of birth."}, "doc.tamanu_source_dbt.patient_birth_data__birth_type": {"name": "patient_birth_data__birth_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_type", "block_contents": "`single` or `plural` birth."}, "doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth": {"name": "patient_birth_data__attendant_at_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__attendant_at_birth", "block_contents": "The type of the attendant at birth.\r\n\r\nOne of:\r\n- `doctor`\r\n- `midwife`\r\n- `nurse`\r\n- `traditional_birth_attentdant`\r\n- `other`"}, "doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth": {"name": "patient_birth_data__name_of_attendant_at_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__name_of_attendant_at_birth", "block_contents": "Name of attendant at birth."}, "doc.tamanu_source_dbt.patient_birth_data__birth_facility_id": {"name": "patient_birth_data__birth_facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__birth_facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) the birth was recorded at.\r\n\r\nThis is only required when `registered_birth_place` is `health_facility`."}, "doc.tamanu_source_dbt.patient_birth_data__registered_birth_place": {"name": "patient_birth_data__registered_birth_place", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__registered_birth_place", "block_contents": "Type of the actual birth place.\r\n\r\nOne of:\r\n- `health_facility`\r\n- `home`\r\n- `other`"}, "doc.tamanu_source_dbt.patient_birth_data__time_of_birth_legacy": {"name": "patient_birth_data__time_of_birth_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_birth_data.md", "original_file_path": "models\\sources\\patient_birth_data.md", "unique_id": "doc.tamanu_source_dbt.patient_birth_data__time_of_birth_legacy", "block_contents": "[Deprecated] Time of birth."}, "doc.tamanu_source_dbt.table__patient_care_plans": {"name": "table__patient_care_plans", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_care_plans.md", "original_file_path": "models\\sources\\patient_care_plans.md", "unique_id": "doc.tamanu_source_dbt.table__patient_care_plans", "block_contents": "List of current care plans the patient is on.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Care plans\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_conditions`, `public.patient_family_histories`,\r\n`public.patient_issues`."}, "doc.tamanu_source_dbt.patient_care_plans__patient_id": {"name": "patient_care_plans__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_care_plans.md", "original_file_path": "models\\sources\\patient_care_plans.md", "unique_id": "doc.tamanu_source_dbt.patient_care_plans__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_care_plans__examiner_id": {"name": "patient_care_plans__examiner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_care_plans.md", "original_file_path": "models\\sources\\patient_care_plans.md", "unique_id": "doc.tamanu_source_dbt.patient_care_plans__examiner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) who prescribed this care plan."}, "doc.tamanu_source_dbt.patient_care_plans__care_plan_id": {"name": "patient_care_plans__care_plan_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_care_plans.md", "original_file_path": "models\\sources\\patient_care_plans.md", "unique_id": "doc.tamanu_source_dbt.patient_care_plans__care_plan_id", "block_contents": "Reference to the care plan ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__patient_communications": {"name": "table__patient_communications", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.table__patient_communications", "block_contents": "Messages being sent to a patient, via a variety of channels.\r\n\r\nThis is a multiplexed queue to send emails, SMS, IM messages, etc specifically to patients.\r\n\r\nProcessed by the `PatientEmailCommunicationProcessor` scheduled task."}, "doc.tamanu_source_dbt.patient_communications__type": {"name": "patient_communications__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__type", "block_contents": "The type of communication.\r\n\r\nThis affects the template or action being taken."}, "doc.tamanu_source_dbt.patient_communications__channel": {"name": "patient_communications__channel", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__channel", "block_contents": "The channel to send the message with.\r\n\r\nOne of:\r\n- Email\r\n- Sms\r\n- WhatsApp\r\n- Telegram"}, "doc.tamanu_source_dbt.patient_communications__subject": {"name": "patient_communications__subject", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__subject", "block_contents": "Subject line (short summary of the message).\r\n\r\nThis is the subject line of an email, or equivalent for other channels."}, "doc.tamanu_source_dbt.patient_communications__content": {"name": "patient_communications__content", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__content", "block_contents": "Content of the message."}, "doc.tamanu_source_dbt.patient_communications__status": {"name": "patient_communications__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__status", "block_contents": "Processing status of the communication.\r\n\r\nOne of:\r\n- `Queued`\r\n- `Processed`\r\n- `Sent`\r\n- `Error`\r\n- `Delivered`\r\n- `Bad Format`"}, "doc.tamanu_source_dbt.patient_communications__error": {"name": "patient_communications__error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__error", "block_contents": "If the communication sending fails, this is the error."}, "doc.tamanu_source_dbt.patient_communications__retry_count": {"name": "patient_communications__retry_count", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__retry_count", "block_contents": "How many times the sending has been retried."}, "doc.tamanu_source_dbt.patient_communications__patient_id": {"name": "patient_communications__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients) that communication is for."}, "doc.tamanu_source_dbt.patient_communications__destination": {"name": "patient_communications__destination", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__destination", "block_contents": "Destination address to send this message to.\r\n\r\nIf this is not provided here, it will be derived from the patient, such as using the\r\n[`patient_contacts`](#!/source/source.tamanu.tamanu.patient_contacts) table."}, "doc.tamanu_source_dbt.patient_communications__attachment": {"name": "patient_communications__attachment", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__attachment", "block_contents": "The attachment as a string."}, "doc.tamanu_source_dbt.patient_communications__hash": {"name": "patient_communications__hash", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_communications.md", "original_file_path": "models\\sources\\patient_communications.md", "unique_id": "doc.tamanu_source_dbt.patient_communications__hash", "block_contents": "Hash of original data that went into creating the row, for purposes of deduplication.\r\n\r\nThe hashing is done with the `hashtext` postgres function."}, "doc.tamanu_source_dbt.table__patient_conditions": {"name": "table__patient_conditions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.table__patient_conditions", "block_contents": "List of ongoing conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Ongoing conditions\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`,\r\n`public.patient_family_histories`, `public.patient_issues`."}, "doc.tamanu_source_dbt.patient_conditions__note": {"name": "patient_conditions__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__note", "block_contents": "Free-form description of this condition."}, "doc.tamanu_source_dbt.patient_conditions__recorded_date": {"name": "patient_conditions__recorded_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__recorded_date", "block_contents": "Datetime at which this issue was recorded."}, "doc.tamanu_source_dbt.patient_conditions__resolved": {"name": "patient_conditions__resolved", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__resolved", "block_contents": "Whether the condition has resolved."}, "doc.tamanu_source_dbt.patient_conditions__patient_id": {"name": "patient_conditions__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_conditions__examiner_id": {"name": "patient_conditions__examiner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__examiner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording this\r\ncondition."}, "doc.tamanu_source_dbt.patient_conditions__condition_id": {"name": "patient_conditions__condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__condition_id", "block_contents": "Reference to a diagnosis describing this issue ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.patient_conditions__recorded_date_legacy": {"name": "patient_conditions__recorded_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__recorded_date_legacy", "block_contents": "[Deprecated] Timestamp at which this issue was recorded."}, "doc.tamanu_source_dbt.patient_conditions__resolution_date": {"name": "patient_conditions__resolution_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__resolution_date", "block_contents": "Datetime at which this issue was resolved."}, "doc.tamanu_source_dbt.patient_conditions__resolution_practitioner_id": {"name": "patient_conditions__resolution_practitioner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__resolution_practitioner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) diagnosing/recording the\r\nresolution of this condition."}, "doc.tamanu_source_dbt.patient_conditions__resolution_note": {"name": "patient_conditions__resolution_note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_conditions.md", "original_file_path": "models\\sources\\patient_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_conditions__resolution_note", "block_contents": "Free-form description or notes about the resolution of this condition."}, "doc.tamanu_source_dbt.table__patient_contacts": {"name": "table__patient_contacts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.table__patient_contacts", "block_contents": "Describes how a patient may be contacted, via email, SMS, or IM apps.\r\n\r\nAt present, this is used for:\r\n- display in the application (all methods)\r\n- emailing the patient (`method=Email`)\r\n- sending Telegram reminders for appointments (`method=Telegram`)"}, "doc.tamanu_source_dbt.patient_contacts__name": {"name": "patient_contacts__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__name", "block_contents": "Free-form name of the contact method.\r\n\r\nThis could be the name of the patient, or a relationship if the contact method is via another person\r\n(e.g. `Spouse`, `Parent`, `Caregiver`), or a logical keyword if multiple contacts of the same method\r\nare provided (e.g. `Main`, `Primary`, `Work`, `Home`), etc."}, "doc.tamanu_source_dbt.patient_contacts__method": {"name": "patient_contacts__method", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__method", "block_contents": "What application the contact uses:\r\n- `Email`\r\n- `Sms`\r\n- `WhatsApp`\r\n- `Telegram`"}, "doc.tamanu_source_dbt.patient_contacts__connection_details": {"name": "patient_contacts__connection_details", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__connection_details", "block_contents": "JSON structure containing the details of the contact.\r\n\r\nIts schema varies based on the `method`."}, "doc.tamanu_source_dbt.patient_contacts__patient_id": {"name": "patient_contacts__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_contacts__relationship_id": {"name": "patient_contacts__relationship_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_contacts.md", "original_file_path": "models\\sources\\patient_contacts.md", "unique_id": "doc.tamanu_source_dbt.patient_contacts__relationship_id", "block_contents": "If the contact method is via another person."}, "doc.tamanu_source_dbt.table__patient_death_data": {"name": "table__patient_death_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.table__patient_death_data", "block_contents": "Information about a patient's death."}, "doc.tamanu_source_dbt.patient_death_data__patient_id": {"name": "patient_death_data__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients) who died."}, "doc.tamanu_source_dbt.patient_death_data__clinician_id": {"name": "patient_death_data__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__clinician_id", "block_contents": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who is recording this death."}, "doc.tamanu_source_dbt.patient_death_data__facility_id": {"name": "patient_death_data__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where this death is being recorded."}, "doc.tamanu_source_dbt.patient_death_data__manner": {"name": "patient_death_data__manner", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__manner", "block_contents": "A descriptive text specifying the manner of death."}, "doc.tamanu_source_dbt.patient_death_data__recent_surgery": {"name": "patient_death_data__recent_surgery", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__recent_surgery", "block_contents": "Whether the deceased patient had a recent surgery, if any."}, "doc.tamanu_source_dbt.patient_death_data__last_surgery_date": {"name": "patient_death_data__last_surgery_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__last_surgery_date", "block_contents": "Datetime of the most recent surgery the patient received, if any."}, "doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id": {"name": "patient_death_data__last_surgery_reason_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__last_surgery_reason_id", "block_contents": "Reference to a `diagnosis` ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) for the\r\nreason of the most recent surgery the patient received, if any."}, "doc.tamanu_source_dbt.patient_death_data__external_cause_date": {"name": "patient_death_data__external_cause_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__external_cause_date", "block_contents": "Datetime of external cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__external_cause_location": {"name": "patient_death_data__external_cause_location", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__external_cause_location", "block_contents": "Physical location of external cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__external_cause_notes": {"name": "patient_death_data__external_cause_notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__external_cause_notes", "block_contents": "Free-form description of the location of external cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__was_pregnant": {"name": "patient_death_data__was_pregnant", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__was_pregnant", "block_contents": "Whether the deceased was pregnant."}, "doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed": {"name": "patient_death_data__pregnancy_contributed", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__pregnancy_contributed", "block_contents": "Whether the pregnancy contributed to the death."}, "doc.tamanu_source_dbt.patient_death_data__fetal_or_infant": {"name": "patient_death_data__fetal_or_infant", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__fetal_or_infant", "block_contents": "Whether the deceased was themselves a foetus or infant."}, "doc.tamanu_source_dbt.patient_death_data__stillborn": {"name": "patient_death_data__stillborn", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__stillborn", "block_contents": "Whether the deceased was themselves stillborn."}, "doc.tamanu_source_dbt.patient_death_data__birth_weight": {"name": "patient_death_data__birth_weight", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__birth_weight", "block_contents": "If the deceased was a foetus, stillborn, or infant, their birth weight."}, "doc.tamanu_source_dbt.patient_death_data__within_day_of_birth": {"name": "patient_death_data__within_day_of_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__within_day_of_birth", "block_contents": "If the deceased was a foetus, stillborn, or infant, whether their passing was on the day of their birth."}, "doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth": {"name": "patient_death_data__hours_survived_since_birth", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__hours_survived_since_birth", "block_contents": "If the deceased was an infant, how many days since the birth passed before their death."}, "doc.tamanu_source_dbt.patient_death_data__carrier_age": {"name": "patient_death_data__carrier_age", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__carrier_age", "block_contents": "If the deceased was a foetus, stillborn, or infant, the age of the carrier."}, "doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks": {"name": "patient_death_data__carrier_pregnancy_weeks", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__carrier_pregnancy_weeks", "block_contents": "If the deceased was a foetus, stillborn, or infant, how many weeks pregnant their carrier was."}, "doc.tamanu_source_dbt.patient_death_data__outside_health_facility": {"name": "patient_death_data__outside_health_facility", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__outside_health_facility", "block_contents": "Whether the death occurred outside of the facility."}, "doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset": {"name": "patient_death_data__primary_cause_time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__primary_cause_time_after_onset", "block_contents": "The time in minutes after onset of the primary cause of death, if known."}, "doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id": {"name": "patient_death_data__primary_cause_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__primary_cause_condition_id", "block_contents": "Reference to the primary cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if known."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_time_after_onset": {"name": "patient_death_data__antecedent_cause1_time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_time_after_onset", "block_contents": "The time in minutes after onset of an antecedent (1) cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id": {"name": "patient_death_data__antecedent_cause1_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause1_condition_id", "block_contents": "Reference to an antecedent (1) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_time_after_onset": {"name": "patient_death_data__antecedent_cause2_time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_time_after_onset", "block_contents": "The time in minutes after onset of an antecedent (2) cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id": {"name": "patient_death_data__antecedent_cause2_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause2_condition_id", "block_contents": "Reference to an antecedent (2) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable."}, "doc.tamanu_source_dbt.patient_death_data__external_cause_date_legacy": {"name": "patient_death_data__external_cause_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__external_cause_date_legacy", "block_contents": "[Deprecated] Timestamp of external cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__last_surgery_date_legacy": {"name": "patient_death_data__last_surgery_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__last_surgery_date_legacy", "block_contents": "[Deprecated] Timestamp of the most recent surgery the patient received, if any."}, "doc.tamanu_source_dbt.patient_death_data__is_final": {"name": "patient_death_data__is_final", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__is_final", "block_contents": "Whether this date record is final.\r\n\r\nIn Tamanu, this is set by a supervisor after review, and cannot be reversed; it causes all fields to\r\nbecome read-only. The only way to undo this record is through a `death_revert_logs`."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_time_after_onset": {"name": "patient_death_data__antecedent_cause3_time_after_onset", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_time_after_onset", "block_contents": "The time in minutes after onset of an antecedent (3) cause of death, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_condition_id": {"name": "patient_death_data__antecedent_cause3_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__antecedent_cause3_condition_id", "block_contents": "Reference to an antecedent (3) cause of death\r\n([Reference Data](#!/source/source.tamanu.tamanu.reference_data)), if applicable."}, "doc.tamanu_source_dbt.patient_death_data__autopsy_requested": {"name": "patient_death_data__autopsy_requested", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__autopsy_requested", "block_contents": "Whether an autopsy was requested."}, "doc.tamanu_source_dbt.patient_death_data__autopsy_findings_used": {"name": "patient_death_data__autopsy_findings_used", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__autopsy_findings_used", "block_contents": "If an autopsy was requested, whether the findings were used in the death certification."}, "doc.tamanu_source_dbt.patient_death_data__manner_of_death_description": {"name": "patient_death_data__manner_of_death_description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__manner_of_death_description", "block_contents": "If an external cause occurred, a text description on how and if applicable, notes of poisoning agent."}, "doc.tamanu_source_dbt.patient_death_data__pregnancy_moment": {"name": "patient_death_data__pregnancy_moment", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__pregnancy_moment", "block_contents": "The status of the pregnancy of the deceased, if applicable."}, "doc.tamanu_source_dbt.patient_death_data__multiple_pregnancy": {"name": "patient_death_data__multiple_pregnancy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__multiple_pregnancy", "block_contents": "Whether the deceased infant happened in a multiple pregnancy."}, "doc.tamanu_source_dbt.patient_death_data__mother_condition_description": {"name": "patient_death_data__mother_condition_description", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_death_data.md", "original_file_path": "models\\sources\\patient_death_data.md", "unique_id": "doc.tamanu_source_dbt.patient_death_data__mother_condition_description", "block_contents": "A text description stating the conditions of mother that affected the fetus/newborn, if the death was perinatal."}, "doc.tamanu_source_dbt.table__patient_facilities": {"name": "table__patient_facilities", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_facilities.md", "original_file_path": "models\\sources\\patient_facilities.md", "unique_id": "doc.tamanu_source_dbt.table__patient_facilities", "block_contents": "Tracks which patients are of interest to which facilities.\r\n\r\nThis is used to refine sync data: only patient data related to these patients is synced to a\r\nfacility (plus general data, and some exceptions apply like vaccine data under some conditions).\r\n\r\nIn Tamanu, this can be set manually on the facility server (via the \"mark for sync\" button), or\r\ncentrally (via some labs / vaccine programs, or via bulk-imports).\r\n\r\n_(\"Joe Patient attends X Clinic\" is clinical info; even though an entry in patient facilities\r\ndoesn't necessarily imply this, it often does.)_"}, "doc.tamanu_source_dbt.patient_facilities__facility_id": {"name": "patient_facilities__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_facilities.md", "original_file_path": "models\\sources\\patient_facilities.md", "unique_id": "doc.tamanu_source_dbt.patient_facilities__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities)."}, "doc.tamanu_source_dbt.patient_facilities__patient_id": {"name": "patient_facilities__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_facilities.md", "original_file_path": "models\\sources\\patient_facilities.md", "unique_id": "doc.tamanu_source_dbt.patient_facilities__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.table__patient_family_histories": {"name": "table__patient_family_histories", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.table__patient_family_histories", "block_contents": "List of family history conditions known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Family history\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_issues`."}, "doc.tamanu_source_dbt.patient_family_histories__note": {"name": "patient_family_histories__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__note", "block_contents": "Free-form description of this issue."}, "doc.tamanu_source_dbt.patient_family_histories__recorded_date": {"name": "patient_family_histories__recorded_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__recorded_date", "block_contents": "Datetime at which this issue was recorded."}, "doc.tamanu_source_dbt.patient_family_histories__relationship": {"name": "patient_family_histories__relationship", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__relationship", "block_contents": "Free-form description of the family relationship."}, "doc.tamanu_source_dbt.patient_family_histories__patient_id": {"name": "patient_family_histories__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_family_histories__practitioner_id": {"name": "patient_family_histories__practitioner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__practitioner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) recording this history."}, "doc.tamanu_source_dbt.patient_family_histories__diagnosis_id": {"name": "patient_family_histories__diagnosis_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__diagnosis_id", "block_contents": "Reference to a diagnosis ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))\r\ndescribing this issue."}, "doc.tamanu_source_dbt.patient_family_histories__recorded_date_legacy": {"name": "patient_family_histories__recorded_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_family_histories.md", "original_file_path": "models\\sources\\patient_family_histories.md", "unique_id": "doc.tamanu_source_dbt.patient_family_histories__recorded_date_legacy", "block_contents": "[Deprecated] Timestamp at which this issue was recorded."}, "doc.tamanu_source_dbt.table__patient_field_definitions": {"name": "table__patient_field_definitions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.table__patient_field_definitions", "block_contents": "Custom inputs to be included in the Tamanu patient details screens.\r\n\r\nThese are grouped using [categories](#!/source/source.tamanu.tamanu.patient_field_definition_categories)."}, "doc.tamanu_source_dbt.patient_field_definitions__name": {"name": "patient_field_definitions__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definitions__name", "block_contents": "Name of the input."}, "doc.tamanu_source_dbt.patient_field_definitions__field_type": {"name": "patient_field_definitions__field_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definitions__field_type", "block_contents": "Input field type.\r\n\r\nOne of:\r\n- `string`\r\n- `number`\r\n- `select`"}, "doc.tamanu_source_dbt.patient_field_definitions__options": {"name": "patient_field_definitions__options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definitions__options", "block_contents": "When `type = 'select'`, the list of options for this select.\r\n\r\nPostgreSQL array of strings."}, "doc.tamanu_source_dbt.patient_field_definitions__category_id": {"name": "patient_field_definitions__category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definitions.md", "original_file_path": "models\\sources\\patient_field_definitions.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definitions__category_id", "block_contents": "The [category](#!/source/source.tamanu.tamanu.patient_field_definition_categories) this field is in."}, "doc.tamanu_source_dbt.table__patient_field_definition_categories": {"name": "table__patient_field_definition_categories", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definition_categories.md", "original_file_path": "models\\sources\\patient_field_definition_categories.md", "unique_id": "doc.tamanu_source_dbt.table__patient_field_definition_categories", "block_contents": "Groupings for [patient field definitions](#!/source/source.tamanu.tamanu.patient_field_definitions)."}, "doc.tamanu_source_dbt.patient_field_definition_categories__name": {"name": "patient_field_definition_categories__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_definition_categories.md", "original_file_path": "models\\sources\\patient_field_definition_categories.md", "unique_id": "doc.tamanu_source_dbt.patient_field_definition_categories__name", "block_contents": "Name of category."}, "doc.tamanu_source_dbt.table__patient_field_values": {"name": "table__patient_field_values", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_values.md", "original_file_path": "models\\sources\\patient_field_values.md", "unique_id": "doc.tamanu_source_dbt.table__patient_field_values", "block_contents": "Values recorded in custom patient fields.\r\n\r\nThe `id` column is generated to enforce one value row per field definition per patient."}, "doc.tamanu_source_dbt.patient_field_values__value": {"name": "patient_field_values__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_values.md", "original_file_path": "models\\sources\\patient_field_values.md", "unique_id": "doc.tamanu_source_dbt.patient_field_values__value", "block_contents": "Value."}, "doc.tamanu_source_dbt.patient_field_values__definition_id": {"name": "patient_field_values__definition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_values.md", "original_file_path": "models\\sources\\patient_field_values.md", "unique_id": "doc.tamanu_source_dbt.patient_field_values__definition_id", "block_contents": "The [field definition](#!/source/source.tamanu.tamanu.patient_field_definitions)."}, "doc.tamanu_source_dbt.patient_field_values__patient_id": {"name": "patient_field_values__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_field_values.md", "original_file_path": "models\\sources\\patient_field_values.md", "unique_id": "doc.tamanu_source_dbt.patient_field_values__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.table__patient_issues": {"name": "table__patient_issues", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.table__patient_issues", "block_contents": "List of \"other issues\" known about a patient.\r\n\r\nIn Tamanu this is displayed and entered in the patient view sidebar, under \"Other patient issues\".\r\n\r\nSee also: `public.patient_allergies`, `public.patient_care_plans`, `public.patient_conditions`,\r\n`public.patient_family_histories`."}, "doc.tamanu_source_dbt.patient_issues__note": {"name": "patient_issues__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__note", "block_contents": "Free-form description of this issue."}, "doc.tamanu_source_dbt.patient_issues__recorded_date": {"name": "patient_issues__recorded_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__recorded_date", "block_contents": "Datetime at which this issue was recorded."}, "doc.tamanu_source_dbt.patient_issues__type": {"name": "patient_issues__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__type", "block_contents": "If set to `Warning`, an alert will pop up when visiting the patient."}, "doc.tamanu_source_dbt.patient_issues__patient_id": {"name": "patient_issues__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_issues__recorded_date_legacy": {"name": "patient_issues__recorded_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_issues.md", "original_file_path": "models\\sources\\patient_issues.md", "unique_id": "doc.tamanu_source_dbt.patient_issues__recorded_date_legacy", "block_contents": "[Deprecated] Timestamp at which this issue was recorded."}, "doc.tamanu_source_dbt.table__patient_ongoing_prescriptions": {"name": "table__patient_ongoing_prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_ongoing_prescriptions.md", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__patient_ongoing_prescriptions", "block_contents": "Association of patient to prescription"}, "doc.tamanu_source_dbt.patient_ongoing_prescriptions__patient_id": {"name": "patient_ongoing_prescriptions__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_ongoing_prescriptions.md", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.patient_ongoing_prescriptions__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients)"}, "doc.tamanu_source_dbt.patient_ongoing_prescriptions__prescription_id": {"name": "patient_ongoing_prescriptions__prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_ongoing_prescriptions.md", "original_file_path": "models\\sources\\patient_ongoing_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.patient_ongoing_prescriptions__prescription_id", "block_contents": "The [prescription](#!/source/source.tamanu.tamanu.prescriptions)"}, "doc.tamanu_source_dbt.table__patient_program_registrations": {"name": "table__patient_program_registrations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.table__patient_program_registrations", "block_contents": "Table with information about the program registrations of a patient. This is helpful\r\nto enroll a specific patient within a program that will be followed for an extended\r\nperiod of time.\r\n\r\n**This table is append-only.**\r\nA new record is created every time there is a change to the status of a registration. \r\n\r\nAt the moment, this implies that when merging two patients, both with a registration to the same\r\nregistry, the merged patient ends up with two registrations."}, "doc.tamanu_source_dbt.patient_program_registrations__registration_status": {"name": "patient_program_registrations__registration_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__registration_status", "block_contents": "The current status of the registration.\r\n\r\nOne of:\r\n- `active`\r\n- `inactive`\r\n- `recordedInError`"}, "doc.tamanu_source_dbt.patient_program_registrations__patient_id": {"name": "patient_program_registrations__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__patient_id", "block_contents": "Reference to the [Patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_program_registrations__program_registry_id": {"name": "patient_program_registrations__program_registry_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__program_registry_id", "block_contents": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nof the registration."}, "doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id": {"name": "patient_program_registrations__clinical_status_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__clinical_status_id", "block_contents": "Reference to the [Program Registry Clinical Status](#!/source/source.tamanu.tamanu.program_registry_clinical_statuses)\r\nof the registration."}, "doc.tamanu_source_dbt.patient_program_registrations__clinician_id": {"name": "patient_program_registrations__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__clinician_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that\r\nregistration."}, "doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id": {"name": "patient_program_registrations__registering_facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__registering_facility_id", "block_contents": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) where the\r\nregistration was registered in."}, "doc.tamanu_source_dbt.patient_program_registrations__facility_id": {"name": "patient_program_registrations__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__facility_id", "block_contents": "Reference to the [Facility](#!/source/source.tamanu.tamanu.facilities) this program\r\nregistration is from."}, "doc.tamanu_source_dbt.patient_program_registrations__village_id": {"name": "patient_program_registrations__village_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__village_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\n(`type=village`) this program registration is from."}, "doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id": {"name": "patient_program_registrations__deactivated_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__deactivated_clinician_id", "block_contents": "The clinician that removed the patient from the program registry."}, "doc.tamanu_source_dbt.patient_program_registrations__deactivated_date": {"name": "patient_program_registrations__deactivated_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registrations.md", "original_file_path": "models\\sources\\patient_program_registrations.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registrations__deactivated_date", "block_contents": "The date that the patient from the program registry."}, "doc.tamanu_source_dbt.table__patient_program_registration_conditions": {"name": "table__patient_program_registration_conditions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.table__patient_program_registration_conditions", "block_contents": "Table of conditions related to patients in a program registration."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id": {"name": "patient_program_registration_conditions__program_registry_condition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_id", "block_contents": "Reference to the [Program Registry Condition](#!/source/source.tamanu.tamanu.program_registry_conditions)."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id": {"name": "patient_program_registration_conditions__clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__clinician_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) recording that condition."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id": {"name": "patient_program_registration_conditions__deletion_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__deletion_clinician_id", "block_contents": "Reference to the [Clinician](#!/source/source.tamanu.tamanu.users) that removed the condition."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change": {"name": "patient_program_registration_conditions__reason_for_change", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__reason_for_change", "block_contents": "Optional field for recording the reason for changing the condition."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__condition": {"name": "patient_program_registration_conditions__condition", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__condition", "block_contents": ""}, "doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id": {"name": "patient_program_registration_conditions__patient_program_registration_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__patient_program_registration_id", "block_contents": "Reference to the [Patient Program Registry](#!/source/source.tamanu.tamanu.patient_program_registrations)\r\nof the condition."}, "doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id": {"name": "patient_program_registration_conditions__program_registry_condition_category_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_program_registration_conditions.md", "original_file_path": "models\\sources\\patient_program_registration_conditions.md", "unique_id": "doc.tamanu_source_dbt.patient_program_registration_conditions__program_registry_condition_category_id", "block_contents": "Reference to the [Program Registry Condition Category](#!/source/source.tamanu.tamanu.program_registry_condition_categories)\r\nof the condition."}, "doc.tamanu_source_dbt.table__patient_secondary_ids": {"name": "table__patient_secondary_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_secondary_ids.md", "original_file_path": "models\\sources\\patient_secondary_ids.md", "unique_id": "doc.tamanu_source_dbt.table__patient_secondary_ids", "block_contents": "Alternative IDs to be checked for when searching for patient by ID.\r\n\r\nFor example, driver licence or passport numbers, or other national or local health numbers, if there\r\nare disparate systems or the country is in a transitional period."}, "doc.tamanu_source_dbt.patient_secondary_ids__value": {"name": "patient_secondary_ids__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_secondary_ids.md", "original_file_path": "models\\sources\\patient_secondary_ids.md", "unique_id": "doc.tamanu_source_dbt.patient_secondary_ids__value", "block_contents": "Value of the identifier."}, "doc.tamanu_source_dbt.patient_secondary_ids__type_id": {"name": "patient_secondary_ids__type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_secondary_ids.md", "original_file_path": "models\\sources\\patient_secondary_ids.md", "unique_id": "doc.tamanu_source_dbt.patient_secondary_ids__type_id", "block_contents": "Reference to [Reference Data](#!/source/source.tamanu.tamanu.reference_data)\r\nwith `type=secondaryIdType`."}, "doc.tamanu_source_dbt.patient_secondary_ids__patient_id": {"name": "patient_secondary_ids__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_secondary_ids.md", "original_file_path": "models\\sources\\patient_secondary_ids.md", "unique_id": "doc.tamanu_source_dbt.patient_secondary_ids__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients).\r\n\r\nThere may be zero or more `patient_secondary_ids` per patient."}, "doc.tamanu_source_dbt.table__patient_vrs_data": {"name": "table__patient_vrs_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.table__patient_vrs_data", "block_contents": "Data for Fiji's VRS integration only."}, "doc.tamanu_source_dbt.patient_vrs_data__id_type": {"name": "patient_vrs_data__id_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__id_type", "block_contents": "TBC"}, "doc.tamanu_source_dbt.patient_vrs_data__identifier": {"name": "patient_vrs_data__identifier", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__identifier", "block_contents": "TBC"}, "doc.tamanu_source_dbt.patient_vrs_data__unmatched_village_name": {"name": "patient_vrs_data__unmatched_village_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__unmatched_village_name", "block_contents": "if we don't have a matching village, persist the unmatched name here"}, "doc.tamanu_source_dbt.patient_vrs_data__patient_id": {"name": "patient_vrs_data__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.patient_vrs_data__is_deleted_by_remote": {"name": "patient_vrs_data__is_deleted_by_remote", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\patient_vrs_data.md", "original_file_path": "models\\sources\\patient_vrs_data.md", "unique_id": "doc.tamanu_source_dbt.patient_vrs_data__is_deleted_by_remote", "block_contents": "TBC"}, "doc.tamanu_source_dbt.table__permissions": {"name": "table__permissions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.table__permissions", "block_contents": "These are associations of permissions to roles.\r\n\r\nPermissions are modeled on the concept of a sentence like\r\n\r\n```\r\nROLE can VERB the NOUN\r\nROLE can VERB the NOUN which is specifically the OBJECT ID\r\n```\r\n\r\nSee also the [`roles`](#!/source/source.tamanu.tamanu.roles) and\r\n[`users`](#!/source/source.tamanu.tamanu.users) tables."}, "doc.tamanu_source_dbt.permissions__role_id": {"name": "permissions__role_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.permissions__role_id", "block_contents": "The [`role`](#!/source/source.tamanu.tamanu.roles) authorised for this permission."}, "doc.tamanu_source_dbt.permissions__noun": {"name": "permissions__noun", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.permissions__noun", "block_contents": "The subject of the action/permission, usually the model or resource being affected.\r\n\r\nNouns are defined in `PascalCase` and are singular."}, "doc.tamanu_source_dbt.permissions__verb": {"name": "permissions__verb", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.permissions__verb", "block_contents": "The action verb for this permission.\r\n\r\nSome common verbs include: `create`, `read`, `write`, `list`."}, "doc.tamanu_source_dbt.permissions__object_id": {"name": "permissions__object_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\permissions.md", "original_file_path": "models\\sources\\permissions.md", "unique_id": "doc.tamanu_source_dbt.permissions__object_id", "block_contents": "An optional object ID to specialise the permission.\r\n\r\nIf this is not set the permission is generally for the entire class of objects, if it _is_ set then\r\nthe permission is _only_ for the specific object."}, "doc.tamanu_source_dbt.table__pharmacy_orders": {"name": "table__pharmacy_orders", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.table__pharmacy_orders", "block_contents": "An order for prescriptions placed by Tamanu to a Pharmacy"}, "doc.tamanu_source_dbt.pharmacy_orders__ordering_clinician_id": {"name": "pharmacy_orders__ordering_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__ordering_clinician_id", "block_contents": "Reference to the [clinician](#!/source/source.tamanu.tamanu.users) who placed the order."}, "doc.tamanu_source_dbt.pharmacy_orders__encounter_id": {"name": "pharmacy_orders__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) for the order."}, "doc.tamanu_source_dbt.pharmacy_orders__comments": {"name": "pharmacy_orders__comments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__comments", "block_contents": "Comments provided by the clinician when placing the order."}, "doc.tamanu_source_dbt.pharmacy_orders__is_discharge_prescription": {"name": "pharmacy_orders__is_discharge_prescription", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__is_discharge_prescription", "block_contents": "If the patient is being discharged with this prescription."}, "doc.tamanu_source_dbt.pharmacy_orders__facility_id": {"name": "pharmacy_orders__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_orders.md", "original_file_path": "models\\sources\\pharmacy_orders.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_orders__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) where the pharmacy order was placed."}, "doc.tamanu_source_dbt.table__pharmacy_order_prescriptions": {"name": "table__pharmacy_order_prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__pharmacy_order_prescriptions", "block_contents": "Individual prescriptions that are included in a [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders)."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__pharmacy_order_id": {"name": "pharmacy_order_prescriptions__pharmacy_order_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__pharmacy_order_id", "block_contents": "Reference to the [pharmacy_order](#!/source/source.tamanu.tamanu.pharmacy_orders)."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__prescription_id": {"name": "pharmacy_order_prescriptions__prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__prescription_id", "block_contents": "Reference to the [prescription](#!/source/source.tamanu.tamanu.prescriptions)."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__ongoing_prescription_id": {"name": "pharmacy_order_prescriptions__ongoing_prescription_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__ongoing_prescription_id", "block_contents": "When this pharmacy order prescription was created from an ongoing prescription (send to pharmacy flow), references the ongoing [prescription](#!/source/source.tamanu.tamanu.prescriptions). Null for encounter-based pharmacy orders."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__display_id": {"name": "pharmacy_order_prescriptions__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__display_id", "block_contents": "Human-readable request number for this prescription order. A new request number is generated each time a prescription is sent to pharmacy."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__quantity": {"name": "pharmacy_order_prescriptions__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__quantity", "block_contents": "Quantity of medication ordered."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__repeats": {"name": "pharmacy_order_prescriptions__repeats", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__repeats", "block_contents": "Number of repeats for the prescription."}, "doc.tamanu_source_dbt.pharmacy_order_prescriptions__is_completed": {"name": "pharmacy_order_prescriptions__is_completed", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\pharmacy_order_prescriptions.md", "original_file_path": "models\\sources\\pharmacy_order_prescriptions.md", "unique_id": "doc.tamanu_source_dbt.pharmacy_order_prescriptions__is_completed", "block_contents": "Indicates whether this prescription has been fully completed. Set to `true` when all repeats have been dispensed for a discharge prescription (outpatient medication). Used to filter completed prescriptions from active medication request lists."}, "doc.tamanu_source_dbt.table__portal_one_time_tokens": {"name": "table__portal_one_time_tokens", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.table__portal_one_time_tokens", "block_contents": "A table that stores one-time tokens for portal users. These tokens are used for secure operations such as login, password reset, and other temporary authentication requirements. Each token is associated with a specific portal user and has an expiration date."}, "doc.tamanu_source_dbt.portal_one_time_tokens__portal_user_id": {"name": "portal_one_time_tokens__portal_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.portal_one_time_tokens__portal_user_id", "block_contents": "Foreign key that references the id of the portal user to whom this token belongs. When the user is deleted, all associated tokens are automatically deleted (CASCADE)."}, "doc.tamanu_source_dbt.portal_one_time_tokens__type": {"name": "portal_one_time_tokens__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.portal_one_time_tokens__type", "block_contents": "Specifies the purpose of the token\r\nOne of:\r\n- `login` (default)\r\n- `password-reset`"}, "doc.tamanu_source_dbt.portal_one_time_tokens__token": {"name": "portal_one_time_tokens__token", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.portal_one_time_tokens__token", "block_contents": "The unique, secure token string that is used for verification. This token should be generated with strong cryptographic methods to ensure security."}, "doc.tamanu_source_dbt.portal_one_time_tokens__expires_at": {"name": "portal_one_time_tokens__expires_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_one_time_tokens.md", "original_file_path": "models\\sources\\portal_one_time_tokens.md", "unique_id": "doc.tamanu_source_dbt.portal_one_time_tokens__expires_at", "block_contents": "The timestamp at which this token expires and becomes invalid. Tokens should have a limited lifespan appropriate to their purpose, typically ranging from a few minutes to 24 hours depending on the token type."}, "doc.tamanu_source_dbt.table__portal_survey_assignments": {"name": "table__portal_survey_assignments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.table__portal_survey_assignments", "block_contents": "Assignments of surveys to patients for completion through the patient portal.\r\n\r\nThis table tracks which surveys have been assigned to which patients for self-completion through\r\nthe patient portal application. Patients can log into the portal to view their assigned surveys\r\nand complete them independently. Surveys can be assigned to patients for various purposes such as\r\nhealth assessments, follow-up questionnaires, or program evaluations."}, "doc.tamanu_source_dbt.portal_survey_assignments__patient_id": {"name": "portal_survey_assignments__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) who has been assigned the survey."}, "doc.tamanu_source_dbt.portal_survey_assignments__survey_id": {"name": "portal_survey_assignments__survey_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__survey_id", "block_contents": "Reference to the [survey](#!/source/source.tamanu.tamanu.surveys) that has been assigned to the patient."}, "doc.tamanu_source_dbt.portal_survey_assignments__status": {"name": "portal_survey_assignments__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__status", "block_contents": "The current status of the survey assignment in the patient portal.\r\n\r\nOne of:\r\n- `assigned` - Survey has been assigned but the patient has not yet started it in the portal\r\n- `in_progress` - Patient has started the survey in the portal but not completed it\r\n- `completed` - Survey has been fully completed by the patient through the portal\r\n- `expired` - Survey assignment has expired and can no longer be completed in the portal"}, "doc.tamanu_source_dbt.portal_survey_assignments__assigned_by_id": {"name": "portal_survey_assignments__assigned_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__assigned_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who assigned the survey to the patient."}, "doc.tamanu_source_dbt.portal_survey_assignments__survey_response_id": {"name": "portal_survey_assignments__survey_response_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__survey_response_id", "block_contents": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) containing the patient's answers from the portal.\r\n\r\nThis field is only populated when the survey has been completed through the patient portal and a response has been recorded."}, "doc.tamanu_source_dbt.portal_survey_assignments__assigned_at": {"name": "portal_survey_assignments__assigned_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__assigned_at", "block_contents": "Timestamp when the survey was assigned to the patient for completion through the patient portal.\r\n\r\nThis field is provided a value by the Tamanu web frontend when a survey assignment is created."}, "doc.tamanu_source_dbt.portal_survey_assignments__facility_id": {"name": "portal_survey_assignments__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_survey_assignments.md", "original_file_path": "models\\sources\\portal_survey_assignments.md", "unique_id": "doc.tamanu_source_dbt.portal_survey_assignments__facility_id", "block_contents": "The facility that the survey was assigned from"}, "doc.tamanu_source_dbt.table__portal_users": {"name": "table__portal_users", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_users.md", "original_file_path": "models\\sources\\portal_users.md", "unique_id": "doc.tamanu_source_dbt.table__portal_users", "block_contents": "This table manages user accounts for patients who can access the patient portal. It establishes the relationship between patients and their portal login credentials, tracking their registration status and access permissions. Each record represents a patient's portal account with authentication and role information."}, "doc.tamanu_source_dbt.portal_users__patient_id": {"name": "portal_users__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_users.md", "original_file_path": "models\\sources\\portal_users.md", "unique_id": "doc.tamanu_source_dbt.portal_users__patient_id", "block_contents": "Foreign key reference to the patients table. Links the portal user account to a specific patient record in the system. This field is required and establishes the one-to-one relationship between a patient and their portal access."}, "doc.tamanu_source_dbt.portal_users__email": {"name": "portal_users__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_users.md", "original_file_path": "models\\sources\\portal_users.md", "unique_id": "doc.tamanu_source_dbt.portal_users__email", "block_contents": "Unique email address used for patient portal authentication and communication. This serves as the primary identifier for login purposes and must be unique across all patient portal accounts. The field is optional to allow for patients who may not have email addresses, or who have not yet completed the\r\nregistration flow."}, "doc.tamanu_source_dbt.portal_users__status": {"name": "portal_users__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\portal_users.md", "original_file_path": "models\\sources\\portal_users.md", "unique_id": "doc.tamanu_source_dbt.portal_users__status", "block_contents": "Current registration status of the patient portal account. Possible values are 'pending' (default, when account is first created) and 'registered' (when patient has completed the registration process). This field tracks the progression of patient portal onboarding and account activation."}, "doc.tamanu_source_dbt.table__prescriptions": {"name": "table__prescriptions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.table__prescriptions", "block_contents": "Records prescriptions for medications."}, "doc.tamanu_source_dbt.prescriptions__end_date": {"name": "prescriptions__end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__end_date", "block_contents": "When the prescription ends."}, "doc.tamanu_source_dbt.prescriptions__indication": {"name": "prescriptions__indication", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__indication", "block_contents": "The [indication of use](https://en.wikipedia.org/wiki/Indication_(medicine)) for the medicine."}, "doc.tamanu_source_dbt.prescriptions__route": {"name": "prescriptions__route", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__route", "block_contents": "Administration route for the medication."}, "doc.tamanu_source_dbt.prescriptions__medication_id": {"name": "prescriptions__medication_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__medication_id", "block_contents": "The medication ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`)."}, "doc.tamanu_source_dbt.prescriptions__prescriber_id": {"name": "prescriptions__prescriber_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__prescriber_id", "block_contents": "[Who](#!/source/source.tamanu.tamanu.users) prescribed the medication."}, "doc.tamanu_source_dbt.prescriptions__notes": {"name": "prescriptions__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__notes", "block_contents": "Free-form note about the prescription."}, "doc.tamanu_source_dbt.prescriptions__quantity": {"name": "prescriptions__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__quantity", "block_contents": "Quantity of medicine to dispense."}, "doc.tamanu_source_dbt.prescriptions__discontinued": {"name": "prescriptions__discontinued", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__discontinued", "block_contents": "Whether the prescription was discontinued."}, "doc.tamanu_source_dbt.prescriptions__discontinuing_clinician_id": {"name": "prescriptions__discontinuing_clinician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__discontinuing_clinician_id", "block_contents": "If the prescription was discontinued, who did it."}, "doc.tamanu_source_dbt.prescriptions__discontinuing_reason": {"name": "prescriptions__discontinuing_reason", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__discontinuing_reason", "block_contents": "If the prescription was discontinued, why that happened."}, "doc.tamanu_source_dbt.prescriptions__repeats": {"name": "prescriptions__repeats", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__repeats", "block_contents": "How many times this prescription can be repeatedly dispensed without a new prescription."}, "doc.tamanu_source_dbt.prescriptions__discontinued_date": {"name": "prescriptions__discontinued_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__discontinued_date", "block_contents": "If the prescription was discontinued, when that happened."}, "doc.tamanu_source_dbt.prescriptions__end_date_legacy": {"name": "prescriptions__end_date_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__end_date_legacy", "block_contents": "[Deprecated] When the prescription ends."}, "doc.tamanu_source_dbt.prescriptions__is_ongoing": {"name": "prescriptions__is_ongoing", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__is_ongoing", "block_contents": "A flag to determine whether or not the current prescription is ongoing"}, "doc.tamanu_source_dbt.prescriptions__is_prn": {"name": "prescriptions__is_prn", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__is_prn", "block_contents": "A flag to determine whether or not the current prescription is prn"}, "doc.tamanu_source_dbt.prescriptions__is_variable_dose": {"name": "prescriptions__is_variable_dose", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__is_variable_dose", "block_contents": "A flag to determine whether or not the current prescription is variable does"}, "doc.tamanu_source_dbt.prescriptions__dose_amount": {"name": "prescriptions__dose_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__dose_amount", "block_contents": "Numeric field to record dose amount"}, "doc.tamanu_source_dbt.prescriptions__units": {"name": "prescriptions__units", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__units", "block_contents": "The units of the prescription"}, "doc.tamanu_source_dbt.prescriptions__frequency": {"name": "prescriptions__frequency", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__frequency", "block_contents": "The frequency of the prescription"}, "doc.tamanu_source_dbt.prescriptions__start_date": {"name": "prescriptions__start_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__start_date", "block_contents": "The start date of the prescription"}, "doc.tamanu_source_dbt.prescriptions__duration_value": {"name": "prescriptions__duration_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__duration_value", "block_contents": "The duration value of the prescription"}, "doc.tamanu_source_dbt.prescriptions__duration_unit": {"name": "prescriptions__duration_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__duration_unit", "block_contents": "The duration unit of the prescription"}, "doc.tamanu_source_dbt.prescriptions__is_phone_order": {"name": "prescriptions__is_phone_order", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__is_phone_order", "block_contents": "A flag to determine whether or not the current prescription is phone order"}, "doc.tamanu_source_dbt.prescriptions__ideal_times": {"name": "prescriptions__ideal_times", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__ideal_times", "block_contents": "Ideal times which are specified by prescriber"}, "doc.tamanu_source_dbt.prescriptions__pharmacy_notes": {"name": "prescriptions__pharmacy_notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__pharmacy_notes", "block_contents": "Free-form pharmacy note of the prescription."}, "doc.tamanu_source_dbt.prescriptions__display_pharmacy_notes_in_mar": {"name": "prescriptions__display_pharmacy_notes_in_mar", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\prescriptions.md", "original_file_path": "models\\sources\\prescriptions.md", "unique_id": "doc.tamanu_source_dbt.prescriptions__display_pharmacy_notes_in_mar", "block_contents": "A flag to determine whether to display 'Pharmacy notes' on the medication administration record"}, "doc.tamanu_source_dbt.table__procedures": {"name": "table__procedures", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.table__procedures", "block_contents": "Record of each procedure in progress or completed."}, "doc.tamanu_source_dbt.procedures__completed": {"name": "procedures__completed", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__completed", "block_contents": "Whether the procedure has completed."}, "doc.tamanu_source_dbt.procedures__end_time": {"name": "procedures__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__end_time", "block_contents": "When the procedure ended, if it's completed."}, "doc.tamanu_source_dbt.procedures__note": {"name": "procedures__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__note", "block_contents": "Free-form description of the procedure."}, "doc.tamanu_source_dbt.procedures__completed_note": {"name": "procedures__completed_note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__completed_note", "block_contents": "Free-form notes at completion of the procedure."}, "doc.tamanu_source_dbt.procedures__encounter_id": {"name": "procedures__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__encounter_id", "block_contents": "The [encounter](#!/source/source.tamanu.tamanu.encounters) this procedure is a part of."}, "doc.tamanu_source_dbt.procedures__location_id": {"name": "procedures__location_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__location_id", "block_contents": "Reference to the [location](#!/source/source.tamanu.tamanu.locations) the procedure happens in."}, "doc.tamanu_source_dbt.procedures__procedure_type_id": {"name": "procedures__procedure_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__procedure_type_id", "block_contents": "Reference to the procedure type ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = procedureType`)."}, "doc.tamanu_source_dbt.procedures__anaesthetic_id": {"name": "procedures__anaesthetic_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__anaesthetic_id", "block_contents": "Reference to the anaesthetic ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`)."}, "doc.tamanu_source_dbt.procedures__physician_id": {"name": "procedures__physician_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__physician_id", "block_contents": "Reference to the [physician](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.procedures__anaesthetist_id": {"name": "procedures__anaesthetist_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__anaesthetist_id", "block_contents": "Reference to the [anaesthetist](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.procedures__start_time": {"name": "procedures__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__start_time", "block_contents": "When the procedure started."}, "doc.tamanu_source_dbt.procedures__start_time_legacy": {"name": "procedures__start_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__start_time_legacy", "block_contents": "[Deprecated] When the procedure started."}, "doc.tamanu_source_dbt.procedures__end_time_legacy": {"name": "procedures__end_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__end_time_legacy", "block_contents": "[Deprecated] When the procedure ended."}, "doc.tamanu_source_dbt.procedures__department_id": {"name": "procedures__department_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__department_id", "block_contents": "Reference to the [department](#!/source/source.tamanu.tamanu.departments) where the procedure is performed."}, "doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id": {"name": "procedures__assistant_anaesthetist_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__assistant_anaesthetist_id", "block_contents": "Reference to the assistant [anaesthetist](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.procedures__time_in": {"name": "procedures__time_in", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__time_in", "block_contents": "The time when the patient entered the procedure room or when the procedure setup began."}, "doc.tamanu_source_dbt.procedures__time_out": {"name": "procedures__time_out", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedures.md", "original_file_path": "models\\sources\\procedures.md", "unique_id": "doc.tamanu_source_dbt.procedures__time_out", "block_contents": "The time when the patient left the procedure room or when the procedure cleanup was completed."}, "doc.tamanu_source_dbt.table__procedure_assistant_clinicians": {"name": "table__procedure_assistant_clinicians", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_assistant_clinicians.md", "original_file_path": "models\\sources\\procedure_assistant_clinicians.md", "unique_id": "doc.tamanu_source_dbt.table__procedure_assistant_clinicians", "block_contents": "Junction table that links procedures to their assistant clinicians. Records which users served as assistant clinicians for specific procedures."}, "doc.tamanu_source_dbt.procedure_assistant_clinicians__procedure_id": {"name": "procedure_assistant_clinicians__procedure_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_assistant_clinicians.md", "original_file_path": "models\\sources\\procedure_assistant_clinicians.md", "unique_id": "doc.tamanu_source_dbt.procedure_assistant_clinicians__procedure_id", "block_contents": "Reference to the [procedure](#!/source/source.tamanu.tamanu.procedures) this assistant clinician is associated with."}, "doc.tamanu_source_dbt.procedure_assistant_clinicians__user_id": {"name": "procedure_assistant_clinicians__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_assistant_clinicians.md", "original_file_path": "models\\sources\\procedure_assistant_clinicians.md", "unique_id": "doc.tamanu_source_dbt.procedure_assistant_clinicians__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who served as an assistant clinician for the procedure."}, "doc.tamanu_source_dbt.table__procedure_survey_responses": {"name": "table__procedure_survey_responses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_survey_responses.md", "original_file_path": "models\\sources\\procedure_survey_responses.md", "unique_id": "doc.tamanu_source_dbt.table__procedure_survey_responses", "block_contents": "Junction table linking procedures to their associated survey responses."}, "doc.tamanu_source_dbt.procedure_survey_responses__procedure_id": {"name": "procedure_survey_responses__procedure_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_survey_responses.md", "original_file_path": "models\\sources\\procedure_survey_responses.md", "unique_id": "doc.tamanu_source_dbt.procedure_survey_responses__procedure_id", "block_contents": "Reference to the [procedure](#!/source/source.tamanu.tamanu.procedures) this survey response is associated with."}, "doc.tamanu_source_dbt.procedure_survey_responses__survey_response_id": {"name": "procedure_survey_responses__survey_response_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_survey_responses.md", "original_file_path": "models\\sources\\procedure_survey_responses.md", "unique_id": "doc.tamanu_source_dbt.procedure_survey_responses__survey_response_id", "block_contents": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) linked to the procedure."}, "doc.tamanu_source_dbt.table__procedure_type_surveys": {"name": "table__procedure_type_surveys", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_type_surveys.md", "original_file_path": "models\\sources\\procedure_type_surveys.md", "unique_id": "doc.tamanu_source_dbt.table__procedure_type_surveys", "block_contents": "Association between procedure types and surveys\r\n\r\nThis link is used to populate an embedded survey in the procedure modal"}, "doc.tamanu_source_dbt.procedure_type_surveys__procedure_type_id": {"name": "procedure_type_surveys__procedure_type_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_type_surveys.md", "original_file_path": "models\\sources\\procedure_type_surveys.md", "unique_id": "doc.tamanu_source_dbt.procedure_type_surveys__procedure_type_id", "block_contents": "Reference to a [Reference Data](#!/source/source.tamanu.tamanu.reference_data) (`type=procedureType`)"}, "doc.tamanu_source_dbt.procedure_type_surveys__survey_id": {"name": "procedure_type_surveys__survey_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\procedure_type_surveys.md", "original_file_path": "models\\sources\\procedure_type_surveys.md", "unique_id": "doc.tamanu_source_dbt.procedure_type_surveys__survey_id", "block_contents": "Reference to a [survey](#!/source/source.tamanu.tamanu.surveys)."}, "doc.tamanu_source_dbt.table__programs": {"name": "table__programs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\programs.md", "original_file_path": "models\\sources\\programs.md", "unique_id": "doc.tamanu_source_dbt.table__programs", "block_contents": "Groups of [surveys](#!/source/source.tamanu.tamanu.surveys) or [program registries](#!/source/source.tamanu.tamanu.program_registries)."}, "doc.tamanu_source_dbt.programs__code": {"name": "programs__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\programs.md", "original_file_path": "models\\sources\\programs.md", "unique_id": "doc.tamanu_source_dbt.programs__code", "block_contents": "Machine-friendly code."}, "doc.tamanu_source_dbt.programs__name": {"name": "programs__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\programs.md", "original_file_path": "models\\sources\\programs.md", "unique_id": "doc.tamanu_source_dbt.programs__name", "block_contents": "Human-friendly name."}, "doc.tamanu_source_dbt.table__program_data_elements": {"name": "table__program_data_elements", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.table__program_data_elements", "block_contents": "Describes how a survey question gets stored.\r\n\r\nSee [survey screen components](#!/source/source.tamanu.tamanu.survey_screen_components), which\r\ndescribes how the question is displayed."}, "doc.tamanu_source_dbt.program_data_elements__code": {"name": "program_data_elements__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__code", "block_contents": "Machine-friendly short name for the question.\r\n\r\nThis is also used to refer to questions within criteria and such."}, "doc.tamanu_source_dbt.program_data_elements__name": {"name": "program_data_elements__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__name", "block_contents": "Human-friendly name"}, "doc.tamanu_source_dbt.program_data_elements__indicator": {"name": "program_data_elements__indicator", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__indicator", "block_contents": "Another name for the data element.\r\n\r\nIt's named `indicator` from mimicry of Tupaia."}, "doc.tamanu_source_dbt.program_data_elements__default_text": {"name": "program_data_elements__default_text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__default_text", "block_contents": "Default value."}, "doc.tamanu_source_dbt.program_data_elements__default_options": {"name": "program_data_elements__default_options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__default_options", "block_contents": "Default options if this is a dropdown."}, "doc.tamanu_source_dbt.program_data_elements__type": {"name": "program_data_elements__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__type", "block_contents": "Type of the field.\r\n\r\nTypes are here: "}, "doc.tamanu_source_dbt.program_data_elements__visualisation_config": {"name": "program_data_elements__visualisation_config", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_data_elements.md", "original_file_path": "models\\sources\\program_data_elements.md", "unique_id": "doc.tamanu_source_dbt.program_data_elements__visualisation_config", "block_contents": "JSON visualisation configuration."}, "doc.tamanu_source_dbt.table__program_registries": {"name": "table__program_registries", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.table__program_registries", "block_contents": "Table of program registries.\r\n\r\nThis provides functionality to track a patient population defined by a particular disease or\r\ncondition, and follow this population over time.\r\n\r\nThis table defines the different registries available to track users with."}, "doc.tamanu_source_dbt.program_registries__code": {"name": "program_registries__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.program_registries__code", "block_contents": "Machine-friendly identifier."}, "doc.tamanu_source_dbt.program_registries__name": {"name": "program_registries__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.program_registries__name", "block_contents": "Human-friendly name."}, "doc.tamanu_source_dbt.program_registries__currently_at_type": {"name": "program_registries__currently_at_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.program_registries__currently_at_type", "block_contents": "Defines what kind of location the registry can be filtered with.\r\n\r\nOne of:\r\n- `village`\r\n- `facility`"}, "doc.tamanu_source_dbt.program_registries__program_id": {"name": "program_registries__program_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registries.md", "original_file_path": "models\\sources\\program_registries.md", "unique_id": "doc.tamanu_source_dbt.program_registries__program_id", "block_contents": "Reference to a [program](#!/source/source.tamanu.tamanu.programs)."}, "doc.tamanu_source_dbt.table__program_registry_clinical_statuses": {"name": "table__program_registry_clinical_statuses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.table__program_registry_clinical_statuses", "block_contents": "Table of clinical statuses used in program registries."}, "doc.tamanu_source_dbt.program_registry_clinical_statuses__code": {"name": "program_registry_clinical_statuses__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.program_registry_clinical_statuses__code", "block_contents": "Code (identifier) for the clinical status."}, "doc.tamanu_source_dbt.program_registry_clinical_statuses__name": {"name": "program_registry_clinical_statuses__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.program_registry_clinical_statuses__name", "block_contents": "The name of the clinical status."}, "doc.tamanu_source_dbt.program_registry_clinical_statuses__color": {"name": "program_registry_clinical_statuses__color", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.program_registry_clinical_statuses__color", "block_contents": "A color for the clinical status.\r\n\r\nOne of:\r\n- `purple`\r\n- `pink`\r\n- `orange`\r\n- `yellow`\r\n- `blue`\r\n- `green`\r\n- `grey`\r\n- `red`\r\n- `brown`\r\n- `teal`"}, "doc.tamanu_source_dbt.program_registry_clinical_statuses__program_registry_id": {"name": "program_registry_clinical_statuses__program_registry_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_clinical_statuses.md", "original_file_path": "models\\sources\\program_registry_clinical_statuses.md", "unique_id": "doc.tamanu_source_dbt.program_registry_clinical_statuses__program_registry_id", "block_contents": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe status is a part of."}, "doc.tamanu_source_dbt.table__program_registry_conditions": {"name": "table__program_registry_conditions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_conditions.md", "original_file_path": "models\\sources\\program_registry_conditions.md", "unique_id": "doc.tamanu_source_dbt.table__program_registry_conditions", "block_contents": "Table of program registry conditions."}, "doc.tamanu_source_dbt.program_registry_conditions__code": {"name": "program_registry_conditions__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_conditions.md", "original_file_path": "models\\sources\\program_registry_conditions.md", "unique_id": "doc.tamanu_source_dbt.program_registry_conditions__code", "block_contents": "Code (identifier) for the condition."}, "doc.tamanu_source_dbt.program_registry_conditions__name": {"name": "program_registry_conditions__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_conditions.md", "original_file_path": "models\\sources\\program_registry_conditions.md", "unique_id": "doc.tamanu_source_dbt.program_registry_conditions__name", "block_contents": "The name of the condition."}, "doc.tamanu_source_dbt.program_registry_conditions__program_registry_id": {"name": "program_registry_conditions__program_registry_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_conditions.md", "original_file_path": "models\\sources\\program_registry_conditions.md", "unique_id": "doc.tamanu_source_dbt.program_registry_conditions__program_registry_id", "block_contents": "Reference to the [Program Registry](#!/source/source.tamanu.tamanu.program_registries)\r\nthe condition is a part of."}, "doc.tamanu_source_dbt.table__program_registry_condition_categories": {"name": "table__program_registry_condition_categories", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_condition_categories.md", "original_file_path": "models\\sources\\program_registry_condition_categories.md", "unique_id": "doc.tamanu_source_dbt.table__program_registry_condition_categories", "block_contents": "Categories to be set against patient program registry conditions. The categories are configured through the program importer for each program registry. There is a hard-loaded list that is seeded by default in the database for each program registry."}, "doc.tamanu_source_dbt.program_registry_condition_categories__code": {"name": "program_registry_condition_categories__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_condition_categories.md", "original_file_path": "models\\sources\\program_registry_condition_categories.md", "unique_id": "doc.tamanu_source_dbt.program_registry_condition_categories__code", "block_contents": "The code for the category."}, "doc.tamanu_source_dbt.program_registry_condition_categories__name": {"name": "program_registry_condition_categories__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_condition_categories.md", "original_file_path": "models\\sources\\program_registry_condition_categories.md", "unique_id": "doc.tamanu_source_dbt.program_registry_condition_categories__name", "block_contents": "The name for the category."}, "doc.tamanu_source_dbt.program_registry_condition_categories__program_registry_id": {"name": "program_registry_condition_categories__program_registry_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\program_registry_condition_categories.md", "original_file_path": "models\\sources\\program_registry_condition_categories.md", "unique_id": "doc.tamanu_source_dbt.program_registry_condition_categories__program_registry_id", "block_contents": "The id of the program registry."}, "doc.tamanu_source_dbt.table__reference_data": {"name": "table__reference_data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.table__reference_data", "block_contents": "User imported reference data for the environment grouped by type.\r\n\r\n- Catch-all for simple reference data types - there are a LOT of kinds of reference data that exist as just an ID, a \r\nstring label, and occasionally a code; these are all grouped into this table to avoid overcomplicating the schema.\r\n- Occasionally a type of simple reference data will gain some complexity, at which point it will be refactored/migrated \r\nout to use its own table.\r\n- Simple reference data types include a code, type, name and visibility status.\r\n- Example types include `diagnosis`, `procedures`"}, "doc.tamanu_source_dbt.reference_data__code": {"name": "reference_data__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.reference_data__code", "block_contents": "Code of the data item (short value, alphanumerics and hyphens)."}, "doc.tamanu_source_dbt.reference_data__type": {"name": "reference_data__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.reference_data__type", "block_contents": "Class of the data (referred to in code).\r\n\r\nWhenever this table is referred to in a relationship, it's to a specific `type` here. For example a\r\ntable might have a `diagnosis_id`, which is a reference to this table, for specifically only the\r\nrows with `type = diagnosis`."}, "doc.tamanu_source_dbt.reference_data__name": {"name": "reference_data__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.reference_data__name", "block_contents": "Actual data"}, "doc.tamanu_source_dbt.reference_data__system_required": {"name": "reference_data__system_required", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data.md", "original_file_path": "models\\sources\\reference_data.md", "unique_id": "doc.tamanu_source_dbt.reference_data__system_required", "block_contents": "Indicates if this record is system-managed and cannot be modified by users"}, "doc.tamanu_source_dbt.table__reference_data_relations": {"name": "table__reference_data_relations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data_relations.md", "original_file_path": "models\\sources\\reference_data_relations.md", "unique_id": "doc.tamanu_source_dbt.table__reference_data_relations", "block_contents": "Entity hierarchy for reference data.\r\n\r\nSome reference datas can be organised in a hierarchy. This is how that's done."}, "doc.tamanu_source_dbt.reference_data_relations__reference_data_id": {"name": "reference_data_relations__reference_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data_relations.md", "original_file_path": "models\\sources\\reference_data_relations.md", "unique_id": "doc.tamanu_source_dbt.reference_data_relations__reference_data_id", "block_contents": "The [reference data](#!/source/source.tamanu.tamanu.reference_data) item."}, "doc.tamanu_source_dbt.reference_data_relations__reference_data_parent_id": {"name": "reference_data_relations__reference_data_parent_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data_relations.md", "original_file_path": "models\\sources\\reference_data_relations.md", "unique_id": "doc.tamanu_source_dbt.reference_data_relations__reference_data_parent_id", "block_contents": "Another [reference data](#!/source/source.tamanu.tamanu.reference_data) item which is the parent of this one."}, "doc.tamanu_source_dbt.reference_data_relations__type": {"name": "reference_data_relations__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_data_relations.md", "original_file_path": "models\\sources\\reference_data_relations.md", "unique_id": "doc.tamanu_source_dbt.reference_data_relations__type", "block_contents": "The type of hierarchy being described."}, "doc.tamanu_source_dbt.table__reference_drugs": {"name": "table__reference_drugs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.table__reference_drugs", "block_contents": "Additional information about referenceData that is of the type \u201cdrug\u201d"}, "doc.tamanu_source_dbt.reference_drugs__reference_data_id": {"name": "reference_drugs__reference_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__reference_data_id", "block_contents": "Id of the associated reference data"}, "doc.tamanu_source_dbt.reference_drugs__route": {"name": "reference_drugs__route", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__route", "block_contents": "Route of the drug"}, "doc.tamanu_source_dbt.reference_drugs__units": {"name": "reference_drugs__units", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__units", "block_contents": "Units of the drug"}, "doc.tamanu_source_dbt.reference_drugs__notes": {"name": "reference_drugs__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__notes", "block_contents": "Notes of the drug"}, "doc.tamanu_source_dbt.reference_drugs__is_sensitive": {"name": "reference_drugs__is_sensitive", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drugs.md", "original_file_path": "models\\sources\\reference_drugs.md", "unique_id": "doc.tamanu_source_dbt.reference_drugs__is_sensitive", "block_contents": "Whether the drug is sensitive and requires special handling"}, "doc.tamanu_source_dbt.table__reference_drug_facilities": {"name": "table__reference_drug_facilities", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.table__reference_drug_facilities", "block_contents": "Tracks the availability status of drugs at specific facilities.\r\n\r\n- Links reference drugs to facilities with their availability status\r\n- Allows facilities to manage which drugs are available, unavailable, or have limited stock\r\n- Used for medication dispensing workflows to determine drug availability at a facility"}, "doc.tamanu_source_dbt.reference_drug_facilities__reference_drug_id": {"name": "reference_drug_facilities__reference_drug_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.reference_drug_facilities__reference_drug_id", "block_contents": "Foreign key reference to the associated drug in the reference_drugs table"}, "doc.tamanu_source_dbt.reference_drug_facilities__facility_id": {"name": "reference_drug_facilities__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.reference_drug_facilities__facility_id", "block_contents": "Foreign key reference to the facility where this drug availability applies"}, "doc.tamanu_source_dbt.reference_drug_facilities__quantity": {"name": "reference_drug_facilities__quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.reference_drug_facilities__quantity", "block_contents": "The numeric quantity of the drug available at this facility. Stored as an INTEGER:\r\n- Positive integer: Number of units available (e.g., 10, 50, 100)\r\n- 0: Drug is out of stock\r\n- NULL: Quantity is not tracked or unknown (used when stock_status is 'unknown' or 'unavailable')"}, "doc.tamanu_source_dbt.reference_drug_facilities__stock_status": {"name": "reference_drug_facilities__stock_status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_drug_facilities.md", "original_file_path": "models\\sources\\reference_drug_facilities.md", "unique_id": "doc.tamanu_source_dbt.reference_drug_facilities__stock_status", "block_contents": "Indicates the stock availability status of the drug at this facility. Stored as a STRING with the following valid values:\r\n- 'in_stock': Drug is available (quantity > 0)\r\n- 'out_of_stock': Drug is not available but tracked (quantity = 0)\r\n- 'unavailable': Drug is not available at this facility (quantity IS NULL)\r\n- 'unknown': Stock status is unknown or not tracked (quantity IS NULL)\r\n\r\nThis column is stored separately from quantity and is enforced by database constraints to maintain consistency:\r\n- 'in_stock' requires quantity > 0\r\n- 'out_of_stock' requires quantity = 0\r\n- 'unknown' or 'unavailable' require quantity IS NULL"}, "doc.tamanu_source_dbt.table__reference_medication_templates": {"name": "table__reference_medication_templates", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.table__reference_medication_templates", "block_contents": "Stores templates for medications, allowing for pre-defined medication orders."}, "doc.tamanu_source_dbt.reference_medication_templates__reference_data_id": {"name": "reference_medication_templates__reference_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__reference_data_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) for this medication template."}, "doc.tamanu_source_dbt.reference_medication_templates__medication_id": {"name": "reference_medication_templates__medication_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__medication_id", "block_contents": "Reference to the [Reference Data](#!/source/source.tamanu.tamanu.reference_data) for the specific drug in this template."}, "doc.tamanu_source_dbt.reference_medication_templates__is_variable_dose": {"name": "reference_medication_templates__is_variable_dose", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__is_variable_dose", "block_contents": "Boolean indicating if the medication is to be administered \"pro re nata\" (as needed)."}, "doc.tamanu_source_dbt.reference_medication_templates__is_prn": {"name": "reference_medication_templates__is_prn", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__is_prn", "block_contents": "Boolean indicating if the medication dose is variable."}, "doc.tamanu_source_dbt.reference_medication_templates__dose_amount": {"name": "reference_medication_templates__dose_amount", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__dose_amount", "block_contents": "The amount of medication per dose."}, "doc.tamanu_source_dbt.reference_medication_templates__units": {"name": "reference_medication_templates__units", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__units", "block_contents": "The unit for the dose amount (e.g., mg, mL)."}, "doc.tamanu_source_dbt.reference_medication_templates__frequency": {"name": "reference_medication_templates__frequency", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__frequency", "block_contents": "How often the medication should be administered (e.g., BID, TID, QID)."}, "doc.tamanu_source_dbt.reference_medication_templates__route": {"name": "reference_medication_templates__route", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__route", "block_contents": "The route of administration for the medication (e.g., Oral, IV, IM)."}, "doc.tamanu_source_dbt.reference_medication_templates__duration_value": {"name": "reference_medication_templates__duration_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__duration_value", "block_contents": "The numeric value for the duration the medication should be taken (e.g., 7, 14)."}, "doc.tamanu_source_dbt.reference_medication_templates__duration_unit": {"name": "reference_medication_templates__duration_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__duration_unit", "block_contents": "The unit for the medication duration (e.g., days, weeks, months)."}, "doc.tamanu_source_dbt.reference_medication_templates__notes": {"name": "reference_medication_templates__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__notes", "block_contents": "Additional notes or instructions for the medication template."}, "doc.tamanu_source_dbt.reference_medication_templates__discharge_quantity": {"name": "reference_medication_templates__discharge_quantity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__discharge_quantity", "block_contents": "The quantity of medication to be dispensed upon patient discharge."}, "doc.tamanu_source_dbt.reference_medication_templates__is_ongoing": {"name": "reference_medication_templates__is_ongoing", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\reference_medication_templates.md", "original_file_path": "models\\sources\\reference_medication_templates.md", "unique_id": "doc.tamanu_source_dbt.reference_medication_templates__is_ongoing", "block_contents": "A boolean indicating if the medication is ongoing"}, "doc.tamanu_source_dbt.table__referrals": {"name": "table__referrals", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.table__referrals", "block_contents": "[Referrals](https://en.wikipedia.org/wiki/Referral_(medicine)).\r\n\r\nReferrals use a confusing mix of data in the `referrals` table and\r\n[`survey_response_answers`](#!/source/source.tamanu.tamanu.survey_response_answers) identified by\r\nthe text of the question they are for. \r\n\r\nSome additional data is captured in\r\n[survey response answers](#!/source/source.tamanu.tamanu.survey_response_answers), but this is\r\nvariable and not enforced through any validation:\r\n- Where the person is being referred to can be captured by a range of questions, sometimes with a\r\n list of hard coded facility name options, or location groups, or departments.\r\n- Who the referral is \"completed by\" can be captured by a question either the name\r\n 'Referring doctor' or 'Referral completed by'.\r\n- Some referrals are the product of a previous screening survey. In some cases (e.g. Samoa) there is\r\n a SurveyLink question that captures which survey led to this referral, in others (e.g. Nauru)\r\n there is no such question so the two survey responses cannot be reliably linked."}, "doc.tamanu_source_dbt.referrals__referred_facility": {"name": "referrals__referred_facility", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__referred_facility", "block_contents": "Unused."}, "doc.tamanu_source_dbt.referrals__initiating_encounter_id": {"name": "referrals__initiating_encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__initiating_encounter_id", "block_contents": "Reference to the [initiating encounter](#!/source/source.tamanu.tamanu.encounters)."}, "doc.tamanu_source_dbt.referrals__completing_encounter_id": {"name": "referrals__completing_encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__completing_encounter_id", "block_contents": "Unused."}, "doc.tamanu_source_dbt.referrals__survey_response_id": {"name": "referrals__survey_response_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__survey_response_id", "block_contents": "Reference to the [survey response](#!/source/source.tamanu.tamanu.survey_responses) with more data."}, "doc.tamanu_source_dbt.referrals__status": {"name": "referrals__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\referrals.md", "original_file_path": "models\\sources\\referrals.md", "unique_id": "doc.tamanu_source_dbt.referrals__status", "block_contents": "Status of the referral.\r\n\r\nOne of:\r\n- `pending`\r\n- `cancelled`\r\n- `completed`"}, "doc.tamanu_source_dbt.table__refresh_tokens": {"name": "table__refresh_tokens", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.table__refresh_tokens", "block_contents": "Refresh tokens are used by API clients to refresh their authentication quickly, within a timeout."}, "doc.tamanu_source_dbt.refresh_tokens__refresh_id": {"name": "refresh_tokens__refresh_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.refresh_tokens__refresh_id", "block_contents": "Random value given to the client to use as this refresh token."}, "doc.tamanu_source_dbt.refresh_tokens__device_id": {"name": "refresh_tokens__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.refresh_tokens__device_id", "block_contents": "Unique device ID from the client."}, "doc.tamanu_source_dbt.refresh_tokens__user_id": {"name": "refresh_tokens__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.refresh_tokens__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users) being authenticated as."}, "doc.tamanu_source_dbt.refresh_tokens__expires_at": {"name": "refresh_tokens__expires_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\refresh_tokens.md", "original_file_path": "models\\sources\\refresh_tokens.md", "unique_id": "doc.tamanu_source_dbt.refresh_tokens__expires_at", "block_contents": "When the refresh token expires."}, "doc.tamanu_source_dbt.table__report_definitions": {"name": "table__report_definitions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definitions.md", "original_file_path": "models\\sources\\report_definitions.md", "unique_id": "doc.tamanu_source_dbt.table__report_definitions", "block_contents": "A name for a report.\r\n\r\nThis is what you see when selecting a report to generate in Tamanu.\r\n\r\nThe actual data is in [versions](#!/source/source.tamanu.tamanu.report_definition_versions)."}, "doc.tamanu_source_dbt.report_definitions__name": {"name": "report_definitions__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definitions.md", "original_file_path": "models\\sources\\report_definitions.md", "unique_id": "doc.tamanu_source_dbt.report_definitions__name", "block_contents": "Human-friendly name of the report."}, "doc.tamanu_source_dbt.report_definitions__db_schema": {"name": "report_definitions__db_schema", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definitions.md", "original_file_path": "models\\sources\\report_definitions.md", "unique_id": "doc.tamanu_source_dbt.report_definitions__db_schema", "block_contents": "The name of the database schema (namespace) which is queried.\r\n\r\nDefaults to `reporting`, which are standardised and normalised views designed specifically for\r\nreporting; sometimes this is set to `public` to query the raw database directly."}, "doc.tamanu_source_dbt.table__report_definition_versions": {"name": "table__report_definition_versions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.table__report_definition_versions", "block_contents": "A report definition containing the actual executable SQL query.\r\n\r\nReport versions are immutable and changes to a report create a new version."}, "doc.tamanu_source_dbt.report_definition_versions__version_number": {"name": "report_definition_versions__version_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__version_number", "block_contents": "The version number.\r\n\r\nVersion numbers are incrementing integers i.e 1,2,3,4.\r\n\r\nThe active version is determined by the highest `status = 'published'` version number"}, "doc.tamanu_source_dbt.report_definition_versions__notes": {"name": "report_definition_versions__notes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__notes", "block_contents": "Free-form description or usage notes."}, "doc.tamanu_source_dbt.report_definition_versions__status": {"name": "report_definition_versions__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__status", "block_contents": "Status of this version of the report.\r\n\r\nOne of:\r\n- `draft`\r\n- `published`"}, "doc.tamanu_source_dbt.report_definition_versions__query": {"name": "report_definition_versions__query", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__query", "block_contents": "The SQL query."}, "doc.tamanu_source_dbt.report_definition_versions__query_options": {"name": "report_definition_versions__query_options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__query_options", "block_contents": "JSON config containing additional options for the query.\r\n\r\n- Form fields to allow customisation of the query when generating reports (query replacements)\r\n- Default date range e.g. last 30 days\r\n- Context for executing query e.g. this facility or all facilities (facility or central server)"}, "doc.tamanu_source_dbt.report_definition_versions__report_definition_id": {"name": "report_definition_versions__report_definition_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__report_definition_id", "block_contents": "The [report definition](#!/source/source.tamanu.tamanu.report_definitions)."}, "doc.tamanu_source_dbt.report_definition_versions__user_id": {"name": "report_definition_versions__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_definition_versions.md", "original_file_path": "models\\sources\\report_definition_versions.md", "unique_id": "doc.tamanu_source_dbt.report_definition_versions__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who saved this report version."}, "doc.tamanu_source_dbt.table__report_requests": {"name": "table__report_requests", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.table__report_requests", "block_contents": "Queued requests for reports by users.\r\n\r\nReports can be generated on-demand on the server a user is connected to, or it can be queued and\r\nexecuted at the server's leisure, and then sent attached to an email."}, "doc.tamanu_source_dbt.report_requests__report_type": {"name": "report_requests__report_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__report_type", "block_contents": "If the report is defined in code, this is the code of that report.\r\n\r\nMost reports are now created in SQL, but there are still a number of legacy reports that are\r\nhardcoded in the Tamanu source code, and this is how they're referenced."}, "doc.tamanu_source_dbt.report_requests__recipients": {"name": "report_requests__recipients", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__recipients", "block_contents": "JSON array of email addresses.\r\n\r\nSome legacy data may exist that specifies this as a comma-separated values."}, "doc.tamanu_source_dbt.report_requests__parameters": {"name": "report_requests__parameters", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__parameters", "block_contents": "JSON parameters for the report."}, "doc.tamanu_source_dbt.report_requests__status": {"name": "report_requests__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__status", "block_contents": "Processing status of the report request.\r\n\r\nOne of:\r\n- `Received`\r\n- `Processing`\r\n- `Processed`\r\n- `Error`"}, "doc.tamanu_source_dbt.report_requests__requested_by_user_id": {"name": "report_requests__requested_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__requested_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) requesting this report generation."}, "doc.tamanu_source_dbt.report_requests__error": {"name": "report_requests__error", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__error", "block_contents": "If the report fails to process, the error."}, "doc.tamanu_source_dbt.report_requests__process_started_time": {"name": "report_requests__process_started_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__process_started_time", "block_contents": "When processing started."}, "doc.tamanu_source_dbt.report_requests__facility_id": {"name": "report_requests__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this report request is from."}, "doc.tamanu_source_dbt.report_requests__export_format": {"name": "report_requests__export_format", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__export_format", "block_contents": "The format the report results must be exported as.\r\n\r\nOne of:\r\n- `xlsx`\r\n- `csv`"}, "doc.tamanu_source_dbt.report_requests__report_definition_version_id": {"name": "report_requests__report_definition_version_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\report_requests.md", "original_file_path": "models\\sources\\report_requests.md", "unique_id": "doc.tamanu_source_dbt.report_requests__report_definition_version_id", "block_contents": "The [report version](#!/source/source.tamanu.tamanu.report_definition_versions) being generated.\r\n\r\nNote that this is a version, not a report. If a report is updated after a request is queued, the\r\n\"old\" version will be executed. Additionally, new versions must be synced to facilities to be usable."}, "doc.tamanu_source_dbt.table__roles": {"name": "table__roles", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\roles.md", "original_file_path": "models\\sources\\roles.md", "unique_id": "doc.tamanu_source_dbt.table__roles", "block_contents": "These are sets of permissions that are given to users to determine what they can do in Tamanu.\r\n\r\nThe actual permissions are associated to the role in the\r\n[`permissions`](#!/source/source.tamanu.tamanu.permissions) table."}, "doc.tamanu_source_dbt.roles__name": {"name": "roles__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\roles.md", "original_file_path": "models\\sources\\roles.md", "unique_id": "doc.tamanu_source_dbt.roles__name", "block_contents": "Readable name for the role."}, "doc.tamanu_source_dbt.table__scheduled_vaccines": {"name": "table__scheduled_vaccines", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.table__scheduled_vaccines", "block_contents": "A vaccine schedule listing all vaccines expected to be given to a child as part of a country wide Expanded Program of \r\nImmunisation can be incorporated into Tamanu to show each dose and due date on the front end of the system. \r\n\r\nFirst dose of a vaccine should use `weeks_from_birth_due` whilst subsequent doses should use \r\n`weeks_from_last_vaccination_due`."}, "doc.tamanu_source_dbt.scheduled_vaccines__id": {"name": "scheduled_vaccines__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__id", "block_contents": "Tamanu identifier for vaccine schedules"}, "doc.tamanu_source_dbt.scheduled_vaccines__category": {"name": "scheduled_vaccines__category", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__category", "block_contents": "Vaccine category [Routine, Catch-up, Campaign, Other]"}, "doc.tamanu_source_dbt.scheduled_vaccines__label": {"name": "scheduled_vaccines__label", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__label", "block_contents": "Contents of the label column is what will be displayed on the front end of Tamanu \r\nunder fields labelled 'Vaccine'. This is where the vaccine name is listed. E.g. 'BCG'."}, "doc.tamanu_source_dbt.scheduled_vaccines__dose_label": {"name": "scheduled_vaccines__dose_label", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__dose_label", "block_contents": "Dose label indicates what will appear on the front end of Tamanu re when the dose is due. It can be a time in a child's \r\nlife (e.g. 'Birth', '6 weeks') or a dose of vaccine (e.g. 'Dose 1', 'Dose 2')"}, "doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_birth_due": {"name": "scheduled_vaccines__weeks_from_birth_due", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_birth_due", "block_contents": "This column is used to tell Tamanu how many weeks from the child's date of birth a vaccine is due. This will populate \r\nthe front end within the Vaccine schedule section in the column 'Due date'. For a vaccine to appear in the Vaccine \r\nschedule a dose must have a `weeksFromBirthDue` entered into the reference data. \r\n\r\nThis field should be used only for the first dose of the vaccine. Subsequent doses should use \r\n`weeks_from_last_vaccination_due`"}, "doc.tamanu_source_dbt.scheduled_vaccines__index": {"name": "scheduled_vaccines__index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__index", "block_contents": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given."}, "doc.tamanu_source_dbt.scheduled_vaccines__vaccine_id": {"name": "scheduled_vaccines__vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__vaccine_id", "block_contents": "Use the vaccineId column to link the id column of the Reference Data sheet Drug to the vaccine schedule. Copy the exact \r\nid from the id column in the reference data sheet Drug and paste it in the vaccineId column in the Scheduled Vaccine \r\nsheet."}, "doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_last_vaccination_due": {"name": "scheduled_vaccines__weeks_from_last_vaccination_due", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__weeks_from_last_vaccination_due", "block_contents": "This column is used to show when a second dose is due in relation to the first dose. For example, if dose 1 is due at 6 \r\nweeks and dose 2 is due at 10 weeks, this column would read '4' against the 10 week dose as dose 2 is due 4 weeks after \r\ndose 1 is given. The order of a vaccine dose is defined at the `index` field. \r\n\r\nThis field should not be used for the first dose but for subsequent doses. First dose should use `weeks_from_birth_due`"}, "doc.tamanu_source_dbt.scheduled_vaccines__hide_from_certificate": {"name": "scheduled_vaccines__hide_from_certificate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__hide_from_certificate", "block_contents": "Vaccines can be hidden from the vaccine certificate where required\r\n\r\nTo hide a vaccine from appearing on the vaccine certificate across the deployment, use column hideFromCertificate\r\n- true = vaccine will not appear on the vaccine certificate\r\n- blank / false = vaccine will appear on the vaccine certificate"}, "doc.tamanu_source_dbt.scheduled_vaccines__sort_index": {"name": "scheduled_vaccines__sort_index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\scheduled_vaccines.md", "original_file_path": "models\\sources\\scheduled_vaccines.md", "unique_id": "doc.tamanu_source_dbt.scheduled_vaccines__sort_index", "block_contents": "Sort index defaults to 0"}, "doc.tamanu_source_dbt.table__SequelizeMeta": {"name": "table__SequelizeMeta", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\SequelizeMeta.md", "original_file_path": "models\\sources\\SequelizeMeta.md", "unique_id": "doc.tamanu_source_dbt.table__SequelizeMeta", "block_contents": "This table tracks which migrations have been run. It is automatically managed by Sequelize (within Tamanu's `migrate`\r\nsubcommand), should never be edited manually"}, "doc.tamanu_source_dbt.SequelizeMeta__name": {"name": "SequelizeMeta__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\SequelizeMeta.md", "original_file_path": "models\\sources\\SequelizeMeta.md", "unique_id": "doc.tamanu_source_dbt.SequelizeMeta__name", "block_contents": "Name of the migration"}, "doc.tamanu_source_dbt.table__settings": {"name": "table__settings", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.table__settings", "block_contents": "Shared and synced configuration values.\r\n\r\nAlways set from the Central server / Admin interfaces and then synced to facilities.\r\n\r\nThose can change dynamically when a server/client is up, some settings are read at point of use and\r\nso change is applied \"immediately\", some settings are read once at server start but those should be\r\nrare and eventually eliminated as there's no facility within Tamanu to restart its own servers."}, "doc.tamanu_source_dbt.settings__key": {"name": "settings__key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.settings__key", "block_contents": "Dotted JSON path."}, "doc.tamanu_source_dbt.settings__value": {"name": "settings__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.settings__value", "block_contents": "JSON value."}, "doc.tamanu_source_dbt.settings__facility_id": {"name": "settings__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.settings__facility_id", "block_contents": "The [facility](#!/source/source.tamanu.tamanu.facilities) this setting is scoped to."}, "doc.tamanu_source_dbt.settings__scope": {"name": "settings__scope", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\settings.md", "original_file_path": "models\\sources\\settings.md", "unique_id": "doc.tamanu_source_dbt.settings__scope", "block_contents": "Scope of the setting, which determines how it's applied.\r\n\r\nOne of:\r\n- `global`\r\n- `central`\r\n- `facility`"}, "doc.tamanu_source_dbt.table__signers": {"name": "table__signers", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.table__signers", "block_contents": "Table of signing key and certificates for EUDCC and ICAO VDS certifications.\r\n\r\nIntroduced during the COVID-19 pandemic, these are standards which can be\r\nused to produce a QR code containing vaccine information and a digital signature\r\nwhich certifies that the vaccines were administered by a competent authority.\r\n\r\nDigital signatures are issued using a key which is rotated every three months,\r\nand which is itself signed by a Certificate Authority. A country's CA is trusted\r\nby verifying authorities such as the ICAO or EU. This completes the trust chain.\r\n\r\nTamanu generates keys and Certificate Signing Requests in this table. The secret\r\nkey material never leaves the server which generates it. CSRs are signed by the\r\ncountry Health CA, which then returns a Certificate, which is loaded in Tamanu.\r\n\r\nThere are two sets of dates associated with each Signing Key:\r\n- the validity period propagates to the Digital Signatures on the QR codes; and\r\n is generally set to 10 years.\r\n- the working period defines when the Signing Key is rotated.\r\n\r\nWhen a key is rotated, the secret material may be erased to ensure the key can\r\nnever be used again; the public information is kept forever.\r\n\r\nThere is always at most one row in this table which has a NULL `certificate`\r\nfield; this is the pending CSR.\r\n\r\nThe Signing Key in use is the row which has a NON-NULL `certificate`, a validity\r\nand working period encompassing the current time, a NON-NULL `private_key`, and\r\nis the newest within that set.\r\n\r\nSee also the `certifiable_vaccines` table.\r\n\r\nThis table is present on Facility Servers, but never populated."}, "doc.tamanu_source_dbt.signers__country_code": {"name": "signers__country_code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__country_code", "block_contents": "ISO country code for the Health CA."}, "doc.tamanu_source_dbt.signers__private_key": {"name": "signers__private_key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__private_key", "block_contents": "Private key data.\r\n\r\nThis is stored encrypted at rest, using the configuration key `integrations.signer.keySecret`."}, "doc.tamanu_source_dbt.signers__public_key": {"name": "signers__public_key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__public_key", "block_contents": "Public key data."}, "doc.tamanu_source_dbt.signers__request": {"name": "signers__request", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__request", "block_contents": "Certificate Signing Request."}, "doc.tamanu_source_dbt.signers__certificate": {"name": "signers__certificate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__certificate", "block_contents": "Signed Certificate (signed by the Health CA)."}, "doc.tamanu_source_dbt.signers__validity_period_start": {"name": "signers__validity_period_start", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__validity_period_start", "block_contents": "Before that date, the key cannot be used, and signatures generated by it cannot be trusted."}, "doc.tamanu_source_dbt.signers__validity_period_end": {"name": "signers__validity_period_end", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__validity_period_end", "block_contents": "After that date, the key cannot be used, and signatures generated by it cannot be trusted."}, "doc.tamanu_source_dbt.signers__signatures_issued": {"name": "signers__signatures_issued", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__signatures_issued", "block_contents": "Counter of digital signatures issued from this key.\r\n\r\nThis can be used for statistical purposes or for usage policy. For example, one\r\ncould specify that kyes should be rotated every three months or every 1000\r\nsignatures, whichever comes first."}, "doc.tamanu_source_dbt.signers__request_sent_at": {"name": "signers__request_sent_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__request_sent_at", "block_contents": "Date at which the CSR was sent to be signed by the Health CA."}, "doc.tamanu_source_dbt.signers__working_period_start": {"name": "signers__working_period_start", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__working_period_start", "block_contents": "Before that date, the key cannot be used."}, "doc.tamanu_source_dbt.signers__working_period_end": {"name": "signers__working_period_end", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\signers.md", "original_file_path": "models\\sources\\signers.md", "unique_id": "doc.tamanu_source_dbt.signers__working_period_end", "block_contents": "After that date, the key cannot be used.\r\n\r\nAfter that date, the private key may also be nulled.\r\n\r\nThis is always less than or equal to `validity_period_end`."}, "doc.tamanu_source_dbt.table__socket_io_attachments": {"name": "table__socket_io_attachments", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\socket_io_attachments.md", "original_file_path": "models\\sources\\socket_io_attachments.md", "unique_id": "doc.tamanu_source_dbt.table__socket_io_attachments", "block_contents": "Table used by Socket.IO to synchronise WebSocket sessions across server replicas."}, "doc.tamanu_source_dbt.socket_io_attachments__payload": {"name": "socket_io_attachments__payload", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\socket_io_attachments.md", "original_file_path": "models\\sources\\socket_io_attachments.md", "unique_id": "doc.tamanu_source_dbt.socket_io_attachments__payload", "block_contents": "Payload."}, "doc.tamanu_source_dbt.table__surveys": {"name": "table__surveys", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.table__surveys", "block_contents": "Surveys, aka custom forms that can be filled by practitioners.\r\n\r\nThese are composed of [screen components](#!/source/source.tamanu.tamanu.survey_screen_components)."}, "doc.tamanu_source_dbt.surveys__code": {"name": "surveys__code", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__code", "block_contents": "Machine-friendly code."}, "doc.tamanu_source_dbt.surveys__name": {"name": "surveys__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__name", "block_contents": "Human-friendly name."}, "doc.tamanu_source_dbt.surveys__program_id": {"name": "surveys__program_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__program_id", "block_contents": "The [program](#!/source/source.tamanu.tamanu.programs) grouping this survey."}, "doc.tamanu_source_dbt.surveys__survey_type": {"name": "surveys__survey_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__survey_type", "block_contents": "Type of survey.\r\n\r\nOne of:\r\n- `programs`\r\n- `referral`\r\n- `obsolete`\r\n- `vitals`"}, "doc.tamanu_source_dbt.surveys__is_sensitive": {"name": "surveys__is_sensitive", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__is_sensitive", "block_contents": "Whether the data recorded in the survey is sensitive."}, "doc.tamanu_source_dbt.surveys__notifiable": {"name": "surveys__notifiable", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__notifiable", "block_contents": "Whether filling this survey sends a notification email.\r\n\r\nThese are sent by the `SurveyCompletionNotifierProcessor` scheduled task."}, "doc.tamanu_source_dbt.surveys__notify_email_addresses": {"name": "surveys__notify_email_addresses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\surveys.md", "original_file_path": "models\\sources\\surveys.md", "unique_id": "doc.tamanu_source_dbt.surveys__notify_email_addresses", "block_contents": "If `notifiable` is true, where to send the notification."}, "doc.tamanu_source_dbt.table__survey_responses": {"name": "table__survey_responses", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.table__survey_responses", "block_contents": "A response to a survey (as recorded by a practitioner).\r\n\r\nTypically surveys are filled on behalf of patients as part of an encounter.\r\n\r\nBecause there are multiple distinct kinds of dates at play here:\r\n- `created_at`, `updated_at`, `deleted_at` are system data for syncing and cannot be relied on for realtime\r\n- `start_time`, `end_time` are real datetimes automatically recorded when starting and submitting a survey response\r\n- in survey response answers, there could be a data element for targeting the date of when exactly the data is recorded in real time."}, "doc.tamanu_source_dbt.survey_responses__start_time": {"name": "survey_responses__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__start_time", "block_contents": "When the survey was started."}, "doc.tamanu_source_dbt.survey_responses__end_time": {"name": "survey_responses__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__end_time", "block_contents": "When the survey was completed."}, "doc.tamanu_source_dbt.survey_responses__result": {"name": "survey_responses__result", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__result", "block_contents": "The numeric value that is the summary of the survey response."}, "doc.tamanu_source_dbt.survey_responses__survey_id": {"name": "survey_responses__survey_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__survey_id", "block_contents": "The [survey](#!/source/source.tamanu.tamanu.surveys) being responded to."}, "doc.tamanu_source_dbt.survey_responses__encounter_id": {"name": "survey_responses__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this survey response is a part of."}, "doc.tamanu_source_dbt.survey_responses__result_text": {"name": "survey_responses__result_text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__result_text", "block_contents": "The textual value that is the summary of the survey response."}, "doc.tamanu_source_dbt.survey_responses__user_id": {"name": "survey_responses__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) recording this survey response."}, "doc.tamanu_source_dbt.survey_responses__start_time_legacy": {"name": "survey_responses__start_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__start_time_legacy", "block_contents": "[Deprecated] When the survey was started."}, "doc.tamanu_source_dbt.survey_responses__end_time_legacy": {"name": "survey_responses__end_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__end_time_legacy", "block_contents": "[Deprecated] When the survey was completed."}, "doc.tamanu_source_dbt.survey_responses__notified": {"name": "survey_responses__notified", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__notified", "block_contents": "If the [survey](#!/source/source.tamanu.tamanu.surveys) is `notifiable`, whether this response's\r\nnotification has been sent."}, "doc.tamanu_source_dbt.survey_responses__metadata": {"name": "survey_responses__metadata", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_responses.md", "original_file_path": "models\\sources\\survey_responses.md", "unique_id": "doc.tamanu_source_dbt.survey_responses__metadata", "block_contents": "Metadata for a survey response, (eg: if a survey response is linked to another survey response)"}, "doc.tamanu_source_dbt.table__survey_response_answers": {"name": "table__survey_response_answers", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.table__survey_response_answers", "block_contents": "A single answer as part of a [survey response](#!/source/source.tamanu.tamanu.survey_responses)."}, "doc.tamanu_source_dbt.survey_response_answers__name": {"name": "survey_response_answers__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__name", "block_contents": "Name of the question."}, "doc.tamanu_source_dbt.survey_response_answers__body": {"name": "survey_response_answers__body", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__body", "block_contents": "Value of the answer."}, "doc.tamanu_source_dbt.survey_response_answers__response_id": {"name": "survey_response_answers__response_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__response_id", "block_contents": "The [survey response](#!/source/source.tamanu.tamanu.survey_responses)."}, "doc.tamanu_source_dbt.survey_response_answers__data_element_id": {"name": "survey_response_answers__data_element_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__data_element_id", "block_contents": "Reference to the [question](#!/source/source.tamanu.tamanu.program_data_elements)."}, "doc.tamanu_source_dbt.survey_response_answers__body_legacy": {"name": "survey_response_answers__body_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_response_answers.md", "original_file_path": "models\\sources\\survey_response_answers.md", "unique_id": "doc.tamanu_source_dbt.survey_response_answers__body_legacy", "block_contents": "[Deprecated] Value of the answer in old format."}, "doc.tamanu_source_dbt.table__survey_screen_components": {"name": "table__survey_screen_components", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.table__survey_screen_components", "block_contents": "Describes how a survey question gets displayed.\r\n\r\nSee [program data element](#!/source/source.tamanu.tamanu.program_data_elements), which describes\r\nhow the data from the question is stored."}, "doc.tamanu_source_dbt.survey_screen_components__screen_index": {"name": "survey_screen_components__screen_index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__screen_index", "block_contents": "Screen this component should appear on.\r\n\r\nSurveys can have multiple \"screens\" or pages, this index sets where this particular question sits."}, "doc.tamanu_source_dbt.survey_screen_components__component_index": {"name": "survey_screen_components__component_index", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__component_index", "block_contents": "The absolute index (order) of the component in the survey."}, "doc.tamanu_source_dbt.survey_screen_components__text": {"name": "survey_screen_components__text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__text", "block_contents": "Description or question of this component."}, "doc.tamanu_source_dbt.survey_screen_components__validation_criteria": {"name": "survey_screen_components__validation_criteria", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__validation_criteria", "block_contents": "JSON criteria that determines whether the value entered in this component is accepted."}, "doc.tamanu_source_dbt.survey_screen_components__detail": {"name": "survey_screen_components__detail", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__detail", "block_contents": "Longer description or explanatory text of this component."}, "doc.tamanu_source_dbt.survey_screen_components__config": {"name": "survey_screen_components__config", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__config", "block_contents": "JSON additional config of the component."}, "doc.tamanu_source_dbt.survey_screen_components__options": {"name": "survey_screen_components__options", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__options", "block_contents": "JSON array of strings of options to be selected."}, "doc.tamanu_source_dbt.survey_screen_components__visibility_criteria": {"name": "survey_screen_components__visibility_criteria", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__visibility_criteria", "block_contents": "JSON criteria that determines when this component is visible.\r\n\r\nA criteria is a list of other components' codes and the value that will make this question show up:\r\n\r\n```json\r\n{\r\n \"otherQuestion\": \"Yes\"\r\n}\r\n```\r\n\r\nThere can also be the special criterium `{\"hidden\": true}` which always hides the question, and the\r\nspecial key `\"_conjunction\": \"or\"` which makes it so _any one_ item in the list is sufficient to\r\nshow the question, instead of the default where _all_ items must match."}, "doc.tamanu_source_dbt.survey_screen_components__calculation": {"name": "survey_screen_components__calculation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__calculation", "block_contents": "Math expression to do calculations on the entered value before it's saved.\r\n\r\nFor example `questionCode + 3`."}, "doc.tamanu_source_dbt.survey_screen_components__survey_id": {"name": "survey_screen_components__survey_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__survey_id", "block_contents": "The [survey](#!/source/source.tamanu.tamanu.surveys)."}, "doc.tamanu_source_dbt.survey_screen_components__data_element_id": {"name": "survey_screen_components__data_element_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\survey_screen_components.md", "original_file_path": "models\\sources\\survey_screen_components.md", "unique_id": "doc.tamanu_source_dbt.survey_screen_components__data_element_id", "block_contents": "Reference to the [data element](#!/source/source.tamanu.tamanu.program_data_elements) configuring\r\nhow the data from the question is stored."}, "doc.tamanu_source_dbt.table__sync_device_ticks": {"name": "table__sync_device_ticks", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_device_ticks.md", "original_file_path": "models\\sources\\sync_device_ticks.md", "unique_id": "doc.tamanu_source_dbt.table__sync_device_ticks", "block_contents": "Cache of which syncing device is at which tick.\r\n\r\nThis is used internally as part of sync."}, "doc.tamanu_source_dbt.sync_device_ticks__persisted_at_sync_tick": {"name": "sync_device_ticks__persisted_at_sync_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_device_ticks.md", "original_file_path": "models\\sources\\sync_device_ticks.md", "unique_id": "doc.tamanu_source_dbt.sync_device_ticks__persisted_at_sync_tick", "block_contents": "The sync tick."}, "doc.tamanu_source_dbt.sync_device_ticks__device_id": {"name": "sync_device_ticks__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_device_ticks.md", "original_file_path": "models\\sources\\sync_device_ticks.md", "unique_id": "doc.tamanu_source_dbt.sync_device_ticks__device_id", "block_contents": "The device that's at this sync tick."}, "doc.tamanu_source_dbt.table__sync_lookup": {"name": "table__sync_lookup", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.table__sync_lookup", "block_contents": "Cache of records to use for sync.\r\n\r\nThis is used internally in the sync process."}, "doc.tamanu_source_dbt.sync_lookup__record_id": {"name": "sync_lookup__record_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__record_id", "block_contents": "The `id` field of the record."}, "doc.tamanu_source_dbt.sync_lookup__record_type": {"name": "sync_lookup__record_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__record_type", "block_contents": "The table name of the record."}, "doc.tamanu_source_dbt.sync_lookup__data": {"name": "sync_lookup__data", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__data", "block_contents": "All the fields of the record."}, "doc.tamanu_source_dbt.sync_lookup__patient_id": {"name": "sync_lookup__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__patient_id", "block_contents": "If the record has a [patient](#!/source/source.tamanu.tamanu.patients) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__encounter_id": {"name": "sync_lookup__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__encounter_id", "block_contents": "If the record has an [encounter](#!/source/source.tamanu.tamanu.encounters) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__facility_id": {"name": "sync_lookup__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__facility_id", "block_contents": "If the record has a [facility](#!/source/source.tamanu.tamanu.facilitys) reference, this is it extracted here.\r\n\r\nThis is used to filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__is_lab_request": {"name": "sync_lookup__is_lab_request", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__is_lab_request", "block_contents": "Whether the record is or is related to a lab request.\r\n\r\nThis is used to filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__is_deleted": {"name": "sync_lookup__is_deleted", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__is_deleted", "block_contents": "Whether the record is deleted (`deleted_at` is not null).\r\n\r\nThis is used to sort and filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__updated_at_by_field_sum": {"name": "sync_lookup__updated_at_by_field_sum", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__updated_at_by_field_sum", "block_contents": "If the record has an `updatedAtByField`, the sum of those values.\r\n\r\nThis is used to sort and filter records efficiently during the sync process."}, "doc.tamanu_source_dbt.sync_lookup__pushed_by_device_id": {"name": "sync_lookup__pushed_by_device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup.md", "original_file_path": "models\\sources\\sync_lookup.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup__pushed_by_device_id", "block_contents": "The unique device that pushed this record."}, "doc.tamanu_source_dbt.table__sync_lookup_ticks": {"name": "table__sync_lookup_ticks", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup_ticks.md", "original_file_path": "models\\sources\\sync_lookup_ticks.md", "unique_id": "doc.tamanu_source_dbt.table__sync_lookup_ticks", "block_contents": "Stores range of sync lookup ticks per sync."}, "doc.tamanu_source_dbt.sync_lookup_ticks__source_start_tick": {"name": "sync_lookup_ticks__source_start_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup_ticks.md", "original_file_path": "models\\sources\\sync_lookup_ticks.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup_ticks__source_start_tick", "block_contents": "Represents the previous lookup up to tick."}, "doc.tamanu_source_dbt.sync_lookup_ticks__lookup_end_tick": {"name": "sync_lookup_ticks__lookup_end_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_lookup_ticks.md", "original_file_path": "models\\sources\\sync_lookup_ticks.md", "unique_id": "doc.tamanu_source_dbt.sync_lookup_ticks__lookup_end_tick", "block_contents": "Represents the new sync tick at time of updating lookup-pending records."}, "doc.tamanu_source_dbt.table__sync_queued_devices": {"name": "table__sync_queued_devices", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.table__sync_queued_devices", "block_contents": "Devices waiting their turn to be synced."}, "doc.tamanu_source_dbt.sync_queued_devices__last_seen_time": {"name": "sync_queued_devices__last_seen_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__last_seen_time", "block_contents": "The last time the device has reached out to the syncing server."}, "doc.tamanu_source_dbt.sync_queued_devices__last_synced_tick": {"name": "sync_queued_devices__last_synced_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__last_synced_tick", "block_contents": "The sync tick the device is currently at."}, "doc.tamanu_source_dbt.sync_queued_devices__facility_id_legacy": {"name": "sync_queued_devices__facility_id_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__facility_id_legacy", "block_contents": "[Deprecated] Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) this device is associated with."}, "doc.tamanu_source_dbt.sync_queued_devices__urgent": {"name": "sync_queued_devices__urgent", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__urgent", "block_contents": "A way for a device to bump its priority in the queue."}, "doc.tamanu_source_dbt.sync_queued_devices__facility_ids": {"name": "sync_queued_devices__facility_ids", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_queued_devices.md", "original_file_path": "models\\sources\\sync_queued_devices.md", "unique_id": "doc.tamanu_source_dbt.sync_queued_devices__facility_ids", "block_contents": "Reference to the [facilities](#!/source/source.tamanu.tamanu.facilities) this device is associated with."}, "doc.tamanu_source_dbt.table__sync_sessions": {"name": "table__sync_sessions", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.table__sync_sessions", "block_contents": "Records of each user that can login to the site"}, "doc.tamanu_source_dbt.sync_sessions__id": {"name": "sync_sessions__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__id", "block_contents": "Tamanu identifier for the sync session"}, "doc.tamanu_source_dbt.sync_sessions__start_time": {"name": "sync_sessions__start_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__start_time", "block_contents": "Timestamp when sync session started"}, "doc.tamanu_source_dbt.sync_sessions__last_connection_time": {"name": "sync_sessions__last_connection_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__last_connection_time", "block_contents": "Timestamp when sync session made last connection"}, "doc.tamanu_source_dbt.sync_sessions__snapshot_completed_at": {"name": "sync_sessions__snapshot_completed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__snapshot_completed_at", "block_contents": "Timestamp when sync session snapshot was completed"}, "doc.tamanu_source_dbt.sync_sessions__debug_info": {"name": "sync_sessions__debug_info", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__debug_info", "block_contents": "Debug information for the sync session"}, "doc.tamanu_source_dbt.sync_sessions__parameters": {"name": "sync_sessions__parameters", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__parameters", "block_contents": "Parameters for the sync session"}, "doc.tamanu_source_dbt.sync_sessions__completed_at": {"name": "sync_sessions__completed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__completed_at", "block_contents": "Timestamp when sync session was completed"}, "doc.tamanu_source_dbt.sync_sessions__persist_completed_at": {"name": "sync_sessions__persist_completed_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__persist_completed_at", "block_contents": "Timestamp when sync session completion record is persisted"}, "doc.tamanu_source_dbt.sync_sessions__pull_since": {"name": "sync_sessions__pull_since", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__pull_since", "block_contents": "Sync tick that the sync session pulled since"}, "doc.tamanu_source_dbt.sync_sessions__pull_until": {"name": "sync_sessions__pull_until", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__pull_until", "block_contents": "Sync tick that the sync session pulled until"}, "doc.tamanu_source_dbt.sync_sessions__started_at_tick": {"name": "sync_sessions__started_at_tick", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__started_at_tick", "block_contents": "Sync tick that the sync session started at"}, "doc.tamanu_source_dbt.sync_sessions__snapshot_started_at": {"name": "sync_sessions__snapshot_started_at", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__snapshot_started_at", "block_contents": "Timestamp the sync session snapshot started at"}, "doc.tamanu_source_dbt.sync_sessions__errors": {"name": "sync_sessions__errors", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\sync_sessions.md", "original_file_path": "models\\sources\\sync_sessions.md", "unique_id": "doc.tamanu_source_dbt.sync_sessions__errors", "block_contents": "If a sync fails, the error(s)."}, "doc.tamanu_source_dbt.table__tasks": {"name": "table__tasks", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.table__tasks", "block_contents": "Tasks related to encounters"}, "doc.tamanu_source_dbt.tasks__encounter_id": {"name": "tasks__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this task is a part of."}, "doc.tamanu_source_dbt.tasks__name": {"name": "tasks__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__name", "block_contents": "Name of the task."}, "doc.tamanu_source_dbt.tasks__due_time": {"name": "tasks__due_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__due_time", "block_contents": "When the task is due."}, "doc.tamanu_source_dbt.tasks__end_time": {"name": "tasks__end_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__end_time", "block_contents": "When the repeating task is end."}, "doc.tamanu_source_dbt.tasks__requested_by_user_id": {"name": "tasks__requested_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__requested_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested this task."}, "doc.tamanu_source_dbt.tasks__request_time": {"name": "tasks__request_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__request_time", "block_contents": "When the task is requested."}, "doc.tamanu_source_dbt.tasks__status": {"name": "tasks__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__status", "block_contents": "Status of the task.\r\n\r\nOne of:\r\n- `todo`\r\n- `completed`\r\n- `non_completed`"}, "doc.tamanu_source_dbt.tasks__note": {"name": "tasks__note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__note", "block_contents": "Note of the task."}, "doc.tamanu_source_dbt.tasks__frequency_value": {"name": "tasks__frequency_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__frequency_value", "block_contents": "Frequency value of the task (if the task is repeating), must go with frequency unit."}, "doc.tamanu_source_dbt.tasks__frequency_unit": {"name": "tasks__frequency_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__frequency_unit", "block_contents": "Frequency unit of the task (if the task is repeating).\r\n\r\nOne of:\r\n- `minute`\r\n- `hour`\r\n- `day`"}, "doc.tamanu_source_dbt.tasks__high_priority": {"name": "tasks__high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__high_priority", "block_contents": "Boolean specify if the task is high priority."}, "doc.tamanu_source_dbt.tasks__parent_task_id": {"name": "tasks__parent_task_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__parent_task_id", "block_contents": "Reference to the original [task](#!/source/source.tamanu.tamanu.tasks) that the task is repeated from if it is a repeating task."}, "doc.tamanu_source_dbt.tasks__completed_by_user_id": {"name": "tasks__completed_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__completed_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as completed."}, "doc.tamanu_source_dbt.tasks__completed_time": {"name": "tasks__completed_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__completed_time", "block_contents": "When the task is marked as completed."}, "doc.tamanu_source_dbt.tasks__completed_note": {"name": "tasks__completed_note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__completed_note", "block_contents": "Completed note of the task."}, "doc.tamanu_source_dbt.tasks__not_completed_by_user_id": {"name": "tasks__not_completed_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__not_completed_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as not completed."}, "doc.tamanu_source_dbt.tasks__not_completed_time": {"name": "tasks__not_completed_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__not_completed_time", "block_contents": "When the task is marked as not completed."}, "doc.tamanu_source_dbt.tasks__not_completed_reason_id": {"name": "tasks__not_completed_reason_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__not_completed_reason_id", "block_contents": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is not completed."}, "doc.tamanu_source_dbt.tasks__todo_by_user_id": {"name": "tasks__todo_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__todo_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who marked this task as to-do."}, "doc.tamanu_source_dbt.tasks__todo_time": {"name": "tasks__todo_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__todo_time", "block_contents": "When the task is marked as to-do."}, "doc.tamanu_source_dbt.tasks__todo_note": {"name": "tasks__todo_note", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__todo_note", "block_contents": "To-do note of the task."}, "doc.tamanu_source_dbt.tasks__deleted_by_user_id": {"name": "tasks__deleted_by_user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__deleted_by_user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who delete this task."}, "doc.tamanu_source_dbt.tasks__deleted_time": {"name": "tasks__deleted_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__deleted_time", "block_contents": "When the task is deleted."}, "doc.tamanu_source_dbt.tasks__deleted_reason_id": {"name": "tasks__deleted_reason_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__deleted_reason_id", "block_contents": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is deleted."}, "doc.tamanu_source_dbt.tasks__deleted_reason_for_sync_id": {"name": "tasks__deleted_reason_for_sync_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__deleted_reason_for_sync_id", "block_contents": "The reason ([Reference Data](#!/source/source.tamanu.tamanu.reference_data)) why this task is deleted if it is deleted by the system."}, "doc.tamanu_source_dbt.tasks__duration_value": {"name": "tasks__duration_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__duration_value", "block_contents": "Numeric value specifying the expected duration of the task, must be used in conjunction with duration_unit."}, "doc.tamanu_source_dbt.tasks__duration_unit": {"name": "tasks__duration_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__duration_unit", "block_contents": "Unit of time for the task duration.\r\n\r\nOne of:\r\n- `hours`\r\n- `days`\r\n- `occurrences`"}, "doc.tamanu_source_dbt.tasks__task_type": {"name": "tasks__task_type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\tasks.md", "original_file_path": "models\\sources\\tasks.md", "unique_id": "doc.tamanu_source_dbt.tasks__task_type", "block_contents": "Type of the task.\r\n\r\nOne of:\r\n- `normal_task`\r\n- `medication_due_task`"}, "doc.tamanu_source_dbt.table__task_designations": {"name": "table__task_designations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_designations.md", "original_file_path": "models\\sources\\task_designations.md", "unique_id": "doc.tamanu_source_dbt.table__task_designations", "block_contents": "Association of designation to task."}, "doc.tamanu_source_dbt.task_designations__task_id": {"name": "task_designations__task_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_designations.md", "original_file_path": "models\\sources\\task_designations.md", "unique_id": "doc.tamanu_source_dbt.task_designations__task_id", "block_contents": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.task_designations__designation_id": {"name": "task_designations__designation_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_designations.md", "original_file_path": "models\\sources\\task_designations.md", "unique_id": "doc.tamanu_source_dbt.task_designations__designation_id", "block_contents": "The task [task](#!/source/source.tamanu.tamanu.tasks)"}, "doc.tamanu_source_dbt.table__task_templates": {"name": "table__task_templates", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.table__task_templates", "block_contents": "Template of tasks which then can be created upon"}, "doc.tamanu_source_dbt.task_templates__reference_data_id": {"name": "task_templates__reference_data_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.task_templates__reference_data_id", "block_contents": "The name of task template, referred to ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.task_templates__high_priority": {"name": "task_templates__high_priority", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.task_templates__high_priority", "block_contents": "Boolean specify if the task template is high priority."}, "doc.tamanu_source_dbt.task_templates__frequency_value": {"name": "task_templates__frequency_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.task_templates__frequency_value", "block_contents": "Frequency value of the task template (if the task is repeating), must go with frequency unit."}, "doc.tamanu_source_dbt.task_templates__frequency_unit": {"name": "task_templates__frequency_unit", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_templates.md", "original_file_path": "models\\sources\\task_templates.md", "unique_id": "doc.tamanu_source_dbt.task_templates__frequency_unit", "block_contents": "Frequency unit of the task template (if the task is repeating).\r\n\r\nOne of:\r\n- `minute`\r\n- `hour`\r\n- `day`"}, "doc.tamanu_source_dbt.table__task_template_designations": {"name": "table__task_template_designations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_template_designations.md", "original_file_path": "models\\sources\\task_template_designations.md", "unique_id": "doc.tamanu_source_dbt.table__task_template_designations", "block_contents": "Association of designation to task template"}, "doc.tamanu_source_dbt.task_template_designations__task_template_id": {"name": "task_template_designations__task_template_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_template_designations.md", "original_file_path": "models\\sources\\task_template_designations.md", "unique_id": "doc.tamanu_source_dbt.task_template_designations__task_template_id", "block_contents": "The task template ([Task Template](#!/source/source.tamanu.tamanu.task_templates))."}, "doc.tamanu_source_dbt.task_template_designations__designation_id": {"name": "task_template_designations__designation_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\task_template_designations.md", "original_file_path": "models\\sources\\task_template_designations.md", "unique_id": "doc.tamanu_source_dbt.task_template_designations__designation_id", "block_contents": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__templates": {"name": "table__templates", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.table__templates", "block_contents": "Templates used for patient letters and clinical notes etc."}, "doc.tamanu_source_dbt.templates__name": {"name": "templates__name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__name", "block_contents": "Internal name of the template (used when importing)."}, "doc.tamanu_source_dbt.templates__date_created": {"name": "templates__date_created", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__date_created", "block_contents": "When the template was created."}, "doc.tamanu_source_dbt.templates__title": {"name": "templates__title", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__title", "block_contents": "Title of the template (which will be rendered)."}, "doc.tamanu_source_dbt.templates__body": {"name": "templates__body", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__body", "block_contents": "Body of the template (which will be rendered)."}, "doc.tamanu_source_dbt.templates__created_by_id": {"name": "templates__created_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__created_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who created this template."}, "doc.tamanu_source_dbt.templates__type": {"name": "templates__type", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\templates.md", "original_file_path": "models\\sources\\templates.md", "unique_id": "doc.tamanu_source_dbt.templates__type", "block_contents": "Type of the template (referred to in code)."}, "doc.tamanu_source_dbt.table__translated_strings": {"name": "table__translated_strings", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\translated_strings.md", "original_file_path": "models\\sources\\translated_strings.md", "unique_id": "doc.tamanu_source_dbt.table__translated_strings", "block_contents": "Localisation and translation strings.\r\n\r\nThese are used for two distinct purposes:\r\n- to translate Tamanu in languages other than English\r\n- to adjust the wording of specific items in the UI"}, "doc.tamanu_source_dbt.translated_strings__string_id": {"name": "translated_strings__string_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\translated_strings.md", "original_file_path": "models\\sources\\translated_strings.md", "unique_id": "doc.tamanu_source_dbt.translated_strings__string_id", "block_contents": "The internal reference of the item being translated."}, "doc.tamanu_source_dbt.translated_strings__language": {"name": "translated_strings__language", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\translated_strings.md", "original_file_path": "models\\sources\\translated_strings.md", "unique_id": "doc.tamanu_source_dbt.translated_strings__language", "block_contents": "The language code."}, "doc.tamanu_source_dbt.translated_strings__text": {"name": "translated_strings__text", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\translated_strings.md", "original_file_path": "models\\sources\\translated_strings.md", "unique_id": "doc.tamanu_source_dbt.translated_strings__text", "block_contents": "The actual translated text."}, "doc.tamanu_source_dbt.table__triages": {"name": "table__triages", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.table__triages", "block_contents": "Triage data of patients waiting in an emergency department."}, "doc.tamanu_source_dbt.triages__arrival_time": {"name": "triages__arrival_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__arrival_time", "block_contents": "When the patient arrived."}, "doc.tamanu_source_dbt.triages__triage_time": {"name": "triages__triage_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__triage_time", "block_contents": "When the patient was triaged."}, "doc.tamanu_source_dbt.triages__closed_time": {"name": "triages__closed_time", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__closed_time", "block_contents": "When the patient was processed."}, "doc.tamanu_source_dbt.triages__score": {"name": "triages__score", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__score", "block_contents": "Classification done by the triage practitioner."}, "doc.tamanu_source_dbt.triages__encounter_id": {"name": "triages__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this triage is for."}, "doc.tamanu_source_dbt.triages__practitioner_id": {"name": "triages__practitioner_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__practitioner_id", "block_contents": "Reference to the [practitioner](#!/source/source.tamanu.tamanu.users) assigned to this patient."}, "doc.tamanu_source_dbt.triages__chief_complaint_id": {"name": "triages__chief_complaint_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__chief_complaint_id", "block_contents": "Reference to the primary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`)."}, "doc.tamanu_source_dbt.triages__secondary_complaint_id": {"name": "triages__secondary_complaint_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__secondary_complaint_id", "block_contents": "Reference to the secondary complaint ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = triageReason`)."}, "doc.tamanu_source_dbt.triages__arrival_time_legacy": {"name": "triages__arrival_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__arrival_time_legacy", "block_contents": "[Deprecated] When the patient arrived."}, "doc.tamanu_source_dbt.triages__triage_time_legacy": {"name": "triages__triage_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__triage_time_legacy", "block_contents": "[Deprecated] When the patient was triaged."}, "doc.tamanu_source_dbt.triages__closed_time_legacy": {"name": "triages__closed_time_legacy", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__closed_time_legacy", "block_contents": "[Deprecated] When the patient was processed."}, "doc.tamanu_source_dbt.triages__arrival_mode_id": {"name": "triages__arrival_mode_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\triages.md", "original_file_path": "models\\sources\\triages.md", "unique_id": "doc.tamanu_source_dbt.triages__arrival_mode_id", "block_contents": "Reference to how the patient arrived ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = arrivalMode`)."}, "doc.tamanu_source_dbt.table__upcoming_vaccinations": {"name": "table__upcoming_vaccinations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.table__upcoming_vaccinations", "block_contents": "A **view** which lists patients and next vaccine due for a given vaccine type.\r\n\r\nThe first dose of a vaccine type is based on weeks from birth due whilst subsequent doses are based on weeks from last \r\nvaccination due.\r\n\r\nAge limits in years and thresholds in days for scheduled status are configurable with the following defaults:\r\n\r\n- Age = 15\r\n- Status: Scheduled = 28\r\n- Status: Upcoming = 7\r\n- Status: Due = -7\r\n- Status: Overdue = -55\r\n- Status: Missed = -Infinity"}, "doc.tamanu_source_dbt.upcoming_vaccinations__patient_id": {"name": "upcoming_vaccinations__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__patient_id", "block_contents": "The [patient](#!/source/source.tamanu.tamanu.patients)."}, "doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id": {"name": "upcoming_vaccinations__scheduled_vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__scheduled_vaccine_id", "block_contents": "Reference to the [scheduled vaccine](#!/source/source.tamanu.tamanu.scheduled_vaccines)."}, "doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_category": {"name": "upcoming_vaccinations__vaccine_category", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_category", "block_contents": "Vaccine category [Routine, Catch-up, Campaign, Other]"}, "doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_id": {"name": "upcoming_vaccinations__vaccine_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__vaccine_id", "block_contents": "Reference to the vaccine ([Reference Data](#!/source/source.tamanu.tamanu.reference_data), `type = drug`)."}, "doc.tamanu_source_dbt.upcoming_vaccinations__due_date": {"name": "upcoming_vaccinations__due_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__due_date", "block_contents": "Due date of the scheduled vaccine."}, "doc.tamanu_source_dbt.upcoming_vaccinations__days_till_due": {"name": "upcoming_vaccinations__days_till_due", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__days_till_due", "block_contents": "Number of days until the scheduled vaccine is due. Negative numbers indicates the number of days in the past the vaccine\r\nwas due."}, "doc.tamanu_source_dbt.upcoming_vaccinations__status": {"name": "upcoming_vaccinations__status", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\upcoming_vaccinations.md", "original_file_path": "models\\sources\\upcoming_vaccinations.md", "unique_id": "doc.tamanu_source_dbt.upcoming_vaccinations__status", "block_contents": "Status of the upcoming vaccination listed ['DUE', 'OVERDUE', 'MISSED', 'SCHEDULED', 'UPCOMING']"}, "doc.tamanu_source_dbt.table__users": {"name": "table__users", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.table__users", "block_contents": "Records of each user that can login to Tamanu.\r\n\r\nThis includes machine users.\r\n\r\nThere is one special user account with an all-zero `id`, which is the global \"system\" user. This is\r\nused as a pseudo identity where the Tamanu system itself takes an action that normally is performed\r\nby a human or API user."}, "doc.tamanu_source_dbt.users__email": {"name": "users__email", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__email", "block_contents": "Email address for user. This is used to login and receive emails."}, "doc.tamanu_source_dbt.users__password": {"name": "users__password", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__password", "block_contents": "Hashed password for user login.\r\n\r\nThe value is encoded as a \"standard password hash\" with a `$[type]$[params]$[salt]$[hash]` general\r\nformat. This allows upgrading algorithms and parameters seamlessly. The current algorithm is bcrypt.\r\n\r\nThis may be null to prevent a user from being able to login."}, "doc.tamanu_source_dbt.users__display_name": {"name": "users__display_name", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__display_name", "block_contents": "The human readable display name for the user."}, "doc.tamanu_source_dbt.users__display_id": {"name": "users__display_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__display_id", "block_contents": "Display identifier for the user.\r\n\r\nThis may be the employee code or badge number."}, "doc.tamanu_source_dbt.users__phone_number": {"name": "users__phone_number", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__phone_number", "block_contents": "Phone number for the user.\r\n\r\nThis is not currently available anywhere visible."}, "doc.tamanu_source_dbt.users__role": {"name": "users__role", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__role", "block_contents": "The role of the user, which sets their permission level.\r\n\r\nThe special values `admin` and `system` indicate a superadmin and a system user respectively."}, "doc.tamanu_source_dbt.users__device_registration_quota": {"name": "users__device_registration_quota", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\users.md", "original_file_path": "models\\sources\\users.md", "unique_id": "doc.tamanu_source_dbt.users__device_registration_quota", "block_contents": "How many devices this user can register (when `features.deviceRegistrationQuota` is enabled).\r\n\r\nSee [`devices`](#!/source/source.tamanu.tamanu.devices) for more."}, "doc.tamanu_source_dbt.table__user_designations": {"name": "table__user_designations", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_designations.md", "original_file_path": "models\\sources\\user_designations.md", "unique_id": "doc.tamanu_source_dbt.table__user_designations", "block_contents": "Association of user to designation"}, "doc.tamanu_source_dbt.user_designations__user_id": {"name": "user_designations__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_designations.md", "original_file_path": "models\\sources\\user_designations.md", "unique_id": "doc.tamanu_source_dbt.user_designations__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users)"}, "doc.tamanu_source_dbt.user_designations__designation_id": {"name": "user_designations__designation_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_designations.md", "original_file_path": "models\\sources\\user_designations.md", "unique_id": "doc.tamanu_source_dbt.user_designations__designation_id", "block_contents": "The designation ([Reference Data](#!/source/source.tamanu.tamanu.reference_data))."}, "doc.tamanu_source_dbt.table__user_facilities": {"name": "table__user_facilities", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_facilities.md", "original_file_path": "models\\sources\\user_facilities.md", "unique_id": "doc.tamanu_source_dbt.table__user_facilities", "block_contents": "Association of users to facilities.\r\n\r\nThis can be used to assign users to certain facilities, for authorisation purposes or for staff convenience."}, "doc.tamanu_source_dbt.user_facilities__facility_id": {"name": "user_facilities__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_facilities.md", "original_file_path": "models\\sources\\user_facilities.md", "unique_id": "doc.tamanu_source_dbt.user_facilities__facility_id", "block_contents": "The [facility](#!/source/source.tamanu.tamanu.facilities)."}, "doc.tamanu_source_dbt.user_facilities__user_id": {"name": "user_facilities__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_facilities.md", "original_file_path": "models\\sources\\user_facilities.md", "unique_id": "doc.tamanu_source_dbt.user_facilities__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.table__user_leaves": {"name": "table__user_leaves", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_leaves.md", "original_file_path": "models\\sources\\user_leaves.md", "unique_id": "doc.tamanu_source_dbt.table__user_leaves", "block_contents": "Records user leave requests, including leave period and scheduling/removal metadata."}, "doc.tamanu_source_dbt.user_leaves__start_date": {"name": "user_leaves__start_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_leaves.md", "original_file_path": "models\\sources\\user_leaves.md", "unique_id": "doc.tamanu_source_dbt.user_leaves__start_date", "block_contents": "Start date of the leave."}, "doc.tamanu_source_dbt.user_leaves__end_date": {"name": "user_leaves__end_date", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_leaves.md", "original_file_path": "models\\sources\\user_leaves.md", "unique_id": "doc.tamanu_source_dbt.user_leaves__end_date", "block_contents": "End date of the leave."}, "doc.tamanu_source_dbt.user_leaves__user_id": {"name": "user_leaves__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_leaves.md", "original_file_path": "models\\sources\\user_leaves.md", "unique_id": "doc.tamanu_source_dbt.user_leaves__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who requested the leave."}, "doc.tamanu_source_dbt.table__user_localisation_caches": {"name": "table__user_localisation_caches", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_localisation_caches.md", "original_file_path": "models\\sources\\user_localisation_caches.md", "unique_id": "doc.tamanu_source_dbt.table__user_localisation_caches", "block_contents": "Cached localisation data.\r\n\r\nLocalisation can be pretty expensive to retrieve, so this caches it per user."}, "doc.tamanu_source_dbt.user_localisation_caches__localisation": {"name": "user_localisation_caches__localisation", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_localisation_caches.md", "original_file_path": "models\\sources\\user_localisation_caches.md", "unique_id": "doc.tamanu_source_dbt.user_localisation_caches__localisation", "block_contents": "JSON data."}, "doc.tamanu_source_dbt.user_localisation_caches__user_id": {"name": "user_localisation_caches__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_localisation_caches.md", "original_file_path": "models\\sources\\user_localisation_caches.md", "unique_id": "doc.tamanu_source_dbt.user_localisation_caches__user_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) this cache is for."}, "doc.tamanu_source_dbt.table__user_login_attempts": {"name": "table__user_login_attempts", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_login_attempts.md", "original_file_path": "models\\sources\\user_login_attempts.md", "unique_id": "doc.tamanu_source_dbt.table__user_login_attempts", "block_contents": "A table that tracks user login attempts for the lockout feature."}, "doc.tamanu_source_dbt.user_login_attempts__outcome": {"name": "user_login_attempts__outcome", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_login_attempts.md", "original_file_path": "models\\sources\\user_login_attempts.md", "unique_id": "doc.tamanu_source_dbt.user_login_attempts__outcome", "block_contents": "A string specifying the outcome of the login attempt."}, "doc.tamanu_source_dbt.user_login_attempts__device_id": {"name": "user_login_attempts__device_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_login_attempts.md", "original_file_path": "models\\sources\\user_login_attempts.md", "unique_id": "doc.tamanu_source_dbt.user_login_attempts__device_id", "block_contents": "The [device](#!/source/source.tamanu.tamanu.devices)."}, "doc.tamanu_source_dbt.user_login_attempts__user_id": {"name": "user_login_attempts__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_login_attempts.md", "original_file_path": "models\\sources\\user_login_attempts.md", "unique_id": "doc.tamanu_source_dbt.user_login_attempts__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.table__user_preferences": {"name": "table__user_preferences", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.table__user_preferences", "block_contents": "Per-user preferences."}, "doc.tamanu_source_dbt.user_preferences__user_id": {"name": "user_preferences__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.user_preferences__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users) these preferences are for."}, "doc.tamanu_source_dbt.user_preferences__key": {"name": "user_preferences__key", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.user_preferences__key", "block_contents": "Key of the user preference"}, "doc.tamanu_source_dbt.user_preferences__value": {"name": "user_preferences__value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.user_preferences__value", "block_contents": "Value of the user preference"}, "doc.tamanu_source_dbt.user_preferences__facility_id": {"name": "user_preferences__facility_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_preferences.md", "original_file_path": "models\\sources\\user_preferences.md", "unique_id": "doc.tamanu_source_dbt.user_preferences__facility_id", "block_contents": "Reference to the [facility](#!/source/source.tamanu.tamanu.facilities) that this preference applies to"}, "doc.tamanu_source_dbt.table__user_recently_viewed_patients": {"name": "table__user_recently_viewed_patients", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_recently_viewed_patients.md", "original_file_path": "models\\sources\\user_recently_viewed_patients.md", "unique_id": "doc.tamanu_source_dbt.table__user_recently_viewed_patients", "block_contents": "A list of patients that a user has viewed recently.\r\n\r\nThis powers the \"quick access\" list in Tamanu to get back to patients that a user was last\r\ninteracting with."}, "doc.tamanu_source_dbt.user_recently_viewed_patients__user_id": {"name": "user_recently_viewed_patients__user_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_recently_viewed_patients.md", "original_file_path": "models\\sources\\user_recently_viewed_patients.md", "unique_id": "doc.tamanu_source_dbt.user_recently_viewed_patients__user_id", "block_contents": "The [user](#!/source/source.tamanu.tamanu.users)."}, "doc.tamanu_source_dbt.user_recently_viewed_patients__patient_id": {"name": "user_recently_viewed_patients__patient_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\user_recently_viewed_patients.md", "original_file_path": "models\\sources\\user_recently_viewed_patients.md", "unique_id": "doc.tamanu_source_dbt.user_recently_viewed_patients__patient_id", "block_contents": "Reference to the [patient](#!/source/source.tamanu.tamanu.patients) that was viewed."}, "doc.tamanu_source_dbt.table__vitals": {"name": "table__vitals", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.table__vitals", "block_contents": "[Deprecated] Patient's observed vitals. This is now done as a survey response."}, "doc.tamanu_source_dbt.vitals__id": {"name": "vitals__id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__id", "block_contents": "Tamanu identifier for vitals"}, "doc.tamanu_source_dbt.vitals__temperature": {"name": "vitals__temperature", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__temperature", "block_contents": "Observed patient's body temperature"}, "doc.tamanu_source_dbt.vitals__weight": {"name": "vitals__weight", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__weight", "block_contents": "Observed patient's body weight"}, "doc.tamanu_source_dbt.vitals__height": {"name": "vitals__height", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__height", "block_contents": "Observed patient's height"}, "doc.tamanu_source_dbt.vitals__sbp": {"name": "vitals__sbp", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__sbp", "block_contents": "Observed patient's systolic blood pressure"}, "doc.tamanu_source_dbt.vitals__dbp": {"name": "vitals__dbp", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__dbp", "block_contents": "Observed patient's diastolic blood pressure"}, "doc.tamanu_source_dbt.vitals__heart_rate": {"name": "vitals__heart_rate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__heart_rate", "block_contents": "Observed patient's heart rate"}, "doc.tamanu_source_dbt.vitals__respiratory_rate": {"name": "vitals__respiratory_rate", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__respiratory_rate", "block_contents": "Observed patient's respiratory rate"}, "doc.tamanu_source_dbt.vitals__spo2": {"name": "vitals__spo2", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__spo2", "block_contents": "Observed patient's SpO2 level or saturation of peripheral oxygen"}, "doc.tamanu_source_dbt.vitals__avpu": {"name": "vitals__avpu", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__avpu", "block_contents": "Observed patient's AVPU (alert, verbal, pain, unresponsive) level"}, "doc.tamanu_source_dbt.vitals__gcs": {"name": "vitals__gcs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__gcs", "block_contents": "Observed patient's Glasgow coma scale (GCS)"}, "doc.tamanu_source_dbt.vitals__hemoglobin": {"name": "vitals__hemoglobin", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__hemoglobin", "block_contents": "Observed patient's hemoglobin levels"}, "doc.tamanu_source_dbt.vitals__fasting_blood_glucose": {"name": "vitals__fasting_blood_glucose", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__fasting_blood_glucose", "block_contents": "Observed patient's fasting blood glucose level"}, "doc.tamanu_source_dbt.vitals__urine_ph": {"name": "vitals__urine_ph", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_ph", "block_contents": "Observed patient's urine pH"}, "doc.tamanu_source_dbt.vitals__encounter_id": {"name": "vitals__encounter_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__encounter_id", "block_contents": "Reference to the [encounter](#!/source/source.tamanu.tamanu.encounters) this recording of vitals is a part of."}, "doc.tamanu_source_dbt.vitals__urine_leukocytes": {"name": "vitals__urine_leukocytes", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_leukocytes", "block_contents": "Observed patient's urine leukocytes level"}, "doc.tamanu_source_dbt.vitals__urine_nitrites": {"name": "vitals__urine_nitrites", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_nitrites", "block_contents": "Observed patient's urine nitrites"}, "doc.tamanu_source_dbt.vitals__urobilinogen": {"name": "vitals__urobilinogen", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urobilinogen", "block_contents": "Observed patient's urobilinogen level"}, "doc.tamanu_source_dbt.vitals__urine_protein": {"name": "vitals__urine_protein", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_protein", "block_contents": "Observed patient's urine protein level"}, "doc.tamanu_source_dbt.vitals__blood_in_urine": {"name": "vitals__blood_in_urine", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__blood_in_urine", "block_contents": "Observed patient's blood in urine"}, "doc.tamanu_source_dbt.vitals__urine_specific_gravity": {"name": "vitals__urine_specific_gravity", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_specific_gravity", "block_contents": "Observed patient's urine_specific_gravity"}, "doc.tamanu_source_dbt.vitals__urine_ketone": {"name": "vitals__urine_ketone", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_ketone", "block_contents": "Observed patient's urine ketone level"}, "doc.tamanu_source_dbt.vitals__urine_bilirubin": {"name": "vitals__urine_bilirubin", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_bilirubin", "block_contents": "Observed patient's urine bilirubin level"}, "doc.tamanu_source_dbt.vitals__urine_glucose": {"name": "vitals__urine_glucose", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__urine_glucose", "block_contents": "Observed patient's urine glucose levels"}, "doc.tamanu_source_dbt.vitals__migrated_record": {"name": "vitals__migrated_record", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vitals.md", "original_file_path": "models\\sources\\vitals.md", "unique_id": "doc.tamanu_source_dbt.vitals__migrated_record", "block_contents": "Tamanu identifier for the survey response the vitals record was migrated to"}, "doc.tamanu_source_dbt.table__vital_logs": {"name": "table__vital_logs", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.table__vital_logs", "block_contents": "Change logs for vitals survey responses."}, "doc.tamanu_source_dbt.vital_logs__previous_value": {"name": "vital_logs__previous_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__previous_value", "block_contents": "Previous value before the logged change in vitals survey response."}, "doc.tamanu_source_dbt.vital_logs__new_value": {"name": "vital_logs__new_value", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__new_value", "block_contents": "New value after the logged change in vitals survey response."}, "doc.tamanu_source_dbt.vital_logs__reason_for_change": {"name": "vital_logs__reason_for_change", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__reason_for_change", "block_contents": "Reason for the logged change in the vitals survey response."}, "doc.tamanu_source_dbt.vital_logs__recorded_by_id": {"name": "vital_logs__recorded_by_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__recorded_by_id", "block_contents": "Reference to the [user](#!/source/source.tamanu.tamanu.users) who made this change."}, "doc.tamanu_source_dbt.vital_logs__answer_id": {"name": "vital_logs__answer_id", "resource_type": "doc", "package_name": "tamanu_source_dbt", "path": "sources\\vital_logs.md", "original_file_path": "models\\sources\\vital_logs.md", "unique_id": "doc.tamanu_source_dbt.vital_logs__answer_id", "block_contents": "The [survey answer](#!/source/source.tamanu.tamanu.survey_response_answers) being changed."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {}, "parent_map": {"model.tamanu_source_dbt.contributing_death_causes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"], "model.tamanu_source_dbt.departments": ["source.tamanu_source_dbt.tamanu.departments"], "model.tamanu_source_dbt.discharges": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.document_metadata": ["source.tamanu_source_dbt.tamanu.document_metadata"], "model.tamanu_source_dbt.encounters": ["source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.encounters_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.encounter_diagnoses": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.encounter_diagnoses_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.encounter_diets": ["source.tamanu_source_dbt.tamanu.encounter_diets", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.encounter_history": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.encounter_prescriptions": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.facilities": ["source.tamanu_source_dbt.tamanu.facilities"], "model.tamanu_source_dbt.imaging_area_external_codes": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "model.tamanu_source_dbt.imaging_requests": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_requests"], "model.tamanu_source_dbt.imaging_request_areas": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_request_areas", "source.tamanu_source_dbt.tamanu.imaging_requests"], "model.tamanu_source_dbt.imaging_results": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.imaging_results"], "model.tamanu_source_dbt.invoices": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.invoices"], "model.tamanu_source_dbt.invoice_insurance_plans": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "model.tamanu_source_dbt.invoice_insurance_plan_items": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "model.tamanu_source_dbt.invoice_items": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoices"], "model.tamanu_source_dbt.invoice_price_lists": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "model.tamanu_source_dbt.invoice_price_list_items": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "model.tamanu_source_dbt.invoice_products": ["source.tamanu_source_dbt.tamanu.invoice_products"], "model.tamanu_source_dbt.lab_requests": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_requests"], "model.tamanu_source_dbt.lab_requests_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.lab_request_logs": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_request_logs", "source.tamanu_source_dbt.tamanu.lab_requests"], "model.tamanu_source_dbt.lab_request_logs_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.lab_tests": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_tests"], "model.tamanu_source_dbt.lab_test_panels": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "model.tamanu_source_dbt.lab_test_panel_lab_test_types": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "model.tamanu_source_dbt.lab_test_panel_requests": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "model.tamanu_source_dbt.lab_test_types": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "model.tamanu_source_dbt.locations": ["source.tamanu_source_dbt.tamanu.locations"], "model.tamanu_source_dbt.location_bookings": ["source.tamanu_source_dbt.tamanu.appointments"], "model.tamanu_source_dbt.location_groups": ["source.tamanu_source_dbt.tamanu.location_groups"], "model.tamanu_source_dbt.medication_dispenses": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.medication_dispenses", "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "source.tamanu_source_dbt.tamanu.pharmacy_orders"], "model.tamanu_source_dbt.notes": ["source.tamanu_source_dbt.tamanu.notes", "source.tamanu_source_dbt.tamanu.reference_data"], "model.tamanu_source_dbt.outpatient_appointments": ["source.tamanu_source_dbt.tamanu.appointment_schedules", "source.tamanu_source_dbt.tamanu.appointments"], "model.tamanu_source_dbt.outpatient_appointments_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.patients": ["source.tamanu_source_dbt.tamanu.patients"], "model.tamanu_source_dbt.patients_access_logs": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "model.tamanu_source_dbt.patients_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patients"], "model.tamanu_source_dbt.patients_merged": ["source.tamanu_source_dbt.tamanu.patients"], "model.tamanu_source_dbt.patients_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.patient_additional_data": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "model.tamanu_source_dbt.patient_additional_data_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_additional_data"], "model.tamanu_source_dbt.patient_allergies": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "model.tamanu_source_dbt.patient_birth_data": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "model.tamanu_source_dbt.patient_care_plans": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "model.tamanu_source_dbt.patient_conditions": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "model.tamanu_source_dbt.patient_death_contributing_causes": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"], "model.tamanu_source_dbt.patient_death_data": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "model.tamanu_source_dbt.patient_facilities": ["source.tamanu_source_dbt.tamanu.patient_facilities"], "model.tamanu_source_dbt.patient_family_histories": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "model.tamanu_source_dbt.patient_field_values": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "model.tamanu_source_dbt.patient_program_registrations": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registrations_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registration_conditions": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "model.tamanu_source_dbt.patient_vaccinations_upcoming": ["source.tamanu_source_dbt.tamanu.upcoming_vaccinations"], "model.tamanu_source_dbt.pharmacy_orders": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.pharmacy_orders"], "model.tamanu_source_dbt.pharmacy_order_prescriptions": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions", "source.tamanu_source_dbt.tamanu.pharmacy_orders"], "model.tamanu_source_dbt.prescriptions": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions", "source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.prescriptions"], "model.tamanu_source_dbt.procedures": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.procedures"], "model.tamanu_source_dbt.procedures_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.programs": ["source.tamanu_source_dbt.tamanu.programs"], "model.tamanu_source_dbt.program_data_elements": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "model.tamanu_source_dbt.program_registries": ["source.tamanu_source_dbt.tamanu.program_registries"], "model.tamanu_source_dbt.program_registry_clinical_statuses": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "model.tamanu_source_dbt.program_registry_conditions": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "model.tamanu_source_dbt.program_registry_condition_categories": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "model.tamanu_source_dbt.reference_data": ["source.tamanu_source_dbt.tamanu.reference_data"], "model.tamanu_source_dbt.referrals": ["source.tamanu_source_dbt.tamanu.referrals"], "model.tamanu_source_dbt.refresh_tokens": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "model.tamanu_source_dbt.roles": ["source.tamanu_source_dbt.tamanu.roles"], "model.tamanu_source_dbt.surveys": ["source.tamanu_source_dbt.tamanu.surveys"], "model.tamanu_source_dbt.survey_responses": ["source.tamanu_source_dbt.tamanu.survey_responses"], "model.tamanu_source_dbt.survey_response_answers": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "model.tamanu_source_dbt.survey_screen_components": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "model.tamanu_source_dbt.translated_strings": ["source.tamanu_source_dbt.tamanu.translated_strings"], "model.tamanu_source_dbt.triages": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.triages"], "model.tamanu_source_dbt.users": ["source.tamanu_source_dbt.tamanu.users"], "model.tamanu_source_dbt.users_metadata": ["source.tamanu_source_dbt.logs__tamanu.changes"], "model.tamanu_source_dbt.vaccine_administrations": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.encounters"], "model.tamanu_source_dbt.vaccine_administrations_change_logs": ["model.tamanu_source_dbt.encounters", "source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.administered_vaccines"], "model.tamanu_source_dbt.vaccine_schedules": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "model.tamanu_source_dbt.ds__sensitive_admissions": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_diagnoses": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_encounters_emergency": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_encounter_diets": ["model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_allergies", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__sensitive_imaging_requests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_lab_requests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_lab_tests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_location_bookings": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_medication_dispenses": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users", "source.tamanu_source_dbt.tamanu.appointment_schedules"], "model.tamanu_source_dbt.ds__sensitive_procedures": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_referrals": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.survey_responses", "model.tamanu_source_dbt.surveys", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_user_audit": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.roles", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__sensitive_vaccinations": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.ds__admissions": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__births": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__deaths": ["model.tamanu_source_dbt.contributing_death_causes", "model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_death_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__diagnoses": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__encounters_emergency": ["model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__encounter_diets": ["model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_allergies", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__encounter_prescriptions": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__imaging_requests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__invoice_products": ["model.tamanu_source_dbt.invoice_insurance_plan_items", "model.tamanu_source_dbt.invoice_insurance_plans", "model.tamanu_source_dbt.invoice_price_list_items", "model.tamanu_source_dbt.invoice_price_lists", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types"], "model.tamanu_source_dbt.ds__lab_requests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__lab_tests": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__location_bookings": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__medication_dispenses": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.ds__ongoing_conditions": ["model.tamanu_source_dbt.patient_conditions", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__outpatient_appointments": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__outpatient_appointments_audit": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users", "source.tamanu_source_dbt.tamanu.appointment_schedules"], "model.tamanu_source_dbt.ds__patients": ["model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__patients_access_logs": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_access_logs", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__patients_change_logs": ["model.tamanu_source_dbt.patient_additional_data_change_logs", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_change_logs", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__patient_program_registrations": ["model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_program_registration_conditions", "model.tamanu_source_dbt.patient_program_registrations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.program_registries", "model.tamanu_source_dbt.program_registry_clinical_statuses", "model.tamanu_source_dbt.program_registry_condition_categories", "model.tamanu_source_dbt.program_registry_conditions", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming": ["model.tamanu_source_dbt.patient_vaccinations_upcoming", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.ds__procedures": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__referrals": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.referrals", "model.tamanu_source_dbt.survey_responses", "model.tamanu_source_dbt.surveys", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details": ["model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_merged"], "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations": ["model.tamanu_source_dbt.patient_birth_data", "model.tamanu_source_dbt.patients"], "model.tamanu_source_dbt.ds__user_audit": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.roles", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users"], "model.tamanu_source_dbt.ds__vaccinations": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.int__admission_history_department": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.patients"], "model.tamanu_source_dbt.int__admission_history_location": ["model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients"], "model.tamanu_source_dbt.int__lab_requests_history": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.lab_request_logs", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.reference_data"], "model.tamanu_source_dbt.sensitive-admissions-line-list": ["model.tamanu_source_dbt.ds__sensitive_admissions"], "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments": ["model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit"], "model.tamanu_source_dbt.sensitive-encounter-diets-line-list": ["model.tamanu_source_dbt.ds__sensitive_encounter_diets"], "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.sensitive-imaging-requests-line-list": ["model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.translated_strings"], "model.tamanu_source_dbt.sensitive-imaging-requests-summary": ["model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.translated_strings"], "model.tamanu_source_dbt.sensitive-incomplete-referrals": ["model.tamanu_source_dbt.ds__sensitive_referrals"], "model.tamanu_source_dbt.sensitive-lab-requests-line-list": ["model.tamanu_source_dbt.ds__sensitive_lab_requests"], "model.tamanu_source_dbt.sensitive-lab-tests-line-list": ["model.tamanu_source_dbt.ds__sensitive_lab_tests"], "model.tamanu_source_dbt.sensitive-location-bookings-line-list": ["model.tamanu_source_dbt.ds__sensitive_location_bookings"], "model.tamanu_source_dbt.sensitive-medication-dispensed-summary": ["model.tamanu_source_dbt.ds__sensitive_medication_dispenses"], "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list": ["model.tamanu_source_dbt.ds__sensitive_outpatient_appointments"], "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary": ["model.tamanu_source_dbt.ds__sensitive_encounters_emergency"], "model.tamanu_source_dbt.sensitive-prescription-line-list": ["model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions"], "model.tamanu_source_dbt.sensitive-procedures-line-list": ["model.tamanu_source_dbt.ds__sensitive_procedures"], "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list": ["model.tamanu_source_dbt.ds__sensitive_diagnoses"], "model.tamanu_source_dbt.sensitive-user-audit-line-list": ["model.tamanu_source_dbt.ds__sensitive_user_audit"], "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list": ["model.tamanu_source_dbt.ds__sensitive_vaccinations"], "model.tamanu_source_dbt.sensitive-vaccine-line-list": ["model.tamanu_source_dbt.ds__sensitive_vaccinations"], "model.tamanu_source_dbt.admissions-line-list": ["model.tamanu_source_dbt.ds__admissions"], "model.tamanu_source_dbt.audit-outpatient-appointments": ["model.tamanu_source_dbt.ds__outpatient_appointments_audit"], "model.tamanu_source_dbt.audit-patient-details-edit": ["model.tamanu_source_dbt.ds__patients_change_logs"], "model.tamanu_source_dbt.audit-patient-views": ["model.tamanu_source_dbt.ds__patients_access_logs"], "model.tamanu_source_dbt.deceased-patients-line-list": ["model.tamanu_source_dbt.ds__deaths"], "model.tamanu_source_dbt.encounter-diets-line-list": ["model.tamanu_source_dbt.ds__encounter_diets"], "model.tamanu_source_dbt.encounter-summary-by-end-date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.encounter-summary-by-start-date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoice_products", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_test_panels", "model.tamanu_source_dbt.lab_test_types", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.reference_data", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.users", "model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_schedules"], "model.tamanu_source_dbt.hospital-admissions-by-area-summary": ["model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.locations"], "model.tamanu_source_dbt.hospital-admissions-by-department-summary": ["model.tamanu_source_dbt.int__admission_history_department"], "model.tamanu_source_dbt.hospital-admissions-by-location-summary": ["model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.locations"], "model.tamanu_source_dbt.imaging-requests-line-list": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.translated_strings"], "model.tamanu_source_dbt.imaging-requests-summary": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.translated_strings"], "model.tamanu_source_dbt.incomplete-referrals": ["model.tamanu_source_dbt.ds__referrals"], "model.tamanu_source_dbt.invoice-products-summary": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.invoice_insurance_plans", "model.tamanu_source_dbt.invoice_price_lists"], "model.tamanu_source_dbt.lab-requests-line-list": ["model.tamanu_source_dbt.ds__lab_requests"], "model.tamanu_source_dbt.lab-requests-summary": ["model.tamanu_source_dbt.int__lab_requests_history"], "model.tamanu_source_dbt.lab-tests-line-list": ["model.tamanu_source_dbt.ds__lab_tests"], "model.tamanu_source_dbt.location-bookings-line-list": ["model.tamanu_source_dbt.ds__location_bookings"], "model.tamanu_source_dbt.medication-dispensed-summary": ["model.tamanu_source_dbt.ds__medication_dispenses"], "model.tamanu_source_dbt.ongoing-conditions-line-list": ["model.tamanu_source_dbt.ds__ongoing_conditions"], "model.tamanu_source_dbt.outpatient-appointments-line-list": ["model.tamanu_source_dbt.ds__outpatient_appointments"], "model.tamanu_source_dbt.patient-emergency-encounters-summary": ["model.tamanu_source_dbt.ds__encounters_emergency"], "model.tamanu_source_dbt.prescription-line-list": ["model.tamanu_source_dbt.ds__encounter_prescriptions"], "model.tamanu_source_dbt.procedures-line-list": ["model.tamanu_source_dbt.ds__procedures"], "model.tamanu_source_dbt.program-registry-line-list": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.program-registry-removed-patients-line-list": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.recent-diagnoses-line-list": ["model.tamanu_source_dbt.ds__diagnoses"], "model.tamanu_source_dbt.registered-births-line-list": ["model.tamanu_source_dbt.ds__births"], "model.tamanu_source_dbt.registered-patients-by-dob-line-list": ["model.tamanu_source_dbt.ds__patients"], "model.tamanu_source_dbt.registered-patients-daily-summary": ["model.tamanu_source_dbt.ds__patients"], "model.tamanu_source_dbt.registered-patients-line-list": ["model.tamanu_source_dbt.ds__patients"], "model.tamanu_source_dbt.upcoming-vaccinations-line-list": ["model.tamanu_source_dbt.ds__patient_vaccinations_upcoming"], "model.tamanu_source_dbt.usage-quality-metrics-patient-details": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details"], "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations"], "model.tamanu_source_dbt.user-audit-line-list": ["model.tamanu_source_dbt.ds__user_audit"], "model.tamanu_source_dbt.vaccine-audit-line-list": ["model.tamanu_source_dbt.ds__vaccinations"], "model.tamanu_source_dbt.vaccine-line-list": ["model.tamanu_source_dbt.ds__vaccinations"], "test.tamanu_source_dbt.logical__ds__admissions": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__diagnoses": ["model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__encounters_emergency": ["model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.triages"], "test.tamanu_source_dbt.logical__ds__encounter_diets": ["model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__encounter_prescriptions": ["model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__imaging_requests": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__location_bookings": ["model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__outpatient_appointments": ["model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.location_groups", "model.tamanu_source_dbt.outpatient_appointments"], "test.tamanu_source_dbt.logical__ds__procedures": ["model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.procedures"], "test.tamanu_source_dbt.logical__ds__referrals": ["model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.referrals"], "test.tamanu_source_dbt.logical__ds__user_audit": ["model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations"], "test.tamanu_source_dbt.logical__ds__vaccinations": ["model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.vaccine_administrations"], "test.tamanu_source_dbt.logical__encounter_summary_by_end_date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users"], "test.tamanu_source_dbt.logical__encounter_summary_by_start_date": ["model.tamanu_source_dbt.departments", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.facilities", "model.tamanu_source_dbt.locations", "model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.users"], "test.tamanu_source_dbt.assert__metric_definitions__disaggregations": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.assert__patients__village_id": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.assert__users__role": ["source.tamanu_source_dbt.tamanu.roles", "source.tamanu_source_dbt.tamanu.users"], "seed.tamanu_source_dbt.metric_definitions": [], "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f": ["seed.tamanu_source_dbt.metric_definitions"], "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc": ["model.tamanu_source_dbt.encounter_diagnoses"], "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9": ["source.tamanu_source_dbt.logs__tamanu.accesses"], "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465": ["source.tamanu_source_dbt.logs__tamanu.changes", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8": ["source.tamanu_source_dbt.logs__tamanu.changes"], "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0": ["source.tamanu_source_dbt.logs__tamanu.debug_logs"], "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0": ["source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"], "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8": ["source.tamanu_source_dbt.logs__tamanu.fhir_writes"], "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54": ["source.tamanu_source_dbt.logs__tamanu.migrations"], "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1": ["source.tamanu_source_dbt.tamanu.administered_vaccines"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f": ["source.tamanu_source_dbt.tamanu.administered_vaccines", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230": ["source.tamanu_source_dbt.tamanu.appointments", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c": ["source.tamanu_source_dbt.tamanu.appointments"], "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c": ["source.tamanu_source_dbt.tamanu.appointment_procedure_types"], "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf": ["source.tamanu_source_dbt.tamanu.appointment_schedules"], "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b": ["source.tamanu_source_dbt.tamanu.assets"], "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d": ["source.tamanu_source_dbt.tamanu.attachments"], "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250": ["source.tamanu_source_dbt.tamanu.certifiable_vaccines"], "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a": ["source.tamanu_source_dbt.tamanu.certificate_notifications", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5": ["source.tamanu_source_dbt.tamanu.certificate_notifications", "source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe": ["source.tamanu_source_dbt.tamanu.certificate_notifications", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7": ["source.tamanu_source_dbt.tamanu.certificate_notifications"], "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b": ["source.tamanu_source_dbt.tamanu.contributing_death_causes", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a": ["source.tamanu_source_dbt.tamanu.contributing_death_causes"], "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c": ["source.tamanu_source_dbt.tamanu.death_revert_logs", "source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c": ["source.tamanu_source_dbt.tamanu.death_revert_logs", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54": ["source.tamanu_source_dbt.tamanu.death_revert_logs", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf": ["source.tamanu_source_dbt.tamanu.death_revert_logs"], "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182": ["source.tamanu_source_dbt.tamanu.departments"], "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812": ["source.tamanu_source_dbt.tamanu.devices", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6": ["source.tamanu_source_dbt.tamanu.devices"], "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59": ["source.tamanu_source_dbt.tamanu.discharges"], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b": ["source.tamanu_source_dbt.tamanu.discharges"], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574": ["source.tamanu_source_dbt.tamanu.discharges"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c": ["source.tamanu_source_dbt.tamanu.discharges"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4": ["source.tamanu_source_dbt.tamanu.discharges", "source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b": ["source.tamanu_source_dbt.tamanu.document_metadata", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909": ["source.tamanu_source_dbt.tamanu.document_metadata", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd": ["source.tamanu_source_dbt.tamanu.attachments", "source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947": ["source.tamanu_source_dbt.tamanu.document_metadata"], "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2": ["source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464": ["source.tamanu_source_dbt.tamanu.encounter_diagnoses", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836": ["source.tamanu_source_dbt.tamanu.encounter_diets", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d": ["source.tamanu_source_dbt.tamanu.encounter_diets", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae": ["source.tamanu_source_dbt.tamanu.encounter_diets"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.encounters"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47": ["source.tamanu_source_dbt.tamanu.encounter_history", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca": ["source.tamanu_source_dbt.tamanu.encounter_history"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2": ["source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"], "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab": ["source.tamanu_source_dbt.tamanu.encounter_prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f": ["source.tamanu_source_dbt.tamanu.facilities"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb": ["source.tamanu_source_dbt.tamanu.imaging_area_external_codes"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999": ["source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600": ["source.tamanu_source_dbt.tamanu.imaging_request_areas", "source.tamanu_source_dbt.tamanu.imaging_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06": ["source.tamanu_source_dbt.tamanu.imaging_request_areas", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462": ["source.tamanu_source_dbt.tamanu.imaging_request_areas"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069": ["source.tamanu_source_dbt.tamanu.imaging_requests", "source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113": ["source.tamanu_source_dbt.tamanu.imaging_results", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046": ["source.tamanu_source_dbt.tamanu.imaging_results"], "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee": ["source.tamanu_source_dbt.tamanu.imaging_type_external_codes"], "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b": ["source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33": ["source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1": ["source.tamanu_source_dbt.tamanu.invoice_discounts", "source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3": ["source.tamanu_source_dbt.tamanu.invoice_discounts", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160": ["source.tamanu_source_dbt.tamanu.invoice_discounts"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plans"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3": ["source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments", "source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02": ["source.tamanu_source_dbt.tamanu.invoice_insurer_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8": ["source.tamanu_source_dbt.tamanu.invoice_items", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100": ["source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts", "source.tamanu_source_dbt.tamanu.invoice_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3": ["source.tamanu_source_dbt.tamanu.invoice_item_discounts"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c": ["source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments", "source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6": ["source.tamanu_source_dbt.tamanu.invoice_patient_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060": ["source.tamanu_source_dbt.tamanu.invoice_payments", "source.tamanu_source_dbt.tamanu.invoices"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b": ["source.tamanu_source_dbt.tamanu.invoice_payments", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145": ["source.tamanu_source_dbt.tamanu.invoice_payments"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7": ["source.tamanu_source_dbt.tamanu.invoice_price_lists"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a": ["source.tamanu_source_dbt.tamanu.invoice_price_list_items"], "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616": ["source.tamanu_source_dbt.tamanu.invoice_products"], "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f": ["source.tamanu_source_dbt.tamanu.ips_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9": ["source.tamanu_source_dbt.tamanu.ips_requests"], "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7": ["source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec": ["source.tamanu_source_dbt.tamanu.departments", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f": ["source.tamanu_source_dbt.tamanu.attachments", "source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506": ["source.tamanu_source_dbt.tamanu.lab_request_attachments", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba": ["source.tamanu_source_dbt.tamanu.lab_request_attachments"], "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3": ["source.tamanu_source_dbt.tamanu.lab_request_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd": ["source.tamanu_source_dbt.tamanu.lab_request_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da": ["source.tamanu_source_dbt.tamanu.lab_request_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e": ["source.tamanu_source_dbt.tamanu.lab_request_logs", "source.tamanu_source_dbt.tamanu.lab_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883": ["source.tamanu_source_dbt.tamanu.lab_request_logs", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f": ["source.tamanu_source_dbt.tamanu.lab_request_logs"], "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa": ["source.tamanu_source_dbt.tamanu.lab_requests", "source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e": ["source.tamanu_source_dbt.tamanu.lab_test_types", "source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f": ["source.tamanu_source_dbt.tamanu.lab_tests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5": ["source.tamanu_source_dbt.tamanu.lab_tests", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de": ["source.tamanu_source_dbt.tamanu.lab_tests"], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6": ["source.tamanu_source_dbt.tamanu.lab_test_panels", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16": ["source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types", "source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types", "source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36": ["source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests", "source.tamanu_source_dbt.tamanu.lab_test_panels"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d": ["source.tamanu_source_dbt.tamanu.lab_test_panel_requests"], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4": ["source.tamanu_source_dbt.tamanu.lab_test_types", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94": ["source.tamanu_source_dbt.tamanu.lab_test_types"], "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21": ["source.tamanu_source_dbt.tamanu.local_system_facts"], "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b": ["source.tamanu_source_dbt.tamanu.local_system_facts"], "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d": ["source.tamanu_source_dbt.tamanu.local_system_facts"], "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e": ["source.tamanu_source_dbt.tamanu.location_groups", "source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5": ["source.tamanu_source_dbt.tamanu.locations"], "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f": ["source.tamanu_source_dbt.tamanu.location_assignments"], "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3": ["source.tamanu_source_dbt.tamanu.location_assignment_templates"], "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0": ["source.tamanu_source_dbt.tamanu.location_groups"], "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a": ["source.tamanu_source_dbt.tamanu.medication_administration_records"], "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c": ["source.tamanu_source_dbt.tamanu.medication_administration_record_doses"], "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91": ["source.tamanu_source_dbt.tamanu.medication_dispenses"], "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5": ["source.tamanu_source_dbt.tamanu.notes", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7": ["source.tamanu_source_dbt.tamanu.notes", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822": ["source.tamanu_source_dbt.tamanu.notes"], "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0": ["source.tamanu_source_dbt.tamanu.notes_legacy"], "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b": ["source.tamanu_source_dbt.tamanu.note_items", "source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3": ["source.tamanu_source_dbt.tamanu.note_items", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca": ["source.tamanu_source_dbt.tamanu.note_items", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d": ["source.tamanu_source_dbt.tamanu.note_items"], "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc": ["source.tamanu_source_dbt.tamanu.note_pages"], "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2": ["source.tamanu_source_dbt.tamanu.notifications"], "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac": ["source.tamanu_source_dbt.tamanu.one_time_logins", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03": ["source.tamanu_source_dbt.tamanu.one_time_logins"], "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54": ["source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf": ["source.tamanu_source_dbt.tamanu.patient_additional_data"], "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8": ["source.tamanu_source_dbt.tamanu.patient_allergies"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7": ["source.tamanu_source_dbt.tamanu.patient_birth_data", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9": ["source.tamanu_source_dbt.tamanu.patient_birth_data"], "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450": ["source.tamanu_source_dbt.tamanu.patient_care_plans"], "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba": ["source.tamanu_source_dbt.tamanu.patient_communications", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278": ["source.tamanu_source_dbt.tamanu.patient_communications"], "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb": ["source.tamanu_source_dbt.tamanu.patient_conditions"], "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615": ["source.tamanu_source_dbt.tamanu.patient_contacts", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27": ["source.tamanu_source_dbt.tamanu.patient_contacts", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683": ["source.tamanu_source_dbt.tamanu.patient_contacts"], "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126": ["source.tamanu_source_dbt.tamanu.patient_death_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de": ["source.tamanu_source_dbt.tamanu.patient_death_data", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6": ["source.tamanu_source_dbt.tamanu.patient_facilities"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4": ["source.tamanu_source_dbt.tamanu.patient_facilities"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062": ["source.tamanu_source_dbt.tamanu.patient_facilities", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92": ["source.tamanu_source_dbt.tamanu.patient_family_histories", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6": ["source.tamanu_source_dbt.tamanu.patient_family_histories", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce": ["source.tamanu_source_dbt.tamanu.patient_family_histories", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718": ["source.tamanu_source_dbt.tamanu.patient_family_histories"], "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories", "source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106": ["source.tamanu_source_dbt.tamanu.patient_field_definitions"], "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6": ["source.tamanu_source_dbt.tamanu.patient_field_definition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5": ["source.tamanu_source_dbt.tamanu.patient_field_definitions", "source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59": ["source.tamanu_source_dbt.tamanu.patient_field_values", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2": ["source.tamanu_source_dbt.tamanu.patient_field_values"], "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb": ["source.tamanu_source_dbt.tamanu.patient_issues", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397": ["source.tamanu_source_dbt.tamanu.patient_issues"], "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae": ["source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554": ["source.tamanu_source_dbt.tamanu.patient_program_registrations", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d": ["source.tamanu_source_dbt.tamanu.patient_program_registrations"], "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618": ["source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"], "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463": ["source.tamanu_source_dbt.tamanu.patient_secondary_ids"], "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"], "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561": ["source.tamanu_source_dbt.tamanu.patient_vrs_data", "source.tamanu_source_dbt.tamanu.patients"], "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437": ["source.tamanu_source_dbt.tamanu.patient_vrs_data"], "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407": ["source.tamanu_source_dbt.tamanu.permissions", "source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be": ["source.tamanu_source_dbt.tamanu.permissions"], "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904": ["source.tamanu_source_dbt.tamanu.pharmacy_orders"], "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b": ["source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9": ["source.tamanu_source_dbt.tamanu.portal_one_time_tokens"], "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0": ["source.tamanu_source_dbt.tamanu.portal_survey_assignments"], "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108": ["source.tamanu_source_dbt.tamanu.portal_users"], "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b": ["source.tamanu_source_dbt.tamanu.prescriptions"], "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8": ["source.tamanu_source_dbt.tamanu.locations", "source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82": ["source.tamanu_source_dbt.tamanu.procedures", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157": ["source.tamanu_source_dbt.tamanu.procedures"], "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e": ["source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"], "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3": ["source.tamanu_source_dbt.tamanu.procedure_survey_responses"], "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41": ["source.tamanu_source_dbt.tamanu.procedure_type_surveys"], "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9": ["source.tamanu_source_dbt.tamanu.programs"], "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030": ["source.tamanu_source_dbt.tamanu.program_data_elements"], "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746": ["source.tamanu_source_dbt.tamanu.program_registries"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8": ["source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413": ["source.tamanu_source_dbt.tamanu.program_registries", "source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f": ["source.tamanu_source_dbt.tamanu.program_registry_conditions"], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95": ["source.tamanu_source_dbt.tamanu.program_registry_condition_categories"], "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20": ["source.tamanu_source_dbt.tamanu.reference_data"], "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b": ["source.tamanu_source_dbt.tamanu.reference_data_relations"], "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485": ["source.tamanu_source_dbt.tamanu.reference_drugs"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370": ["source.tamanu_source_dbt.tamanu.reference_drug_facilities"], "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1": ["source.tamanu_source_dbt.tamanu.reference_medication_templates"], "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d": ["source.tamanu_source_dbt.tamanu.referrals", "source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb": ["source.tamanu_source_dbt.tamanu.referrals"], "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2": ["source.tamanu_source_dbt.tamanu.refresh_tokens", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921": ["source.tamanu_source_dbt.tamanu.refresh_tokens"], "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3": ["source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2": ["source.tamanu_source_dbt.tamanu.report_definition_versions", "source.tamanu_source_dbt.tamanu.report_definitions"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192": ["source.tamanu_source_dbt.tamanu.report_definition_versions", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762": ["source.tamanu_source_dbt.tamanu.report_definition_versions"], "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4": ["source.tamanu_source_dbt.tamanu.report_requests", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d": ["source.tamanu_source_dbt.tamanu.report_definition_versions", "source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267": ["source.tamanu_source_dbt.tamanu.report_requests"], "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a": ["source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463": ["source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef": ["source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f": ["source.tamanu_source_dbt.tamanu.roles"], "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines"], "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c": ["source.tamanu_source_dbt.tamanu.SequelizeMeta"], "test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6": ["source.tamanu_source_dbt.tamanu.SequelizeMeta"], "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8": ["source.tamanu_source_dbt.tamanu.settings"], "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6": ["source.tamanu_source_dbt.tamanu.signers"], "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"], "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48": ["source.tamanu_source_dbt.tamanu.socket_io_attachments"], "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635": ["source.tamanu_source_dbt.tamanu.programs", "source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b": ["source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90": ["source.tamanu_source_dbt.tamanu.survey_responses", "source.tamanu_source_dbt.tamanu.surveys"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04": ["source.tamanu_source_dbt.tamanu.survey_responses", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924": ["source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d": ["source.tamanu_source_dbt.tamanu.survey_response_answers", "source.tamanu_source_dbt.tamanu.survey_responses"], "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b": ["source.tamanu_source_dbt.tamanu.program_data_elements", "source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf": ["source.tamanu_source_dbt.tamanu.survey_response_answers"], "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa": ["source.tamanu_source_dbt.tamanu.survey_screen_components"], "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41": ["source.tamanu_source_dbt.tamanu.sync_device_ticks"], "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63": ["source.tamanu_source_dbt.tamanu.facilities", "source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211": ["source.tamanu_source_dbt.tamanu.sync_lookup"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"], "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359": ["source.tamanu_source_dbt.tamanu.sync_lookup_ticks"], "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd": ["source.tamanu_source_dbt.tamanu.sync_queued_devices"], "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb": ["source.tamanu_source_dbt.tamanu.sync_sessions"], "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d": ["source.tamanu_source_dbt.tamanu.tasks"], "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273": ["source.tamanu_source_dbt.tamanu.task_designations"], "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6": ["source.tamanu_source_dbt.tamanu.task_templates"], "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1": ["source.tamanu_source_dbt.tamanu.task_template_designations"], "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c": ["source.tamanu_source_dbt.tamanu.templates", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c": ["source.tamanu_source_dbt.tamanu.templates"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2": ["source.tamanu_source_dbt.tamanu.translated_strings"], "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0": ["source.tamanu_source_dbt.tamanu.encounters", "source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138": ["source.tamanu_source_dbt.tamanu.triages", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a": ["source.tamanu_source_dbt.tamanu.reference_data", "source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f": ["source.tamanu_source_dbt.tamanu.triages"], "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c": ["source.tamanu_source_dbt.tamanu.patients", "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"], "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf": ["source.tamanu_source_dbt.tamanu.scheduled_vaccines", "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"], "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704": ["source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06": ["source.tamanu_source_dbt.tamanu.user_designations"], "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a": ["source.tamanu_source_dbt.tamanu.user_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3": ["source.tamanu_source_dbt.tamanu.user_facilities"], "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16": ["source.tamanu_source_dbt.tamanu.user_facilities"], "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565": ["source.tamanu_source_dbt.tamanu.user_leaves"], "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"], "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"], "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3": ["source.tamanu_source_dbt.tamanu.user_localisation_caches"], "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999": ["source.tamanu_source_dbt.tamanu.devices", "source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5": ["source.tamanu_source_dbt.tamanu.user_login_attempts", "source.tamanu_source_dbt.tamanu.users"], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05": ["source.tamanu_source_dbt.tamanu.user_login_attempts"], "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13": ["source.tamanu_source_dbt.tamanu.user_preferences"], "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8": ["source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"], "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1": ["source.tamanu_source_dbt.tamanu.vitals"], "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055": ["source.tamanu_source_dbt.tamanu.users", "source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d": ["source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26": ["source.tamanu_source_dbt.tamanu.survey_response_answers", "source.tamanu_source_dbt.tamanu.vital_logs"], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877": ["source.tamanu_source_dbt.tamanu.vital_logs"], "source.tamanu_source_dbt.logs__tamanu.accesses": [], "source.tamanu_source_dbt.logs__tamanu.changes": [], "source.tamanu_source_dbt.logs__tamanu.debug_logs": [], "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes": [], "source.tamanu_source_dbt.logs__tamanu.fhir_writes": [], "source.tamanu_source_dbt.logs__tamanu.migrations": [], "source.tamanu_source_dbt.tamanu.administered_vaccines": [], "source.tamanu_source_dbt.tamanu.appointments": [], "source.tamanu_source_dbt.tamanu.appointment_procedure_types": [], "source.tamanu_source_dbt.tamanu.appointment_schedules": [], "source.tamanu_source_dbt.tamanu.assets": [], "source.tamanu_source_dbt.tamanu.attachments": [], "source.tamanu_source_dbt.tamanu.certifiable_vaccines": [], "source.tamanu_source_dbt.tamanu.certificate_notifications": [], "source.tamanu_source_dbt.tamanu.contributing_death_causes": [], "source.tamanu_source_dbt.tamanu.death_revert_logs": [], "source.tamanu_source_dbt.tamanu.departments": [], "source.tamanu_source_dbt.tamanu.devices": [], "source.tamanu_source_dbt.tamanu.discharges": [], "source.tamanu_source_dbt.tamanu.document_metadata": [], "source.tamanu_source_dbt.tamanu.encounters": [], "source.tamanu_source_dbt.tamanu.encounter_diagnoses": [], "source.tamanu_source_dbt.tamanu.encounter_diets": [], "source.tamanu_source_dbt.tamanu.encounter_history": [], "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions": [], "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories": [], "source.tamanu_source_dbt.tamanu.encounter_prescriptions": [], "source.tamanu_source_dbt.tamanu.facilities": [], "source.tamanu_source_dbt.tamanu.imaging_area_external_codes": [], "source.tamanu_source_dbt.tamanu.imaging_requests": [], "source.tamanu_source_dbt.tamanu.imaging_request_areas": [], "source.tamanu_source_dbt.tamanu.imaging_results": [], "source.tamanu_source_dbt.tamanu.imaging_type_external_codes": [], "source.tamanu_source_dbt.tamanu.invoices": [], "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans": [], "source.tamanu_source_dbt.tamanu.invoice_discounts": [], "source.tamanu_source_dbt.tamanu.invoice_insurance_plans": [], "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items": [], "source.tamanu_source_dbt.tamanu.invoice_insurer_payments": [], "source.tamanu_source_dbt.tamanu.invoice_items": [], "source.tamanu_source_dbt.tamanu.invoice_item_discounts": [], "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances": [], "source.tamanu_source_dbt.tamanu.invoice_patient_payments": [], "source.tamanu_source_dbt.tamanu.invoice_payments": [], "source.tamanu_source_dbt.tamanu.invoice_price_lists": [], "source.tamanu_source_dbt.tamanu.invoice_price_list_items": [], "source.tamanu_source_dbt.tamanu.invoice_products": [], "source.tamanu_source_dbt.tamanu.ips_requests": [], "source.tamanu_source_dbt.tamanu.lab_requests": [], "source.tamanu_source_dbt.tamanu.lab_request_attachments": [], "source.tamanu_source_dbt.tamanu.lab_request_logs": [], "source.tamanu_source_dbt.tamanu.lab_tests": [], "source.tamanu_source_dbt.tamanu.lab_test_panels": [], "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types": [], "source.tamanu_source_dbt.tamanu.lab_test_panel_requests": [], "source.tamanu_source_dbt.tamanu.lab_test_types": [], "source.tamanu_source_dbt.tamanu.local_system_facts": [], "source.tamanu_source_dbt.tamanu.locations": [], "source.tamanu_source_dbt.tamanu.location_assignments": [], "source.tamanu_source_dbt.tamanu.location_assignment_templates": [], "source.tamanu_source_dbt.tamanu.location_groups": [], "source.tamanu_source_dbt.tamanu.medication_administration_records": [], "source.tamanu_source_dbt.tamanu.medication_administration_record_doses": [], "source.tamanu_source_dbt.tamanu.medication_dispenses": [], "source.tamanu_source_dbt.tamanu.notes": [], "source.tamanu_source_dbt.tamanu.notes_legacy": [], "source.tamanu_source_dbt.tamanu.note_items": [], "source.tamanu_source_dbt.tamanu.note_pages": [], "source.tamanu_source_dbt.tamanu.notifications": [], "source.tamanu_source_dbt.tamanu.one_time_logins": [], "source.tamanu_source_dbt.tamanu.patients": [], "source.tamanu_source_dbt.tamanu.patient_additional_data": [], "source.tamanu_source_dbt.tamanu.patient_allergies": [], "source.tamanu_source_dbt.tamanu.patient_birth_data": [], "source.tamanu_source_dbt.tamanu.patient_care_plans": [], "source.tamanu_source_dbt.tamanu.patient_communications": [], "source.tamanu_source_dbt.tamanu.patient_conditions": [], "source.tamanu_source_dbt.tamanu.patient_contacts": [], "source.tamanu_source_dbt.tamanu.patient_death_data": [], "source.tamanu_source_dbt.tamanu.patient_facilities": [], "source.tamanu_source_dbt.tamanu.patient_family_histories": [], "source.tamanu_source_dbt.tamanu.patient_field_definitions": [], "source.tamanu_source_dbt.tamanu.patient_field_definition_categories": [], "source.tamanu_source_dbt.tamanu.patient_field_values": [], "source.tamanu_source_dbt.tamanu.patient_issues": [], "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions": [], "source.tamanu_source_dbt.tamanu.patient_program_registrations": [], "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions": [], "source.tamanu_source_dbt.tamanu.patient_secondary_ids": [], "source.tamanu_source_dbt.tamanu.patient_vrs_data": [], "source.tamanu_source_dbt.tamanu.permissions": [], "source.tamanu_source_dbt.tamanu.pharmacy_orders": [], "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions": [], "source.tamanu_source_dbt.tamanu.portal_one_time_tokens": [], "source.tamanu_source_dbt.tamanu.portal_survey_assignments": [], "source.tamanu_source_dbt.tamanu.portal_users": [], "source.tamanu_source_dbt.tamanu.prescriptions": [], "source.tamanu_source_dbt.tamanu.procedures": [], "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians": [], "source.tamanu_source_dbt.tamanu.procedure_survey_responses": [], "source.tamanu_source_dbt.tamanu.procedure_type_surveys": [], "source.tamanu_source_dbt.tamanu.programs": [], "source.tamanu_source_dbt.tamanu.program_data_elements": [], "source.tamanu_source_dbt.tamanu.program_registries": [], "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses": [], "source.tamanu_source_dbt.tamanu.program_registry_conditions": [], "source.tamanu_source_dbt.tamanu.program_registry_condition_categories": [], "source.tamanu_source_dbt.tamanu.reference_data": [], "source.tamanu_source_dbt.tamanu.reference_data_relations": [], "source.tamanu_source_dbt.tamanu.reference_drugs": [], "source.tamanu_source_dbt.tamanu.reference_drug_facilities": [], "source.tamanu_source_dbt.tamanu.reference_medication_templates": [], "source.tamanu_source_dbt.tamanu.referrals": [], "source.tamanu_source_dbt.tamanu.refresh_tokens": [], "source.tamanu_source_dbt.tamanu.report_definitions": [], "source.tamanu_source_dbt.tamanu.report_definition_versions": [], "source.tamanu_source_dbt.tamanu.report_requests": [], "source.tamanu_source_dbt.tamanu.roles": [], "source.tamanu_source_dbt.tamanu.scheduled_vaccines": [], "source.tamanu_source_dbt.tamanu.SequelizeMeta": [], "source.tamanu_source_dbt.tamanu.settings": [], "source.tamanu_source_dbt.tamanu.signers": [], "source.tamanu_source_dbt.tamanu.socket_io_attachments": [], "source.tamanu_source_dbt.tamanu.surveys": [], "source.tamanu_source_dbt.tamanu.survey_responses": [], "source.tamanu_source_dbt.tamanu.survey_response_answers": [], "source.tamanu_source_dbt.tamanu.survey_screen_components": [], "source.tamanu_source_dbt.tamanu.sync_device_ticks": [], "source.tamanu_source_dbt.tamanu.sync_lookup": [], "source.tamanu_source_dbt.tamanu.sync_lookup_ticks": [], "source.tamanu_source_dbt.tamanu.sync_queued_devices": [], "source.tamanu_source_dbt.tamanu.sync_sessions": [], "source.tamanu_source_dbt.tamanu.tasks": [], "source.tamanu_source_dbt.tamanu.task_designations": [], "source.tamanu_source_dbt.tamanu.task_templates": [], "source.tamanu_source_dbt.tamanu.task_template_designations": [], "source.tamanu_source_dbt.tamanu.templates": [], "source.tamanu_source_dbt.tamanu.translated_strings": [], "source.tamanu_source_dbt.tamanu.triages": [], "source.tamanu_source_dbt.tamanu.upcoming_vaccinations": [], "source.tamanu_source_dbt.tamanu.users": [], "source.tamanu_source_dbt.tamanu.user_designations": [], "source.tamanu_source_dbt.tamanu.user_facilities": [], "source.tamanu_source_dbt.tamanu.user_leaves": [], "source.tamanu_source_dbt.tamanu.user_localisation_caches": [], "source.tamanu_source_dbt.tamanu.user_login_attempts": [], "source.tamanu_source_dbt.tamanu.user_preferences": [], "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients": [], "source.tamanu_source_dbt.tamanu.vitals": [], "source.tamanu_source_dbt.tamanu.vital_logs": [], "unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs": ["model.tamanu_source_dbt.patient_program_registrations_change_logs"], "unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs": ["model.tamanu_source_dbt.patient_program_registration_conditions_change_logs"], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation": ["model.tamanu_source_dbt.ds__admissions"], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality": ["model.tamanu_source_dbt.ds__admissions"], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only": ["model.tamanu_source_dbt.ds__admissions"], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities": ["model.tamanu_source_dbt.ds__admissions"]}, "child_map": {"model.tamanu_source_dbt.contributing_death_causes": ["model.tamanu_source_dbt.ds__deaths"], "model.tamanu_source_dbt.departments": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.discharges": ["model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.document_metadata": [], "model.tamanu_source_dbt.encounters": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "test.tamanu_source_dbt.logical__ds__admissions", "test.tamanu_source_dbt.logical__ds__diagnoses", "test.tamanu_source_dbt.logical__ds__encounter_diets", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions", "test.tamanu_source_dbt.logical__ds__imaging_requests", "test.tamanu_source_dbt.logical__ds__procedures", "test.tamanu_source_dbt.logical__ds__referrals", "test.tamanu_source_dbt.logical__ds__user_audit", "test.tamanu_source_dbt.logical__ds__vaccinations", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.encounters_metadata": [], "model.tamanu_source_dbt.encounter_diagnoses": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc", "test.tamanu_source_dbt.logical__ds__diagnoses"], "model.tamanu_source_dbt.encounter_diagnoses_metadata": [], "model.tamanu_source_dbt.encounter_diets": ["model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_diets"], "model.tamanu_source_dbt.encounter_history": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.encounter_prescriptions": ["model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions"], "model.tamanu_source_dbt.facilities": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patients_access_logs", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__admissions", "test.tamanu_source_dbt.logical__ds__diagnoses", "test.tamanu_source_dbt.logical__ds__encounter_diets", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions", "test.tamanu_source_dbt.logical__ds__imaging_requests", "test.tamanu_source_dbt.logical__ds__location_bookings", "test.tamanu_source_dbt.logical__ds__outpatient_appointments", "test.tamanu_source_dbt.logical__ds__procedures", "test.tamanu_source_dbt.logical__ds__referrals", "test.tamanu_source_dbt.logical__ds__user_audit", "test.tamanu_source_dbt.logical__ds__vaccinations", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.imaging_area_external_codes": [], "model.tamanu_source_dbt.imaging_requests": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__imaging_requests"], "model.tamanu_source_dbt.imaging_request_areas": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.imaging_results": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__sensitive_imaging_requests"], "model.tamanu_source_dbt.invoices": ["model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.invoice_insurance_plans": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.invoice-products-summary"], "model.tamanu_source_dbt.invoice_insurance_plan_items": ["model.tamanu_source_dbt.ds__invoice_products"], "model.tamanu_source_dbt.invoice_items": ["model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.invoice_price_lists": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.invoice-products-summary"], "model.tamanu_source_dbt.invoice_price_list_items": ["model.tamanu_source_dbt.ds__invoice_products"], "model.tamanu_source_dbt.invoice_products": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_requests": ["model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_requests_metadata": [], "model.tamanu_source_dbt.lab_request_logs": ["model.tamanu_source_dbt.int__lab_requests_history"], "model.tamanu_source_dbt.lab_request_logs_metadata": [], "model.tamanu_source_dbt.lab_tests": ["model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_test_panels": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_test_panel_lab_test_types": [], "model.tamanu_source_dbt.lab_test_panel_requests": ["model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.lab_test_types": ["model.tamanu_source_dbt.ds__invoice_products", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.locations": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.hospital-admissions-by-area-summary", "model.tamanu_source_dbt.hospital-admissions-by-location-summary", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__admissions", "test.tamanu_source_dbt.logical__ds__diagnoses", "test.tamanu_source_dbt.logical__ds__encounter_diets", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions", "test.tamanu_source_dbt.logical__ds__imaging_requests", "test.tamanu_source_dbt.logical__ds__location_bookings", "test.tamanu_source_dbt.logical__ds__procedures", "test.tamanu_source_dbt.logical__ds__referrals", "test.tamanu_source_dbt.logical__ds__user_audit", "test.tamanu_source_dbt.logical__ds__vaccinations", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.location_bookings": ["model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "test.tamanu_source_dbt.logical__ds__location_bookings"], "model.tamanu_source_dbt.location_groups": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__outpatient_appointments"], "model.tamanu_source_dbt.medication_dispenses": ["model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses"], "model.tamanu_source_dbt.notes": ["model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.outpatient_appointments": ["model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "test.tamanu_source_dbt.logical__ds__outpatient_appointments"], "model.tamanu_source_dbt.outpatient_appointments_change_logs": ["model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit"], "model.tamanu_source_dbt.patients": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__ongoing_conditions", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__patients_access_logs", "model.tamanu_source_dbt.ds__patients_change_logs", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details", "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__admission_history_department", "model.tamanu_source_dbt.int__admission_history_location", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.patients_access_logs": ["model.tamanu_source_dbt.ds__patients_access_logs"], "model.tamanu_source_dbt.patients_change_logs": ["model.tamanu_source_dbt.ds__patients_change_logs"], "model.tamanu_source_dbt.patients_merged": ["model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details"], "model.tamanu_source_dbt.patients_metadata": [], "model.tamanu_source_dbt.patient_additional_data": ["model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.patient_additional_data_change_logs": ["model.tamanu_source_dbt.ds__patients_change_logs"], "model.tamanu_source_dbt.patient_allergies": ["model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_diets"], "model.tamanu_source_dbt.patient_birth_data": ["model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations"], "model.tamanu_source_dbt.patient_care_plans": [], "model.tamanu_source_dbt.patient_conditions": ["model.tamanu_source_dbt.ds__ongoing_conditions"], "model.tamanu_source_dbt.patient_death_contributing_causes": [], "model.tamanu_source_dbt.patient_death_data": ["model.tamanu_source_dbt.ds__deaths"], "model.tamanu_source_dbt.patient_facilities": [], "model.tamanu_source_dbt.patient_family_histories": [], "model.tamanu_source_dbt.patient_field_values": [], "model.tamanu_source_dbt.patient_program_registrations": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registrations_change_logs": ["unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs"], "model.tamanu_source_dbt.patient_program_registration_conditions": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs": ["unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs"], "model.tamanu_source_dbt.patient_vaccinations_upcoming": ["model.tamanu_source_dbt.ds__patient_vaccinations_upcoming"], "model.tamanu_source_dbt.pharmacy_orders": ["model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses"], "model.tamanu_source_dbt.pharmacy_order_prescriptions": ["model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses"], "model.tamanu_source_dbt.prescriptions": ["model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.procedures": ["model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__procedures"], "model.tamanu_source_dbt.procedures_metadata": [], "model.tamanu_source_dbt.programs": [], "model.tamanu_source_dbt.program_data_elements": [], "model.tamanu_source_dbt.program_registries": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.program_registry_clinical_statuses": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.program_registry_conditions": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.program_registry_condition_categories": ["model.tamanu_source_dbt.ds__patient_program_registrations"], "model.tamanu_source_dbt.reference_data": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounter_diets", "model.tamanu_source_dbt.ds__encounter_prescriptions", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__medication_dispenses", "model.tamanu_source_dbt.ds__ongoing_conditions", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__patients_access_logs", "model.tamanu_source_dbt.ds__patients_change_logs", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounter_diets", "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_medication_dispenses", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.int__lab_requests_history", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.referrals": ["model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_referrals", "test.tamanu_source_dbt.logical__ds__referrals"], "model.tamanu_source_dbt.refresh_tokens": [], "model.tamanu_source_dbt.roles": ["model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__user_audit"], "model.tamanu_source_dbt.surveys": ["model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_referrals"], "model.tamanu_source_dbt.survey_responses": ["model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_referrals"], "model.tamanu_source_dbt.survey_response_answers": [], "model.tamanu_source_dbt.survey_screen_components": [], "model.tamanu_source_dbt.translated_strings": ["model.tamanu_source_dbt.imaging-requests-line-list", "model.tamanu_source_dbt.imaging-requests-summary", "model.tamanu_source_dbt.sensitive-imaging-requests-line-list", "model.tamanu_source_dbt.sensitive-imaging-requests-summary"], "model.tamanu_source_dbt.triages": ["model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__encounters_emergency"], "model.tamanu_source_dbt.users": ["model.tamanu_source_dbt.ds__admissions", "model.tamanu_source_dbt.ds__births", "model.tamanu_source_dbt.ds__deaths", "model.tamanu_source_dbt.ds__diagnoses", "model.tamanu_source_dbt.ds__encounters_emergency", "model.tamanu_source_dbt.ds__imaging_requests", "model.tamanu_source_dbt.ds__lab_requests", "model.tamanu_source_dbt.ds__lab_tests", "model.tamanu_source_dbt.ds__location_bookings", "model.tamanu_source_dbt.ds__ongoing_conditions", "model.tamanu_source_dbt.ds__outpatient_appointments", "model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__patient_program_registrations", "model.tamanu_source_dbt.ds__patients", "model.tamanu_source_dbt.ds__patients_access_logs", "model.tamanu_source_dbt.ds__patients_change_logs", "model.tamanu_source_dbt.ds__procedures", "model.tamanu_source_dbt.ds__referrals", "model.tamanu_source_dbt.ds__sensitive_admissions", "model.tamanu_source_dbt.ds__sensitive_diagnoses", "model.tamanu_source_dbt.ds__sensitive_encounters_emergency", "model.tamanu_source_dbt.ds__sensitive_imaging_requests", "model.tamanu_source_dbt.ds__sensitive_lab_requests", "model.tamanu_source_dbt.ds__sensitive_lab_tests", "model.tamanu_source_dbt.ds__sensitive_location_bookings", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_procedures", "model.tamanu_source_dbt.ds__sensitive_referrals", "model.tamanu_source_dbt.ds__sensitive_user_audit", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__user_audit", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__encounter_summary_by_end_date", "test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.users_metadata": [], "model.tamanu_source_dbt.vaccine_administrations": ["model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date", "test.tamanu_source_dbt.logical__ds__vaccinations"], "model.tamanu_source_dbt.vaccine_administrations_change_logs": ["model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__vaccinations"], "model.tamanu_source_dbt.vaccine_schedules": ["model.tamanu_source_dbt.ds__patient_vaccinations_upcoming", "model.tamanu_source_dbt.ds__sensitive_vaccinations", "model.tamanu_source_dbt.ds__vaccinations", "model.tamanu_source_dbt.encounter-summary-by-end-date", "model.tamanu_source_dbt.encounter-summary-by-start-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date", "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"], "model.tamanu_source_dbt.ds__sensitive_admissions": ["model.tamanu_source_dbt.sensitive-admissions-line-list"], "model.tamanu_source_dbt.ds__sensitive_diagnoses": ["model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list"], "model.tamanu_source_dbt.ds__sensitive_encounters_emergency": ["model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary"], "model.tamanu_source_dbt.ds__sensitive_encounter_diets": ["model.tamanu_source_dbt.sensitive-encounter-diets-line-list"], "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions": ["model.tamanu_source_dbt.sensitive-prescription-line-list"], "model.tamanu_source_dbt.ds__sensitive_imaging_requests": ["model.tamanu_source_dbt.sensitive-imaging-requests-line-list", "model.tamanu_source_dbt.sensitive-imaging-requests-summary"], "model.tamanu_source_dbt.ds__sensitive_lab_requests": ["model.tamanu_source_dbt.sensitive-lab-requests-line-list"], "model.tamanu_source_dbt.ds__sensitive_lab_tests": ["model.tamanu_source_dbt.sensitive-lab-tests-line-list"], "model.tamanu_source_dbt.ds__sensitive_location_bookings": ["model.tamanu_source_dbt.sensitive-location-bookings-line-list"], "model.tamanu_source_dbt.ds__sensitive_medication_dispenses": ["model.tamanu_source_dbt.sensitive-medication-dispensed-summary"], "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments": ["model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list"], "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit": ["model.tamanu_source_dbt.sensitive-audit-outpatient-appointments"], "model.tamanu_source_dbt.ds__sensitive_procedures": ["model.tamanu_source_dbt.sensitive-procedures-line-list"], "model.tamanu_source_dbt.ds__sensitive_referrals": ["model.tamanu_source_dbt.sensitive-incomplete-referrals"], "model.tamanu_source_dbt.ds__sensitive_user_audit": ["model.tamanu_source_dbt.sensitive-user-audit-line-list"], "model.tamanu_source_dbt.ds__sensitive_vaccinations": ["model.tamanu_source_dbt.sensitive-vaccine-audit-line-list", "model.tamanu_source_dbt.sensitive-vaccine-line-list"], "model.tamanu_source_dbt.ds__admissions": ["model.tamanu_source_dbt.admissions-line-list", "test.tamanu_source_dbt.logical__ds__admissions", "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation", "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality", "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only", "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities"], "model.tamanu_source_dbt.ds__births": ["model.tamanu_source_dbt.registered-births-line-list"], "model.tamanu_source_dbt.ds__deaths": ["model.tamanu_source_dbt.deceased-patients-line-list"], "model.tamanu_source_dbt.ds__diagnoses": ["model.tamanu_source_dbt.recent-diagnoses-line-list", "test.tamanu_source_dbt.logical__ds__diagnoses"], "model.tamanu_source_dbt.ds__encounters_emergency": ["model.tamanu_source_dbt.patient-emergency-encounters-summary", "test.tamanu_source_dbt.logical__ds__encounters_emergency"], "model.tamanu_source_dbt.ds__encounter_diets": ["model.tamanu_source_dbt.encounter-diets-line-list", "test.tamanu_source_dbt.logical__ds__encounter_diets"], "model.tamanu_source_dbt.ds__encounter_prescriptions": ["model.tamanu_source_dbt.prescription-line-list", "test.tamanu_source_dbt.logical__ds__encounter_prescriptions"], "model.tamanu_source_dbt.ds__imaging_requests": ["model.tamanu_source_dbt.imaging-requests-line-list", "model.tamanu_source_dbt.imaging-requests-summary", "test.tamanu_source_dbt.logical__ds__imaging_requests"], "model.tamanu_source_dbt.ds__invoice_products": ["model.tamanu_source_dbt.invoice-products-summary"], "model.tamanu_source_dbt.ds__lab_requests": ["model.tamanu_source_dbt.lab-requests-line-list"], "model.tamanu_source_dbt.ds__lab_tests": ["model.tamanu_source_dbt.lab-tests-line-list"], "model.tamanu_source_dbt.ds__location_bookings": ["model.tamanu_source_dbt.location-bookings-line-list", "test.tamanu_source_dbt.logical__ds__location_bookings"], "model.tamanu_source_dbt.ds__medication_dispenses": ["model.tamanu_source_dbt.medication-dispensed-summary"], "model.tamanu_source_dbt.ds__ongoing_conditions": ["model.tamanu_source_dbt.ongoing-conditions-line-list"], "model.tamanu_source_dbt.ds__outpatient_appointments": ["model.tamanu_source_dbt.outpatient-appointments-line-list", "test.tamanu_source_dbt.logical__ds__outpatient_appointments"], "model.tamanu_source_dbt.ds__outpatient_appointments_audit": ["model.tamanu_source_dbt.audit-outpatient-appointments"], "model.tamanu_source_dbt.ds__patients": ["model.tamanu_source_dbt.registered-patients-by-dob-line-list", "model.tamanu_source_dbt.registered-patients-daily-summary", "model.tamanu_source_dbt.registered-patients-line-list"], "model.tamanu_source_dbt.ds__patients_access_logs": ["model.tamanu_source_dbt.audit-patient-views"], "model.tamanu_source_dbt.ds__patients_change_logs": ["model.tamanu_source_dbt.audit-patient-details-edit"], "model.tamanu_source_dbt.ds__patient_program_registrations": ["model.tamanu_source_dbt.program-registry-line-list", "model.tamanu_source_dbt.program-registry-removed-patients-line-list"], "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming": ["model.tamanu_source_dbt.upcoming-vaccinations-line-list"], "model.tamanu_source_dbt.ds__procedures": ["model.tamanu_source_dbt.procedures-line-list", "test.tamanu_source_dbt.logical__ds__procedures"], "model.tamanu_source_dbt.ds__referrals": ["model.tamanu_source_dbt.incomplete-referrals", "test.tamanu_source_dbt.logical__ds__referrals"], "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details": ["model.tamanu_source_dbt.usage-quality-metrics-patient-details"], "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations": ["model.tamanu_source_dbt.usage-quality-metrics-patient-registrations"], "model.tamanu_source_dbt.ds__user_audit": ["model.tamanu_source_dbt.user-audit-line-list", "test.tamanu_source_dbt.logical__ds__user_audit"], "model.tamanu_source_dbt.ds__vaccinations": ["model.tamanu_source_dbt.vaccine-audit-line-list", "model.tamanu_source_dbt.vaccine-line-list", "test.tamanu_source_dbt.logical__ds__vaccinations"], "model.tamanu_source_dbt.int__admission_history_department": ["model.tamanu_source_dbt.hospital-admissions-by-department-summary"], "model.tamanu_source_dbt.int__admission_history_location": ["model.tamanu_source_dbt.hospital-admissions-by-area-summary", "model.tamanu_source_dbt.hospital-admissions-by-location-summary"], "model.tamanu_source_dbt.int__lab_requests_history": ["model.tamanu_source_dbt.lab-requests-summary"], "model.tamanu_source_dbt.sensitive-admissions-line-list": [], "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments": [], "model.tamanu_source_dbt.sensitive-encounter-diets-line-list": [], "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date": [], "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date": [], "model.tamanu_source_dbt.sensitive-imaging-requests-line-list": [], "model.tamanu_source_dbt.sensitive-imaging-requests-summary": [], "model.tamanu_source_dbt.sensitive-incomplete-referrals": [], "model.tamanu_source_dbt.sensitive-lab-requests-line-list": [], "model.tamanu_source_dbt.sensitive-lab-tests-line-list": [], "model.tamanu_source_dbt.sensitive-location-bookings-line-list": [], "model.tamanu_source_dbt.sensitive-medication-dispensed-summary": [], "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list": [], "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary": [], "model.tamanu_source_dbt.sensitive-prescription-line-list": [], "model.tamanu_source_dbt.sensitive-procedures-line-list": [], "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list": [], "model.tamanu_source_dbt.sensitive-user-audit-line-list": [], "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list": [], "model.tamanu_source_dbt.sensitive-vaccine-line-list": [], "model.tamanu_source_dbt.admissions-line-list": [], "model.tamanu_source_dbt.audit-outpatient-appointments": [], "model.tamanu_source_dbt.audit-patient-details-edit": [], "model.tamanu_source_dbt.audit-patient-views": [], "model.tamanu_source_dbt.deceased-patients-line-list": [], "model.tamanu_source_dbt.encounter-diets-line-list": [], "model.tamanu_source_dbt.encounter-summary-by-end-date": ["test.tamanu_source_dbt.logical__encounter_summary_by_end_date"], "model.tamanu_source_dbt.encounter-summary-by-start-date": ["test.tamanu_source_dbt.logical__encounter_summary_by_start_date"], "model.tamanu_source_dbt.hospital-admissions-by-area-summary": [], "model.tamanu_source_dbt.hospital-admissions-by-department-summary": [], "model.tamanu_source_dbt.hospital-admissions-by-location-summary": [], "model.tamanu_source_dbt.imaging-requests-line-list": [], "model.tamanu_source_dbt.imaging-requests-summary": [], "model.tamanu_source_dbt.incomplete-referrals": [], "model.tamanu_source_dbt.invoice-products-summary": [], "model.tamanu_source_dbt.lab-requests-line-list": [], "model.tamanu_source_dbt.lab-requests-summary": [], "model.tamanu_source_dbt.lab-tests-line-list": [], "model.tamanu_source_dbt.location-bookings-line-list": [], "model.tamanu_source_dbt.medication-dispensed-summary": [], "model.tamanu_source_dbt.ongoing-conditions-line-list": [], "model.tamanu_source_dbt.outpatient-appointments-line-list": [], "model.tamanu_source_dbt.patient-emergency-encounters-summary": [], "model.tamanu_source_dbt.prescription-line-list": [], "model.tamanu_source_dbt.procedures-line-list": [], "model.tamanu_source_dbt.program-registry-line-list": [], "model.tamanu_source_dbt.program-registry-removed-patients-line-list": [], "model.tamanu_source_dbt.recent-diagnoses-line-list": [], "model.tamanu_source_dbt.registered-births-line-list": [], "model.tamanu_source_dbt.registered-patients-by-dob-line-list": [], "model.tamanu_source_dbt.registered-patients-daily-summary": [], "model.tamanu_source_dbt.registered-patients-line-list": [], "model.tamanu_source_dbt.upcoming-vaccinations-line-list": [], "model.tamanu_source_dbt.usage-quality-metrics-patient-details": [], "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations": [], "model.tamanu_source_dbt.user-audit-line-list": [], "model.tamanu_source_dbt.vaccine-audit-line-list": [], "model.tamanu_source_dbt.vaccine-line-list": [], "test.tamanu_source_dbt.logical__ds__admissions": [], "test.tamanu_source_dbt.logical__ds__diagnoses": [], "test.tamanu_source_dbt.logical__ds__encounters_emergency": [], "test.tamanu_source_dbt.logical__ds__encounter_diets": [], "test.tamanu_source_dbt.logical__ds__encounter_prescriptions": [], "test.tamanu_source_dbt.logical__ds__imaging_requests": [], "test.tamanu_source_dbt.logical__ds__location_bookings": [], "test.tamanu_source_dbt.logical__ds__outpatient_appointments": [], "test.tamanu_source_dbt.logical__ds__procedures": [], "test.tamanu_source_dbt.logical__ds__referrals": [], "test.tamanu_source_dbt.logical__ds__user_audit": [], "test.tamanu_source_dbt.logical__ds__vaccinations": [], "test.tamanu_source_dbt.logical__encounter_summary_by_end_date": [], "test.tamanu_source_dbt.logical__encounter_summary_by_start_date": [], "test.tamanu_source_dbt.assert__metric_definitions__disaggregations": [], "test.tamanu_source_dbt.assert__patients__village_id": [], "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due": [], "test.tamanu_source_dbt.assert__users__role": [], "seed.tamanu_source_dbt.metric_definitions": ["test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac", "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef", "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c", "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852", "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c", "test.tamanu_source_dbt.assert__metric_definitions__disaggregations", "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489", "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64", "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461", "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25", "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08", "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf", "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0", "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f", "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e", "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6", "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a", "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13"], "test.tamanu_source_dbt.not_null_metric_definitions_metric_id.9346dbbc08": [], "test.tamanu_source_dbt.unique_metric_definitions_metric_id.9dc8f94f13": [], "test.tamanu_source_dbt.not_null_metric_definitions_kind.3b7c1c6f25": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_kind__metric__cohort__condition_era__drug_era__dose_era__episode.2331adec5c": [], "test.tamanu_source_dbt.not_null_metric_definitions_name.3434d351cf": [], "test.tamanu_source_dbt.not_null_metric_definitions_description.bafd7b9461": [], "test.tamanu_source_dbt.not_null_metric_definitions_data_source.4f6ce8f489": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_data_source__tamanu__msupply__senaite__weather.680e9becac": [], "test.tamanu_source_dbt.not_null_metric_definitions_definition_source.74f26eec64": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_definition_source__WHO_SMART_HIV__WHO_CORE_100__WHO_PEN__SDG__DHIS2_HDT__MANA__GLOBAL_FUND__OHDSI__IYCF__MSF__BES.d4e0c37eef": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_unit__count__percentage__rate_per_1000.2a3690b35c": [], "test.tamanu_source_dbt.not_null_metric_definitions_subject_grain.3ae25b89d6": [], "test.tamanu_source_dbt.relationships_metric_definitions_variant_of__metric_id__ref_metric_definitions_.b076bff24a": [], "test.tamanu_source_dbt.not_null_metric_definitions_owner.a60d96b7a0": [], "test.tamanu_source_dbt.not_null_metric_definitions_status.7377818f5e": [], "test.tamanu_source_dbt.accepted_values_metric_definitions_status__draft__approved__deprecated.528117a852": [], "test.tamanu_source_dbt.not_null_metric_definitions_spec_path.bf5f3ab76f": [], "test.tamanu_source_dbt.dbt_utils_not_accepted_values_encounter_diagnoses_certainty__disproven__error.c54e4458bc": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b": [], "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567": [], "test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8": [], "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3": [], "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54": [], "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd": [], "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e": [], "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c": [], "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f": [], "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4": [], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5": [], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec": [], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0": [], "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c": [], "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c": [], "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442": [], "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf": [], "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54": [], "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b": [], "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227": [], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e": [], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1": [], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e": [], "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d": [], "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd": [], "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766": [], "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250": [], "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625": [], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a": [], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a": [], "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe": [], "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7": [], "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5": [], "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b": [], "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a": [], "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a": [], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05": [], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137": [], "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54": [], "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf": [], "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc": [], "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb": [], "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d": [], "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45": [], "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530": [], "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182": [], "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040": [], "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812": [], "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6": [], "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59": [], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b": [], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5": [], "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f": [], "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4": [], "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3": [], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b": [], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459": [], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd": [], "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a": [], "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947": [], "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd": [], "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2": [], "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350": [], "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab": [], "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1": [], "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069": [], "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046": [], "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5": [], "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee": [], "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b": [], "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6": [], "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a": [], "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0": [], "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616": [], "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d": [], "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf": [], "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8": [], "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d": [], "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4": [], "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94": [], "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21": [], "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b": [], "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d": [], "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1": [], "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574": [], "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce": [], "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2": [], "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2": [], "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204": [], "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e": [], "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5": [], "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f": [], "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3": [], "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7": [], "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255": [], "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0": [], "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a": [], "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c": [], "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377": [], "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91": [], "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2": [], "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5": [], "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205": [], "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822": [], "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676": [], "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0": [], "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b": [], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b": [], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3": [], "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d": [], "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13": [], "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc": [], "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62": [], "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2": [], "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f": [], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d": [], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af": [], "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac": [], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08": [], "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03": [], "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed": [], "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7": [], "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463": [], "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6": [], "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561": [], "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437": [], "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624": [], "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395": [], "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be": [], "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904": [], "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0": [], "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b": [], "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9": [], "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0": [], "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2": [], "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7": [], "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108": [], "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9": [], "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b": [], "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127": [], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85": [], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac": [], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39": [], "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157": [], "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e": [], "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3": [], "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c": [], "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41": [], "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37": [], "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4": [], "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef": [], "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50": [], "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9": [], "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9": [], "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4": [], "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f": [], "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940": [], "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370": [], "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4": [], "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1": [], "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee": [], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c": [], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6": [], "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9": [], "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb": [], "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95": [], "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2": [], "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921": [], "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d": [], "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3": [], "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762": [], "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9": [], "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d": [], "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267": [], "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a": [], "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463": [], "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef": [], "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f": [], "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070": [], "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e": [], "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c": [], "test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6": [], "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6": [], "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11": [], "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8": [], "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31": [], "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6": [], "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156": [], "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc": [], "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48": [], "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266": [], "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80": [], "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b": [], "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924": [], "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d": [], "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf": [], "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413": [], "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c": [], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886": [], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e": [], "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd": [], "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab": [], "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb": [], "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee": [], "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d": [], "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273": [], "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea": [], "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6": [], "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d": [], "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1": [], "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998": [], "test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692": [], "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780": [], "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c": [], "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582": [], "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2": [], "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35": [], "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd": [], "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6": [], "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b": [], "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0": [], "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44": [], "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a": [], "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f": [], "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c": [], "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf": [], "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90": [], "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3": [], "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e": [], "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704": [], "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06": [], "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16": [], "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565": [], "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3": [], "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c": [], "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106": [], "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05": [], "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13": [], "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839": [], "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8": [], "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f": [], "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1": [], "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b": [], "test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff": [], "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d": [], "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26": [], "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877": [], "source.tamanu_source_dbt.logs__tamanu.accesses": ["model.tamanu_source_dbt.patients_access_logs", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_back_end_context.c461ef5b10", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_created_at.c559af59c4", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_device_id.277d95b364", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_front_end_context.aeef6880f0", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_id.47650015e9", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_is_mobile.87cbc52937", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_logged_at.aee8df31c7", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_id.c49d0f4d84", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_record_type.b59437e552", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_session_id.3968767d39", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at.d68343154e", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_updated_at_sync_tick.82731184f9", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_user_id.4731fc507d", "test.tamanu_source_dbt.source_not_null_logs__tamanu_accesses_version.92cc727c2e", "test.tamanu_source_dbt.source_unique_logs__tamanu_accesses_id.58775d956a"], "source.tamanu_source_dbt.logs__tamanu.changes": ["model.tamanu_source_dbt.encounter_diagnoses_metadata", "model.tamanu_source_dbt.encounters_metadata", "model.tamanu_source_dbt.lab_request_logs_metadata", "model.tamanu_source_dbt.lab_requests_metadata", "model.tamanu_source_dbt.outpatient_appointments_change_logs", "model.tamanu_source_dbt.patient_additional_data_change_logs", "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs", "model.tamanu_source_dbt.patient_program_registrations_change_logs", "model.tamanu_source_dbt.patients_change_logs", "model.tamanu_source_dbt.patients_metadata", "model.tamanu_source_dbt.procedures_metadata", "model.tamanu_source_dbt.users_metadata", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_created_at.3b82d26023", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_device_id.e56e90ec9d", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_id.866e117189", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_logged_at.1def9d3088", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_created_at.d09f0598ea", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_data.83bbd4bbf6", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_id.782318322c", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_record_updated_at.7ba7742260", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_name.0b42537bc6", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_oid.b9844b50e8", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_table_schema.3e59c96f61", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_at_sync_tick.c1c5731de8", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_updated_by_user_id.82cb04062b", "test.tamanu_source_dbt.source_not_null_logs__tamanu_changes_version.9d511c5658", "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465", "test.tamanu_source_dbt.source_unique_logs__tamanu_changes_id.dd0bf715d9"], "source.tamanu_source_dbt.logs__tamanu.debug_logs": ["test.tamanu_source_dbt.source_accepted_values_logs__tamanu_debug_logs_type__syncLookupUpdate.827ca373d0", "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_id.2cd56785d4", "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_info.5cb0ccb1a0", "test.tamanu_source_dbt.source_not_null_logs__tamanu_debug_logs_type.78622a3567", "test.tamanu_source_dbt.source_unique_logs__tamanu_debug_logs_id.a03e8469cd"], "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes": ["test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_created_at.53c44d382b", "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_id.5b06029985", "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_report_id.5a861460f0", "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_status.b440e65629", "test.tamanu_source_dbt.source_not_null_logs__tamanu_dhis2_pushes_updated_at.46346dc2f0", "test.tamanu_source_dbt.source_unique_logs__tamanu_dhis2_pushes_id.0da5ddfd43"], "source.tamanu_source_dbt.logs__tamanu.fhir_writes": ["test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_body.face3433a2", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_created_at.6a5dde6c84", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_headers.d9c7e90be8", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_id.82c7762d53", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_url.1acf607faf", "test.tamanu_source_dbt.source_not_null_logs__tamanu_fhir_writes_verb.2b0319d883", "test.tamanu_source_dbt.source_unique_logs__tamanu_fhir_writes_id.8353be29e8"], "source.tamanu_source_dbt.logs__tamanu.migrations": ["test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_device_id.30a569c46c", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_direction.c83fad8f7e", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_id.5638ece336", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_logged_at.9b591e2016", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_migrations.bf597438c3", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_record_sync_tick.ddbd48d1c1", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_updated_at_sync_tick.2ee4244e54", "test.tamanu_source_dbt.source_not_null_logs__tamanu_migrations_version.ad4fd97571", "test.tamanu_source_dbt.source_unique_logs__tamanu_migrations_id.12ea87b61e"], "source.tamanu_source_dbt.tamanu.administered_vaccines": ["model.tamanu_source_dbt.vaccine_administrations", "model.tamanu_source_dbt.vaccine_administrations_change_logs", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f", "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_injection_site__left_arm__right_arm__left_thigh__right_thigh__oral__other.a34597923c", "test.tamanu_source_dbt.source_accepted_values_tamanu_administered_vaccines_status__DUE__GIVEN__HISTORICAL__MISSED__NOT_GIVEN__OVERDUE__RECORDED_IN_ERROR__SCHEDULED__UNKNOWN__UPCOMING.8b8a9d77fd", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_created_at.311e25104e", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_id.71c049c95c", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_status.3bf7e20f14", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at.81a714c41e", "test.tamanu_source_dbt.source_not_null_tamanu_administered_vaccines_updated_at_sync_tick.1f4a79d8c1", "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d", "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e", "test.tamanu_source_dbt.source_unique_tamanu_administered_vaccines_id.1b16daae05"], "source.tamanu_source_dbt.tamanu.appointments": ["model.tamanu_source_dbt.location_bookings", "model.tamanu_source_dbt.outpatient_appointments", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733", "test.tamanu_source_dbt.source_accepted_values_tamanu_appointments_status__Confirmed__Arrived__Assessed__Seen__No_show__Cancelled.2b51753ed0", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_id.d1a6de3ce4", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_is_high_priority.3c2beccb9c", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_status.3078c54556", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_type_legacy.cd7aaf3419", "test.tamanu_source_dbt.source_not_null_tamanu_appointments_updated_at_sync_tick.fc1a99ab76", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5", "test.tamanu_source_dbt.source_unique_tamanu_appointments_id.5632c4fc60"], "source.tamanu_source_dbt.tamanu.appointment_procedure_types": ["test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_appointment_id.5ad9e548f4", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_created_at.2e4c1b17ce", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_id.138766fc43", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_procedure_type_id.14840677e5", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at.7d42fb36d3", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_procedure_types_updated_at_sync_tick.66fee65a6c", "test.tamanu_source_dbt.source_unique_tamanu_appointment_procedure_types_id.037055b61c"], "source.tamanu_source_dbt.tamanu.appointment_schedules": ["model.tamanu_source_dbt.ds__outpatient_appointments_audit", "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit", "model.tamanu_source_dbt.outpatient_appointments", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_created_at.51ddaf1fe0", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_frequency.1a456b5d85", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_id.61a1963563", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_interval.09395917c8", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_is_fully_generated.fd5b4e8ebf", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at.ceb401c90c", "test.tamanu_source_dbt.source_not_null_tamanu_appointment_schedules_updated_at_sync_tick.3902446442", "test.tamanu_source_dbt.source_unique_tamanu_appointment_schedules_id.0a8d801e6f"], "source.tamanu_source_dbt.tamanu.assets": ["test.tamanu_source_dbt.source_accepted_values_tamanu_assets_type__image_png__image_svg.4ac901bedb", "test.tamanu_source_dbt.source_not_null_tamanu_assets_data.58f7384f54", "test.tamanu_source_dbt.source_not_null_tamanu_assets_id.5903661f6e", "test.tamanu_source_dbt.source_not_null_tamanu_assets_name.9ccba2d3d2", "test.tamanu_source_dbt.source_not_null_tamanu_assets_type.a71e515992", "test.tamanu_source_dbt.source_not_null_tamanu_assets_updated_at_sync_tick.6baf11bd0b", "test.tamanu_source_dbt.source_unique_tamanu_assets_id.0b004e27a6"], "source.tamanu_source_dbt.tamanu.attachments": ["test.tamanu_source_dbt.source_not_null_tamanu_attachments_data.d8f00c841e", "test.tamanu_source_dbt.source_not_null_tamanu_attachments_id.89138b8f9e", "test.tamanu_source_dbt.source_not_null_tamanu_attachments_type.3fa788a0f1", "test.tamanu_source_dbt.source_not_null_tamanu_attachments_updated_at_sync_tick.964e5f600d", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f", "test.tamanu_source_dbt.source_unique_tamanu_attachments_id.58d67f1227"], "source.tamanu_source_dbt.tamanu.certifiable_vaccines": ["test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_created_at.ed08316054", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_disease_code.c672804493", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_icd11_drug_code.e0022050d1", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_id.b73eb6daff", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_maximum_dosage.ab28eb0766", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at.57aee6fafd", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_updated_at_sync_tick.ce5ff28250", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_code.6c9677a1ed", "test.tamanu_source_dbt.source_not_null_tamanu_certifiable_vaccines_vaccine_id.836f9ff4fb", "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_id.f0a184f1a0", "test.tamanu_source_dbt.source_unique_tamanu_certifiable_vaccines_vaccine_id.ab754e124f"], "source.tamanu_source_dbt.tamanu.certificate_notifications": ["test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_status__Queued__Processed__Error__Ignore.3450abc93a", "test.tamanu_source_dbt.source_accepted_values_tamanu_certificate_notifications_type__covid_19_clearance__vaccination_certificate__icao_test__icao_vacc.ca722e42a5", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_id.7757b0046d", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_require_signing.266cbeb625", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_status.561750c1e5", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_type.a7491c4721", "test.tamanu_source_dbt.source_not_null_tamanu_certificate_notifications_updated_at_sync_tick.7cb5b88cb7", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a", "test.tamanu_source_dbt.source_unique_tamanu_certificate_notifications_id.71e705665b"], "source.tamanu_source_dbt.tamanu.contributing_death_causes": ["model.tamanu_source_dbt.contributing_death_causes", "model.tamanu_source_dbt.patient_death_contributing_causes", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_condition_id.7888faae6b", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_id.0c8b2503cb", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_patient_death_data_id.d0b021dec5", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_time_after_onset.aaabeca43d", "test.tamanu_source_dbt.source_not_null_tamanu_contributing_death_causes_updated_at_sync_tick.082b545b7a", "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a", "test.tamanu_source_dbt.source_unique_tamanu_contributing_death_causes_id.626611e2fa"], "source.tamanu_source_dbt.tamanu.death_revert_logs": ["test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_created_at.c782214dc7", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_death_data_id.4889452a8a", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_id.6df645dcf5", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_patient_id.12123f0c05", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_revert_time.3e0bd39153", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_reverted_by_id.34e5a69137", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at.844962c5a1", "test.tamanu_source_dbt.source_not_null_tamanu_death_revert_logs_updated_at_sync_tick.24982eacdf", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54", "test.tamanu_source_dbt.source_unique_tamanu_death_revert_logs_id.001d670317"], "source.tamanu_source_dbt.tamanu.departments": ["model.tamanu_source_dbt.departments", "test.tamanu_source_dbt.source_not_null_tamanu_departments_code.196489124d", "test.tamanu_source_dbt.source_not_null_tamanu_departments_id.4f5628ebfb", "test.tamanu_source_dbt.source_not_null_tamanu_departments_name.3448ffbf45", "test.tamanu_source_dbt.source_not_null_tamanu_departments_updated_at_sync_tick.3876957182", "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec", "test.tamanu_source_dbt.source_unique_tamanu_departments_id.f24dde60cc"], "source.tamanu_source_dbt.tamanu.devices": ["test.tamanu_source_dbt.source_not_null_tamanu_devices_created_at.f353e449ee", "test.tamanu_source_dbt.source_not_null_tamanu_devices_id.5c11d14906", "test.tamanu_source_dbt.source_not_null_tamanu_devices_last_seen_at.940293bbb4", "test.tamanu_source_dbt.source_not_null_tamanu_devices_registered_by_id.99c3580040", "test.tamanu_source_dbt.source_not_null_tamanu_devices_scopes.a34bba28b6", "test.tamanu_source_dbt.source_not_null_tamanu_devices_updated_at.9667683ae2", "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812", "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999", "test.tamanu_source_dbt.source_unique_tamanu_devices_id.0507752158"], "source.tamanu_source_dbt.tamanu.discharges": ["model.tamanu_source_dbt.discharges", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5", "test.tamanu_source_dbt.source_not_null_tamanu_discharges_encounter_id.5299e31574", "test.tamanu_source_dbt.source_not_null_tamanu_discharges_id.4a7ff5af7b", "test.tamanu_source_dbt.source_not_null_tamanu_discharges_updated_at_sync_tick.0b20bf424c", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4", "test.tamanu_source_dbt.source_unique_tamanu_discharges_id.8b9c580a59"], "source.tamanu_source_dbt.tamanu.document_metadata": ["model.tamanu_source_dbt.document_metadata", "test.tamanu_source_dbt.source_accepted_values_tamanu_document_metadata_source__patient_letter__uploaded.d562bb3947", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_attachment_id.73279e3459", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_document_uploaded_at.3e699cede3", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_id.df7500e31c", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_name.1e7e44b11e", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_source.c7dde3dea4", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_type.ad3c33203c", "test.tamanu_source_dbt.source_not_null_tamanu_document_metadata_updated_at_sync_tick.818184c71a", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_attachment_id__id__source_tamanu_attachments_.422a5cdedd", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_department_id__id__source_tamanu_departments_.5942352785", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b", "test.tamanu_source_dbt.source_unique_tamanu_document_metadata_id.25fbd602e6"], "source.tamanu_source_dbt.tamanu.encounters": ["model.tamanu_source_dbt.discharges", "model.tamanu_source_dbt.encounter_diagnoses", "model.tamanu_source_dbt.encounter_diets", "model.tamanu_source_dbt.encounter_history", "model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.encounters", "model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_results", "model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoices", "model.tamanu_source_dbt.lab_request_logs", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_test_panel_requests", "model.tamanu_source_dbt.lab_tests", "model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "model.tamanu_source_dbt.prescriptions", "model.tamanu_source_dbt.procedures", "model.tamanu_source_dbt.triages", "model.tamanu_source_dbt.vaccine_administrations", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9", "test.tamanu_source_dbt.source_accepted_values_tamanu_encounters_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.6454543933", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_created_at.5a9caa2a2b", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_encounter_type.169507cb50", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_id.3d82b88759", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_start_date.a5dec75857", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at.65ef63b763", "test.tamanu_source_dbt.source_not_null_tamanu_encounters_updated_at_sync_tick.1eb037d2f2", "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_encounter_id__id__source_tamanu_encounters_.1ab396ce2d", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_encounter_id__id__source_tamanu_encounters_.43adeff312", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_encounter_id__id__source_tamanu_encounters_.58f844c909", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_department_id__id__source_tamanu_departments_.54b3d36175", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503", "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e", "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0", "test.tamanu_source_dbt.source_unique_tamanu_encounters_id.6da54b7f38"], "source.tamanu_source_dbt.tamanu.encounter_diagnoses": ["model.tamanu_source_dbt.encounter_diagnoses", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069", "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_diagnoses_certainty__confirmed__disproven__emergency__error__suspected.9dcc845ca8", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_created_at.2e0c2e1d40", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_date.3cb9b9f92a", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_id.5010c4db2d", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at.e843942ea8", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diagnoses_updated_at_sync_tick.82fe91df26", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_encounter_id__id__source_tamanu_encounters_.16e875a59a", "test.tamanu_source_dbt.source_unique_tamanu_encounter_diagnoses_id.d52ee9adc9"], "source.tamanu_source_dbt.tamanu.encounter_diets": ["model.tamanu_source_dbt.encounter_diets", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_created_at.0f3c391127", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_diet_id.f096ba53ad", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_encounter_id.56ca3f2a1c", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_id.d0805612f7", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at.1a3c4fcb7f", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_diets_updated_at_sync_tick.1e9301afae", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diets_encounter_id__id__source_tamanu_encounters_.90c10b0836", "test.tamanu_source_dbt.source_unique_tamanu_encounter_diets_id.da8f18a027"], "source.tamanu_source_dbt.tamanu.encounter_history": ["model.tamanu_source_dbt.encounter_history", "test.tamanu_source_dbt.source_accepted_values_tamanu_encounter_history_encounter_type__admission__clinic__imaging__emergency__observation__triage__surveyResponse__vaccination.af58070d62", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_change_type.53d3e33bca", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_created_at.d7d91fd2e8", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_date.5840578e29", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_department_id.2bf94ddc1c", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_id.5d9223d72c", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_encounter_type.a7b6e21a3c", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_examiner_id.96fc96334d", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_id.98f4907b32", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_location_id.5b7796abc8", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at.cafd8d5cb6", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_history_updated_at_sync_tick.6ea4b7b4cd", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_department_id__id__source_tamanu_departments_.cc3dcc54fd", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_encounter_id__id__source_tamanu_encounters_.98ae5b7d3b", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb", "test.tamanu_source_dbt.source_unique_tamanu_encounter_history_id.b5104bb3a4"], "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions": ["test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_created_at.ad1eb449bc", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_encounter_prescription_id.fbd245146d", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_id.e57a9fc1b3", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_duration.dbd59b4962", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_end_date.7bc8a722ce", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_start_date.e8ca98a8ab", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_pause_time_unit.d2004436c1", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at.b6f63cea98", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescriptions_updated_at_sync_tick.242bd8180f", "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescriptions_id.41bdc9747d"], "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories": ["test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action.36a50d92fd", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_action_date.fff7387332", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_created_at.1766fe12bb", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_encounter_prescription_id.6431100b96", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_id.9371741f30", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at.bce04537f7", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_pause_prescription_histories_updated_at_sync_tick.1a62809ae2", "test.tamanu_source_dbt.source_unique_tamanu_encounter_pause_prescription_histories_id.242095e95a"], "source.tamanu_source_dbt.tamanu.encounter_prescriptions": ["model.tamanu_source_dbt.encounter_prescriptions", "model.tamanu_source_dbt.prescriptions", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_created_at.777fb22523", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_encounter_id.ea618fdd05", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_id.3be49c8399", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_is_selected_for_discharge.621eb1bc4b", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_prescription_id.485995235b", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at.cc684b1350", "test.tamanu_source_dbt.source_not_null_tamanu_encounter_prescriptions_updated_at_sync_tick.b07eb557ab", "test.tamanu_source_dbt.source_unique_tamanu_encounter_prescriptions_id.6371d45cc1"], "source.tamanu_source_dbt.tamanu.facilities": ["model.tamanu_source_dbt.facilities", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4", "test.tamanu_source_dbt.source_accepted_values_tamanu_facilities_visibility_status__current__historical.1f32aa4a9d", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_code.55fbf8c36c", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_id.ad186295b9", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_is_sensitive.83efc1299f", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_name.9ac276f33d", "test.tamanu_source_dbt.source_not_null_tamanu_facilities_updated_at_sync_tick.5ebc0505a1", "test.tamanu_source_dbt.source_relationships_tamanu_departments_facility_id__id__source_tamanu_facilities_.632d512530", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_address__street_address__source_tamanu_facilities_.298b48d81f", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_name__name__source_tamanu_facilities_.1fe0fe6f7f", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_facility_town__city_town__source_tamanu_facilities_.68747350e4", "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330", "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286", "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0", "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa", "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63", "test.tamanu_source_dbt.source_unique_tamanu_facilities_id.9e454badf4"], "source.tamanu_source_dbt.tamanu.imaging_area_external_codes": ["model.tamanu_source_dbt.imaging_area_external_codes", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_area_id.b59576cea8", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_code.af72562338", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_created_at.5a8be2828e", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_id.fe52d7eda4", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at.fde1da72e8", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_updated_at_sync_tick.1bfbc765fb", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_area_external_codes_visibility_status.83963919d0", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c", "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_area_id.050349fa98", "test.tamanu_source_dbt.source_unique_tamanu_imaging_area_external_codes_id.ac26885b2b"], "source.tamanu_source_dbt.tamanu.imaging_requests": ["model.tamanu_source_dbt.imaging_request_areas", "model.tamanu_source_dbt.imaging_requests", "model.tamanu_source_dbt.imaging_results", "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_imaging_type__angiogram__colonoscopy__ctScan__ecg__echocardiogram__endoscopy__fluroscopy__holterMonitor__mammogram__orthopantomography__mri__stressTest__ultrasound__vascularStudy__xRay.b2d7a7ce17", "test.tamanu_source_dbt.source_accepted_values_tamanu_imaging_requests_status__pending__in_progress__completed__cancelled__deleted__entered_in_error.a9ecb8382a", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_created_at.d386c49d0f", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_display_id.7bf4017999", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_id.d663e704e6", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_requested_date.4fe72ce056", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at.ea1a5d3b4f", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_requests_updated_at_sync_tick.bde3718e92", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_encounter_id__id__source_tamanu_encounters_.6e73984503", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069", "test.tamanu_source_dbt.source_unique_tamanu_imaging_requests_id.189883862e"], "source.tamanu_source_dbt.tamanu.imaging_request_areas": ["model.tamanu_source_dbt.imaging_request_areas", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_area_id.e9e04e2311", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_created_at.bbbd373fe1", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_id.3b96eae2fd", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_imaging_request_id.c75e5d81dd", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at.aab4a9c280", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_request_areas_updated_at_sync_tick.cdbd0a0462", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_imaging_request_id__id__source_tamanu_imaging_requests_.ea8a5a0600", "test.tamanu_source_dbt.source_unique_tamanu_imaging_request_areas_id.b9f4c605b2"], "source.tamanu_source_dbt.tamanu.imaging_results": ["model.tamanu_source_dbt.imaging_results", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_completed_at.3e8e297046", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_created_at.59c90956bf", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_id.bc45b4d2ee", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_imaging_request_id.68d290fbfe", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at.6f4012c0e4", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_updated_at_sync_tick.35b86ae623", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_results_visibility_status.80dbc6bd58", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_imaging_request_id__id__source_tamanu_imaging_requests_.2549bf4069", "test.tamanu_source_dbt.source_unique_tamanu_imaging_results_id.6830573d99"], "source.tamanu_source_dbt.tamanu.imaging_type_external_codes": ["test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_code.527d0ff6f5", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_created_at.e2ccce310c", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_id.ad31be3508", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_imaging_type_code.6104c70b98", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at.f2a8814402", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_updated_at_sync_tick.447d3995ee", "test.tamanu_source_dbt.source_not_null_tamanu_imaging_type_external_codes_visibility_status.3ef76c80ff", "test.tamanu_source_dbt.source_unique_tamanu_imaging_type_external_codes_id.99627516fd"], "source.tamanu_source_dbt.tamanu.invoices": ["model.tamanu_source_dbt.invoice_items", "model.tamanu_source_dbt.invoices", "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_insurer_payment_status__unpaid__paid__partial__rejected.3e0ad430bb", "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_patient_payment_status__unpaid__paid__partial.fa024cba1f", "test.tamanu_source_dbt.source_accepted_values_tamanu_invoices_status__cancelled__in_progress__finalised.6e4b4a0157", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_created_at.f79d3fee01", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_date.af363f73c1", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_display_id.d7f24dffea", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_encounter_id.165abf9a41", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_id.547f4c6b53", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_insurer_payment_status.defe067d68", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_patient_payment_status.c489578d60", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_status.3cc2fac683", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_updated_at_sync_tick.1157c94f1b", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060", "test.tamanu_source_dbt.source_relationships_tamanu_invoices_encounter_id__id__source_tamanu_encounters_.5dd1ea3660", "test.tamanu_source_dbt.source_unique_tamanu_invoices_id.5821fd311e"], "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans": ["test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_created_at.3c4109e1f6", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_id.81fdb96190", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_id.06e1c59b11", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_invoice_insurance_plan_id.b21c244f33", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at.23b9b151a0", "test.tamanu_source_dbt.source_not_null_tamanu_invoices_invoice_insurance_plans_updated_at_sync_tick.65d4601e80", "test.tamanu_source_dbt.source_unique_tamanu_invoices_invoice_insurance_plans_id.33a1630253"], "source.tamanu_source_dbt.tamanu.invoice_discounts": ["test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_by_user_id.eacadbca1c", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_applied_time.de2863c9b1", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_created_at.2a4d9814f4", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_id.e5dd8872f8", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_invoice_id.e692b8ae47", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_is_manual.e5a0d85a43", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_percentage.eeb4864a35", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_discounts_updated_at_sync_tick.96efd53160", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_invoice_id__id__source_tamanu_invoices_.93879e6aa1", "test.tamanu_source_dbt.source_unique_tamanu_invoice_discounts_id.90b9b4d8a6"], "source.tamanu_source_dbt.tamanu.invoice_insurance_plans": ["model.tamanu_source_dbt.invoice_insurance_plans", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_code.5691576988", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_created_at.6a73080b49", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_id.4c3a005a8c", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at.1382c20539", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_updated_at_sync_tick.1671b13fb3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plans_visibility_status.3bdc27963d", "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plans_id.c93eebe7c9"], "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items": ["model.tamanu_source_dbt.invoice_insurance_plan_items", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_created_at.3f6d2aaeca", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_id.43701f0ea4", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_insurance_plan_id.22ae6631a9", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_invoice_product_id.e10425ebc3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at.31dd03f410", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurance_plan_items_updated_at_sync_tick.1d01aecfe2", "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurance_plan_items_id.cbd4f88b8d"], "source.tamanu_source_dbt.tamanu.invoice_insurer_payments": ["test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a", "test.tamanu_source_dbt.source_accepted_values_tamanu_invoice_insurer_payments_status__unpaid__paid__partial__rejected.b655cf463e", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_created_at.8b24ac848c", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_id.e4847e6d62", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_insurer_id.d4af11cfdf", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_invoice_payment_id.d5611881a3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_status.7ac01d0560", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_insurer_payments_updated_at_sync_tick.4f3ee2ea02", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7", "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_id.b447e82df0", "test.tamanu_source_dbt.source_unique_tamanu_invoice_insurer_payments_invoice_payment_id.7dc74551cc"], "source.tamanu_source_dbt.tamanu.invoice_items": ["model.tamanu_source_dbt.invoice_items", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_approved.3e2ce00100", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_created_at.474e57c0bb", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_id.dc141da1a1", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_invoice_id.3660f18c91", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_order_date.7be79d0261", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_ordered_by_user_id.a2db62ee39", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_quantity.3be1c84af8", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_items_updated_at_sync_tick.0d6baa054f", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_invoice_id__id__source_tamanu_invoices_.1c28785b87", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f", "test.tamanu_source_dbt.source_unique_tamanu_invoice_items_id.9cdffdcc59"], "source.tamanu_source_dbt.tamanu.invoice_item_discounts": ["test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_amount.0e8480cee8", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_created_at.664f2faa45", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_id.bcff96eb2f", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_invoice_item_id.3398752f5b", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_type.f759ed12f3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_discounts_updated_at_sync_tick.15b4636f1b", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_item_discounts_invoice_item_id__id__source_tamanu_invoice_items_.18c0b3db45", "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_discounts_id.171e1a5e94"], "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances": ["test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_coverage_value_final.21d527ca7b", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_created_at.c2d663353d", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_id.c00db5ebff", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_insurance_plan_id.61feb9231c", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_invoice_item_id.705d63f383", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at.eaa471bbcf", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_item_finalised_insurances_updated_at_sync_tick.b75138b334", "test.tamanu_source_dbt.source_unique_tamanu_invoice_item_finalised_insurances_id.7d268a7e0a"], "source.tamanu_source_dbt.tamanu.invoice_patient_payments": ["test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_created_at.2612097232", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_id.a2e9c179c4", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_invoice_payment_id.b24d465eaf", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_method_id.49c2b4bb2d", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_patient_payments_updated_at_sync_tick.9cbc6365e6", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e", "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_id.31f94704f5", "test.tamanu_source_dbt.source_unique_tamanu_invoice_patient_payments_invoice_payment_id.6379289247"], "source.tamanu_source_dbt.tamanu.invoice_payments": ["test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_amount.ce266dd7a6", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_created_at.a163e272e6", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_date.7761ae0a7d", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_id.3dad87d906", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_invoice_id.f83a526a9f", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_receipt_number.bd93ab85a8", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_payments_updated_at_sync_tick.011299b145", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_insurer_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.bb3f5a2cf7", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_patient_payments_invoice_payment_id__id__source_tamanu_invoice_payments_.e12c61546e", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_invoice_id__id__source_tamanu_invoices_.d07f617060", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b", "test.tamanu_source_dbt.source_unique_tamanu_invoice_payments_id.0aeb9e30d1"], "source.tamanu_source_dbt.tamanu.invoice_price_lists": ["model.tamanu_source_dbt.invoice_price_lists", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_code.741a3b08ab", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_created_at.84fe51b659", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_id.dc8853229e", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at.75781a813a", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_updated_at_sync_tick.ff56fc27cb", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_lists_visibility_status.a2ae9351b7", "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_lists_id.92912c617f"], "source.tamanu_source_dbt.tamanu.invoice_price_list_items": ["model.tamanu_source_dbt.invoice_price_list_items", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_created_at.94f64a01f3", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_id.5081c70d98", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_price_list_id.98a95f7705", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_invoice_product_id.21d5cfd939", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_is_hidden.7422bf5f0a", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at.3be1e8411f", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_price_list_items_updated_at_sync_tick.96a1770fd7", "test.tamanu_source_dbt.source_unique_tamanu_invoice_price_list_items_id.0ce15b2467"], "source.tamanu_source_dbt.tamanu.invoice_products": ["model.tamanu_source_dbt.invoice_products", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_created_at.815791ae0e", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_id.9b98c43ede", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_insurable.94732ef307", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_name.c01b81d553", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_updated_at_sync_tick.510c557616", "test.tamanu_source_dbt.source_not_null_tamanu_invoice_products_visibility_status.a7dd9ecfa0", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_product_id__id__source_tamanu_invoice_products_.46ad5d1e2f", "test.tamanu_source_dbt.source_unique_tamanu_invoice_products_id.abc4b55436"], "source.tamanu_source_dbt.tamanu.ips_requests": ["test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_at.28215c9764", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_created_by.943d0fec8d", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_email.29f30a58bf", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_id.82d75ba779", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_patient_id.b5ad6ea558", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_status.680fa2f376", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at.b1c150635e", "test.tamanu_source_dbt.source_not_null_tamanu_ips_requests_updated_at_sync_tick.72991067d9", "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f", "test.tamanu_source_dbt.source_unique_tamanu_ips_requests_id.3f494ccf34"], "source.tamanu_source_dbt.tamanu.lab_requests": ["model.tamanu_source_dbt.lab_request_logs", "model.tamanu_source_dbt.lab_requests", "model.tamanu_source_dbt.lab_tests", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30", "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_reason_for_cancellation__clinical__duplicate__entered_in_error__other__patient_discharged__patient_refused.2cbc5618a7", "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_requests_status__reception_pending__results_pending__interim_results__to_be_verified__verified__published__cancelled__invalidated__deleted__sample_not_collected__entered_in_error.a405e0e600", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_created_at.1ee9713d63", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_display_id.cbbdd33475", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_id.e536409687", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at.fca847ad8c", "test.tamanu_source_dbt.source_not_null_tamanu_lab_requests_updated_at_sync_tick.ef00317737", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_request_id__id__source_tamanu_lab_requests_.3cf536fdbe", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_department_id__id__source_tamanu_departments_.b8a500a3ec", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_encounter_id__id__source_tamanu_encounters_.ead6a9d3f0", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd", "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa", "test.tamanu_source_dbt.source_unique_tamanu_lab_requests_id.4e5a6c8c2f"], "source.tamanu_source_dbt.tamanu.lab_request_attachments": ["test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_attachment_id.6a6139cc22", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_created_at.b587e22da8", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_id.6f2075f317", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_lab_request_id.15bc6fc2df", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at.ce5b0e489b", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_attachments_updated_at_sync_tick.a0d8b0a6ba", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_attachment_id__id__source_tamanu_attachments_.eff1df818f", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_lab_request_id__id__source_tamanu_lab_requests_.8995368506", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_attachments_replaced_by_id__id__source_tamanu_lab_request_attachments_.5c53ecfc7d", "test.tamanu_source_dbt.source_unique_tamanu_lab_request_attachments_id.b7eb3f1eb1"], "source.tamanu_source_dbt.tamanu.lab_request_logs": ["model.tamanu_source_dbt.lab_request_logs", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_id.fe608e09fd", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_status.8e024043da", "test.tamanu_source_dbt.source_not_null_tamanu_lab_request_logs_updated_at_sync_tick.960428a44f", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_lab_request_id__id__source_tamanu_lab_requests_.f8e2c6d82e", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883", "test.tamanu_source_dbt.source_unique_tamanu_lab_request_logs_id.7acd19c7d3"], "source.tamanu_source_dbt.tamanu.lab_tests": ["model.tamanu_source_dbt.lab_tests", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_created_at.667f51451c", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_date.e00dab5c9e", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_id.abec38f58a", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_result.cac9a56686", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at.64be4fd140", "test.tamanu_source_dbt.source_not_null_tamanu_lab_tests_updated_at_sync_tick.eeac5bc0de", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_lab_test_id__id__source_tamanu_lab_tests_.7bacb605d5", "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_request_id__id__source_tamanu_lab_requests_.feba1f8faa", "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e", "test.tamanu_source_dbt.source_unique_tamanu_lab_tests_id.2135a2616a"], "source.tamanu_source_dbt.tamanu.lab_test_panels": ["model.tamanu_source_dbt.lab_test_panels", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_code.41611b6a55", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_created_at.da26e7a248", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_id.11a6b51e6b", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_name.3fdd4c9c83", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at.b4f58197df", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_updated_at_sync_tick.bd90caed16", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panels_visibility_status.482b848a4d", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff", "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panels_id.509550e62b"], "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types": ["model.tamanu_source_dbt.lab_test_panel_lab_test_types", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types__order_.e98f400006", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_created_at.a16be69527", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id.35608ab0f8", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_lab_test_type_id.69ea8c29b8", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at.92a5a89a02", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_lab_test_types_updated_at_sync_tick.539440bb36", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_panel_id__id__source_tamanu_lab_test_panels_.930e94d56c", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a"], "source.tamanu_source_dbt.tamanu.lab_test_panel_requests": ["model.tamanu_source_dbt.lab_test_panel_requests", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_created_at.8a393e3d79", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_encounter_id.ffb89736d8", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_id.41fa505d02", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_lab_test_panel_id.e533aeba03", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at.f165e4a05b", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_panel_requests_updated_at_sync_tick.c176776d9d", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_lab_test_panel_request_id__id__source_tamanu_lab_test_panel_requests_.2905d1bd3a", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_encounter_id__id__source_tamanu_encounters_.01f5be3602", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_requests_lab_test_panel_id__id__source_tamanu_lab_test_panels_.1bf2e5a1ff", "test.tamanu_source_dbt.source_unique_tamanu_lab_test_panel_requests_id.fa501ddd2c"], "source.tamanu_source_dbt.tamanu.lab_test_types": ["model.tamanu_source_dbt.lab_test_types", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4", "test.tamanu_source_dbt.source_accepted_values_tamanu_lab_test_types_result_type__FreeText__Number__Select.e7c22c9eca", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_code.84b27e0faa", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_created_at.6a4f074401", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_id.0d085cde9d", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_is_sensitive.7905ffff94", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_name.87dee5eabd", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_result_type.a33f1d56c0", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_unit.953f194d89", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at.34e9cce3fa", "test.tamanu_source_dbt.source_not_null_tamanu_lab_test_types_updated_at_sync_tick.f5cbb064a4", "test.tamanu_source_dbt.source_relationships_tamanu_lab_test_panel_lab_test_types_lab_test_type_id__id__source_tamanu_lab_test_types_.ca4f2c354a", "test.tamanu_source_dbt.source_relationships_tamanu_lab_tests_lab_test_type_id__id__source_tamanu_lab_test_types_.1db3f2d26e", "test.tamanu_source_dbt.source_unique_tamanu_lab_test_types_id.59d45fd4c8"], "source.tamanu_source_dbt.tamanu.local_system_facts": ["test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_id.b86094ee5b", "test.tamanu_source_dbt.source_not_null_tamanu_local_system_facts_key.d313f0ba6d", "test.tamanu_source_dbt.source_unique_tamanu_local_system_facts_id.fec4c53d21"], "source.tamanu_source_dbt.tamanu.locations": ["model.tamanu_source_dbt.locations", "test.tamanu_source_dbt.source_accepted_values_tamanu_locations_visibility_status__current__historical.8ec0690204", "test.tamanu_source_dbt.source_not_null_tamanu_locations_code.5c9a7f01c2", "test.tamanu_source_dbt.source_not_null_tamanu_locations_id.406e448574", "test.tamanu_source_dbt.source_not_null_tamanu_locations_name.b6c0a3d9c2", "test.tamanu_source_dbt.source_not_null_tamanu_locations_updated_at_sync_tick.3e72adcac5", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_id__id__source_tamanu_locations_.894dbd0b29", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_location_id__id__source_tamanu_locations_.c9d4f477fb", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_location_id__id__source_tamanu_locations_.37f810a377", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_planned_location_id__id__source_tamanu_locations_.b6110183f5", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_id__id__source_tamanu_locations_.70fffaafa5", "test.tamanu_source_dbt.source_relationships_tamanu_locations_facility_id__id__source_tamanu_facilities_.def8603286", "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8", "test.tamanu_source_dbt.source_unique_tamanu_locations_code.dffad8f5ce", "test.tamanu_source_dbt.source_unique_tamanu_locations_id.09af17ade1"], "source.tamanu_source_dbt.tamanu.location_assignments": ["test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_created_at.df3be173f2", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_date.41611197a6", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_end_time.1d084e0550", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_id.f9c655fff8", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_location_id.4ec3093145", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_start_time.3eaa8dd9bd", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at.31f65e2832", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_updated_at_sync_tick.b44f74a24f", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignments_user_id.49ff1e2e9a", "test.tamanu_source_dbt.source_unique_tamanu_location_assignments_id.d7960bf1a5"], "source.tamanu_source_dbt.tamanu.location_assignment_templates": ["test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_created_at.a5e55e1095", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_date.0265301d5d", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_end_time.65aa617784", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_id.91706d5751", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_location_id.f01a2ba717", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_end_date.cfd6b45ace", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_frequency.c7157d2070", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_repeat_unit.2fca6b103d", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_start_time.aad4cea7dc", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at.813872183e", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_updated_at_sync_tick.902f20bfe3", "test.tamanu_source_dbt.source_not_null_tamanu_location_assignment_templates_user_id.fc74c558b6", "test.tamanu_source_dbt.source_unique_tamanu_location_assignment_templates_id.2a2b122606"], "source.tamanu_source_dbt.tamanu.location_groups": ["model.tamanu_source_dbt.location_groups", "test.tamanu_source_dbt.source_accepted_values_tamanu_location_groups_visibility_status__current__historical.5756cd0b4b", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_code.c2bcc0bf4f", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_created_at.b199e250ad", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_facility_id.d062db3ac7", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_id.00f301e9d3", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_is_bookable.c3c0909cd0", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_name.983b6df532", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at.4a9b84a719", "test.tamanu_source_dbt.source_not_null_tamanu_location_groups_updated_at_sync_tick.b75e499255", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_location_group_id__id__source_tamanu_location_groups_.b603c9c40f", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_location_group_id__id__source_tamanu_location_groups_.5f80fa9caf", "test.tamanu_source_dbt.source_relationships_tamanu_location_groups_facility_id__id__source_tamanu_facilities_.ecb02b7330", "test.tamanu_source_dbt.source_relationships_tamanu_locations_location_group_id__id__source_tamanu_location_groups_.351ebd459e", "test.tamanu_source_dbt.source_unique_tamanu_location_groups_id.92f4a5e856"], "source.tamanu_source_dbt.tamanu.medication_administration_records": ["test.tamanu_source_dbt.source_accepted_values_tamanu_medication_administration_records_status__GIVEN__NOT_GIVEN.5e232a0448", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_created_at.9f08841aa3", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_due_at.448f2c2000", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_id.052d1d08f9", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_auto_generated.092ff3874d", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_is_edited.178286708a", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at.f0bd0e1339", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_records_updated_at_sync_tick.59617cf32f", "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_records_id.90c6de3c48"], "source.tamanu_source_dbt.tamanu.medication_administration_record_doses": ["test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_created_at.d2ae234e45", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_amount.331e93abb3", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_dose_index.c22ff9799c", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_by_user_id.65d6a1441b", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_given_time.1ccce1a649", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_id.a52e3aa0c8", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_mar_id.5c2f68633d", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_recorded_by_user_id.a78608d49f", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at.3bad2c9822", "test.tamanu_source_dbt.source_not_null_tamanu_medication_administration_record_doses_updated_at_sync_tick.fc7397bf69", "test.tamanu_source_dbt.source_unique_tamanu_medication_administration_record_doses_id.433dfbdead"], "source.tamanu_source_dbt.tamanu.medication_dispenses": ["model.tamanu_source_dbt.medication_dispenses", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_created_at.e8d7e87757", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_at.515dc80dcb", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_dispensed_by_user_id.afdbe34024", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_id.4e57f1d462", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_pharmacy_order_prescription_id.d4c0bafee8", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_quantity.362d1d5f50", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at.76e722a377", "test.tamanu_source_dbt.source_not_null_tamanu_medication_dispenses_updated_at_sync_tick.463ee92e91", "test.tamanu_source_dbt.source_unique_tamanu_medication_dispenses_id.3794f39031"], "source.tamanu_source_dbt.tamanu.notes": ["model.tamanu_source_dbt.notes", "test.tamanu_source_dbt.source_accepted_values_tamanu_notes_record_type__Encounter__ImagingRequest__LabRequest__Patient__PatientCarePlan__Triage.bec5c8fb7d", "test.tamanu_source_dbt.source_not_null_tamanu_notes_content.aaef9e6205", "test.tamanu_source_dbt.source_not_null_tamanu_notes_created_at.6995826036", "test.tamanu_source_dbt.source_not_null_tamanu_notes_date.da7301eac5", "test.tamanu_source_dbt.source_not_null_tamanu_notes_id.09c896ad4f", "test.tamanu_source_dbt.source_not_null_tamanu_notes_note_type_id.149bd5c822", "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_id.cfea6af90a", "test.tamanu_source_dbt.source_not_null_tamanu_notes_record_type.95fdec276c", "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at.a1ee0f269e", "test.tamanu_source_dbt.source_not_null_tamanu_notes_updated_at_sync_tick.c817dbafe2", "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5", "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7", "test.tamanu_source_dbt.source_relationships_tamanu_notes_revised_by_id__id__source_tamanu_notes_.2e3d834e0e", "test.tamanu_source_dbt.source_unique_tamanu_notes_id.a24a543e48"], "source.tamanu_source_dbt.tamanu.notes_legacy": ["test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_content.88552a0676", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_created_at.1614bfff1e", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_date.ebfcb3c49c", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_id.0ca554e30e", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_id.e04f2d4fd5", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_record_type.c368d7d085", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at.9cb08b5b1d", "test.tamanu_source_dbt.source_not_null_tamanu_notes_legacy_updated_at_sync_tick.935e8256d0", "test.tamanu_source_dbt.source_unique_tamanu_notes_legacy_id.b36a7a24dd"], "source.tamanu_source_dbt.tamanu.note_items": ["test.tamanu_source_dbt.source_not_null_tamanu_note_items_content.cdcdc58bd6", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_created_at.6c19cc76af", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_date.b7ba7d298b", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_id.e102088706", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_note_page_id.e6a2a1ff2b", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at.c552d1546c", "test.tamanu_source_dbt.source_not_null_tamanu_note_items_updated_at_sync_tick.9c0561f44d", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca", "test.tamanu_source_dbt.source_unique_tamanu_note_items_id.6a3c41e3a8"], "source.tamanu_source_dbt.tamanu.note_pages": ["test.tamanu_source_dbt.source_not_null_tamanu_note_pages_created_at.d12af0d7fa", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_date.73c5e4ff13", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_id.ca251365f2", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_note_type.ef33cb53cd", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_id.4fb443d5b8", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_record_type.3a45297bcc", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at.f4a3d0c174", "test.tamanu_source_dbt.source_not_null_tamanu_note_pages_updated_at_sync_tick.92101dbbcc", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_note_page_id__id__source_tamanu_note_pages_.11dd57c56b", "test.tamanu_source_dbt.source_unique_tamanu_note_pages_id.589de9f269"], "source.tamanu_source_dbt.tamanu.notifications": ["test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_at.8d2ded1ce7", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_created_time.5a54e4d785", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_id.04c2f24f06", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_metadata.054778f4a5", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_status.74f6b456fc", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_type.a007c8bb26", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at.ae82c65f62", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_updated_at_sync_tick.9098dc98f2", "test.tamanu_source_dbt.source_not_null_tamanu_notifications_user_id.72a5473ae9", "test.tamanu_source_dbt.source_unique_tamanu_notifications_id.51d3db417b"], "source.tamanu_source_dbt.tamanu.one_time_logins": ["test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_expires_at.0051cd2e03", "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_id.6318f1fc0d", "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_token.6b7dbabb08", "test.tamanu_source_dbt.source_not_null_tamanu_one_time_logins_user_id.ebe1f826af", "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac", "test.tamanu_source_dbt.source_unique_tamanu_one_time_logins_id.b1d11d6c3f"], "source.tamanu_source_dbt.tamanu.patients": ["model.tamanu_source_dbt.patients", "model.tamanu_source_dbt.patients_change_logs", "model.tamanu_source_dbt.patients_merged", "test.tamanu_source_dbt.assert__patients__village_id", "test.tamanu_source_dbt.source_accepted_values_tamanu_patients_sex__female__male__other.a3c5a2bdc7", "test.tamanu_source_dbt.source_not_null_tamanu_patients_created_at.f10f4a4622", "test.tamanu_source_dbt.source_not_null_tamanu_patients_display_id.faf4f13c00", "test.tamanu_source_dbt.source_not_null_tamanu_patients_id.275ed05302", "test.tamanu_source_dbt.source_not_null_tamanu_patients_sex.107df8a545", "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at.907998e8ed", "test.tamanu_source_dbt.source_not_null_tamanu_patients_updated_at_sync_tick.937dfa8d54", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_patient_id__id__source_tamanu_patients_.994c2060a5", "test.tamanu_source_dbt.source_relationships_tamanu_certificate_notifications_patient_id__id__source_tamanu_patients_.445dca3a7a", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_patient_id__id__source_tamanu_patients_.ab4f34cd7c", "test.tamanu_source_dbt.source_relationships_tamanu_document_metadata_patient_id__id__source_tamanu_patients_.697577ed3b", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_patient_id__id__source_tamanu_patients_.86e006efba", "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7", "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba", "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741", "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062", "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59", "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f", "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886", "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c", "test.tamanu_source_dbt.source_unique_tamanu_patients_display_id.d601818f72", "test.tamanu_source_dbt.source_unique_tamanu_patients_id.aad3b90c9d"], "source.tamanu_source_dbt.tamanu.patient_additional_data": ["model.tamanu_source_dbt.patient_additional_data", "model.tamanu_source_dbt.patient_additional_data_change_logs", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_blood_type__A___A___AB___AB___B___B___O___O_.d16028f9e4", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_additional_data_marital_status__Defacto__Married__Single__Widow__Divorced__Separated__Unknown.663d1d9b1c", "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_patient_id.9eb859e167", "test.tamanu_source_dbt.source_not_null_tamanu_patient_additional_data_updated_at_sync_tick.d93ed515bf", "test.tamanu_source_dbt.source_unique_tamanu_patient_additional_data_patient_id.765b349cc6"], "source.tamanu_source_dbt.tamanu.patient_allergies": ["model.tamanu_source_dbt.patient_allergies", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_created_at.59905c68e2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_id.f1126d18a5", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_recorded_date.de31b171cd", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at.048547273e", "test.tamanu_source_dbt.source_not_null_tamanu_patient_allergies_updated_at_sync_tick.14fb342ab8", "test.tamanu_source_dbt.source_unique_tamanu_patient_allergies_id.898e40bfbb"], "source.tamanu_source_dbt.tamanu.patient_birth_data": ["model.tamanu_source_dbt.patient_birth_data", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_attendant_at_birth__doctor__midwife__nurse__traditional_birth_attentdant__other.f7dbbb7dc8", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_birth_delivery_type__normal_vaginal_delivery__breech__emergency_c_section__elective_c_section__vacuum_extraction__forceps__other.cdd88bca26", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_birth_data_registered_birth_place__health_facility__home__other.68a09fae97", "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_created_at.ee3353eccc", "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_patient_id.7c9d7da294", "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at.96f99396c0", "test.tamanu_source_dbt.source_not_null_tamanu_patient_birth_data_updated_at_sync_tick.ad66b3a9e9", "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_birth_facility_id__id__source_tamanu_facilities_.41f2b0a645", "test.tamanu_source_dbt.source_relationships_tamanu_patient_birth_data_patient_id__id__source_tamanu_patients_.535a68dcb7", "test.tamanu_source_dbt.source_unique_tamanu_patient_birth_data_patient_id.8e97708df0"], "source.tamanu_source_dbt.tamanu.patient_care_plans": ["model.tamanu_source_dbt.patient_care_plans", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_created_at.dd6e82d0b1", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_date.34408a1445", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_id.56024c4140", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at.b6d6e4d022", "test.tamanu_source_dbt.source_not_null_tamanu_patient_care_plans_updated_at_sync_tick.310ae42450", "test.tamanu_source_dbt.source_unique_tamanu_patient_care_plans_id.a3a1194e99"], "source.tamanu_source_dbt.tamanu.patient_communications": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_channel.587842d7e0", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_created_at.33e1921e8e", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_id.1fe956c44c", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_status.125dae34af", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_type.4795985e7b", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at.871abd87ae", "test.tamanu_source_dbt.source_not_null_tamanu_patient_communications_updated_at_sync_tick.2b3912c278", "test.tamanu_source_dbt.source_relationships_tamanu_patient_communications_patient_id__id__source_tamanu_patients_.f0401833ba", "test.tamanu_source_dbt.source_unique_tamanu_patient_communications_id.b90ad76da2"], "source.tamanu_source_dbt.tamanu.patient_conditions": ["model.tamanu_source_dbt.patient_conditions", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_created_at.deda3b580a", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_id.5d2e0fb3a9", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_recorded_date.91d95abca2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at.1dc42ed219", "test.tamanu_source_dbt.source_not_null_tamanu_patient_conditions_updated_at_sync_tick.2e7535fcbb", "test.tamanu_source_dbt.source_unique_tamanu_patient_conditions_id.1b1daf4d86"], "source.tamanu_source_dbt.tamanu.patient_contacts": ["test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27", "test.tamanu_source_dbt.source_accepted_values_tamanu_patient_contacts_method__Email__Sms__WhatsApp__Telegram.8c6857119c", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_created_at.29d447b596", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_id.9e63606ba7", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_method.37c9585829", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_name.2a5f2c99f9", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_patient_id.58de0a1f28", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_relationship_id.20abe6c3b2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at.e81c827845", "test.tamanu_source_dbt.source_not_null_tamanu_patient_contacts_updated_at_sync_tick.3d648b4683", "test.tamanu_source_dbt.source_relationships_tamanu_patient_contacts_patient_id__id__source_tamanu_patients_.606993d615", "test.tamanu_source_dbt.source_unique_tamanu_patient_contacts_id.3c41111688"], "source.tamanu_source_dbt.tamanu.patient_death_data": ["model.tamanu_source_dbt.contributing_death_causes", "model.tamanu_source_dbt.patient_death_contributing_causes", "model.tamanu_source_dbt.patient_death_data", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_clinician_id.419275886d", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_id.61b8d549ff", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_is_final.f258620126", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_patient_id.fa93535dcf", "test.tamanu_source_dbt.source_not_null_tamanu_patient_death_data_updated_at_sync_tick.74f83a5b18", "test.tamanu_source_dbt.source_relationships_tamanu_contributing_death_causes_patient_death_data_id__id__source_tamanu_patient_death_data_.404540bf0a", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_death_data_id__id__source_tamanu_patient_death_data_.a370a6342c", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_facility_id__id__source_tamanu_facilities_.d81577e3c0", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_patient_id__id__source_tamanu_patients_.2640b3d741", "test.tamanu_source_dbt.source_unique_tamanu_patient_death_data_id.2155f2b6c6"], "source.tamanu_source_dbt.tamanu.patient_facilities": ["model.tamanu_source_dbt.patient_facilities", "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_facility_id.2e4a51e2f6", "test.tamanu_source_dbt.source_not_null_tamanu_patient_facilities_patient_id.a4d7ee14a4", "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_facility_id__id__source_tamanu_facilities_.8a454e3fea", "test.tamanu_source_dbt.source_relationships_tamanu_patient_facilities_patient_id__id__source_tamanu_patients_.62c931e062"], "source.tamanu_source_dbt.tamanu.patient_family_histories": ["model.tamanu_source_dbt.patient_family_histories", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_created_at.8ee5173bfa", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_id.d2d0e80b7f", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_recorded_date.ec1039e1d3", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at.c710d3b7b3", "test.tamanu_source_dbt.source_not_null_tamanu_patient_family_histories_updated_at_sync_tick.eff3f46718", "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_patient_id__id__source_tamanu_patients_.3f50556d92", "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6", "test.tamanu_source_dbt.source_unique_tamanu_patient_family_histories_id.403e2d1751"], "source.tamanu_source_dbt.tamanu.patient_field_definitions": ["test.tamanu_source_dbt.source_accepted_values_tamanu_patient_field_definitions_field_type__string__number__select.8c8193f02d", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_category_id.5bb661f0af", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_created_at.b7c144e251", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_field_type.01dad44ce8", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_id.3b31aed01d", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_name.a1fb4fbbdb", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at.812399208c", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_updated_at_sync_tick.9334037106", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definitions_visibility_status.353a97d1ea", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5", "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definitions_id.96d277b7c5"], "source.tamanu_source_dbt.tamanu.patient_field_definition_categories": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_created_at.aca434dbf3", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_id.a80a45d121", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_name.a7913c1d45", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at.f6f9f3ee6a", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_definition_categories_updated_at_sync_tick.e345b399c6", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_definitions_category_id__id__source_tamanu_patient_field_definition_categories_.d67c1014d6", "test.tamanu_source_dbt.source_unique_tamanu_patient_field_definition_categories_id.7b788d0c37"], "source.tamanu_source_dbt.tamanu.patient_field_values": ["model.tamanu_source_dbt.patient_field_values", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_created_at.acd6792845", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_definition_id.afb3baa363", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_patient_id.d726e4e785", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at.dc8ebd5fcb", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_updated_at_sync_tick.37926ff0c2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_field_values_value.20bfdc4dc5", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_definition_id__id__source_tamanu_patient_field_definitions_.7942c868d5", "test.tamanu_source_dbt.source_relationships_tamanu_patient_field_values_patient_id__id__source_tamanu_patients_.7e29294f59"], "source.tamanu_source_dbt.tamanu.patient_issues": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_created_at.e6b6b24d67", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_id.90df660f7f", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_recorded_date.1adb9dcc27", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_type.86926f7218", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at.3d4ab948f0", "test.tamanu_source_dbt.source_not_null_tamanu_patient_issues_updated_at_sync_tick.b613106397", "test.tamanu_source_dbt.source_relationships_tamanu_patient_issues_patient_id__id__source_tamanu_patients_.d2d3f731fb", "test.tamanu_source_dbt.source_unique_tamanu_patient_issues_id.cc84a334be"], "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_created_at.0bf2c435a7", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_id.01386e7977", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_patient_id.f41a0ed63a", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_prescription_id.3409401d0e", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at.6af6ca8d00", "test.tamanu_source_dbt.source_not_null_tamanu_patient_ongoing_prescriptions_updated_at_sync_tick.d9e250caae", "test.tamanu_source_dbt.source_unique_tamanu_patient_ongoing_prescriptions_id.acc37386e6"], "source.tamanu_source_dbt.tamanu.patient_program_registrations": ["model.tamanu_source_dbt.patient_program_registration_conditions", "model.tamanu_source_dbt.patient_program_registrations", "model.tamanu_source_dbt.patient_program_registrations_change_logs", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_clinician_id.f5eec02863", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_created_at.b6bbcb66a6", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_date.ee77ca5f67", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_id.3e27cbc953", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_patient_id.21a8bab832", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_program_registry_id.c9b21e72ac", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_registration_status.f99db0e260", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at.7b0cb3a4d3", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registrations_updated_at_sync_tick.6e539b8d2d", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_facility_id__id__source_tamanu_facilities_.e70f29b144", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_patient_id__id__source_tamanu_patients_.edaef8726f", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_registering_facility_id__id__source_tamanu_facilities_.0915c99f9a", "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registrations_id.82d7fead9b"], "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions": ["model.tamanu_source_dbt.patient_program_registration_conditions", "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_created_at.ffd5ec434b", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_date.51631f2975", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_id.148f05b382", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_program_registry_condition_category_id.e4d2008618", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at.ec3ed984e8", "test.tamanu_source_dbt.source_not_null_tamanu_patient_program_registration_conditions_updated_at_sync_tick.9a6307d740", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf", "test.tamanu_source_dbt.source_unique_tamanu_patient_program_registration_conditions_id.18c7acc7c5"], "source.tamanu_source_dbt.tamanu.patient_secondary_ids": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_id.c12a4d4ff4", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_patient_id.b8437631c2", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_type_id.1c5040f680", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_updated_at_sync_tick.f04774a463", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_value.ecfec42154", "test.tamanu_source_dbt.source_not_null_tamanu_patient_secondary_ids_visibility_status.687573a37f", "test.tamanu_source_dbt.source_unique_tamanu_patient_secondary_ids_id.3ac199e68c"], "source.tamanu_source_dbt.tamanu.patient_vrs_data": ["test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_id.4cc64fcbe6", "test.tamanu_source_dbt.source_not_null_tamanu_patient_vrs_data_is_deleted_by_remote.37fb7ca437", "test.tamanu_source_dbt.source_relationships_tamanu_patient_vrs_data_patient_id__id__source_tamanu_patients_.a8a8eb7561", "test.tamanu_source_dbt.source_unique_tamanu_patient_vrs_data_id.23cca07715"], "source.tamanu_source_dbt.tamanu.permissions": ["test.tamanu_source_dbt.source_not_null_tamanu_permissions_id.6ee02405bb", "test.tamanu_source_dbt.source_not_null_tamanu_permissions_noun.e00a302536", "test.tamanu_source_dbt.source_not_null_tamanu_permissions_role_id.de3cb0b624", "test.tamanu_source_dbt.source_not_null_tamanu_permissions_updated_at_sync_tick.cb90c585be", "test.tamanu_source_dbt.source_not_null_tamanu_permissions_verb.7e7206e395", "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407", "test.tamanu_source_dbt.source_unique_tamanu_permissions_id.f42c77c5be"], "source.tamanu_source_dbt.tamanu.pharmacy_orders": ["model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "model.tamanu_source_dbt.pharmacy_orders", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_created_at.c5c0ae80b6", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_date.d54f107a00", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_encounter_id.5425699795", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_facility_id.9a63aff904", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_id.a04c130d73", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_is_discharge_prescription.3adc7ce103", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_ordering_clinician_id.51e116019a", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at.5cbf7e3b7d", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_orders_updated_at_sync_tick.bc9433fa8e", "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_orders_id.8a0e450c16"], "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions": ["model.tamanu_source_dbt.medication_dispenses", "model.tamanu_source_dbt.pharmacy_order_prescriptions", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_created_at.f3e852be35", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_id.fd53b388c3", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_is_completed.d0fc6c67a0", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_pharmacy_order_id.00d2c5b906", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_prescription_id.5a6d9c2855", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_quantity.02521782a2", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at.4e7669a584", "test.tamanu_source_dbt.source_not_null_tamanu_pharmacy_order_prescriptions_updated_at_sync_tick.eb82a5ba2b", "test.tamanu_source_dbt.source_unique_tamanu_pharmacy_order_prescriptions_id.03a99815d2"], "source.tamanu_source_dbt.tamanu.portal_one_time_tokens": ["test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_created_at.1c1279979b", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_expires_at.e45d1c82d9", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_id.ab6f761724", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_portal_user_id.5159527428", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_token.8afdc93478", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_type.5c33a4037d", "test.tamanu_source_dbt.source_not_null_tamanu_portal_one_time_tokens_updated_at.b077921d8b", "test.tamanu_source_dbt.source_unique_tamanu_portal_one_time_tokens_id.84f65f30bf"], "source.tamanu_source_dbt.tamanu.portal_survey_assignments": ["test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_at.368a678108", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_assigned_by_id.0e7bb7620f", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_created_at.28c46a0f38", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_facility_id.635b864bd0", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_id.493854cb01", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_patient_id.4d329cbe3d", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_status.cbc3f2b455", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_survey_id.4c38bb901d", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at.fba08a91b8", "test.tamanu_source_dbt.source_not_null_tamanu_portal_survey_assignments_updated_at_sync_tick.71bac26d85", "test.tamanu_source_dbt.source_unique_tamanu_portal_survey_assignments_id.07592792ba"], "source.tamanu_source_dbt.tamanu.portal_users": ["test.tamanu_source_dbt.source_not_null_tamanu_portal_users_created_at.dd512de83d", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_email.46b31ee79f", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_id.5d79991deb", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_patient_id.f2014094b2", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_status.1904f1c6d7", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at.5a6d07bf8a", "test.tamanu_source_dbt.source_not_null_tamanu_portal_users_updated_at_sync_tick.b6190d5108", "test.tamanu_source_dbt.source_unique_tamanu_portal_users_email.4ffb54b9ac", "test.tamanu_source_dbt.source_unique_tamanu_portal_users_id.2af5302ce1"], "source.tamanu_source_dbt.tamanu.prescriptions": ["model.tamanu_source_dbt.prescriptions", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_created_at.ce02db9537", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_date.a2e0f3a811", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_frequency.387650c017", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_id.acb2ebf90d", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_start_date.6b47c62ca9", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_units.04b2e47d71", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at.db8ce11745", "test.tamanu_source_dbt.source_not_null_tamanu_prescriptions_updated_at_sync_tick.ccc1aacb8b", "test.tamanu_source_dbt.source_unique_tamanu_prescriptions_id.e43fe53647"], "source.tamanu_source_dbt.tamanu.procedures": ["model.tamanu_source_dbt.procedures", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_created_at.04e3942886", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_date.dcd844e127", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_id.ba34e3de73", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at.25bc26ecf8", "test.tamanu_source_dbt.source_not_null_tamanu_procedures_updated_at_sync_tick.2da29f5157", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_encounter_id__id__source_tamanu_encounters_.e6407dfa85", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_location_id__id__source_tamanu_locations_.679ed5aba8", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39", "test.tamanu_source_dbt.source_unique_tamanu_procedures_id.ed36ede291"], "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians": ["test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_created_at.6b6e8d8caf", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_id.5e29573c0c", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_procedure_id.d372d78257", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at.29771b97a5", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_updated_at_sync_tick.874770378e", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_assistant_clinicians_user_id.1c73aa9d80", "test.tamanu_source_dbt.source_unique_tamanu_procedure_assistant_clinicians_id.c47366f5e6"], "source.tamanu_source_dbt.tamanu.procedure_survey_responses": ["test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_created_at.8143f338d9", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_id.a4c8f21301", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_procedure_id.d49cf97456", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_survey_response_id.08df151a05", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at.d9d19cd3aa", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_survey_responses_updated_at_sync_tick.7ee597b2e3", "test.tamanu_source_dbt.source_unique_tamanu_procedure_survey_responses_id.f04f0f3841"], "source.tamanu_source_dbt.tamanu.procedure_type_surveys": ["test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_created_at.f34e2e523c", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_id.846fa7b74b", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_procedure_type_id.05c245e1bc", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_survey_id.8490b1ab3d", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at.b5a09d255c", "test.tamanu_source_dbt.source_not_null_tamanu_procedure_type_surveys_updated_at_sync_tick.d37ec82a41", "test.tamanu_source_dbt.source_unique_tamanu_procedure_type_surveys_id.4813977d15"], "source.tamanu_source_dbt.tamanu.programs": ["model.tamanu_source_dbt.programs", "test.tamanu_source_dbt.source_not_null_tamanu_programs_created_at.9b5a061fef", "test.tamanu_source_dbt.source_not_null_tamanu_programs_id.30041338c4", "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at.1fdd112a50", "test.tamanu_source_dbt.source_not_null_tamanu_programs_updated_at_sync_tick.b90cb49ae9", "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635", "test.tamanu_source_dbt.source_unique_tamanu_programs_id.62a81a7e37"], "source.tamanu_source_dbt.tamanu.program_data_elements": ["model.tamanu_source_dbt.program_data_elements", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_created_at.3a9a1d2f6d", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_id.0e73c12f56", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_type.5a4507db5e", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at.3f3cecdcc3", "test.tamanu_source_dbt.source_not_null_tamanu_program_data_elements_updated_at_sync_tick.d9577c2030", "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b", "test.tamanu_source_dbt.source_unique_tamanu_program_data_elements_id.a75c7468d4"], "source.tamanu_source_dbt.tamanu.program_registries": ["model.tamanu_source_dbt.program_registries", "test.tamanu_source_dbt.source_accepted_values_tamanu_program_registries_currently_at_type__village__facility.878b7101a5", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_code.42a17fd859", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_created_at.ec096818cc", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_currently_at_type.1181424fbc", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_id.e8dd600ce7", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_name.7b40894126", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_program_id.86ea68d449", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at.b636966c96", "test.tamanu_source_dbt.source_not_null_tamanu_program_registries_updated_at_sync_tick.5bea147746", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_program_registry_id__id__source_tamanu_program_registries_.ca26255395", "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa", "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413", "test.tamanu_source_dbt.source_unique_tamanu_program_registries_code.6aae9c851a", "test.tamanu_source_dbt.source_unique_tamanu_program_registries_id.4591df7852"], "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses": ["model.tamanu_source_dbt.program_registry_clinical_statuses", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_code.b6dbb55eee", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_created_at.db653414c9", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_id.5152485ff1", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_name.1483c9ad54", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_program_registry_id.51f24319f9", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at.74ec57dc65", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_clinical_statuses_updated_at_sync_tick.a28eb831c8", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinical_status_id__id__source_tamanu_program_registry_clinical_statuses_.f60ae13805", "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_clinical_statuses_program_registry_id__id__source_tamanu_program_registries_.5a69a4eefa", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_code.93a7de7fa7", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_clinical_statuses_id.6579ad9f9e"], "source.tamanu_source_dbt.tamanu.program_registry_conditions": ["model.tamanu_source_dbt.program_registry_conditions", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_code.6e0f8d91fe", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_created_at.f1a67190af", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_id.96669373a2", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_name.fb44ee2d53", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_program_registry_id.8b4085a6a4", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at.2f0d7717b7", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_conditions_updated_at_sync_tick.81caed205f", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_program_registry_condition_id__id__source_tamanu_program_registry_conditions_.bfef5107bf", "test.tamanu_source_dbt.source_relationships_tamanu_program_registry_conditions_program_registry_id__id__source_tamanu_program_registries_.4b46b0e413", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_code.9e9e23890c", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_conditions_id.8aed9112e7"], "source.tamanu_source_dbt.tamanu.program_registry_condition_categories": ["model.tamanu_source_dbt.program_registry_condition_categories", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_code.a8f2bb54d7", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_created_at.a0f967234b", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_id.a5fda78261", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_name.e875bc9167", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_program_registry_id.bef6922940", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at.704b596025", "test.tamanu_source_dbt.source_not_null_tamanu_program_registry_condition_categories_updated_at_sync_tick.62ea28ae95", "test.tamanu_source_dbt.source_unique_tamanu_program_registry_condition_categories_id.18374f5f6e"], "source.tamanu_source_dbt.tamanu.reference_data": ["model.tamanu_source_dbt.notes", "model.tamanu_source_dbt.reference_data", "test.tamanu_source_dbt.assert__patients__village_id", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_administered_vaccines_not_given_reason_id__id__source_tamanu_reference_data___type_vaccineNotGivenReason_.8bc715362f", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_appointment_type_id__id__source_tamanu_reference_data___type_appointmentType_.d6a8261230", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_appointments_booking_type_id__id__source_tamanu_reference_data___type_bookingType_.e993598733", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_manufacturer_id__id__source_tamanu_reference_data___type_manufacturer_.7fbca1adbc", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_certifiable_vaccines_vaccine_id__id__source_tamanu_reference_data___type_vaccine_.2a45c16791", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_contributing_death_causes_condition_id__id__source_tamanu_reference_data___type_diagnosis_.677e6eaf1b", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_discharges_disposition_id__id__source_tamanu_reference_data___type_dischargeDisposition_.2fff0e5fc5", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diagnoses_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.6536f09069", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounter_diets_diet_id__id__source_tamanu_reference_data___type_diet_.e71c59d77d", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_patient_billing_type_id__id__source_tamanu_reference_data___type_patientBillingType_.ecb4200032", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_encounters_referral_source_id__id__source_tamanu_reference_data___type_referralSource_.6759a4eea9", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_facilities_catchment_id__id__source_tamanu_reference_data___type_catchment_.0a191fc0e4", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_insurer_payments_insurer_id__id__source_tamanu_reference_data___type_insurer_.04f39ad92a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_invoice_patient_payments_method_id__id__source_tamanu_reference_data___type_paymentMethod_.0c32c0d3e1", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_sample_site_id__id__source_tamanu_reference_data___type_labSampleSite_.726d5f854e", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.1161021af0", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_laboratory_id__id__source_tamanu_reference_data___type_labTestLaboratory_.4ae8635507", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_lab_test_priority_id__id__source_tamanu_reference_data___type_labTestPriority_.15144cb13a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_requests_specimen_type_id__id__source_tamanu_reference_data___type_specimenType_.b37e5b8f30", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_panels_category_id__id__source_tamanu_reference_data___type_labTestCategory_.f5578be7c6", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_test_types_lab_test_category_id__id__source_tamanu_reference_data___type_labTestCategory_.8034332af4", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_category_id__id__source_tamanu_reference_data___type_labTestCategory_.be7e43137f", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_lab_tests_lab_test_method_id__id__source_tamanu_reference_data___type_labTestMethod_.b46161f1b5", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_contacts_relationship_id__id__source_tamanu_reference_data___type_contactRelationship_.98d8247d27", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause1_condition_id__id__source_tamanu_reference_data___type_diagnosis_.7ace974f49", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause2_condition_id__id__source_tamanu_reference_data___type_diagnosis_.1dea4f8138", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_antecedent_cause3_condition_id__id__source_tamanu_reference_data___type_diagnosis_.c7596dc8de", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_last_surgery_reason_id__id__source_tamanu_reference_data___type_diagnosis_.f3a9b1a797", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_death_data_primary_cause_condition_id__id__source_tamanu_reference_data___type_diagnosis_.27473a57dc", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_family_histories_diagnosis_id__id__source_tamanu_reference_data___type_diagnosis_.569a8c1cce", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_patient_program_registrations_village_id__id__source_tamanu_reference_data___type_village_.db6437c554", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_anaesthetic_id__id__source_tamanu_reference_data___type_drug_.8b2aee60ac", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_procedures_procedure_type_id__id__source_tamanu_reference_data___type_procedureType_.357cfc4070", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_code.45bb74a969", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_created_at.929d48b0fb", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_id.558d36e056", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_name.92065a73ea", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_system_required.5345a25d20", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_type.be10d4a572", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at.2d38750dde", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_updated_at_sync_tick.c5ae94a272", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_area_external_codes_area_id__id__source_tamanu_reference_data_.32280d3e7c", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_request_areas_area_id__id__source_tamanu_reference_data_.6afdf29a06", "test.tamanu_source_dbt.source_unique_tamanu_reference_data_id.f40209ddee"], "source.tamanu_source_dbt.tamanu.reference_data_relations": ["test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_created_at.c605cb5fd3", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_id.6816cc32f5", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_type.16a6b96610", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at.1731c2aeb8", "test.tamanu_source_dbt.source_not_null_tamanu_reference_data_relations_updated_at_sync_tick.b7d71eb49b", "test.tamanu_source_dbt.source_unique_tamanu_reference_data_relations_id.0fd94d2b7e"], "source.tamanu_source_dbt.tamanu.reference_drugs": ["test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_created_at.56d6a7bcc0", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_id.262b5ed3f6", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_is_sensitive.e5bd778894", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_reference_data_id.69bff85f87", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at.573d9fdd62", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drugs_updated_at_sync_tick.82d2c43485", "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_id.b18d9ebb13", "test.tamanu_source_dbt.source_unique_tamanu_reference_drugs_reference_data_id.ecedb99e2c"], "source.tamanu_source_dbt.tamanu.reference_drug_facilities": ["test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_created_at.8b63abec3a", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_facility_id.5012dd6aea", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_reference_drug_id.358fa51efa", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_stock_status.290bc96370", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at.978a5d4017", "test.tamanu_source_dbt.source_not_null_tamanu_reference_drug_facilities_updated_at_sync_tick.26b8e76f96"], "source.tamanu_source_dbt.tamanu.reference_medication_templates": ["test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_created_at.f610fc9916", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_frequency.af51280e00", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_id.f4e40f0746", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_ongoing.a2332da0d1", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_prn.6fb35e8eed", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_is_variable_dose.13556de3df", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_medication_id.050df86e27", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_reference_data_id.655683c6a0", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_route.a182c49081", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_units.692f7068eb", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at.b43c9d5e62", "test.tamanu_source_dbt.source_not_null_tamanu_reference_medication_templates_updated_at_sync_tick.cd13e259c4", "test.tamanu_source_dbt.source_unique_tamanu_reference_medication_templates_id.9c50848c51"], "source.tamanu_source_dbt.tamanu.referrals": ["model.tamanu_source_dbt.referrals", "test.tamanu_source_dbt.source_accepted_values_tamanu_referrals_status__pending__cancelled__completed.86187bc5c9", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_created_at.7dc2e9f62e", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_id.b643c6e9cf", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_status.b2da9beb55", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at.319fc895ee", "test.tamanu_source_dbt.source_not_null_tamanu_referrals_updated_at_sync_tick.475afc0dcb", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_completing_encounter_id__id__source_tamanu_encounters_.dc1e9922b6", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_initiating_encounter_id__id__source_tamanu_encounters_.e17964499c", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d", "test.tamanu_source_dbt.source_unique_tamanu_referrals_id.724932b7f0"], "source.tamanu_source_dbt.tamanu.refresh_tokens": ["model.tamanu_source_dbt.refresh_tokens", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_device_id.b6b31e60be", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_expires_at.a515544921", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_id.470a9a0ad1", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_refresh_id.1f1f3cc868", "test.tamanu_source_dbt.source_not_null_tamanu_refresh_tokens_user_id.78eb836f95", "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2", "test.tamanu_source_dbt.source_unique_tamanu_refresh_tokens_id.0c9c64d141"], "source.tamanu_source_dbt.tamanu.report_definitions": ["test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_db_schema.f939e6dfa3", "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_id.b8bb2a951d", "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_name.a630c1f799", "test.tamanu_source_dbt.source_not_null_tamanu_report_definitions_updated_at_sync_tick.3d8f13be51", "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2", "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_id.26898ce7eb", "test.tamanu_source_dbt.source_unique_tamanu_report_definitions_name.2f942767b6"], "source.tamanu_source_dbt.tamanu.report_definition_versions": ["test.tamanu_source_dbt.source_accepted_values_tamanu_report_definition_versions_status__draft__published.7b945f9a74", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_id.aeefc85efc", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_status.b2ccf6ba31", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_updated_at_sync_tick.c11a1df762", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_user_id.c3351f91fd", "test.tamanu_source_dbt.source_not_null_tamanu_report_definition_versions_version_number.a1c7832d22", "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_report_definition_id__id__source_tamanu_report_definitions_.b208147bc2", "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d", "test.tamanu_source_dbt.source_unique_tamanu_report_definition_versions_id.fc34f6d49c"], "source.tamanu_source_dbt.tamanu.report_requests": ["test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_export_format__xlsx__csv.68903ce3f9", "test.tamanu_source_dbt.source_accepted_values_tamanu_report_requests_status__Received__Processing__Processed__Error.526b71b853", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_created_at.5d76519d08", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_export_format.0e947a46a3", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_id.8374913dcd", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_recipients.d49a8a2f72", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_requested_by_user_id.10828a78a1", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_status.4eafffa24a", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at.60abf391b8", "test.tamanu_source_dbt.source_not_null_tamanu_report_requests_updated_at_sync_tick.eef7d7f267", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_facility_id__id__source_tamanu_facilities_.ce7ace92aa", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_report_definition_version_id__id__source_tamanu_report_definition_versions_.c9440b513d", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4", "test.tamanu_source_dbt.source_unique_tamanu_report_requests_id.d871afb2cf"], "source.tamanu_source_dbt.tamanu.roles": ["model.tamanu_source_dbt.roles", "test.tamanu_source_dbt.assert__users__role", "test.tamanu_source_dbt.source_not_null_tamanu_roles_id.a534c5d463", "test.tamanu_source_dbt.source_not_null_tamanu_roles_name.cfc8ac49ef", "test.tamanu_source_dbt.source_not_null_tamanu_roles_updated_at_sync_tick.7e4ea46e3f", "test.tamanu_source_dbt.source_relationships_tamanu_permissions_role_id__id__source_tamanu_roles_.5a5a1be407", "test.tamanu_source_dbt.source_unique_tamanu_roles_id.0ad588a58a"], "source.tamanu_source_dbt.tamanu.scheduled_vaccines": ["model.tamanu_source_dbt.vaccine_schedules", "test.tamanu_source_dbt.assert__scheduled_vaccines__weeks_due", "test.tamanu_source_dbt.source_accepted_values_tamanu_scheduled_vaccines_category__Campaign__Catchup__Other__Routine.c38ebd4174", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_created_at.af5ea94ddb", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_hide_from_certificate.69f1da7070", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_id.5f527b2c7d", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_sort_index.b8dba8349e", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at.bbfa85d08b", "test.tamanu_source_dbt.source_not_null_tamanu_scheduled_vaccines_updated_at_sync_tick.b312aecb83", "test.tamanu_source_dbt.source_relationships_tamanu_administered_vaccines_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.7bc6d9cb6e", "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf", "test.tamanu_source_dbt.source_unique_tamanu_scheduled_vaccines_id.2034f06a45"], "source.tamanu_source_dbt.tamanu.SequelizeMeta": ["test.tamanu_source_dbt.source_not_null_tamanu_SequelizeMeta_name.8bbd44e2f6", "test.tamanu_source_dbt.source_unique_tamanu_SequelizeMeta_name.ed3437179c"], "source.tamanu_source_dbt.tamanu.settings": ["test.tamanu_source_dbt.source_accepted_values_tamanu_settings_scope__global__central__facility.5ddc355de8", "test.tamanu_source_dbt.source_not_null_tamanu_settings_created_at.8ad3e239a6", "test.tamanu_source_dbt.source_not_null_tamanu_settings_id.5ec7f45b36", "test.tamanu_source_dbt.source_not_null_tamanu_settings_key.83ad9711e6", "test.tamanu_source_dbt.source_not_null_tamanu_settings_scope.64d1f26cf2", "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at.9dc40b301e", "test.tamanu_source_dbt.source_not_null_tamanu_settings_updated_at_sync_tick.9e782f5b11", "test.tamanu_source_dbt.source_relationships_tamanu_settings_facility_id__id__source_tamanu_facilities_.bf1a10aebe", "test.tamanu_source_dbt.source_unique_tamanu_settings_id.6bf47c8849"], "source.tamanu_source_dbt.tamanu.signers": ["test.tamanu_source_dbt.source_not_null_tamanu_signers_country_code.735093d735", "test.tamanu_source_dbt.source_not_null_tamanu_signers_created_at.ebbc95db3b", "test.tamanu_source_dbt.source_not_null_tamanu_signers_id.d9bf36bcfd", "test.tamanu_source_dbt.source_not_null_tamanu_signers_public_key.8c9810508e", "test.tamanu_source_dbt.source_not_null_tamanu_signers_request.7f61438b31", "test.tamanu_source_dbt.source_not_null_tamanu_signers_signatures_issued.14d1c11aa6", "test.tamanu_source_dbt.source_not_null_tamanu_signers_updated_at.1364660ca8", "test.tamanu_source_dbt.source_unique_tamanu_signers_id.596fa93fab"], "source.tamanu_source_dbt.tamanu.socket_io_attachments": ["test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_id.acd275c6dc", "test.tamanu_source_dbt.source_not_null_tamanu_socket_io_attachments_updated_at_sync_tick.8169c97d48", "test.tamanu_source_dbt.source_unique_tamanu_socket_io_attachments_id.919f1a7156"], "source.tamanu_source_dbt.tamanu.surveys": ["model.tamanu_source_dbt.surveys", "test.tamanu_source_dbt.source_accepted_values_tamanu_surveys_survey_type__programs__referral__obsolete__vitals.fb3dae8522", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_created_at.49abf4cc08", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_id.232633415e", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_is_sensitive.5f59558cfe", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notifiable.fa289a592a", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_notify_email_addresses.6c0b996c80", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at.88f3f24266", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_updated_at_sync_tick.27e79d3218", "test.tamanu_source_dbt.source_not_null_tamanu_surveys_visibility_status.a50fde3a7b", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90", "test.tamanu_source_dbt.source_relationships_tamanu_surveys_program_id__id__source_tamanu_programs_.fa85daf635", "test.tamanu_source_dbt.source_unique_tamanu_surveys_id.0e6c4290cc"], "source.tamanu_source_dbt.tamanu.survey_responses": ["model.tamanu_source_dbt.survey_responses", "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_created_at.49ae85efe6", "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_id.89723bde14", "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at.1ac4070914", "test.tamanu_source_dbt.source_not_null_tamanu_survey_responses_updated_at_sync_tick.d413782924", "test.tamanu_source_dbt.source_relationships_tamanu_referrals_survey_response_id__id__source_tamanu_survey_responses_.36148d215d", "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_encounter_id__id__source_tamanu_encounters_.5fa54101ad", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_survey_id__id__source_tamanu_surveys_.f0ce4a9c90", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04", "test.tamanu_source_dbt.source_unique_tamanu_survey_responses_id.7d37627ac3"], "source.tamanu_source_dbt.tamanu.survey_response_answers": ["model.tamanu_source_dbt.survey_response_answers", "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_created_at.6a14b3247f", "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_id.a1a5252fba", "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at.e9d87e13d5", "test.tamanu_source_dbt.source_not_null_tamanu_survey_response_answers_updated_at_sync_tick.23337bdabf", "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_data_element_id__id__source_tamanu_program_data_elements_.a34b366f2b", "test.tamanu_source_dbt.source_relationships_tamanu_survey_response_answers_response_id__id__source_tamanu_survey_responses_.f49aacfe3d", "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26", "test.tamanu_source_dbt.source_unique_tamanu_survey_response_answers_id.9ab12c2f4a"], "source.tamanu_source_dbt.tamanu.survey_screen_components": ["model.tamanu_source_dbt.survey_screen_components", "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_created_at.e0b4cb2d3f", "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_id.f2559a7214", "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at.87177a4413", "test.tamanu_source_dbt.source_not_null_tamanu_survey_screen_components_updated_at_sync_tick.ac240e6aaa", "test.tamanu_source_dbt.source_unique_tamanu_survey_screen_components_id.83c6daf387"], "source.tamanu_source_dbt.tamanu.sync_device_ticks": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_device_id.6e51235a41", "test.tamanu_source_dbt.source_not_null_tamanu_sync_device_ticks_persisted_at_sync_tick.70f0dcb68a", "test.tamanu_source_dbt.source_unique_tamanu_sync_device_ticks_persisted_at_sync_tick.fad79e2999"], "source.tamanu_source_dbt.tamanu.sync_lookup": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_data.aadfed61f6", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_id.e77326bde2", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_deleted.356b4fa211", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_is_lab_request.dbe4ce8b63", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_id.39e7bce4d2", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_record_type.f0bc60b21f", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_updated_at_sync_tick.902ae4ae9c", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_encounter_id__id__source_tamanu_encounters_.f3141bec3e", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_facility_id__id__source_tamanu_facilities_.c67a117f63", "test.tamanu_source_dbt.source_relationships_tamanu_sync_lookup_patient_id__id__source_tamanu_patients_.07efccc886", "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_id.dc05d15b43"], "source.tamanu_source_dbt.tamanu.sync_lookup_ticks": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_lookup_end_tick.2552341359", "test.tamanu_source_dbt.source_not_null_tamanu_sync_lookup_ticks_source_start_tick.4b0254a181", "test.tamanu_source_dbt.source_unique_tamanu_sync_lookup_ticks_lookup_end_tick.f4830d30b3"], "source.tamanu_source_dbt.tamanu.sync_queued_devices": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_created_at.ca84df51b3", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_facility_ids.1c565eb9fd", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_id.8a7ff7ff9d", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_seen_time.e49db9d307", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_last_synced_tick.ebca46f7d5", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_updated_at.3c113842b4", "test.tamanu_source_dbt.source_not_null_tamanu_sync_queued_devices_urgent.cdd3e5fe6d", "test.tamanu_source_dbt.source_unique_tamanu_sync_queued_devices_id.6c914cf2fe"], "source.tamanu_source_dbt.tamanu.sync_sessions": ["test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_created_at.0c852b71e6", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_id.0f66f04bf1", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_last_connection_time.c7679203ab", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_parameters.f21c74e9cb", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_start_time.10e3f256db", "test.tamanu_source_dbt.source_not_null_tamanu_sync_sessions_updated_at.807ac1b19c", "test.tamanu_source_dbt.source_unique_tamanu_sync_sessions_id.889d1d85c3"], "source.tamanu_source_dbt.tamanu.tasks": ["test.tamanu_source_dbt.source_not_null_tamanu_tasks_created_at.75a1e0c186", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_due_time.786df1eb28", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_encounter_id.a10fb48922", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_id.5bf790bd4a", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_name.2bd48eee09", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_request_time.23dfcbcfc2", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_requested_by_user_id.952e010b84", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_status.bac3beba06", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_task_type.4d57fb7d6d", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at.6e16335296", "test.tamanu_source_dbt.source_not_null_tamanu_tasks_updated_at_sync_tick.1b04cf33ee", "test.tamanu_source_dbt.source_unique_tamanu_tasks_id.78245a380c"], "source.tamanu_source_dbt.tamanu.task_designations": ["test.tamanu_source_dbt.source_not_null_tamanu_task_designations_created_at.60f756cdb6", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_designation_id.dc0adb2396", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_id.2c04a11c88", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_task_id.d0e443e977", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at.14c7cc7b2e", "test.tamanu_source_dbt.source_not_null_tamanu_task_designations_updated_at_sync_tick.6da15a7273", "test.tamanu_source_dbt.source_unique_tamanu_task_designations_id.adf46ec6db"], "source.tamanu_source_dbt.tamanu.task_templates": ["test.tamanu_source_dbt.source_not_null_tamanu_task_templates_created_at.dc5ea6d6ea", "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_id.0933c9bcea", "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_reference_data_id.7d5a72304e", "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at.4ff8103b44", "test.tamanu_source_dbt.source_not_null_tamanu_task_templates_updated_at_sync_tick.91bfaac2c6", "test.tamanu_source_dbt.source_unique_tamanu_task_templates_id.f452d2227f", "test.tamanu_source_dbt.source_unique_tamanu_task_templates_reference_data_id.7d4341b2a8"], "source.tamanu_source_dbt.tamanu.task_template_designations": ["test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_created_at.c02e7baa62", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_designation_id.08e232161f", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_id.b21ed442a4", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_task_template_id.7cd91a06a9", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at.8c60186f8d", "test.tamanu_source_dbt.source_not_null_tamanu_task_template_designations_updated_at_sync_tick.a7118edaf1", "test.tamanu_source_dbt.source_unique_tamanu_task_template_designations_id.d2b5b4576a"], "source.tamanu_source_dbt.tamanu.templates": ["test.tamanu_source_dbt.source_not_null_tamanu_templates_id.4e582a2692", "test.tamanu_source_dbt.source_not_null_tamanu_templates_name.5251789780", "test.tamanu_source_dbt.source_not_null_tamanu_templates_type.6083b4eb5c", "test.tamanu_source_dbt.source_not_null_tamanu_templates_updated_at_sync_tick.68f02a36e6", "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c", "test.tamanu_source_dbt.source_unique_tamanu_templates_id.2cf6e18998"], "source.tamanu_source_dbt.tamanu.translated_strings": ["model.tamanu_source_dbt.translated_strings", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_created_at.07e267913e", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_language.5db2b5e2e8", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_string_id.7e37c8c4ad", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at.d1e4d3b582", "test.tamanu_source_dbt.source_not_null_tamanu_translated_strings_updated_at_sync_tick.25a430f1e2"], "source.tamanu_source_dbt.tamanu.triages": ["model.tamanu_source_dbt.triages", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_arrival_mode_id__id__source_tamanu_reference_data___type_arrivalMode_.26a3871e3a", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_chief_complaint_id__id__source_tamanu_reference_data___type_triageReason_.3203451a40", "test.tamanu_source_dbt.dbt_utils_source_relationships_where_tamanu_triages_secondary_complaint_id__id__source_tamanu_reference_data___type_triageReason_.8c9e664e44", "test.tamanu_source_dbt.source_not_null_tamanu_triages_created_at.9d4e7381d6", "test.tamanu_source_dbt.source_not_null_tamanu_triages_id.8276269bfd", "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at.3cd54f2d9b", "test.tamanu_source_dbt.source_not_null_tamanu_triages_updated_at_sync_tick.38a343c27f", "test.tamanu_source_dbt.source_relationships_tamanu_triages_encounter_id__id__source_tamanu_encounters_.3903adeec0", "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138", "test.tamanu_source_dbt.source_unique_tamanu_triages_id.86b3cfdd35"], "source.tamanu_source_dbt.tamanu.upcoming_vaccinations": ["model.tamanu_source_dbt.patient_vaccinations_upcoming", "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_patient_id__id__source_tamanu_patients_.32e4981e6c", "test.tamanu_source_dbt.source_relationships_tamanu_upcoming_vaccinations_scheduled_vaccine_id__id__source_tamanu_scheduled_vaccines_.37ba12bfdf"], "source.tamanu_source_dbt.tamanu.users": ["model.tamanu_source_dbt.users", "test.tamanu_source_dbt.assert__users__role", "test.tamanu_source_dbt.dbt_utils_source_accepted_range_tamanu_users_device_registration_quota__0.fdd0e2e704", "test.tamanu_source_dbt.source_not_null_tamanu_users_created_at.7bde2fabde", "test.tamanu_source_dbt.source_not_null_tamanu_users_device_registration_quota.06b86bd62e", "test.tamanu_source_dbt.source_not_null_tamanu_users_display_name.86d7ca2504", "test.tamanu_source_dbt.source_not_null_tamanu_users_email.c9dd9cef8c", "test.tamanu_source_dbt.source_not_null_tamanu_users_id.7a4497a05a", "test.tamanu_source_dbt.source_not_null_tamanu_users_role.553b7aa11f", "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at.63853dad90", "test.tamanu_source_dbt.source_not_null_tamanu_users_updated_at_sync_tick.ddaa25a636", "test.tamanu_source_dbt.source_not_null_tamanu_users_visibility_status.48d8ce74c3", "test.tamanu_source_dbt.source_relationships_logs__tamanu_changes_updated_by_user_id__id__source_tamanu_users_.7c9053d465", "test.tamanu_source_dbt.source_relationships_tamanu_appointments_clinician_id__id__source_tamanu_users_.b2920f6fec", "test.tamanu_source_dbt.source_relationships_tamanu_death_revert_logs_reverted_by_id__id__source_tamanu_users_.953c559e54", "test.tamanu_source_dbt.source_relationships_tamanu_devices_registered_by_id__id__source_tamanu_users_.b7e1d90812", "test.tamanu_source_dbt.source_relationships_tamanu_discharges_discharger_id__id__source_tamanu_users_.1e9379ede1", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_diagnoses_clinician_id__id__source_tamanu_users_.98d7d9c464", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_actor_id__id__source_tamanu_users_.fbf272ed47", "test.tamanu_source_dbt.source_relationships_tamanu_encounter_history_examiner_id__id__source_tamanu_users_.b2d555c7b6", "test.tamanu_source_dbt.source_relationships_tamanu_encounters_examiner_id__id__source_tamanu_users_.1a33a59a12", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_completed_by_id__id__source_tamanu_users_.d4627e3b55", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_requests_requested_by_id__id__source_tamanu_users_.120db4235e", "test.tamanu_source_dbt.source_relationships_tamanu_imaging_results_completed_by_id__id__source_tamanu_users_.cf92796113", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_discounts_applied_by_user_id__id__source_tamanu_users_.4ec462b6c3", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_items_ordered_by_user_id__id__source_tamanu_users_.a5aadc15a8", "test.tamanu_source_dbt.source_relationships_tamanu_invoice_payments_updated_by_user_id__id__source_tamanu_users_.11aa785c7b", "test.tamanu_source_dbt.source_relationships_tamanu_ips_requests_created_by__id__source_tamanu_users_.9e7a2bec9f", "test.tamanu_source_dbt.source_relationships_tamanu_lab_request_logs_updated_by_id__id__source_tamanu_users_.86e7966883", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_collected_by_id__id__source_tamanu_users_.fa7e746896", "test.tamanu_source_dbt.source_relationships_tamanu_lab_requests_requested_by_id__id__source_tamanu_users_.332337a1bd", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_author_id__id__source_tamanu_users_.1029ad90a3", "test.tamanu_source_dbt.source_relationships_tamanu_note_items_on_behalf_of_id__id__source_tamanu_users_.35728438ca", "test.tamanu_source_dbt.source_relationships_tamanu_notes_author_id__id__source_tamanu_users_.d295cc11d5", "test.tamanu_source_dbt.source_relationships_tamanu_notes_on_behalf_of_id__id__source_tamanu_users_.8b38421ee7", "test.tamanu_source_dbt.source_relationships_tamanu_one_time_logins_user_id__id__source_tamanu_users_.93741528ac", "test.tamanu_source_dbt.source_relationships_tamanu_patient_death_data_clinician_id__id__source_tamanu_users_.12e92239d7", "test.tamanu_source_dbt.source_relationships_tamanu_patient_family_histories_practitioner_id__id__source_tamanu_users_.1464fe93d6", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_clinician_id__id__source_tamanu_users_.1928169432", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registration_conditions_deletion_clinician_id__id__source_tamanu_users_.329bc7b403", "test.tamanu_source_dbt.source_relationships_tamanu_patient_program_registrations_clinician_id__id__source_tamanu_users_.660ded928b", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_anaesthetist_id__id__source_tamanu_users_.5a3ee51b82", "test.tamanu_source_dbt.source_relationships_tamanu_procedures_physician_id__id__source_tamanu_users_.b1d682ce39", "test.tamanu_source_dbt.source_relationships_tamanu_refresh_tokens_user_id__id__source_tamanu_users_.ba625319c2", "test.tamanu_source_dbt.source_relationships_tamanu_report_definition_versions_user_id__id__source_tamanu_users_.53887ef192", "test.tamanu_source_dbt.source_relationships_tamanu_report_requests_requested_by_user_id__id__source_tamanu_users_.11b6b8f5c4", "test.tamanu_source_dbt.source_relationships_tamanu_survey_responses_user_id__id__source_tamanu_users_.2aef705f04", "test.tamanu_source_dbt.source_relationships_tamanu_templates_created_by_id__id__source_tamanu_users_.e25012c12c", "test.tamanu_source_dbt.source_relationships_tamanu_triages_practitioner_id__id__source_tamanu_users_.9341ff1138", "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5", "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055", "test.tamanu_source_dbt.source_unique_tamanu_users_email.e8d696ebe0", "test.tamanu_source_dbt.source_unique_tamanu_users_id.b46294f196"], "source.tamanu_source_dbt.tamanu.user_designations": ["test.tamanu_source_dbt.source_not_null_tamanu_user_designations_created_at.db3f67069a", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_designation_id.f9b573eeb8", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_id.be521369b8", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at.4bbf71e0b0", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_updated_at_sync_tick.934bc4ad06", "test.tamanu_source_dbt.source_not_null_tamanu_user_designations_user_id.2b15af1d80", "test.tamanu_source_dbt.source_unique_tamanu_user_designations_id.85f719d07a"], "source.tamanu_source_dbt.tamanu.user_facilities": ["test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_id.b28d1c6ab3", "test.tamanu_source_dbt.source_not_null_tamanu_user_facilities_updated_at_sync_tick.14851edb16", "test.tamanu_source_dbt.source_unique_tamanu_user_facilities_id.30936aeb5a"], "source.tamanu_source_dbt.tamanu.user_leaves": ["test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_created_at.638cb66e18", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_end_date.69c42bf7d9", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_id.3c0b468b6b", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_start_date.a4376146d4", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at.045e6c9ad2", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_updated_at_sync_tick.05dfeae565", "test.tamanu_source_dbt.source_not_null_tamanu_user_leaves_user_id.df71d24528", "test.tamanu_source_dbt.source_unique_tamanu_user_leaves_id.f9fb006fa5"], "source.tamanu_source_dbt.tamanu.user_localisation_caches": ["test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_id.31e4c40fbd", "test.tamanu_source_dbt.source_not_null_tamanu_user_localisation_caches_localisation.6988ef3ae3", "test.tamanu_source_dbt.source_unique_tamanu_user_localisation_caches_id.32edbc1226"], "source.tamanu_source_dbt.tamanu.user_login_attempts": ["test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_created_at.6e8a042c51", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_id.41946400e6", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_outcome.75b959648c", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at.d3d764c50c", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_updated_at_sync_tick.4f8f310f05", "test.tamanu_source_dbt.source_not_null_tamanu_user_login_attempts_user_id.51a52b5106", "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_device_id__id__source_tamanu_devices_.caa8944999", "test.tamanu_source_dbt.source_relationships_tamanu_user_login_attempts_user_id__id__source_tamanu_users_.e19bccc1a5", "test.tamanu_source_dbt.source_unique_tamanu_user_login_attempts_id.5f14bcd808"], "source.tamanu_source_dbt.tamanu.user_preferences": ["test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_created_at.b4868da62e", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_id.0563337670", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_key.42f62cbf6e", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at.e3fb22ee58", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_updated_at_sync_tick.68db073099", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_user_id.de0ee34cbb", "test.tamanu_source_dbt.source_not_null_tamanu_user_preferences_value.05dc3d9f13", "test.tamanu_source_dbt.source_unique_tamanu_user_preferences_id.ff8617d0af"], "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients": ["test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_created_at.60a2cd8b3e", "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_id.0772796918", "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_patient_id.3c02c3c6e8", "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_updated_at.f76b5440b3", "test.tamanu_source_dbt.source_not_null_tamanu_user_recently_viewed_patients_user_id.8e3a703839", "test.tamanu_source_dbt.source_unique_tamanu_user_recently_viewed_patients_id.723cf05c7a"], "source.tamanu_source_dbt.tamanu.vitals": ["test.tamanu_source_dbt.source_not_null_tamanu_vitals_created_at.16b6f3a14f", "test.tamanu_source_dbt.source_not_null_tamanu_vitals_date_recorded.0d32b23c9f", "test.tamanu_source_dbt.source_not_null_tamanu_vitals_id.18a9bbf45f", "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at.a07980dfdb", "test.tamanu_source_dbt.source_not_null_tamanu_vitals_updated_at_sync_tick.9962306ac1", "test.tamanu_source_dbt.source_unique_tamanu_vitals_id.fd030294af"], "source.tamanu_source_dbt.tamanu.vital_logs": ["test.tamanu_source_dbt.source_accepted_values_tamanu_vital_logs_reason_for_change__incorrect_patient__incorrect_value__other__recorded_in_error.f8319959ff", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_answer_id.a061b3580d", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_created_at.1c50457539", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_date.19b648a68b", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_id.2865672c8c", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at.fad4900972", "test.tamanu_source_dbt.source_not_null_tamanu_vital_logs_updated_at_sync_tick.8257970877", "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_answer_id__id__source_tamanu_survey_response_answers_.345fc6ff26", "test.tamanu_source_dbt.source_relationships_tamanu_vital_logs_recorded_by_id__id__source_tamanu_users_.7c5a5dd055", "test.tamanu_source_dbt.source_unique_tamanu_vital_logs_id.3a1b593bf4"], "unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs": [], "unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs": [], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation": [], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality": [], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only": [], "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {"unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs": {"model": "patient_program_registrations_change_logs", "given": [{"input": "source('logs__tamanu', 'changes')", "rows": [{"id": "550e8400-e29b-41d4-a716-446655440001", "logged_at": "2025-06-20 10:00:00+12:00", "updated_by_user_id": "user_001", "record_id": "reg_001", "table_name": "patient_program_registrations", "version": "2.33.0", "record_created_at": "2024-01-15 09:00:00", "record_updated_at": "2024-01-15 09:00:00", "record_data": "{\"date\": \"2024-01-15T09:00:00Z\", \"registration_status\": \"active\", \"patient_id\": \"pat_001\", \"program_registry_id\": \"prog_001\", \"clinical_status_id\": \"status_001\", \"clinician_id\": \"cli_001\", \"registering_facility_id\": \"fac_001\", \"facility_id\": \"fac_001\"}"}, {"id": "550e8400-e29b-41d4-a716-446655440002", "logged_at": "2025-06-20 14:30:00+12:00", "updated_by_user_id": "user_002", "record_id": "reg_001", "table_name": "patient_program_registrations", "version": "2.33.1", "record_created_at": "2024-01-16 13:30:00", "record_updated_at": "2024-01-16 13:30:00", "record_data": "{\"date\": \"2024-01-16T13:30:00Z\", \"registration_status\": \"inactive\", \"patient_id\": \"pat_001\", \"program_registry_id\": \"prog_001\", \"clinical_status_id\": \"status_002\", \"clinician_id\": \"cli_002\", \"registering_facility_id\": \"fac_001\", \"facility_id\": \"fac_001\", \"deactivated_clinician_id\": \"cli_003\", \"deactivated_date\": \"2024-01-16T15:00:00Z\"}"}], "format": "csv", "fixture": null}, {"input": "source('tamanu', 'patient_program_registrations')", "rows": [{"id": "reg_001", "date": "2026-01-18 10:00:00", "registration_status": "inactive", "patient_id": "pat_001", "program_registry_id": "prog_001", "clinical_status_id": "status_002", "clinician_id": "cli_002", "registering_facility_id": "fac_001", "facility_id": "fac_001", "village_id": null, "deactivated_clinician_id": "cli_003", "deactivated_date": "2024-01-16 15:00:00", "deleted_at": null}], "format": "csv", "fixture": null}], "expect": {"rows": [{"changelog_id": "550e8400-e29b-41d4-a716-446655440001", "logged_at": "2025-06-20 10:00:00+12:00", "updated_by_user_id": "user_001", "id": "reg_001", "datetime": "2024-01-15 09:00:00", "registration_status": "active", "patient_id": "pat_001", "program_registry_id": "prog_001", "clinical_status_id": "status_001", "registered_by_id": "cli_001", "registering_facility_id": "fac_001", "facility_id": "fac_001", "village_id": null, "deactivated_by_id": null, "deactivated_datetime": null}, {"changelog_id": "550e8400-e29b-41d4-a716-446655440002", "logged_at": "2025-06-20 14:30:00+12:00", "updated_by_user_id": "user_002", "id": "reg_001", "datetime": "2024-01-16 13:30:00", "registration_status": "inactive", "patient_id": "pat_001", "program_registry_id": "prog_001", "clinical_status_id": "status_002", "registered_by_id": "cli_002", "registering_facility_id": "fac_001", "facility_id": "fac_001", "village_id": null, "deactivated_by_id": "cli_003", "deactivated_datetime": "2024-01-16 15:00:00"}], "format": "csv", "fixture": null}, "name": "test_patient_program_registrations_change_logs", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registrations_change_logs.yml", "original_file_path": "models\\bases\\patient_program_registrations_change_logs.yml", "unique_id": "unit_test.tamanu_source_dbt.patient_program_registrations_change_logs.test_patient_program_registrations_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registrations_change_logs", "test_patient_program_registrations_change_logs"], "description": "Test basic functionality of patient_program_registrations_change_logs model", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_program_registrations_change_logs"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "daa003d136f6a20aac44bd33b29452bc30d21b55151e4a3256de2cdbc91cd907", "schema": "reporting", "created_at": 1782423652.1449962, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs": {"model": "patient_program_registration_conditions_change_logs", "given": [{"input": "source('logs__tamanu', 'changes')", "rows": [{"id": "550e8400-e29b-41d4-a716-446655440001", "logged_at": "2025-06-20 10:00:00", "updated_by_user_id": "user_001", "record_id": "cond_001", "table_name": "patient_program_registration_conditions", "version": "2.33.0", "record_created_at": "2024-01-15 09:00:00", "record_updated_at": "2024-01-15 09:00:00", "record_data": "{\"id\": \"cond_001\", \"date\": \"2024-01-15T09:00:00Z\", \"program_registry_condition_id\": \"prog_cond_001\", \"patient_program_registration_id\": \"reg_001\", \"program_registry_condition_category_id\": \"primary\", \"reason_for_change\": \"initial_registration\", \"clinician_id\": \"cli_001\", \"deletion_date\": null, \"deletion_clinician_id\": null}"}, {"id": "550e8400-e29b-41d4-a716-446655440002", "logged_at": "2025-06-20 14:30:00", "updated_by_user_id": "user_002", "record_id": "cond_001", "table_name": "patient_program_registration_conditions", "version": "2.33.1", "record_created_at": "2024-01-16 13:30:00", "record_updated_at": "2024-01-16 13:30:00", "record_data": "{\"id\": \"cond_001\", \"date\": \"2024-01-16T13:30:00Z\", \"program_registry_condition_id\": \"prog_cond_001\", \"patient_program_registration_id\": \"reg_001\", \"program_registry_condition_category_id\": \"secondary\", \"reason_for_change\": \"condition_category_updated\", \"clinician_id\": \"cli_002\", \"deletion_date\": \"2024-01-16T15:00:00Z\", \"deletion_clinician_id\": \"cli_003\"}"}], "format": "csv", "fixture": null}, {"input": "source('tamanu', 'patient_program_registration_conditions')", "rows": [{"id": "cond_001", "date": "2024-01-15 09:00:00", "program_registry_condition_id": "prog_cond_001", "patient_program_registration_id": "reg_001", "program_registry_condition_category_id": "primary", "reason_for_change": "initial_registration", "clinician_id": "cli_001", "deletion_date": null, "deletion_clinician_id": null, "deleted_at": null}, {"id": "cond_001", "date": "2024-01-16 13:30:00", "program_registry_condition_id": "prog_cond_001", "patient_program_registration_id": "reg_001", "program_registry_condition_category_id": "secondary", "reason_for_change": "condition_category_updated", "clinician_id": "cli_002", "deletion_date": "2024-01-16 15:00:00", "deletion_clinician_id": "cli_003", "deleted_at": null}], "format": "csv", "fixture": null}], "expect": {"rows": [{"changelog_id": "550e8400-e29b-41d4-a716-446655440002", "logged_at": "2025-06-20 14:30:00", "updated_by_user_id": "user_002", "id": "cond_001", "datetime": "2024-01-16 13:30:00", "program_registry_condition_id": "prog_cond_001", "patient_program_registration_id": "reg_001", "program_registry_condition_category_id": "secondary", "reason_for_change": "condition_category_updated", "recorded_by_id": "cli_002", "deleted_datetime": "2024-01-16 15:00:00", "deleted_by_id": "cli_003"}, {"changelog_id": "550e8400-e29b-41d4-a716-446655440001", "logged_at": "2025-06-20 10:00:00", "updated_by_user_id": "user_001", "id": "cond_001", "datetime": "2024-01-15 09:00:00", "program_registry_condition_id": "prog_cond_001", "patient_program_registration_id": "reg_001", "program_registry_condition_category_id": "primary", "reason_for_change": "initial_registration", "recorded_by_id": "cli_001", "deleted_datetime": null, "deleted_by_id": null}], "format": "csv", "fixture": null}, "name": "test_patient_program_registration_conditions_change_logs", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "bases\\patient_program_registration_conditions_change_logs.yml", "original_file_path": "models\\bases\\patient_program_registration_conditions_change_logs.yml", "unique_id": "unit_test.tamanu_source_dbt.patient_program_registration_conditions_change_logs.test_patient_program_registration_conditions_change_logs", "fqn": ["tamanu_source_dbt", "bases", "patient_program_registration_conditions_change_logs", "test_patient_program_registration_conditions_change_logs"], "description": "Test basic functionality of patient_program_registration_conditions_change_logs model", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.patient_program_registration_conditions_change_logs"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "caca3093fd3f120852e920d714a962363b7e47f68dac517fb9eb72039ad3f979", "schema": "reporting", "created_at": 1782423652.1449962, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation": {"model": "ds__admissions", "given": [{"input": "ref('encounters')", "rows": "select 'enc_001' as id, 'pat_001' as patient_id, '2024-05-15 10:00:00'::timestamp as start_datetime, null::timestamp as end_datetime, 'loc_001' as location_id, 'bill_001' as patient_billing_type_id, 'admission' as encounter_type", "format": "sql", "fixture": null}, {"input": "ref('patients')", "rows": "select 'pat_001' as id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 'male' as sex, 'vil_001' as village_id", "format": "sql", "fixture": null}, {"input": "ref('encounter_history')", "rows": "select 'enc_001' as encounter_id, '2024-05-15 10:00:00'::timestamp as datetime, null::text[] as change_type, 'cli_001' as clinician_id, 'dept_001' as department_id, 'loc_001' as location_id, 'admission' as encounter_type", "format": "sql", "fixture": null}, {"input": "ref('users')", "rows": "select 'cli_001' as id, 'Dr. Alice Wilson' as display_name", "format": "sql", "fixture": null}, {"input": "ref('departments')", "rows": "select 'dept_001' as id, 'Emergency' as name", "format": "sql", "fixture": null}, {"input": "ref('locations')", "rows": "select 'loc_001' as id, 'Room 101' as name, 'fac_001' as facility_id, 'lg_001' as location_group_id", "format": "sql", "fixture": null}, {"input": "ref('location_groups')", "rows": "select 'lg_001' as id, 'Emergency Ward' as name", "format": "sql", "fixture": null}, {"input": "ref('facilities')", "rows": "select 'fac_001' as id, 'Central Hospital' as name, false as is_sensitive", "format": "sql", "fixture": null}, {"input": "ref('reference_data')", "rows": "select 'vil_001' as id, 'Village A' as name, null as code\nunion all\nselect 'bill_001', 'Insurance', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_diagnoses')", "rows": "select null::text as encounter_id, null::text as diagnosis_id, null::boolean as is_primary, null::text as certainty, null::timestamp as datetime\nwhere false", "format": "sql", "fixture": null}], "expect": {"rows": "select 'pat_001' as patient_id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 34 as age, 'Male' as sex, 'vil_001' as village_id, 'Village A' as village, 'bill_001' as billing_type_id, 'Insurance' as billing_type, 'cli_001' as admitting_clinician_id, 'Dr. Alice Wilson' as admitting_clinician, '2024-05-15 10:00:00'::timestamp as admission_datetime, 'active' as admission_status, null::timestamp as discharge_datetime, 'fac_001' as facility_id, 'Central Hospital' as facility, array['dept_001'] as department_ids, 'Emergency' as departments, '2024-05-15 10:00' as department_datetimes, array['lg_001'] as location_group_ids, 'Emergency Ward' as location_groups, '2024-05-15 10:00' as location_group_datetimes, array['loc_001'] as location_ids, 'Room 101' as locations, '2024-05-15 10:00' as location_datetimes, null as primary_diagnoses, null as secondary_diagnoses", "format": "sql", "fixture": null}, "name": "test_ds_admissions_age_calculation", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "unit_tests\\test_ds_admissions_age_calculation.yml", "original_file_path": "models\\unit_tests\\test_ds_admissions_age_calculation.yml", "unique_id": "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_age_calculation", "fqn": ["tamanu_source_dbt", "unit_tests", "ds__admissions", "test_ds_admissions_age_calculation"], "description": "Test age calculation at admission time", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "34db723f667978a93d737512faf08a59a5c2aab9a5ce75a81bbbc31295a7a8e8", "schema": "reporting", "created_at": 1782423652.7174046, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality": {"model": "ds__admissions", "given": [{"input": "ref('encounters')", "rows": "select 'enc_001' as id, 'pat_001' as patient_id, '2024-01-15 10:00:00'::timestamp as start_datetime, null::timestamp as end_datetime, 'loc_001' as location_id, 'bill_001' as patient_billing_type_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', 'pat_002', '2024-01-16 14:30:00'::timestamp, '2024-01-20 09:00:00'::timestamp, 'loc_002', 'bill_002', 'admission'\nunion all\nselect 'enc_003', 'pat_003', '2024-01-17 08:15:00'::timestamp, null::timestamp, 'loc_001', null, 'outpatient'", "format": "sql", "fixture": null}, {"input": "ref('patients')", "rows": "select 'pat_001' as id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 'male' as sex, 'vil_001' as village_id\nunion all\nselect 'pat_002', 'P002', 'Jane', 'Smith', '1985-08-22'::date, 'female', 'vil_002'\nunion all\nselect 'pat_003', 'P003', 'Bob', 'Johnson', '1975-12-10'::date, 'male', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_history')", "rows": "select 'enc_001' as encounter_id, '2024-01-15 10:00:00'::timestamp as datetime, null::text[] as change_type, 'cli_001' as clinician_id, 'dept_001' as department_id, 'loc_001' as location_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', '2024-01-16 14:30:00'::timestamp, null::text[], 'cli_002', 'dept_002', 'loc_002', 'admission'\nunion all\nselect 'enc_002', '2024-01-18 10:00:00'::timestamp, array['department'], 'cli_002', 'dept_003', 'loc_002', 'admission'", "format": "sql", "fixture": null}, {"input": "ref('users')", "rows": "select 'cli_001' as id, 'Dr. Alice Wilson' as display_name\nunion all\nselect 'cli_002', 'Dr. Bob Martinez'", "format": "sql", "fixture": null}, {"input": "ref('departments')", "rows": "select 'dept_001' as id, 'Emergency' as name\nunion all\nselect 'dept_002', 'Internal Medicine'\nunion all\nselect 'dept_003', 'Surgery'", "format": "sql", "fixture": null}, {"input": "ref('locations')", "rows": "select 'loc_001' as id, 'Room 101' as name, 'fac_001' as facility_id, 'lg_001' as location_group_id\nunion all\nselect 'loc_002', 'Room 201', 'fac_001', 'lg_002'", "format": "sql", "fixture": null}, {"input": "ref('location_groups')", "rows": "select 'lg_001' as id, 'Emergency Ward' as name\nunion all\nselect 'lg_002', 'Medical Ward'", "format": "sql", "fixture": null}, {"input": "ref('facilities')", "rows": "select 'fac_001' as id, 'Central Hospital' as name, false as is_sensitive", "format": "sql", "fixture": null}, {"input": "ref('reference_data')", "rows": "select 'vil_001' as id, 'Village A' as name, null as code\nunion all\nselect 'vil_002', 'Village B', null\nunion all\nselect 'bill_001', 'Insurance', null\nunion all\nselect 'bill_002', 'Private Pay', null\nunion all\nselect 'diag_001', 'Hypertension', 'I10'", "format": "sql", "fixture": null}, {"input": "ref('encounter_diagnoses')", "rows": "select 'enc_001' as encounter_id, 'diag_001' as diagnosis_id, true as is_primary, 'confirmed' as certainty, '2024-01-15 11:00:00'::timestamp as datetime\nunion all\nselect 'enc_002', 'diag_001', false, 'confirmed', '2024-01-16 15:00:00'::timestamp", "format": "sql", "fixture": null}], "expect": {"rows": "select 'pat_001' as patient_id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 33 as age, 'Male' as sex, 'vil_001' as village_id, 'Village A' as village, 'bill_001' as billing_type_id, 'Insurance' as billing_type, 'cli_001' as admitting_clinician_id, 'Dr. Alice Wilson' as admitting_clinician, '2024-01-15 10:00:00'::timestamp as admission_datetime, 'active' as admission_status, null::timestamp as discharge_datetime, 'fac_001' as facility_id, 'Central Hospital' as facility, array['dept_001'] as department_ids, 'Emergency' as departments, '2024-01-15 10:00' as department_datetimes, array['lg_001'] as location_group_ids, 'Emergency Ward' as location_groups, '2024-01-15 10:00' as location_group_datetimes, array['loc_001'] as location_ids, 'Room 101' as locations, '2024-01-15 10:00' as location_datetimes, 'Hypertension (I10)' as primary_diagnoses, null as secondary_diagnoses\nunion all\nselect 'pat_002', 'P002', 'Jane', 'Smith', '1985-08-22'::date, 38, 'Female', 'vil_002', 'Village B', 'bill_002', 'Private Pay', 'cli_002', 'Dr. Bob Martinez', '2024-01-16 14:30:00'::timestamp, 'discharged', '2024-01-20 09:00:00'::timestamp, 'fac_001', 'Central Hospital', array['dept_002', 'dept_003'], 'Internal Medicine, Surgery', '2024-01-16 14:30; 2024-01-18 10:00', array['lg_002'], 'Medical Ward', '2024-01-16 14:30', array['loc_002'], 'Room 201', '2024-01-16 14:30', null, 'Hypertension (I10)'", "format": "sql", "fixture": null}, "name": "test_ds_admissions_basic_functionality", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "unit_tests\\test_ds_admissions_basic_functionality.yml", "original_file_path": "models\\unit_tests\\test_ds_admissions_basic_functionality.yml", "unique_id": "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_basic_functionality", "fqn": ["tamanu_source_dbt", "unit_tests", "ds__admissions", "test_ds_admissions_basic_functionality"], "description": "Test basic functionality of ds__admissions model with sample data", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "2cc99841efad0f3cd001abbaf56ba3f2919ebfe1bd434a406f31548705cbf04a", "schema": "reporting", "created_at": 1782423652.7179117, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only": {"model": "ds__admissions", "given": [{"input": "ref('encounters')", "rows": "select 'enc_001' as id, 'pat_001' as patient_id, '2024-01-15 10:00:00'::timestamp as start_datetime, null::timestamp as end_datetime, 'loc_001' as location_id, 'bill_001' as patient_billing_type_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', 'pat_002', '2024-01-16 14:30:00'::timestamp, null::timestamp, 'loc_002', 'bill_002', 'outpatient'\nunion all\nselect 'enc_003', 'pat_003', '2024-01-17 08:15:00'::timestamp, null::timestamp, 'loc_001', null, 'emergency'", "format": "sql", "fixture": null}, {"input": "ref('patients')", "rows": "select 'pat_001' as id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 'male' as sex, 'vil_001' as village_id\nunion all\nselect 'pat_002', 'P002', 'Jane', 'Smith', '1985-08-22'::date, 'female', 'vil_002'\nunion all\nselect 'pat_003', 'P003', 'Bob', 'Johnson', '1975-12-10'::date, 'male', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_history')", "rows": "select 'enc_001' as encounter_id, '2024-01-15 10:00:00'::timestamp as datetime, null::text[] as change_type, 'cli_001' as clinician_id, 'dept_001' as department_id, 'loc_001' as location_id, 'admission' as encounter_type", "format": "sql", "fixture": null}, {"input": "ref('users')", "rows": "select 'cli_001' as id, 'Dr. Alice Wilson' as display_name", "format": "sql", "fixture": null}, {"input": "ref('departments')", "rows": "select 'dept_001' as id, 'Emergency' as name", "format": "sql", "fixture": null}, {"input": "ref('locations')", "rows": "select 'loc_001' as id, 'Room 101' as name, 'fac_001' as facility_id, 'lg_001' as location_group_id\nunion all\nselect 'loc_002', 'Room 201', 'fac_001', 'lg_002'", "format": "sql", "fixture": null}, {"input": "ref('location_groups')", "rows": "select 'lg_001' as id, 'Emergency Ward' as name\nunion all\nselect 'lg_002', 'Medical Ward'", "format": "sql", "fixture": null}, {"input": "ref('facilities')", "rows": "select 'fac_001' as id, 'Central Hospital' as name, false as is_sensitive", "format": "sql", "fixture": null}, {"input": "ref('reference_data')", "rows": "select 'vil_001' as id, 'Village A' as name, null as code\nunion all\nselect 'vil_002', 'Village B', null\nunion all\nselect 'bill_001', 'Insurance', null\nunion all\nselect 'bill_002', 'Private Pay', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_diagnoses')", "rows": "select null::text as encounter_id, null::text as diagnosis_id, null::boolean as is_primary, null::text as certainty, null::timestamp as datetime\nwhere false", "format": "sql", "fixture": null}], "expect": {"rows": "select 'pat_001' as patient_id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 33 as age, 'Male' as sex, 'vil_001' as village_id, 'Village A' as village, 'bill_001' as billing_type_id, 'Insurance' as billing_type, 'cli_001' as admitting_clinician_id, 'Dr. Alice Wilson' as admitting_clinician, '2024-01-15 10:00:00'::timestamp as admission_datetime, 'active' as admission_status, null::timestamp as discharge_datetime, 'fac_001' as facility_id, 'Central Hospital' as facility, array['dept_001'] as department_ids, 'Emergency' as departments, '2024-01-15 10:00' as department_datetimes, array['lg_001'] as location_group_ids, 'Emergency Ward' as location_groups, '2024-01-15 10:00' as location_group_datetimes, array['loc_001'] as location_ids, 'Room 101' as locations, '2024-01-15 10:00' as location_datetimes, null as primary_diagnoses, null as secondary_diagnoses", "format": "sql", "fixture": null}, "name": "test_ds_admissions_filters_admission_encounters_only", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "unit_tests\\test_ds_admissions_filters_admission_encounters_only.yml", "original_file_path": "models\\unit_tests\\test_ds_admissions_filters_admission_encounters_only.yml", "unique_id": "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_filters_admission_encounters_only", "fqn": ["tamanu_source_dbt", "unit_tests", "ds__admissions", "test_ds_admissions_filters_admission_encounters_only"], "description": "Test that only admission encounters are included", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "cf117e08238982706acdef751b6071774a0c29b4826413db40ab96f839bf436a", "schema": "reporting", "created_at": 1782423652.7179117, "versions": null, "version": null}, "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities": {"model": "ds__admissions", "given": [{"input": "ref('encounters')", "rows": "select 'enc_001' as id, 'pat_001' as patient_id, '2024-05-15 10:00:00'::timestamp as start_datetime, null::timestamp as end_datetime, 'loc_001' as location_id, 'bill_001' as patient_billing_type_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', 'pat_002', '2024-05-16 14:00:00'::timestamp, null::timestamp, 'loc_002', 'bill_002', 'admission'", "format": "sql", "fixture": null}, {"input": "ref('patients')", "rows": "select 'pat_001' as id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 'male' as sex, 'vil_001' as village_id\nunion all\nselect 'pat_002', 'P002', 'Jane', 'Smith', '1985-08-22'::date, 'female', 'vil_002'", "format": "sql", "fixture": null}, {"input": "ref('encounter_history')", "rows": "select 'enc_001' as encounter_id, '2024-05-15 10:00:00'::timestamp as datetime, null::text[] as change_type, 'cli_001' as clinician_id, 'dept_001' as department_id, 'loc_001' as location_id, 'admission' as encounter_type\nunion all\nselect 'enc_002', '2024-05-16 14:00:00'::timestamp, null::text[], 'cli_002', 'dept_002', 'loc_002', 'admission'", "format": "sql", "fixture": null}, {"input": "ref('users')", "rows": "select 'cli_001' as id, 'Dr. Alice Wilson' as display_name\nunion all\nselect 'cli_002', 'Dr. Bob Martinez'", "format": "sql", "fixture": null}, {"input": "ref('departments')", "rows": "select 'dept_001' as id, 'Emergency' as name\nunion all\nselect 'dept_002', 'Psychiatry'", "format": "sql", "fixture": null}, {"input": "ref('locations')", "rows": "select 'loc_001' as id, 'Room 101' as name, 'fac_001' as facility_id, 'lg_001' as location_group_id\nunion all\nselect 'loc_002', 'Room 201', 'fac_002', 'lg_002'", "format": "sql", "fixture": null}, {"input": "ref('location_groups')", "rows": "select 'lg_001' as id, 'Emergency Ward' as name\nunion all\nselect 'lg_002', 'Psychiatric Ward'", "format": "sql", "fixture": null}, {"input": "ref('facilities')", "rows": "select 'fac_001' as id, 'Central Hospital' as name, false as is_sensitive\nunion all\nselect 'fac_002', 'Psychiatric Hospital', true", "format": "sql", "fixture": null}, {"input": "ref('reference_data')", "rows": "select 'vil_001' as id, 'Village A' as name, null as code\nunion all\nselect 'vil_002', 'Village B', null\nunion all\nselect 'bill_001', 'Insurance', null\nunion all\nselect 'bill_002', 'Private Pay', null", "format": "sql", "fixture": null}, {"input": "ref('encounter_diagnoses')", "rows": "select null::text as encounter_id, null::text as diagnosis_id, null::boolean as is_primary, null::text as certainty, null::timestamp as datetime\nwhere false", "format": "sql", "fixture": null}], "expect": {"rows": "select 'pat_001' as patient_id, 'P001' as display_id, 'John' as first_name, 'Doe' as last_name, '1990-05-15'::date as date_of_birth, 34 as age, 'Male' as sex, 'vil_001' as village_id, 'Village A' as village, 'bill_001' as billing_type_id, 'Insurance' as billing_type, 'cli_001' as admitting_clinician_id, 'Dr. Alice Wilson' as admitting_clinician, '2024-05-15 10:00:00'::timestamp as admission_datetime, 'active' as admission_status, null::timestamp as discharge_datetime, 'fac_001' as facility_id, 'Central Hospital' as facility, array['dept_001'] as department_ids, 'Emergency' as departments, '2024-05-15 10:00' as department_datetimes, array['lg_001'] as location_group_ids, 'Emergency Ward' as location_groups, '2024-05-15 10:00' as location_group_datetimes, array['loc_001'] as location_ids, 'Room 101' as locations, '2024-05-15 10:00' as location_datetimes, null as primary_diagnoses, null as secondary_diagnoses", "format": "sql", "fixture": null}, "name": "test_ds_admissions_sensitive_facilities", "resource_type": "unit_test", "package_name": "tamanu_source_dbt", "path": "unit_tests\\test_ds_admissions_sensitive_facilities.yml", "original_file_path": "models\\unit_tests\\test_ds_admissions_sensitive_facilities.yml", "unique_id": "unit_test.tamanu_source_dbt.ds__admissions.test_ds_admissions_sensitive_facilities", "fqn": ["tamanu_source_dbt", "unit_tests", "ds__admissions", "test_ds_admissions_sensitive_facilities"], "description": "Test that admissions at sensitive facilities are excluded", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.tamanu_source_dbt.ds__admissions"]}, "config": {"tags": [], "meta": {}, "enabled": true}, "checksum": "b8b410a350cc1031aa301bf92cc85b2815aadfe40f539da8804c4791ce6daffd", "schema": "reporting", "created_at": 1782423652.7236876, "versions": null, "version": null}}, "functions": {}}, catalog: {"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.11.7", "generated_at": "2026-06-25T21:42:57.262227Z", "invocation_id": "41675ac2-8bd9-453e-900a-687bcbdb9f0e", "invocation_started_at": "2026-06-25T21:42:34.153910Z", "env": {}}, "nodes": {"model.tamanu_source_dbt.admissions-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "admissions-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Admitting clinician": {"type": "character varying", "index": 9, "name": "Admitting clinician", "comment": null}, "Admission date and time": {"type": "text", "index": 10, "name": "Admission date and time", "comment": null}, "Admission status": {"type": "text", "index": 11, "name": "Admission status", "comment": null}, "Discharge date and time": {"type": "text", "index": 12, "name": "Discharge date and time", "comment": null}, "Facility": {"type": "character varying(255)", "index": 13, "name": "Facility", "comment": null}, "Department history": {"type": "text", "index": 14, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 15, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 16, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 17, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 18, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 19, "name": "Location history date and times", "comment": null}, "Primary diagnoses": {"type": "text", "index": 20, "name": "Primary diagnoses", "comment": null}, "Secondary diagnoses": {"type": "text", "index": 21, "name": "Secondary diagnoses", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.admissions-line-list"}, "model.tamanu_source_dbt.audit-outpatient-appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "audit-outpatient-appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Change number": {"type": "bigint", "index": 5, "name": "Change number", "comment": null}, "Appointment date and time": {"type": "text", "index": 6, "name": "Appointment date and time", "comment": null}, "Appointment type": {"type": "text", "index": 7, "name": "Appointment type", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 8, "name": "Clinician", "comment": null}, "Area": {"type": "character varying(255)", "index": 9, "name": "Area", "comment": null}, "Priority appointment": {"type": "text", "index": 10, "name": "Priority appointment", "comment": null}, "Repeating appointment": {"type": "text", "index": 11, "name": "Repeating appointment", "comment": null}, "Appointment created by": {"type": "character varying(255)", "index": 12, "name": "Appointment created by", "comment": null}, "Appointment modified by": {"type": "character varying(255)", "index": 13, "name": "Appointment modified by", "comment": null}, "Appointment modified date & time": {"type": "text", "index": 14, "name": "Appointment modified date & time", "comment": null}, "Appointment cancelled": {"type": "text", "index": 15, "name": "Appointment cancelled", "comment": null}, "Previous appointment date & time": {"type": "text", "index": 16, "name": "Previous appointment date & time", "comment": null}, "Previous appointment type": {"type": "text", "index": 17, "name": "Previous appointment type", "comment": null}, "Previous clinician": {"type": "character varying", "index": 18, "name": "Previous clinician", "comment": null}, "Previous area": {"type": "character varying", "index": 19, "name": "Previous area", "comment": null}, "Previous priority appointment": {"type": "text", "index": 20, "name": "Previous priority appointment", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.audit-outpatient-appointments"}, "model.tamanu_source_dbt.audit-patient-details-edit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "audit-patient-details-edit", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "text", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "text", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "text", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Edited by user": {"type": "character varying(255)", "index": 7, "name": "Edited by user", "comment": null}, "User email": {"type": "character varying(255)", "index": 8, "name": "User email", "comment": null}, "User role": {"type": "character varying(255)", "index": 9, "name": "User role", "comment": null}, "Date and time edited": {"type": "text", "index": 10, "name": "Date and time edited", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.audit-patient-details-edit"}, "model.tamanu_source_dbt.audit-patient-views": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "audit-patient-views", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "integer", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Viewed by user": {"type": "character varying(255)", "index": 8, "name": "Viewed by user", "comment": null}, "User email": {"type": "character varying(255)", "index": 9, "name": "User email", "comment": null}, "User role": {"type": "character varying(255)", "index": 10, "name": "User role", "comment": null}, "Viewed at facility": {"type": "character varying(255)", "index": 11, "name": "Viewed at facility", "comment": null}, "Date and time viewed": {"type": "text", "index": 12, "name": "Date and time viewed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.audit-patient-views"}, "model.tamanu_source_dbt.contributing_death_causes": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "contributing_death_causes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "time_after_onset": {"type": "integer", "index": 2, "name": "time_after_onset", "comment": null}, "patient_death_data_id": {"type": "character varying(255)", "index": 3, "name": "patient_death_data_id", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 4, "name": "condition_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.contributing_death_causes"}, "model.tamanu_source_dbt.deceased-patients-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "deceased-patients-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Nationality": {"type": "text", "index": 8, "name": "Nationality", "comment": null}, "Place of death": {"type": "character varying", "index": 9, "name": "Place of death", "comment": null}, "Department": {"type": "character varying(255)", "index": 10, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 11, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 12, "name": "Location", "comment": null}, "Date of death": {"type": "text", "index": 13, "name": "Date of death", "comment": null}, "Attending clinician": {"type": "character varying(255)", "index": 14, "name": "Attending clinician", "comment": null}, "Primary cause of death": {"type": "text", "index": 15, "name": "Primary cause of death", "comment": null}, "Time between onset and death": {"type": "text", "index": 16, "name": "Time between onset and death", "comment": null}, "Antecedent cause 1": {"type": "text", "index": 17, "name": "Antecedent cause 1", "comment": null}, "Antecedent cause 2": {"type": "text", "index": 18, "name": "Antecedent cause 2", "comment": null}, "Other condition 1": {"type": "text", "index": 19, "name": "Other condition 1", "comment": null}, "Other condition 2": {"type": "text", "index": 20, "name": "Other condition 2", "comment": null}, "Other condition 3": {"type": "text", "index": 21, "name": "Other condition 3", "comment": null}, "Other condition 4": {"type": "text", "index": 22, "name": "Other condition 4", "comment": null}, "Had recent surgery": {"type": "text", "index": 23, "name": "Had recent surgery", "comment": null}, "Last surgery date": {"type": "text", "index": 24, "name": "Last surgery date", "comment": null}, "Reason for surgery": {"type": "text", "index": 25, "name": "Reason for surgery", "comment": null}, "Manner of death": {"type": "character varying(255)", "index": 26, "name": "Manner of death", "comment": null}, "External cause date": {"type": "text", "index": 27, "name": "External cause date", "comment": null}, "External cause location": {"type": "character varying(255)", "index": 28, "name": "External cause location", "comment": null}, "Was pregnant": {"type": "text", "index": 29, "name": "Was pregnant", "comment": null}, "Pregnancy contributed": {"type": "character varying(255)", "index": 30, "name": "Pregnancy contributed", "comment": null}, "Was fetal or infant": {"type": "text", "index": 31, "name": "Was fetal or infant", "comment": null}, "Was stillborn": {"type": "text", "index": 32, "name": "Was stillborn", "comment": null}, "Birth weight (kg)": {"type": "integer", "index": 33, "name": "Birth weight (kg)", "comment": null}, "Completed weeks of pregnancy": {"type": "integer", "index": 34, "name": "Completed weeks of pregnancy", "comment": null}, "Age of mother": {"type": "integer", "index": 35, "name": "Age of mother", "comment": null}, "Condition in mother affecting fetus or newborn": {"type": "text", "index": 36, "name": "Condition in mother affecting fetus or newborn", "comment": null}, "Death within day of birth": {"type": "text", "index": 37, "name": "Death within day of birth", "comment": null}, "Hours survived since birth": {"type": "integer", "index": 38, "name": "Hours survived since birth", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.deceased-patients-line-list"}, "model.tamanu_source_dbt.departments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "departments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.departments"}, "model.tamanu_source_dbt.discharges": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "discharges", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "note": {"type": "text", "index": 2, "name": "note", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 3, "name": "encounter_id", "comment": null}, "discharged_by_id": {"type": "character varying(255)", "index": 4, "name": "discharged_by_id", "comment": null}, "disposition_id": {"type": "character varying(255)", "index": 5, "name": "disposition_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.discharges"}, "model.tamanu_source_dbt.document_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "document_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "type": {"type": "text", "index": 3, "name": "type", "comment": null}, "created_datetime": {"type": "timestamp without time zone", "index": 4, "name": "created_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 5, "name": "patient_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.document_metadata"}, "model.tamanu_source_dbt.ds__admissions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__admissions", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 10, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 11, "name": "billing_type", "comment": null}, "admitting_clinician_id": {"type": "character varying", "index": 12, "name": "admitting_clinician_id", "comment": null}, "admitting_clinician": {"type": "character varying", "index": 13, "name": "admitting_clinician", "comment": null}, "admission_datetime": {"type": "timestamp without time zone", "index": 14, "name": "admission_datetime", "comment": null}, "admission_status": {"type": "text", "index": 15, "name": "admission_status", "comment": null}, "discharge_datetime": {"type": "timestamp without time zone", "index": 16, "name": "discharge_datetime", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 17, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 18, "name": "facility", "comment": null}, "department_ids": {"type": "character varying[]", "index": 19, "name": "department_ids", "comment": null}, "departments": {"type": "text", "index": 20, "name": "departments", "comment": null}, "department_datetimes": {"type": "text", "index": 21, "name": "department_datetimes", "comment": null}, "location_group_ids": {"type": "character varying[]", "index": 22, "name": "location_group_ids", "comment": null}, "location_groups": {"type": "text", "index": 23, "name": "location_groups", "comment": null}, "location_group_datetimes": {"type": "text", "index": 24, "name": "location_group_datetimes", "comment": null}, "location_ids": {"type": "character varying[]", "index": 25, "name": "location_ids", "comment": null}, "locations": {"type": "text", "index": 26, "name": "locations", "comment": null}, "location_datetimes": {"type": "text", "index": 27, "name": "location_datetimes", "comment": null}, "primary_diagnoses": {"type": "text", "index": 28, "name": "primary_diagnoses", "comment": null}, "secondary_diagnoses": {"type": "text", "index": 29, "name": "secondary_diagnoses", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__admissions"}, "model.tamanu_source_dbt.ds__births": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__births", "database": "app", "comment": null, "owner": "app"}, "columns": {"registration_date": {"type": "date", "index": 1, "name": "registration_date", "comment": null}, "registered_by": {"type": "character varying", "index": 2, "name": "registered_by", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 4, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 5, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 6, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 7, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 8, "name": "sex", "comment": null}, "ethnicity": {"type": "text", "index": 9, "name": "ethnicity", "comment": null}, "nationality": {"type": "text", "index": 10, "name": "nationality", "comment": null}, "village_id": {"type": "character varying(255)", "index": 11, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 12, "name": "village", "comment": null}, "mother": {"type": "text", "index": 13, "name": "mother", "comment": null}, "father": {"type": "text", "index": 14, "name": "father", "comment": null}, "birth_time": {"type": "time without time zone", "index": 15, "name": "birth_time", "comment": null}, "gestational_age_estimate": {"type": "double precision", "index": 16, "name": "gestational_age_estimate", "comment": null}, "registered_birth_place": {"type": "character varying", "index": 17, "name": "registered_birth_place", "comment": null}, "birth_facility_id": {"type": "character varying(255)", "index": 18, "name": "birth_facility_id", "comment": null}, "birth_facility": {"type": "character varying(255)", "index": 19, "name": "birth_facility", "comment": null}, "attendant_at_birth": {"type": "character varying", "index": 20, "name": "attendant_at_birth", "comment": null}, "name_of_attendant_at_birth": {"type": "character varying(255)", "index": 21, "name": "name_of_attendant_at_birth", "comment": null}, "birth_delivery_type": {"type": "character varying", "index": 22, "name": "birth_delivery_type", "comment": null}, "birth_type": {"type": "text", "index": 23, "name": "birth_type", "comment": null}, "birth_weight": {"type": "numeric", "index": 24, "name": "birth_weight", "comment": null}, "birth_length": {"type": "numeric", "index": 25, "name": "birth_length", "comment": null}, "apgar_score_one_minute": {"type": "integer", "index": 26, "name": "apgar_score_one_minute", "comment": null}, "apgar_score_five_minutes": {"type": "integer", "index": 27, "name": "apgar_score_five_minutes", "comment": null}, "apgar_score_ten_minutes": {"type": "integer", "index": 28, "name": "apgar_score_ten_minutes", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__births"}, "model.tamanu_source_dbt.ds__deaths": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__deaths", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "nationality_id": {"type": "character varying(255)", "index": 10, "name": "nationality_id", "comment": null}, "nationality": {"type": "text", "index": 11, "name": "nationality", "comment": null}, "place_of_death": {"type": "character varying", "index": 12, "name": "place_of_death", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 13, "name": "facility_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 14, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 15, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 20, "name": "date_of_death", "comment": null}, "attending_clinician_id": {"type": "character varying(255)", "index": 21, "name": "attending_clinician_id", "comment": null}, "attending_clinician": {"type": "character varying(255)", "index": 22, "name": "attending_clinician", "comment": null}, "primary_cause_condition_id": {"type": "character varying(255)", "index": 23, "name": "primary_cause_condition_id", "comment": null}, "primary_cause_condition": {"type": "text", "index": 24, "name": "primary_cause_condition", "comment": null}, "time_between_onset_and_death": {"type": "text", "index": 25, "name": "time_between_onset_and_death", "comment": null}, "antecedent_cause_1_id": {"type": "character varying(255)", "index": 26, "name": "antecedent_cause_1_id", "comment": null}, "antecedent_cause_1": {"type": "text", "index": 27, "name": "antecedent_cause_1", "comment": null}, "antecedent_cause_2_id": {"type": "character varying(255)", "index": 28, "name": "antecedent_cause_2_id", "comment": null}, "antecedent_cause_2": {"type": "text", "index": 29, "name": "antecedent_cause_2", "comment": null}, "other_condition_1_id": {"type": "character varying(255)", "index": 30, "name": "other_condition_1_id", "comment": null}, "other_condition_1": {"type": "text", "index": 31, "name": "other_condition_1", "comment": null}, "other_condition_2_id": {"type": "character varying(255)", "index": 32, "name": "other_condition_2_id", "comment": null}, "other_condition_2": {"type": "text", "index": 33, "name": "other_condition_2", "comment": null}, "other_condition_3_id": {"type": "character varying(255)", "index": 34, "name": "other_condition_3_id", "comment": null}, "other_condition_3": {"type": "text", "index": 35, "name": "other_condition_3", "comment": null}, "other_condition_4_id": {"type": "character varying(255)", "index": 36, "name": "other_condition_4_id", "comment": null}, "other_condition_4": {"type": "text", "index": 37, "name": "other_condition_4", "comment": null}, "had_recent_surgery": {"type": "text", "index": 38, "name": "had_recent_surgery", "comment": null}, "last_surgery_date": {"type": "date", "index": 39, "name": "last_surgery_date", "comment": null}, "reason_for_surgery_id": {"type": "character varying(255)", "index": 40, "name": "reason_for_surgery_id", "comment": null}, "reason_for_surgery": {"type": "text", "index": 41, "name": "reason_for_surgery", "comment": null}, "manner_of_death": {"type": "character varying(255)", "index": 42, "name": "manner_of_death", "comment": null}, "external_cause_date": {"type": "date", "index": 43, "name": "external_cause_date", "comment": null}, "external_cause_location": {"type": "character varying(255)", "index": 44, "name": "external_cause_location", "comment": null}, "was_pregnant": {"type": "text", "index": 45, "name": "was_pregnant", "comment": null}, "pregnancy_contributed": {"type": "character varying(255)", "index": 46, "name": "pregnancy_contributed", "comment": null}, "was_fetal_or_infant": {"type": "text", "index": 47, "name": "was_fetal_or_infant", "comment": null}, "was_stillborn": {"type": "text", "index": 48, "name": "was_stillborn", "comment": null}, "birth_weight": {"type": "integer", "index": 49, "name": "birth_weight", "comment": null}, "completed_weeks_of_pregnancy": {"type": "integer", "index": 50, "name": "completed_weeks_of_pregnancy", "comment": null}, "age_of_mother": {"type": "integer", "index": 51, "name": "age_of_mother", "comment": null}, "condition_in_mother_affecting_fetus_or_newborn": {"type": "text", "index": 52, "name": "condition_in_mother_affecting_fetus_or_newborn", "comment": null}, "death_within_day_of_birth": {"type": "text", "index": 53, "name": "death_within_day_of_birth", "comment": null}, "hours_survived_since_birth": {"type": "integer", "index": 54, "name": "hours_survived_since_birth", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__deaths"}, "model.tamanu_source_dbt.ds__diagnoses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__diagnoses", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 3, "name": "diagnosis_id", "comment": null}, "diagnosis": {"type": "text", "index": 4, "name": "diagnosis", "comment": null}, "diagnosis_datetime": {"type": "timestamp without time zone", "index": 5, "name": "diagnosis_datetime", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "display_id": {"type": "character varying(255)", "index": 8, "name": "display_id", "comment": null}, "age": {"type": "double precision", "index": 9, "name": "age", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 11, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 14, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 15, "name": "clinician", "comment": null}, "department_id": {"type": "character varying(255)", "index": 16, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 17, "name": "department", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 20, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 21, "name": "facility", "comment": null}, "certainty": {"type": "text", "index": 22, "name": "certainty", "comment": null}, "is_primary": {"type": "text", "index": 23, "name": "is_primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__diagnoses"}, "model.tamanu_source_dbt.ds__encounter_diets": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__encounter_diets", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 3, "name": "display_id", "comment": null}, "patient_name": {"type": "text", "index": 4, "name": "patient_name", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 5, "name": "start_datetime", "comment": null}, "age": {"type": "text", "index": 6, "name": "age", "comment": null}, "location_id": {"type": "character varying(255)", "index": 7, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 8, "name": "location", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 9, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 10, "name": "location_group", "comment": null}, "diets": {"type": "text", "index": 11, "name": "diets", "comment": null}, "allergies": {"type": "text", "index": 12, "name": "allergies", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__encounter_diets"}, "model.tamanu_source_dbt.ds__encounter_prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__encounter_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 2, "name": "prescription_id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 3, "name": "datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 8, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 9, "name": "age", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 11, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 14, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 15, "name": "facility", "comment": null}, "is_selected_for_discharge": {"type": "boolean", "index": 16, "name": "is_selected_for_discharge", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 17, "name": "medication_id", "comment": null}, "medication_code": {"type": "character varying(255)", "index": 18, "name": "medication_code", "comment": null}, "medication": {"type": "text", "index": 19, "name": "medication", "comment": null}, "route": {"type": "character varying(255)", "index": 20, "name": "route", "comment": null}, "quantity": {"type": "integer", "index": 21, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 22, "name": "repeats", "comment": null}, "is_ongoing": {"type": "boolean", "index": 23, "name": "is_ongoing", "comment": null}, "is_prn": {"type": "boolean", "index": 24, "name": "is_prn", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 25, "name": "is_variable_dose", "comment": null}, "dose_amount": {"type": "numeric", "index": 26, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 27, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 28, "name": "frequency", "comment": null}, "is_discontinued": {"type": "boolean", "index": 29, "name": "is_discontinued", "comment": null}, "discontinued_by_id": {"type": "character varying(255)", "index": 30, "name": "discontinued_by_id", "comment": null}, "discontinuing_reason": {"type": "character varying(255)", "index": 31, "name": "discontinuing_reason", "comment": null}, "discontinued_datetime": {"type": "timestamp without time zone", "index": 32, "name": "discontinued_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__encounter_prescriptions"}, "model.tamanu_source_dbt.ds__encounters_emergency": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__encounters_emergency", "database": "app", "comment": null, "owner": "app"}, "columns": {"triage_id": {"type": "character varying(255)", "index": 1, "name": "triage_id", "comment": null}, "arrival_datetime": {"type": "timestamp without time zone", "index": 2, "name": "arrival_datetime", "comment": null}, "triage_datetime": {"type": "timestamp without time zone", "index": 3, "name": "triage_datetime", "comment": null}, "closed_datetime": {"type": "timestamp without time zone", "index": 4, "name": "closed_datetime", "comment": null}, "score": {"type": "text", "index": 5, "name": "score", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 7, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 8, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 9, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 10, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 11, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 14, "name": "encounter_id", "comment": null}, "encounter_type": {"type": "character varying(31)", "index": 15, "name": "encounter_type", "comment": null}, "arrival_mode": {"type": "text", "index": 16, "name": "arrival_mode", "comment": null}, "chief_complaint": {"type": "text", "index": 17, "name": "chief_complaint", "comment": null}, "secondary_complaint": {"type": "text", "index": 18, "name": "secondary_complaint", "comment": null}, "clinician": {"type": "character varying(255)", "index": 19, "name": "clinician", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 20, "name": "clinician_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 21, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 22, "name": "facility", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__encounters_emergency"}, "model.tamanu_source_dbt.ds__imaging_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__imaging_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "request_id": {"type": "character varying(255)", "index": 16, "name": "request_id", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 17, "name": "requested_datetime", "comment": null}, "supervising_clinician_id": {"type": "character varying(255)", "index": 18, "name": "supervising_clinician_id", "comment": null}, "supervising_clinician": {"type": "character varying(255)", "index": 19, "name": "supervising_clinician", "comment": null}, "requesting_clinician_id": {"type": "character varying(255)", "index": 20, "name": "requesting_clinician_id", "comment": null}, "requesting_clinician": {"type": "character varying(255)", "index": 21, "name": "requesting_clinician", "comment": null}, "priority": {"type": "character varying", "index": 22, "name": "priority", "comment": null}, "imaging_type": {"type": "character varying(31)", "index": 23, "name": "imaging_type", "comment": null}, "imaging_area": {"type": "text", "index": 24, "name": "imaging_area", "comment": null}, "status_id": {"type": "character varying(255)", "index": 25, "name": "status_id", "comment": null}, "status": {"type": "text", "index": 26, "name": "status", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 27, "name": "completed_datetime", "comment": null}, "reason_for_cancellation": {"type": "text", "index": 28, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__imaging_requests"}, "model.tamanu_source_dbt.ds__invoice_products": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__invoice_products", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "insurable": {"type": "boolean", "index": 3, "name": "insurable", "comment": null}, "category": {"type": "character varying(255)", "index": 4, "name": "category", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 5, "name": "source_record_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 6, "name": "visibility_status", "comment": null}, "external_code": {"type": "text", "index": 7, "name": "external_code", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__invoice_products"}, "model.tamanu_source_dbt.ds__lab_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__lab_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department": {"type": "character varying(255)", "index": 12, "name": "department", "comment": null}, "department_id": {"type": "character varying(255)", "index": 13, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 15, "name": "location", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "laboratory_id": {"type": "character varying(255)", "index": 18, "name": "laboratory_id", "comment": null}, "laboratory": {"type": "text", "index": 19, "name": "laboratory", "comment": null}, "request_id": {"type": "character varying(255)", "index": 20, "name": "request_id", "comment": null}, "status": {"type": "character varying", "index": 21, "name": "status", "comment": null}, "status_id": {"type": "character varying(255)", "index": 22, "name": "status_id", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 23, "name": "requested_datetime", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 24, "name": "requested_by_id", "comment": null}, "requested_by": {"type": "character varying(255)", "index": 25, "name": "requested_by", "comment": null}, "requesting_department_id": {"type": "character varying(255)", "index": 26, "name": "requesting_department_id", "comment": null}, "requesting_department": {"type": "character varying(255)", "index": 27, "name": "requesting_department", "comment": null}, "priority_id": {"type": "character varying(255)", "index": 28, "name": "priority_id", "comment": null}, "priority": {"type": "text", "index": 29, "name": "priority", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 30, "name": "lab_test_category_id", "comment": null}, "lab_test_category": {"type": "text", "index": 31, "name": "lab_test_category", "comment": null}, "lab_test_panel": {"type": "character varying(255)", "index": 32, "name": "lab_test_panel", "comment": null}, "tests": {"type": "text", "index": 33, "name": "tests", "comment": null}, "collected_datetime": {"type": "timestamp without time zone", "index": 34, "name": "collected_datetime", "comment": null}, "collected_by_id": {"type": "character varying(255)", "index": 35, "name": "collected_by_id", "comment": null}, "collected_by": {"type": "character varying(255)", "index": 36, "name": "collected_by", "comment": null}, "specimen_type_id": {"type": "character varying(255)", "index": 37, "name": "specimen_type_id", "comment": null}, "specimen_type": {"type": "text", "index": 38, "name": "specimen_type", "comment": null}, "site": {"type": "text", "index": 39, "name": "site", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 40, "name": "completed_datetime", "comment": null}, "reason_for_cancellation": {"type": "character varying", "index": 41, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__lab_requests"}, "model.tamanu_source_dbt.ds__lab_tests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__lab_tests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "requesting_department_id": {"type": "character varying(255)", "index": 14, "name": "requesting_department_id", "comment": null}, "requesting_department": {"type": "character varying(255)", "index": 15, "name": "requesting_department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 20, "name": "lab_request_id", "comment": null}, "status_id": {"type": "character varying(255)", "index": 21, "name": "status_id", "comment": null}, "status": {"type": "character varying", "index": 22, "name": "status", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 23, "name": "lab_test_panel_id", "comment": null}, "lab_test_panel": {"type": "character varying(255)", "index": 24, "name": "lab_test_panel", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 25, "name": "lab_test_category_id", "comment": null}, "lab_test_category": {"type": "text", "index": 26, "name": "lab_test_category", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 27, "name": "requested_datetime", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 28, "name": "requested_by_id", "comment": null}, "requested_by": {"type": "character varying(255)", "index": 29, "name": "requested_by", "comment": null}, "lab_request_published_datetime": {"type": "timestamp without time zone", "index": 30, "name": "lab_request_published_datetime", "comment": null}, "lab_test_date": {"type": "date", "index": 31, "name": "lab_test_date", "comment": null}, "result": {"type": "text", "index": 32, "name": "result", "comment": null}, "verification": {"type": "character varying(255)", "index": 33, "name": "verification", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 34, "name": "lab_test_type_id", "comment": null}, "lab_test_type": {"type": "character varying(255)", "index": 35, "name": "lab_test_type", "comment": null}, "lab_test_completed_datetime": {"type": "timestamp without time zone", "index": 36, "name": "lab_test_completed_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__lab_tests"}, "model.tamanu_source_dbt.ds__location_bookings": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__location_bookings", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 10, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 11, "name": "billing_type", "comment": null}, "booking_start_datetime": {"type": "timestamp without time zone", "index": 12, "name": "booking_start_datetime", "comment": null}, "booking_end_datetime": {"type": "timestamp without time zone", "index": 13, "name": "booking_end_datetime", "comment": null}, "booking_status": {"type": "character varying(255)", "index": 14, "name": "booking_status", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 15, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 16, "name": "clinician", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 17, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 18, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 19, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 20, "name": "location", "comment": null}, "booking_type_id": {"type": "character varying(255)", "index": 21, "name": "booking_type_id", "comment": null}, "booking_type": {"type": "text", "index": 22, "name": "booking_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__location_bookings"}, "model.tamanu_source_dbt.ds__medication_dispenses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__medication_dispenses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "quantity": {"type": "integer", "index": 2, "name": "quantity", "comment": null}, "dispensed_at": {"type": "timestamp without time zone", "index": 3, "name": "dispensed_at", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 5, "name": "facility", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 6, "name": "medication_id", "comment": null}, "medication_code": {"type": "character varying(255)", "index": 7, "name": "medication_code", "comment": null}, "medication": {"type": "text", "index": 8, "name": "medication", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__medication_dispenses"}, "model.tamanu_source_dbt.ds__ongoing_conditions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__ongoing_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village": {"type": "text", "index": 8, "name": "village", "comment": null}, "village_id": {"type": "character varying(255)", "index": 9, "name": "village_id", "comment": null}, "condition": {"type": "text", "index": 10, "name": "condition", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 11, "name": "condition_id", "comment": null}, "recorded_datetime": {"type": "timestamp without time zone", "index": 12, "name": "recorded_datetime", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 13, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 14, "name": "clinician", "comment": null}, "date_resolved": {"type": "timestamp without time zone", "index": 15, "name": "date_resolved", "comment": null}, "clinician_resolving": {"type": "character varying", "index": 16, "name": "clinician_resolving", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__ongoing_conditions"}, "model.tamanu_source_dbt.ds__outpatient_appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__outpatient_appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 8, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 9, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 10, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 11, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 12, "name": "billing_type", "comment": null}, "appointment_start_datetime": {"type": "timestamp without time zone", "index": 13, "name": "appointment_start_datetime", "comment": null}, "appointment_end_datetime": {"type": "timestamp without time zone", "index": 14, "name": "appointment_end_datetime", "comment": null}, "appointment_type_id": {"type": "character varying(255)", "index": 15, "name": "appointment_type_id", "comment": null}, "appointment_type": {"type": "text", "index": 16, "name": "appointment_type", "comment": null}, "appointment_status": {"type": "character varying(255)", "index": 17, "name": "appointment_status", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 18, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 19, "name": "clinician", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 20, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 21, "name": "location_group", "comment": null}, "priority": {"type": "text", "index": 22, "name": "priority", "comment": null}, "schedule_id": {"type": "uuid", "index": 23, "name": "schedule_id", "comment": null}, "until_date": {"type": "date", "index": 24, "name": "until_date", "comment": null}, "interval": {"type": "integer", "index": 25, "name": "interval", "comment": null}, "days_of_week": {"type": "character varying(255)[]", "index": 26, "name": "days_of_week", "comment": null}, "frequency": {"type": "character varying(255)", "index": 27, "name": "frequency", "comment": null}, "nth_weekday": {"type": "integer", "index": 28, "name": "nth_weekday", "comment": null}, "created_by_user_id": {"type": "text", "index": 29, "name": "created_by_user_id", "comment": null}, "created_by": {"type": "character varying(255)", "index": 30, "name": "created_by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__outpatient_appointments"}, "model.tamanu_source_dbt.ds__outpatient_appointments_audit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__outpatient_appointments_audit", "database": "app", "comment": null, "owner": "app"}, "columns": {"change_id": {"type": "uuid", "index": 1, "name": "change_id", "comment": null}, "appointment_id": {"type": "text", "index": 2, "name": "appointment_id", "comment": null}, "change_number": {"type": "bigint", "index": 3, "name": "change_number", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 8, "name": "date_of_birth", "comment": null}, "appointment_start_datetime": {"type": "timestamp without time zone", "index": 9, "name": "appointment_start_datetime", "comment": null}, "appointment_end_datetime": {"type": "timestamp without time zone", "index": 10, "name": "appointment_end_datetime", "comment": null}, "appointment_type": {"type": "text", "index": 11, "name": "appointment_type", "comment": null}, "appointment_type_id": {"type": "text", "index": 12, "name": "appointment_type_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 13, "name": "clinician", "comment": null}, "clinician_id": {"type": "text", "index": 14, "name": "clinician_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "location_group_id": {"type": "text", "index": 16, "name": "location_group_id", "comment": null}, "priority": {"type": "text", "index": 17, "name": "priority", "comment": null}, "schedule_id": {"type": "uuid", "index": 18, "name": "schedule_id", "comment": null}, "is_repeating": {"type": "text", "index": 19, "name": "is_repeating", "comment": null}, "created_by": {"type": "character varying(255)", "index": 20, "name": "created_by", "comment": null}, "created_by_user_id": {"type": "text", "index": 21, "name": "created_by_user_id", "comment": null}, "modified_by": {"type": "character varying(255)", "index": 22, "name": "modified_by", "comment": null}, "modified_by_user_id": {"type": "text", "index": 23, "name": "modified_by_user_id", "comment": null}, "modified_datetime": {"type": "timestamp with time zone", "index": 24, "name": "modified_datetime", "comment": null}, "is_cancelled": {"type": "text", "index": 25, "name": "is_cancelled", "comment": null}, "prev_start_datetime": {"type": "timestamp without time zone", "index": 26, "name": "prev_start_datetime", "comment": null}, "prev_end_datetime": {"type": "timestamp without time zone", "index": 27, "name": "prev_end_datetime", "comment": null}, "prev_appointment_type": {"type": "text", "index": 28, "name": "prev_appointment_type", "comment": null}, "prev_appointment_type_id": {"type": "text", "index": 29, "name": "prev_appointment_type_id", "comment": null}, "prev_clinician": {"type": "character varying", "index": 30, "name": "prev_clinician", "comment": null}, "prev_clinician_id": {"type": "text", "index": 31, "name": "prev_clinician_id", "comment": null}, "prev_location_group": {"type": "character varying", "index": 32, "name": "prev_location_group", "comment": null}, "prev_location_group_id": {"type": "text", "index": 33, "name": "prev_location_group_id", "comment": null}, "prev_priority": {"type": "text", "index": 34, "name": "prev_priority", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 35, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 36, "name": "facility", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__outpatient_appointments_audit"}, "model.tamanu_source_dbt.ds__patient_program_registrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patient_program_registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_program_registration_id": {"type": "text", "index": 1, "name": "patient_program_registration_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 3, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 4, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 5, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 6, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "registering_facility_id": {"type": "character varying(255)", "index": 10, "name": "registering_facility_id", "comment": null}, "registering_facility": {"type": "character varying(255)", "index": 11, "name": "registering_facility", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 12, "name": "registered_by_id", "comment": null}, "registered_by": {"type": "character varying(255)", "index": 13, "name": "registered_by", "comment": null}, "currently_at": {"type": "character varying", "index": 14, "name": "currently_at", "comment": null}, "currently_at_type": {"type": "text", "index": 15, "name": "currently_at_type", "comment": null}, "related_condition_ids": {"type": "character varying[]", "index": 16, "name": "related_condition_ids", "comment": null}, "related_conditions": {"type": "text", "index": 17, "name": "related_conditions", "comment": null}, "related_condition_category_ids": {"type": "text[]", "index": 18, "name": "related_condition_category_ids", "comment": null}, "related_condition_categories": {"type": "text", "index": 19, "name": "related_condition_categories", "comment": null}, "clinical_status_id": {"type": "character varying(255)", "index": 20, "name": "clinical_status_id", "comment": null}, "clinical_status": {"type": "text", "index": 21, "name": "clinical_status", "comment": null}, "registration_status": {"type": "text", "index": 22, "name": "registration_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 23, "name": "program_registry_id", "comment": null}, "subdivision_id": {"type": "character varying(255)", "index": 24, "name": "subdivision_id", "comment": null}, "subdivision": {"type": "text", "index": 25, "name": "subdivision", "comment": null}, "division_id": {"type": "character varying(255)", "index": 26, "name": "division_id", "comment": null}, "division": {"type": "text", "index": 27, "name": "division", "comment": null}, "registration_datetime": {"type": "timestamp without time zone", "index": 28, "name": "registration_datetime", "comment": null}, "deactivated_by_id": {"type": "character varying(255)", "index": 29, "name": "deactivated_by_id", "comment": null}, "deactivated_by": {"type": "character varying(255)", "index": 30, "name": "deactivated_by", "comment": null}, "deactivated_datetime": {"type": "timestamp without time zone", "index": 31, "name": "deactivated_datetime", "comment": null}, "primary_contact_number": {"type": "character varying(255)", "index": 32, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "character varying(255)", "index": 33, "name": "secondary_contact_number", "comment": null}, "emergency_contact_name": {"type": "character varying(255)", "index": 34, "name": "emergency_contact_name", "comment": null}, "emergency_contact_number": {"type": "character varying(255)", "index": 35, "name": "emergency_contact_number", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patient_program_registrations"}, "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patient_vaccinations_upcoming", "database": "app", "comment": null, "owner": "app"}, "columns": {"display_id": {"type": "character varying(255)", "index": 1, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 3, "name": "last_name", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "due_date": {"type": "date", "index": 10, "name": "due_date", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 11, "name": "vaccine_category", "comment": null}, "vaccine_schedules_id": {"type": "character varying(255)", "index": 12, "name": "vaccine_schedules_id", "comment": null}, "vaccine_name": {"type": "character varying(255)", "index": 13, "name": "vaccine_name", "comment": null}, "vaccine_schedule": {"type": "character varying(255)", "index": 14, "name": "vaccine_schedule", "comment": null}, "vaccine_status": {"type": "text", "index": 15, "name": "vaccine_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patient_vaccinations_upcoming"}, "model.tamanu_source_dbt.ds__patients": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patients", "database": "app", "comment": null, "owner": "app"}, "columns": {"registration_date": {"type": "timestamp with time zone", "index": 1, "name": "registration_date", "comment": null}, "registered_by": {"type": "character varying(255)", "index": 2, "name": "registered_by", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 4, "name": "first_name", "comment": null}, "middle_name": {"type": "character varying(255)", "index": 5, "name": "middle_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 6, "name": "last_name", "comment": null}, "cultural_name": {"type": "character varying(255)", "index": 7, "name": "cultural_name", "comment": null}, "display_id": {"type": "character varying(255)", "index": 8, "name": "display_id", "comment": null}, "sex": {"type": "text", "index": 9, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 10, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 11, "name": "village", "comment": null}, "date_of_birth": {"type": "date", "index": 12, "name": "date_of_birth", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 13, "name": "date_of_death", "comment": null}, "birth_certificate": {"type": "character varying(255)", "index": 14, "name": "birth_certificate", "comment": null}, "driving_license": {"type": "character varying(255)", "index": 15, "name": "driving_license", "comment": null}, "passport": {"type": "character varying(255)", "index": 16, "name": "passport", "comment": null}, "blood_type": {"type": "character varying(255)", "index": 17, "name": "blood_type", "comment": null}, "title": {"type": "character varying(255)", "index": 18, "name": "title", "comment": null}, "marital_status": {"type": "character varying(255)", "index": 19, "name": "marital_status", "comment": null}, "primary_contact_number": {"type": "character varying(255)", "index": 20, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "character varying(255)", "index": 21, "name": "secondary_contact_number", "comment": null}, "country_of_birth": {"type": "text", "index": 22, "name": "country_of_birth", "comment": null}, "nationality": {"type": "text", "index": 23, "name": "nationality", "comment": null}, "ethnicity": {"type": "text", "index": 24, "name": "ethnicity", "comment": null}, "occupation": {"type": "text", "index": 25, "name": "occupation", "comment": null}, "religion": {"type": "text", "index": 26, "name": "religion", "comment": null}, "patient_billing_type": {"type": "text", "index": 27, "name": "patient_billing_type", "comment": null}, "mother_id": {"type": "character varying(255)", "index": 28, "name": "mother_id", "comment": null}, "father_id": {"type": "character varying(255)", "index": 29, "name": "father_id", "comment": null}, "street_village": {"type": "character varying(255)", "index": 30, "name": "street_village", "comment": null}, "registration_type": {"type": "text", "index": 31, "name": "registration_type", "comment": null}, "age": {"type": "double precision", "index": 32, "name": "age", "comment": null}, "status": {"type": "text", "index": 33, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patients"}, "model.tamanu_source_dbt.ds__patients_access_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patients_access_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "text", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 6, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 7, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 8, "name": "village", "comment": null}, "viewed_by_user_id": {"type": "text", "index": 9, "name": "viewed_by_user_id", "comment": null}, "viewed_by_user": {"type": "character varying(255)", "index": 10, "name": "viewed_by_user", "comment": null}, "user_email": {"type": "character varying(255)", "index": 11, "name": "user_email", "comment": null}, "user_role": {"type": "character varying(255)", "index": 12, "name": "user_role", "comment": null}, "viewed_at_facility": {"type": "character varying(255)", "index": 13, "name": "viewed_at_facility", "comment": null}, "date_time_viewed": {"type": "timestamp without time zone", "index": 14, "name": "date_time_viewed", "comment": null}, "facility_id": {"type": "text", "index": 15, "name": "facility_id", "comment": null}, "is_mobile": {"type": "boolean", "index": 16, "name": "is_mobile", "comment": null}, "session_id": {"type": "text", "index": 17, "name": "session_id", "comment": null}, "device_id": {"type": "text", "index": 18, "name": "device_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patients_access_logs"}, "model.tamanu_source_dbt.ds__patients_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__patients_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "text", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "text", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "text", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "text", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 6, "name": "sex", "comment": null}, "village_id": {"type": "text", "index": 7, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 8, "name": "village", "comment": null}, "edited_by_user_id": {"type": "text", "index": 9, "name": "edited_by_user_id", "comment": null}, "edited_by_user": {"type": "character varying(255)", "index": 10, "name": "edited_by_user", "comment": null}, "user_email": {"type": "character varying(255)", "index": 11, "name": "user_email", "comment": null}, "user_role": {"type": "character varying(255)", "index": 12, "name": "user_role", "comment": null}, "edited_datetime": {"type": "timestamp without time zone", "index": 13, "name": "edited_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__patients_change_logs"}, "model.tamanu_source_dbt.ds__procedures": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__procedures", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "nationality": {"type": "text", "index": 8, "name": "nationality", "comment": null}, "encounter_facility_id": {"type": "character varying(255)", "index": 9, "name": "encounter_facility_id", "comment": null}, "encounter_facility": {"type": "character varying(255)", "index": 10, "name": "encounter_facility", "comment": null}, "encounter_department_id": {"type": "character varying(255)", "index": 11, "name": "encounter_department_id", "comment": null}, "encounter_department": {"type": "character varying(255)", "index": 12, "name": "encounter_department", "comment": null}, "encounter_type": {"type": "text", "index": 13, "name": "encounter_type", "comment": null}, "encounter_start_datetime": {"type": "timestamp without time zone", "index": 14, "name": "encounter_start_datetime", "comment": null}, "encounter_end_datetime": {"type": "timestamp without time zone", "index": 15, "name": "encounter_end_datetime", "comment": null}, "procedure_facility_id": {"type": "character varying(255)", "index": 16, "name": "procedure_facility_id", "comment": null}, "procedure_facility": {"type": "character varying(255)", "index": 17, "name": "procedure_facility", "comment": null}, "procedure_area_id": {"type": "character varying(255)", "index": 18, "name": "procedure_area_id", "comment": null}, "procedure_area": {"type": "character varying(255)", "index": 19, "name": "procedure_area", "comment": null}, "procedure_location_id": {"type": "character varying(255)", "index": 20, "name": "procedure_location_id", "comment": null}, "procedure_location": {"type": "character varying(255)", "index": 21, "name": "procedure_location", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 22, "name": "procedure_type_id", "comment": null}, "procedure_type": {"type": "text", "index": 23, "name": "procedure_type", "comment": null}, "procedure_date": {"type": "date", "index": 24, "name": "procedure_date", "comment": null}, "procedure_start_time": {"type": "time without time zone", "index": 25, "name": "procedure_start_time", "comment": null}, "procedure_end_time": {"type": "time without time zone", "index": 26, "name": "procedure_end_time", "comment": null}, "procedure_duration": {"type": "text", "index": 27, "name": "procedure_duration", "comment": null}, "procedure_clinician_id": {"type": "character varying(255)", "index": 28, "name": "procedure_clinician_id", "comment": null}, "procedure_clinician": {"type": "character varying(255)", "index": 29, "name": "procedure_clinician", "comment": null}, "procedure_anaesthetist_id": {"type": "character varying(255)", "index": 30, "name": "procedure_anaesthetist_id", "comment": null}, "procedure_anaesthetist": {"type": "character varying(255)", "index": 31, "name": "procedure_anaesthetist", "comment": null}, "procedure_assistant_anaesthetist_id": {"type": "character varying(255)", "index": 32, "name": "procedure_assistant_anaesthetist_id", "comment": null}, "procedure_assistant_anaesthetist": {"type": "character varying(255)", "index": 33, "name": "procedure_assistant_anaesthetist", "comment": null}, "is_completed": {"type": "text", "index": 34, "name": "is_completed", "comment": null}, "time_in": {"type": "time without time zone", "index": 35, "name": "time_in", "comment": null}, "time_out": {"type": "time without time zone", "index": 36, "name": "time_out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__procedures"}, "model.tamanu_source_dbt.ds__referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "village_id": {"type": "character varying(255)", "index": 5, "name": "village_id", "comment": null}, "diagnoses": {"type": "text", "index": 6, "name": "diagnoses", "comment": null}, "referral_type": {"type": "character varying(255)", "index": 7, "name": "referral_type", "comment": null}, "referring_doctor_id": {"type": "character varying(255)", "index": 8, "name": "referring_doctor_id", "comment": null}, "referring_doctor_name": {"type": "character varying(255)", "index": 9, "name": "referring_doctor_name", "comment": null}, "referral_datetime": {"type": "timestamp without time zone", "index": 10, "name": "referral_datetime", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "department": {"type": "character varying(255)", "index": 12, "name": "department", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__referrals"}, "model.tamanu_source_dbt.ds__sensitive_admissions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_admissions", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 10, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 11, "name": "billing_type", "comment": null}, "admitting_clinician_id": {"type": "character varying", "index": 12, "name": "admitting_clinician_id", "comment": null}, "admitting_clinician": {"type": "character varying", "index": 13, "name": "admitting_clinician", "comment": null}, "admission_datetime": {"type": "timestamp without time zone", "index": 14, "name": "admission_datetime", "comment": null}, "admission_status": {"type": "text", "index": 15, "name": "admission_status", "comment": null}, "discharge_datetime": {"type": "timestamp without time zone", "index": 16, "name": "discharge_datetime", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 17, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 18, "name": "facility", "comment": null}, "department_ids": {"type": "character varying[]", "index": 19, "name": "department_ids", "comment": null}, "departments": {"type": "text", "index": 20, "name": "departments", "comment": null}, "department_datetimes": {"type": "text", "index": 21, "name": "department_datetimes", "comment": null}, "location_group_ids": {"type": "character varying[]", "index": 22, "name": "location_group_ids", "comment": null}, "location_groups": {"type": "text", "index": 23, "name": "location_groups", "comment": null}, "location_group_datetimes": {"type": "text", "index": 24, "name": "location_group_datetimes", "comment": null}, "location_ids": {"type": "character varying[]", "index": 25, "name": "location_ids", "comment": null}, "locations": {"type": "text", "index": 26, "name": "locations", "comment": null}, "location_datetimes": {"type": "text", "index": 27, "name": "location_datetimes", "comment": null}, "primary_diagnoses": {"type": "text", "index": 28, "name": "primary_diagnoses", "comment": null}, "secondary_diagnoses": {"type": "text", "index": 29, "name": "secondary_diagnoses", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_admissions"}, "model.tamanu_source_dbt.ds__sensitive_diagnoses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_diagnoses", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 3, "name": "diagnosis_id", "comment": null}, "diagnosis": {"type": "text", "index": 4, "name": "diagnosis", "comment": null}, "diagnosis_datetime": {"type": "timestamp without time zone", "index": 5, "name": "diagnosis_datetime", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "display_id": {"type": "character varying(255)", "index": 8, "name": "display_id", "comment": null}, "age": {"type": "double precision", "index": 9, "name": "age", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 11, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 14, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 15, "name": "clinician", "comment": null}, "department_id": {"type": "character varying(255)", "index": 16, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 17, "name": "department", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 20, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 21, "name": "facility", "comment": null}, "certainty": {"type": "text", "index": 22, "name": "certainty", "comment": null}, "is_primary": {"type": "text", "index": 23, "name": "is_primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_diagnoses"}, "model.tamanu_source_dbt.ds__sensitive_encounter_diets": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_encounter_diets", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 3, "name": "display_id", "comment": null}, "patient_name": {"type": "text", "index": 4, "name": "patient_name", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 5, "name": "start_datetime", "comment": null}, "age": {"type": "text", "index": 6, "name": "age", "comment": null}, "location_id": {"type": "character varying(255)", "index": 7, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 8, "name": "location", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 9, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 10, "name": "location_group", "comment": null}, "diets": {"type": "text", "index": 11, "name": "diets", "comment": null}, "allergies": {"type": "text", "index": 12, "name": "allergies", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounter_diets"}, "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_encounter_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"encounter_id": {"type": "character varying(255)", "index": 1, "name": "encounter_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 2, "name": "prescription_id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 3, "name": "datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 8, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 9, "name": "age", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 11, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 14, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 15, "name": "facility", "comment": null}, "is_selected_for_discharge": {"type": "boolean", "index": 16, "name": "is_selected_for_discharge", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 17, "name": "medication_id", "comment": null}, "medication_code": {"type": "character varying(255)", "index": 18, "name": "medication_code", "comment": null}, "medication": {"type": "text", "index": 19, "name": "medication", "comment": null}, "route": {"type": "character varying(255)", "index": 20, "name": "route", "comment": null}, "quantity": {"type": "integer", "index": 21, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 22, "name": "repeats", "comment": null}, "is_ongoing": {"type": "boolean", "index": 23, "name": "is_ongoing", "comment": null}, "is_prn": {"type": "boolean", "index": 24, "name": "is_prn", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 25, "name": "is_variable_dose", "comment": null}, "dose_amount": {"type": "numeric", "index": 26, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 27, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 28, "name": "frequency", "comment": null}, "is_discontinued": {"type": "boolean", "index": 29, "name": "is_discontinued", "comment": null}, "discontinued_by_id": {"type": "character varying(255)", "index": 30, "name": "discontinued_by_id", "comment": null}, "discontinuing_reason": {"type": "character varying(255)", "index": 31, "name": "discontinuing_reason", "comment": null}, "discontinued_datetime": {"type": "timestamp without time zone", "index": 32, "name": "discontinued_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounter_prescriptions"}, "model.tamanu_source_dbt.ds__sensitive_encounters_emergency": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_encounters_emergency", "database": "app", "comment": null, "owner": "app"}, "columns": {"triage_id": {"type": "character varying(255)", "index": 1, "name": "triage_id", "comment": null}, "arrival_datetime": {"type": "timestamp without time zone", "index": 2, "name": "arrival_datetime", "comment": null}, "triage_datetime": {"type": "timestamp without time zone", "index": 3, "name": "triage_datetime", "comment": null}, "closed_datetime": {"type": "timestamp without time zone", "index": 4, "name": "closed_datetime", "comment": null}, "score": {"type": "text", "index": 5, "name": "score", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 7, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 8, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 9, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 10, "name": "date_of_birth", "comment": null}, "sex": {"type": "text", "index": 11, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 12, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 13, "name": "village", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 14, "name": "encounter_id", "comment": null}, "encounter_type": {"type": "character varying(31)", "index": 15, "name": "encounter_type", "comment": null}, "arrival_mode": {"type": "text", "index": 16, "name": "arrival_mode", "comment": null}, "chief_complaint": {"type": "text", "index": 17, "name": "chief_complaint", "comment": null}, "secondary_complaint": {"type": "text", "index": 18, "name": "secondary_complaint", "comment": null}, "clinician": {"type": "character varying(255)", "index": 19, "name": "clinician", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 20, "name": "clinician_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 21, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 22, "name": "facility", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_encounters_emergency"}, "model.tamanu_source_dbt.ds__sensitive_imaging_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_imaging_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "request_id": {"type": "character varying(255)", "index": 16, "name": "request_id", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 17, "name": "requested_datetime", "comment": null}, "supervising_clinician_id": {"type": "character varying(255)", "index": 18, "name": "supervising_clinician_id", "comment": null}, "supervising_clinician": {"type": "character varying(255)", "index": 19, "name": "supervising_clinician", "comment": null}, "requesting_clinician_id": {"type": "character varying(255)", "index": 20, "name": "requesting_clinician_id", "comment": null}, "requesting_clinician": {"type": "character varying(255)", "index": 21, "name": "requesting_clinician", "comment": null}, "priority": {"type": "character varying", "index": 22, "name": "priority", "comment": null}, "imaging_type": {"type": "character varying(31)", "index": 23, "name": "imaging_type", "comment": null}, "imaging_area": {"type": "text", "index": 24, "name": "imaging_area", "comment": null}, "status_id": {"type": "character varying(255)", "index": 25, "name": "status_id", "comment": null}, "status": {"type": "text", "index": 26, "name": "status", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 27, "name": "completed_datetime", "comment": null}, "reason_for_cancellation": {"type": "text", "index": 28, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_imaging_requests"}, "model.tamanu_source_dbt.ds__sensitive_lab_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_lab_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department": {"type": "character varying(255)", "index": 12, "name": "department", "comment": null}, "department_id": {"type": "character varying(255)", "index": 13, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 15, "name": "location", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "laboratory_id": {"type": "character varying(255)", "index": 18, "name": "laboratory_id", "comment": null}, "laboratory": {"type": "text", "index": 19, "name": "laboratory", "comment": null}, "request_id": {"type": "character varying(255)", "index": 20, "name": "request_id", "comment": null}, "status": {"type": "character varying", "index": 21, "name": "status", "comment": null}, "status_id": {"type": "character varying(255)", "index": 22, "name": "status_id", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 23, "name": "requested_datetime", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 24, "name": "requested_by_id", "comment": null}, "requested_by": {"type": "character varying(255)", "index": 25, "name": "requested_by", "comment": null}, "requesting_department_id": {"type": "character varying(255)", "index": 26, "name": "requesting_department_id", "comment": null}, "requesting_department": {"type": "character varying(255)", "index": 27, "name": "requesting_department", "comment": null}, "priority_id": {"type": "character varying(255)", "index": 28, "name": "priority_id", "comment": null}, "priority": {"type": "text", "index": 29, "name": "priority", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 30, "name": "lab_test_category_id", "comment": null}, "lab_test_category": {"type": "text", "index": 31, "name": "lab_test_category", "comment": null}, "lab_test_panel": {"type": "character varying(255)", "index": 32, "name": "lab_test_panel", "comment": null}, "tests": {"type": "text", "index": 33, "name": "tests", "comment": null}, "collected_datetime": {"type": "timestamp without time zone", "index": 34, "name": "collected_datetime", "comment": null}, "collected_by_id": {"type": "character varying(255)", "index": 35, "name": "collected_by_id", "comment": null}, "collected_by": {"type": "character varying(255)", "index": 36, "name": "collected_by", "comment": null}, "specimen_type_id": {"type": "character varying(255)", "index": 37, "name": "specimen_type_id", "comment": null}, "specimen_type": {"type": "text", "index": 38, "name": "specimen_type", "comment": null}, "site": {"type": "text", "index": 39, "name": "site", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 40, "name": "completed_datetime", "comment": null}, "reason_for_cancellation": {"type": "character varying", "index": 41, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_lab_requests"}, "model.tamanu_source_dbt.ds__sensitive_lab_tests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_lab_tests", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "requesting_department_id": {"type": "character varying(255)", "index": 14, "name": "requesting_department_id", "comment": null}, "requesting_department": {"type": "character varying(255)", "index": 15, "name": "requesting_department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 16, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 17, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 18, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 19, "name": "location", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 20, "name": "lab_request_id", "comment": null}, "status_id": {"type": "character varying(255)", "index": 21, "name": "status_id", "comment": null}, "status": {"type": "character varying", "index": 22, "name": "status", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 23, "name": "lab_test_panel_id", "comment": null}, "lab_test_panel": {"type": "character varying(255)", "index": 24, "name": "lab_test_panel", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 25, "name": "lab_test_category_id", "comment": null}, "lab_test_category": {"type": "text", "index": 26, "name": "lab_test_category", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 27, "name": "requested_datetime", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 28, "name": "requested_by_id", "comment": null}, "requested_by": {"type": "character varying(255)", "index": 29, "name": "requested_by", "comment": null}, "lab_request_published_datetime": {"type": "timestamp without time zone", "index": 30, "name": "lab_request_published_datetime", "comment": null}, "lab_test_date": {"type": "date", "index": 31, "name": "lab_test_date", "comment": null}, "result": {"type": "text", "index": 32, "name": "result", "comment": null}, "verification": {"type": "character varying(255)", "index": 33, "name": "verification", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 34, "name": "lab_test_type_id", "comment": null}, "lab_test_type": {"type": "character varying(255)", "index": 35, "name": "lab_test_type", "comment": null}, "lab_test_completed_datetime": {"type": "timestamp without time zone", "index": 36, "name": "lab_test_completed_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_lab_tests"}, "model.tamanu_source_dbt.ds__sensitive_location_bookings": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_location_bookings", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 10, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 11, "name": "billing_type", "comment": null}, "booking_start_datetime": {"type": "timestamp without time zone", "index": 12, "name": "booking_start_datetime", "comment": null}, "booking_end_datetime": {"type": "timestamp without time zone", "index": 13, "name": "booking_end_datetime", "comment": null}, "booking_status": {"type": "character varying(255)", "index": 14, "name": "booking_status", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 15, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 16, "name": "clinician", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 17, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 18, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 19, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 20, "name": "location", "comment": null}, "booking_type_id": {"type": "character varying(255)", "index": 21, "name": "booking_type_id", "comment": null}, "booking_type": {"type": "text", "index": 22, "name": "booking_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_location_bookings"}, "model.tamanu_source_dbt.ds__sensitive_medication_dispenses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_medication_dispenses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "quantity": {"type": "integer", "index": 2, "name": "quantity", "comment": null}, "dispensed_at": {"type": "timestamp without time zone", "index": 3, "name": "dispensed_at", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 5, "name": "facility", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 6, "name": "medication_id", "comment": null}, "medication_code": {"type": "character varying(255)", "index": 7, "name": "medication_code", "comment": null}, "medication": {"type": "text", "index": 8, "name": "medication", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_medication_dispenses"}, "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_outpatient_appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 8, "name": "contact_number", "comment": null}, "village_id": {"type": "character varying(255)", "index": 9, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 10, "name": "village", "comment": null}, "billing_type_id": {"type": "character varying(255)", "index": 11, "name": "billing_type_id", "comment": null}, "billing_type": {"type": "text", "index": 12, "name": "billing_type", "comment": null}, "appointment_start_datetime": {"type": "timestamp without time zone", "index": 13, "name": "appointment_start_datetime", "comment": null}, "appointment_end_datetime": {"type": "timestamp without time zone", "index": 14, "name": "appointment_end_datetime", "comment": null}, "appointment_type_id": {"type": "character varying(255)", "index": 15, "name": "appointment_type_id", "comment": null}, "appointment_type": {"type": "text", "index": 16, "name": "appointment_type", "comment": null}, "appointment_status": {"type": "character varying(255)", "index": 17, "name": "appointment_status", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 18, "name": "clinician_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 19, "name": "clinician", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 20, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 21, "name": "location_group", "comment": null}, "priority": {"type": "text", "index": 22, "name": "priority", "comment": null}, "schedule_id": {"type": "uuid", "index": 23, "name": "schedule_id", "comment": null}, "until_date": {"type": "date", "index": 24, "name": "until_date", "comment": null}, "interval": {"type": "integer", "index": 25, "name": "interval", "comment": null}, "days_of_week": {"type": "character varying(255)[]", "index": 26, "name": "days_of_week", "comment": null}, "frequency": {"type": "character varying(255)", "index": 27, "name": "frequency", "comment": null}, "nth_weekday": {"type": "integer", "index": 28, "name": "nth_weekday", "comment": null}, "created_by_user_id": {"type": "text", "index": 29, "name": "created_by_user_id", "comment": null}, "created_by": {"type": "character varying(255)", "index": 30, "name": "created_by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments"}, "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_outpatient_appointments_audit", "database": "app", "comment": null, "owner": "app"}, "columns": {"change_id": {"type": "uuid", "index": 1, "name": "change_id", "comment": null}, "appointment_id": {"type": "text", "index": 2, "name": "appointment_id", "comment": null}, "change_number": {"type": "bigint", "index": 3, "name": "change_number", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 8, "name": "date_of_birth", "comment": null}, "appointment_start_datetime": {"type": "timestamp without time zone", "index": 9, "name": "appointment_start_datetime", "comment": null}, "appointment_end_datetime": {"type": "timestamp without time zone", "index": 10, "name": "appointment_end_datetime", "comment": null}, "appointment_type": {"type": "text", "index": 11, "name": "appointment_type", "comment": null}, "appointment_type_id": {"type": "text", "index": 12, "name": "appointment_type_id", "comment": null}, "clinician": {"type": "character varying(255)", "index": 13, "name": "clinician", "comment": null}, "clinician_id": {"type": "text", "index": 14, "name": "clinician_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "location_group_id": {"type": "text", "index": 16, "name": "location_group_id", "comment": null}, "priority": {"type": "text", "index": 17, "name": "priority", "comment": null}, "schedule_id": {"type": "uuid", "index": 18, "name": "schedule_id", "comment": null}, "is_repeating": {"type": "text", "index": 19, "name": "is_repeating", "comment": null}, "created_by": {"type": "character varying(255)", "index": 20, "name": "created_by", "comment": null}, "created_by_user_id": {"type": "text", "index": 21, "name": "created_by_user_id", "comment": null}, "modified_by": {"type": "character varying(255)", "index": 22, "name": "modified_by", "comment": null}, "modified_by_user_id": {"type": "text", "index": 23, "name": "modified_by_user_id", "comment": null}, "modified_datetime": {"type": "timestamp with time zone", "index": 24, "name": "modified_datetime", "comment": null}, "is_cancelled": {"type": "text", "index": 25, "name": "is_cancelled", "comment": null}, "prev_start_datetime": {"type": "timestamp without time zone", "index": 26, "name": "prev_start_datetime", "comment": null}, "prev_end_datetime": {"type": "timestamp without time zone", "index": 27, "name": "prev_end_datetime", "comment": null}, "prev_appointment_type": {"type": "text", "index": 28, "name": "prev_appointment_type", "comment": null}, "prev_appointment_type_id": {"type": "text", "index": 29, "name": "prev_appointment_type_id", "comment": null}, "prev_clinician": {"type": "character varying", "index": 30, "name": "prev_clinician", "comment": null}, "prev_clinician_id": {"type": "text", "index": 31, "name": "prev_clinician_id", "comment": null}, "prev_location_group": {"type": "character varying", "index": 32, "name": "prev_location_group", "comment": null}, "prev_location_group_id": {"type": "text", "index": 33, "name": "prev_location_group_id", "comment": null}, "prev_priority": {"type": "text", "index": 34, "name": "prev_priority", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 35, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 36, "name": "facility", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_outpatient_appointments_audit"}, "model.tamanu_source_dbt.ds__sensitive_procedures": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_procedures", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "nationality": {"type": "text", "index": 8, "name": "nationality", "comment": null}, "encounter_facility_id": {"type": "character varying(255)", "index": 9, "name": "encounter_facility_id", "comment": null}, "encounter_facility": {"type": "character varying(255)", "index": 10, "name": "encounter_facility", "comment": null}, "encounter_department_id": {"type": "character varying(255)", "index": 11, "name": "encounter_department_id", "comment": null}, "encounter_department": {"type": "character varying(255)", "index": 12, "name": "encounter_department", "comment": null}, "encounter_type": {"type": "text", "index": 13, "name": "encounter_type", "comment": null}, "encounter_start_datetime": {"type": "timestamp without time zone", "index": 14, "name": "encounter_start_datetime", "comment": null}, "encounter_end_datetime": {"type": "timestamp without time zone", "index": 15, "name": "encounter_end_datetime", "comment": null}, "procedure_facility_id": {"type": "character varying(255)", "index": 16, "name": "procedure_facility_id", "comment": null}, "procedure_facility": {"type": "character varying(255)", "index": 17, "name": "procedure_facility", "comment": null}, "procedure_area_id": {"type": "character varying(255)", "index": 18, "name": "procedure_area_id", "comment": null}, "procedure_area": {"type": "character varying(255)", "index": 19, "name": "procedure_area", "comment": null}, "procedure_location_id": {"type": "character varying(255)", "index": 20, "name": "procedure_location_id", "comment": null}, "procedure_location": {"type": "character varying(255)", "index": 21, "name": "procedure_location", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 22, "name": "procedure_type_id", "comment": null}, "procedure_type": {"type": "text", "index": 23, "name": "procedure_type", "comment": null}, "procedure_date": {"type": "date", "index": 24, "name": "procedure_date", "comment": null}, "procedure_start_time": {"type": "time without time zone", "index": 25, "name": "procedure_start_time", "comment": null}, "procedure_end_time": {"type": "time without time zone", "index": 26, "name": "procedure_end_time", "comment": null}, "procedure_duration": {"type": "text", "index": 27, "name": "procedure_duration", "comment": null}, "procedure_clinician_id": {"type": "character varying(255)", "index": 28, "name": "procedure_clinician_id", "comment": null}, "procedure_clinician": {"type": "character varying(255)", "index": 29, "name": "procedure_clinician", "comment": null}, "procedure_anaesthetist_id": {"type": "character varying(255)", "index": 30, "name": "procedure_anaesthetist_id", "comment": null}, "procedure_anaesthetist": {"type": "character varying(255)", "index": 31, "name": "procedure_anaesthetist", "comment": null}, "procedure_assistant_anaesthetist_id": {"type": "character varying(255)", "index": 32, "name": "procedure_assistant_anaesthetist_id", "comment": null}, "procedure_assistant_anaesthetist": {"type": "character varying(255)", "index": 33, "name": "procedure_assistant_anaesthetist", "comment": null}, "is_completed": {"type": "text", "index": 34, "name": "is_completed", "comment": null}, "time_in": {"type": "time without time zone", "index": 35, "name": "time_in", "comment": null}, "time_out": {"type": "time without time zone", "index": 36, "name": "time_out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_procedures"}, "model.tamanu_source_dbt.ds__sensitive_referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 4, "name": "last_name", "comment": null}, "village_id": {"type": "character varying(255)", "index": 5, "name": "village_id", "comment": null}, "diagnoses": {"type": "text", "index": 6, "name": "diagnoses", "comment": null}, "referral_type": {"type": "character varying(255)", "index": 7, "name": "referral_type", "comment": null}, "referring_doctor_id": {"type": "character varying(255)", "index": 8, "name": "referring_doctor_id", "comment": null}, "referring_doctor_name": {"type": "character varying(255)", "index": 9, "name": "referring_doctor_name", "comment": null}, "referral_datetime": {"type": "timestamp without time zone", "index": 10, "name": "referral_datetime", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "department": {"type": "character varying(255)", "index": 12, "name": "department", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_referrals"}, "model.tamanu_source_dbt.ds__sensitive_user_audit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_user_audit", "database": "app", "comment": null, "owner": "app"}, "columns": {"user_id": {"type": "character varying(255)", "index": 1, "name": "user_id", "comment": null}, "user_name": {"type": "character varying(255)", "index": 2, "name": "user_name", "comment": null}, "user_role": {"type": "character varying(255)", "index": 3, "name": "user_role", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "patient_category": {"type": "text", "index": 6, "name": "patient_category", "comment": null}, "triage_category": {"type": "text", "index": 7, "name": "triage_category", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 8, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 9, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 10, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 11, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 12, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 13, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 15, "name": "location", "comment": null}, "encounter_start_datetime": {"type": "timestamp without time zone", "index": 16, "name": "encounter_start_datetime", "comment": null}, "encounter_end_datetime": {"type": "timestamp without time zone", "index": 17, "name": "encounter_end_datetime", "comment": null}, "first_note_datetime": {"type": "timestamp without time zone", "index": 18, "name": "first_note_datetime", "comment": null}, "last_note_datetime": {"type": "timestamp without time zone", "index": 19, "name": "last_note_datetime", "comment": null}, "is_discharged": {"type": "text", "index": 20, "name": "is_discharged", "comment": null}, "non_discharge_by_clinicians": {"type": "text", "index": 21, "name": "non_discharge_by_clinicians", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_user_audit"}, "model.tamanu_source_dbt.ds__sensitive_vaccinations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__sensitive_vaccinations", "database": "app", "comment": null, "owner": "app"}, "columns": {"display_id": {"type": "character varying(255)", "index": 1, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 3, "name": "last_name", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 16, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 17, "name": "location", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 18, "name": "scheduled_vaccine_id", "comment": null}, "vaccination_date": {"type": "date", "index": 19, "name": "vaccination_date", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 20, "name": "vaccine_category", "comment": null}, "vaccine_name": {"type": "character varying(255)", "index": 21, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 22, "name": "vaccine_brand", "comment": null}, "disease": {"type": "text", "index": 23, "name": "disease", "comment": null}, "vaccine_status": {"type": "text", "index": 24, "name": "vaccine_status", "comment": null}, "vaccine_schedule": {"type": "character varying(255)", "index": 25, "name": "vaccine_schedule", "comment": null}, "batch": {"type": "character varying(255)", "index": 26, "name": "batch", "comment": null}, "recorded_by": {"type": "character varying", "index": 27, "name": "recorded_by", "comment": null}, "circumstances": {"type": "text", "index": 28, "name": "circumstances", "comment": null}, "given_by": {"type": "text", "index": 29, "name": "given_by", "comment": null}, "given_elsewhere_by": {"type": "text", "index": 30, "name": "given_elsewhere_by", "comment": null}, "not_given_clinician": {"type": "text", "index": 31, "name": "not_given_clinician", "comment": null}, "not_given_reason": {"type": "text", "index": 32, "name": "not_given_reason", "comment": null}, "modified_by": {"type": "character varying", "index": 33, "name": "modified_by", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 34, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__sensitive_vaccinations"}, "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__usage_quality_metrics_patient_details", "database": "app", "comment": null, "owner": "app"}, "columns": {"total_patients": {"type": "bigint", "index": 1, "name": "total_patients", "comment": null}, "total_patients_with_incomplete_name": {"type": "bigint", "index": 2, "name": "total_patients_with_incomplete_name", "comment": null}, "total_patients_with_missing_dob": {"type": "bigint", "index": 3, "name": "total_patients_with_missing_dob", "comment": null}, "total_patients_with_invalid_dob": {"type": "bigint", "index": 4, "name": "total_patients_with_invalid_dob", "comment": null}, "total_patients_with_missing_location": {"type": "bigint", "index": 5, "name": "total_patients_with_missing_location", "comment": null}, "total_patients_with_missing_contact": {"type": "bigint", "index": 6, "name": "total_patients_with_missing_contact", "comment": null}, "total_patients_merged": {"type": "bigint", "index": 7, "name": "total_patients_merged", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_details"}, "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__usage_quality_metrics_patient_registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"registration_date": {"type": "timestamp with time zone", "index": 1, "name": "registration_date", "comment": null}, "total_patient_registrations": {"type": "bigint", "index": 2, "name": "total_patient_registrations", "comment": null}, "total_birth_registrations": {"type": "bigint", "index": 3, "name": "total_birth_registrations", "comment": null}, "total_incorrect_registrations_for_patient_under_6mth": {"type": "bigint", "index": 4, "name": "total_incorrect_registrations_for_patient_under_6mth", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__usage_quality_metrics_patient_registrations"}, "model.tamanu_source_dbt.ds__user_audit": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__user_audit", "database": "app", "comment": null, "owner": "app"}, "columns": {"user_id": {"type": "character varying(255)", "index": 1, "name": "user_id", "comment": null}, "user_name": {"type": "character varying(255)", "index": 2, "name": "user_name", "comment": null}, "user_role": {"type": "character varying(255)", "index": 3, "name": "user_role", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "patient_category": {"type": "text", "index": 6, "name": "patient_category", "comment": null}, "triage_category": {"type": "text", "index": 7, "name": "triage_category", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 8, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 9, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 10, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 11, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 12, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 13, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 15, "name": "location", "comment": null}, "encounter_start_datetime": {"type": "timestamp without time zone", "index": 16, "name": "encounter_start_datetime", "comment": null}, "encounter_end_datetime": {"type": "timestamp without time zone", "index": 17, "name": "encounter_end_datetime", "comment": null}, "first_note_datetime": {"type": "timestamp without time zone", "index": 18, "name": "first_note_datetime", "comment": null}, "last_note_datetime": {"type": "timestamp without time zone", "index": 19, "name": "last_note_datetime", "comment": null}, "is_discharged": {"type": "text", "index": 20, "name": "is_discharged", "comment": null}, "non_discharge_by_clinicians": {"type": "text", "index": 21, "name": "non_discharge_by_clinicians", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__user_audit"}, "model.tamanu_source_dbt.ds__vaccinations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ds__vaccinations", "database": "app", "comment": null, "owner": "app"}, "columns": {"display_id": {"type": "character varying(255)", "index": 1, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 3, "name": "last_name", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "date_of_birth": {"type": "date", "index": 5, "name": "date_of_birth", "comment": null}, "age": {"type": "double precision", "index": 6, "name": "age", "comment": null}, "sex": {"type": "text", "index": 7, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 8, "name": "village_id", "comment": null}, "village": {"type": "text", "index": 9, "name": "village", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 10, "name": "facility_id", "comment": null}, "facility": {"type": "character varying(255)", "index": 11, "name": "facility", "comment": null}, "department_id": {"type": "character varying(255)", "index": 12, "name": "department_id", "comment": null}, "department": {"type": "character varying(255)", "index": 13, "name": "department", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "location_group": {"type": "character varying(255)", "index": 15, "name": "location_group", "comment": null}, "location_id": {"type": "character varying(255)", "index": 16, "name": "location_id", "comment": null}, "location": {"type": "character varying(255)", "index": 17, "name": "location", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 18, "name": "scheduled_vaccine_id", "comment": null}, "vaccination_date": {"type": "date", "index": 19, "name": "vaccination_date", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 20, "name": "vaccine_category", "comment": null}, "vaccine_name": {"type": "character varying(255)", "index": 21, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 22, "name": "vaccine_brand", "comment": null}, "disease": {"type": "text", "index": 23, "name": "disease", "comment": null}, "vaccine_status": {"type": "text", "index": 24, "name": "vaccine_status", "comment": null}, "vaccine_schedule": {"type": "character varying(255)", "index": 25, "name": "vaccine_schedule", "comment": null}, "batch": {"type": "character varying(255)", "index": 26, "name": "batch", "comment": null}, "recorded_by": {"type": "character varying", "index": 27, "name": "recorded_by", "comment": null}, "circumstances": {"type": "text", "index": 28, "name": "circumstances", "comment": null}, "given_by": {"type": "text", "index": 29, "name": "given_by", "comment": null}, "given_elsewhere_by": {"type": "text", "index": 30, "name": "given_elsewhere_by", "comment": null}, "not_given_clinician": {"type": "text", "index": 31, "name": "not_given_clinician", "comment": null}, "not_given_reason": {"type": "text", "index": 32, "name": "not_given_reason", "comment": null}, "modified_by": {"type": "character varying", "index": 33, "name": "modified_by", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 34, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ds__vaccinations"}, "model.tamanu_source_dbt.encounter-diets-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter-diets-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Encounter start date": {"type": "text", "index": 1, "name": "Encounter start date", "comment": null}, "Encounter start time": {"type": "text", "index": 2, "name": "Encounter start time", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "Patient name": {"type": "text", "index": 4, "name": "Patient name", "comment": null}, "Age": {"type": "text", "index": 5, "name": "Age", "comment": null}, "Location": {"type": "text", "index": 6, "name": "Location", "comment": null}, "Diet": {"type": "text", "index": 7, "name": "Diet", "comment": null}, "Allergies": {"type": "text", "index": 8, "name": "Allergies", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter-diets-line-list"}, "model.tamanu_source_dbt.encounter-summary-by-end-date": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter-summary-by-end-date", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 7, "name": "Ethnicity", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 9, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 10, "name": "Encounter end date and time", "comment": null}, "Length of stay (days)": {"type": "integer", "index": 11, "name": "Length of stay (days)", "comment": null}, "Facility": {"type": "character varying(255)", "index": 12, "name": "Facility", "comment": null}, "Emergency encounter type": {"type": "text", "index": 13, "name": "Emergency encounter type", "comment": null}, "Inpatient encounter type": {"type": "text", "index": 14, "name": "Inpatient encounter type", "comment": null}, "Outpatient encounter type": {"type": "text", "index": 15, "name": "Outpatient encounter type", "comment": null}, "Discharge disposition": {"type": "text", "index": 16, "name": "Discharge disposition", "comment": null}, "Triage category": {"type": "text", "index": 17, "name": "Triage category", "comment": null}, "Arrival mode": {"type": "text", "index": 18, "name": "Arrival mode", "comment": null}, "Time seen following triage/Waiting time (hh:mm:ss)": {"type": "text", "index": 19, "name": "Time seen following triage/Waiting time (hh:mm:ss)", "comment": null}, "Clinician": {"type": "text", "index": 20, "name": "Clinician", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 21, "name": "Supervising clinician", "comment": null}, "Discharging department": {"type": "character varying(255)", "index": 22, "name": "Discharging department", "comment": null}, "Discharge date and time of Discharging department": {"type": "text", "index": 23, "name": "Discharge date and time of Discharging department", "comment": null}, "Discharging area": {"type": "character varying(255)", "index": 24, "name": "Discharging area", "comment": null}, "Discharge date and time of Discharging area": {"type": "text", "index": 25, "name": "Discharge date and time of Discharging area", "comment": null}, "Discharging location": {"type": "character varying(255)", "index": 26, "name": "Discharging location", "comment": null}, "Discharge date and time of Discharging location": {"type": "text", "index": 27, "name": "Discharge date and time of Discharging location", "comment": null}, "Department history": {"type": "text", "index": 28, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 29, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 30, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 31, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 32, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 33, "name": "Location history date and times", "comment": null}, "Reason for encounter": {"type": "text", "index": 34, "name": "Reason for encounter", "comment": null}, "Diagnoses": {"type": "text", "index": 35, "name": "Diagnoses", "comment": null}, "Medications": {"type": "text", "index": 36, "name": "Medications", "comment": null}, "Vaccinations": {"type": "text", "index": 37, "name": "Vaccinations", "comment": null}, "Procedures": {"type": "text", "index": 38, "name": "Procedures", "comment": null}, "Lab requests": {"type": "text", "index": 39, "name": "Lab requests", "comment": null}, "Imaging requests": {"type": "text", "index": 40, "name": "Imaging requests", "comment": null}, "Notes": {"type": "text", "index": 41, "name": "Notes", "comment": null}, "invoiceFinalisedDateTime": {"type": "text", "index": 42, "name": "invoiceFinalisedDateTime", "comment": null}, "invoiceProductCategories": {"type": "text", "index": 43, "name": "invoiceProductCategories", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter-summary-by-end-date"}, "model.tamanu_source_dbt.encounter-summary-by-start-date": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter-summary-by-start-date", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 7, "name": "Ethnicity", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 9, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 10, "name": "Encounter end date and time", "comment": null}, "Length of stay (days)": {"type": "integer", "index": 11, "name": "Length of stay (days)", "comment": null}, "Facility": {"type": "character varying(255)", "index": 12, "name": "Facility", "comment": null}, "Emergency encounter type": {"type": "text", "index": 13, "name": "Emergency encounter type", "comment": null}, "Inpatient encounter type": {"type": "text", "index": 14, "name": "Inpatient encounter type", "comment": null}, "Outpatient encounter type": {"type": "text", "index": 15, "name": "Outpatient encounter type", "comment": null}, "Discharge disposition": {"type": "text", "index": 16, "name": "Discharge disposition", "comment": null}, "Triage category": {"type": "text", "index": 17, "name": "Triage category", "comment": null}, "Arrival mode": {"type": "text", "index": 18, "name": "Arrival mode", "comment": null}, "Time seen following triage/Waiting time (hh:mm:ss)": {"type": "text", "index": 19, "name": "Time seen following triage/Waiting time (hh:mm:ss)", "comment": null}, "Clinician": {"type": "text", "index": 20, "name": "Clinician", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 21, "name": "Supervising clinician", "comment": null}, "Discharging department": {"type": "character varying(255)", "index": 22, "name": "Discharging department", "comment": null}, "Discharge date and time of Discharging department": {"type": "text", "index": 23, "name": "Discharge date and time of Discharging department", "comment": null}, "Discharging area": {"type": "character varying(255)", "index": 24, "name": "Discharging area", "comment": null}, "Discharge date and time of Discharging area": {"type": "text", "index": 25, "name": "Discharge date and time of Discharging area", "comment": null}, "Discharging location": {"type": "character varying(255)", "index": 26, "name": "Discharging location", "comment": null}, "Discharge date and time of Discharging location": {"type": "text", "index": 27, "name": "Discharge date and time of Discharging location", "comment": null}, "Department history": {"type": "text", "index": 28, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 29, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 30, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 31, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 32, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 33, "name": "Location history date and times", "comment": null}, "Reason for encounter": {"type": "text", "index": 34, "name": "Reason for encounter", "comment": null}, "Diagnoses": {"type": "text", "index": 35, "name": "Diagnoses", "comment": null}, "Medications": {"type": "text", "index": 36, "name": "Medications", "comment": null}, "Vaccinations": {"type": "text", "index": 37, "name": "Vaccinations", "comment": null}, "Procedures": {"type": "text", "index": 38, "name": "Procedures", "comment": null}, "Lab requests": {"type": "text", "index": 39, "name": "Lab requests", "comment": null}, "Imaging requests": {"type": "text", "index": 40, "name": "Imaging requests", "comment": null}, "Notes": {"type": "text", "index": 41, "name": "Notes", "comment": null}, "invoiceFinalisedDateTime": {"type": "text", "index": 42, "name": "invoiceFinalisedDateTime", "comment": null}, "invoiceProductCategories": {"type": "text", "index": 43, "name": "invoiceProductCategories", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter-summary-by-start-date"}, "model.tamanu_source_dbt.encounter_diagnoses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_diagnoses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "is_primary": {"type": "boolean", "index": 3, "name": "is_primary", "comment": null}, "certainty": {"type": "character varying(255)", "index": 4, "name": "certainty", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 5, "name": "encounter_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 6, "name": "diagnosis_id", "comment": null}, "diagnosed_by_id": {"type": "character varying(255)", "index": 7, "name": "diagnosed_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_diagnoses"}, "model.tamanu_source_dbt.encounter_diagnoses_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_diagnoses_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_diagnoses_metadata"}, "model.tamanu_source_dbt.encounter_diets": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_diets", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "diet_id": {"type": "character varying(255)", "index": 3, "name": "diet_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_diets"}, "model.tamanu_source_dbt.encounter_history": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_history", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 3, "name": "encounter_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 4, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 5, "name": "location_id", "comment": null}, "encounter_type": {"type": "character varying(255)", "index": 6, "name": "encounter_type", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 7, "name": "clinician_id", "comment": null}, "updated_by_id": {"type": "character varying(255)", "index": 8, "name": "updated_by_id", "comment": null}, "change_type": {"type": "text[]", "index": 9, "name": "change_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_history"}, "model.tamanu_source_dbt.encounter_prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounter_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 3, "name": "prescription_id", "comment": null}, "is_selected_for_discharge": {"type": "boolean", "index": 4, "name": "is_selected_for_discharge", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounter_prescriptions"}, "model.tamanu_source_dbt.encounters": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounters", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 2, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 3, "name": "end_datetime", "comment": null}, "encounter_type": {"type": "character varying(31)", "index": 4, "name": "encounter_type", "comment": null}, "reason_for_encounter": {"type": "text", "index": 5, "name": "reason_for_encounter", "comment": null}, "device_id": {"type": "text", "index": 6, "name": "device_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 8, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 9, "name": "location_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 10, "name": "clinician_id", "comment": null}, "patient_billing_type_id": {"type": "character varying(255)", "index": 11, "name": "patient_billing_type_id", "comment": null}, "referral_source_id": {"type": "character varying(255)", "index": 12, "name": "referral_source_id", "comment": null}, "planned_location_id": {"type": "character varying(255)", "index": 13, "name": "planned_location_id", "comment": null}, "planned_location_start_datetime": {"type": "timestamp without time zone", "index": 14, "name": "planned_location_start_datetime", "comment": null}, "discharge_draft": {"type": "jsonb", "index": 15, "name": "discharge_draft", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounters"}, "model.tamanu_source_dbt.encounters_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "encounters_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.encounters_metadata"}, "model.tamanu_source_dbt.facilities": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "division": {"type": "character varying(255)", "index": 4, "name": "division", "comment": null}, "type": {"type": "character varying(255)", "index": 5, "name": "type", "comment": null}, "email": {"type": "character varying(255)", "index": 6, "name": "email", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 7, "name": "contact_number", "comment": null}, "city_town": {"type": "character varying(255)", "index": 8, "name": "city_town", "comment": null}, "street_address": {"type": "character varying(255)", "index": 9, "name": "street_address", "comment": null}, "catchment_id": {"type": "text", "index": 10, "name": "catchment_id", "comment": null}, "visibility_status": {"type": "text", "index": 11, "name": "visibility_status", "comment": null}, "is_sensitive": {"type": "boolean", "index": 12, "name": "is_sensitive", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.facilities"}, "model.tamanu_source_dbt.hospital-admissions-by-area-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "hospital-admissions-by-area-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Month": {"type": "text", "index": 1, "name": "Month", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Area": {"type": "character varying(255)", "index": 3, "name": "Area", "comment": null}, "Number of admissions": {"type": "bigint", "index": 4, "name": "Number of admissions", "comment": null}, "Number of discharges": {"type": "bigint", "index": 5, "name": "Number of discharges", "comment": null}, "Number of deaths": {"type": "bigint", "index": 6, "name": "Number of deaths", "comment": null}, "Number of transfers into location": {"type": "bigint", "index": 7, "name": "Number of transfers into location", "comment": null}, "Number of transfers out of location": {"type": "bigint", "index": 8, "name": "Number of transfers out of location", "comment": null}, "Average length of stay": {"type": "numeric", "index": 9, "name": "Average length of stay", "comment": null}, "Number of patient days": {"type": "numeric", "index": 10, "name": "Number of patient days", "comment": null}, "Bed occupancy (%)": {"type": "text", "index": 11, "name": "Bed occupancy (%)", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-area-summary"}, "model.tamanu_source_dbt.hospital-admissions-by-department-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "hospital-admissions-by-department-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Month": {"type": "text", "index": 1, "name": "Month", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 3, "name": "Department", "comment": null}, "Number of admissions": {"type": "bigint", "index": 4, "name": "Number of admissions", "comment": null}, "Number of discharges": {"type": "bigint", "index": 5, "name": "Number of discharges", "comment": null}, "Number of deaths": {"type": "bigint", "index": 6, "name": "Number of deaths", "comment": null}, "Number of transfers into department": {"type": "bigint", "index": 7, "name": "Number of transfers into department", "comment": null}, "Number of transfers out of department": {"type": "bigint", "index": 8, "name": "Number of transfers out of department", "comment": null}, "Average length of stay": {"type": "numeric", "index": 9, "name": "Average length of stay", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-department-summary"}, "model.tamanu_source_dbt.hospital-admissions-by-location-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "hospital-admissions-by-location-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Month": {"type": "text", "index": 1, "name": "Month", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Area": {"type": "character varying(255)", "index": 3, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 4, "name": "Location", "comment": null}, "Number of admissions": {"type": "bigint", "index": 5, "name": "Number of admissions", "comment": null}, "Number of discharges": {"type": "bigint", "index": 6, "name": "Number of discharges", "comment": null}, "Number of deaths": {"type": "bigint", "index": 7, "name": "Number of deaths", "comment": null}, "Number of transfers into location": {"type": "bigint", "index": 8, "name": "Number of transfers into location", "comment": null}, "Number of transfers out of location": {"type": "bigint", "index": 9, "name": "Number of transfers out of location", "comment": null}, "Average length of stay": {"type": "numeric", "index": 10, "name": "Average length of stay", "comment": null}, "Number of patient days": {"type": "numeric", "index": 11, "name": "Number of patient days", "comment": null}, "Bed occupancy (%)": {"type": "text", "index": 12, "name": "Bed occupancy (%)", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.hospital-admissions-by-location-summary"}, "model.tamanu_source_dbt.imaging-requests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging-requests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 10, "name": "Area", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 11, "name": "Request ID", "comment": null}, "Request date and time": {"type": "text", "index": 12, "name": "Request date and time", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 13, "name": "Supervising clinician", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 14, "name": "Requesting clinician", "comment": null}, "Priority": {"type": "character varying", "index": 15, "name": "Priority", "comment": null}, "Imaging type": {"type": "text", "index": 16, "name": "Imaging type", "comment": null}, "Area to be imaged": {"type": "text", "index": 17, "name": "Area to be imaged", "comment": null}, "Status": {"type": "text", "index": 18, "name": "Status", "comment": null}, "Completed date and time": {"type": "text", "index": 19, "name": "Completed date and time", "comment": null}, "Reason for cancellation": {"type": "text", "index": 20, "name": "Reason for cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging-requests-line-list"}, "model.tamanu_source_dbt.imaging-requests-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging-requests-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date": {"type": "text", "index": 1, "name": "Date", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 3, "name": "Department", "comment": null}, "Imaging type": {"type": "text", "index": 4, "name": "Imaging type", "comment": null}, "Total new requests": {"type": "bigint", "index": 5, "name": "Total new requests", "comment": null}, "Total requests with a status of pending": {"type": "bigint", "index": 6, "name": "Total requests with a status of pending", "comment": null}, "Total requests completed": {"type": "bigint", "index": 7, "name": "Total requests completed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging-requests-summary"}, "model.tamanu_source_dbt.imaging_area_external_codes": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging_area_external_codes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "area_id": {"type": "character varying(255)", "index": 2, "name": "area_id", "comment": null}, "code": {"type": "text", "index": 3, "name": "code", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging_area_external_codes"}, "model.tamanu_source_dbt.imaging_request_areas": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging_request_areas", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "imaging_request_id": {"type": "character varying", "index": 2, "name": "imaging_request_id", "comment": null}, "area_id": {"type": "character varying(255)", "index": 3, "name": "area_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging_request_areas"}, "model.tamanu_source_dbt.imaging_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 3, "name": "datetime", "comment": null}, "status": {"type": "character varying(255)", "index": 4, "name": "status", "comment": null}, "priority": {"type": "character varying(255)", "index": 5, "name": "priority", "comment": null}, "imaging_type": {"type": "character varying(31)", "index": 6, "name": "imaging_type", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 8, "name": "requested_by_id", "comment": null}, "completed_by_id": {"type": "character varying(255)", "index": 9, "name": "completed_by_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 10, "name": "location_id", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 11, "name": "location_group_id", "comment": null}, "reason_for_cancellation": {"type": "character varying(1024)", "index": 12, "name": "reason_for_cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging_requests"}, "model.tamanu_source_dbt.imaging_results": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "imaging_results", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "description": {"type": "text", "index": 3, "name": "description", "comment": null}, "imaging_request_id": {"type": "character varying", "index": 4, "name": "imaging_request_id", "comment": null}, "external_code": {"type": "text", "index": 5, "name": "external_code", "comment": null}, "completed_by_id": {"type": "character varying(255)", "index": 6, "name": "completed_by_id", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.imaging_results"}, "model.tamanu_source_dbt.incomplete-referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "incomplete-referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Diagnoses": {"type": "text", "index": 4, "name": "Diagnoses", "comment": null}, "Referral name": {"type": "character varying(255)", "index": 5, "name": "Referral name", "comment": null}, "Referring doctor": {"type": "character varying(255)", "index": 6, "name": "Referring doctor", "comment": null}, "Referral date": {"type": "text", "index": 7, "name": "Referral date", "comment": null}, "Department": {"type": "character varying(255)", "index": 8, "name": "Department", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.incomplete-referrals"}, "model.tamanu_source_dbt.invoice-products-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice-products-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"ID": {"type": "character varying(255)", "index": 1, "name": "ID", "comment": null}, "Product name": {"type": "text", "index": 2, "name": "Product name", "comment": null}, "Insurable": {"type": "boolean", "index": 3, "name": "Insurable", "comment": null}, "Category": {"type": "character varying(255)", "index": 4, "name": "Category", "comment": null}, "Category ID": {"type": "character varying(255)", "index": 5, "name": "Category ID", "comment": null}, "Visibility status": {"type": "character varying(255)", "index": 6, "name": "Visibility status", "comment": null}, "Lab external code": {"type": "text", "index": 7, "name": "Lab external code", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice-products-summary"}, "model.tamanu_source_dbt.invoice_insurance_plan_items": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_insurance_plan_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "invoice_insurance_plan_id": {"type": "text", "index": 2, "name": "invoice_insurance_plan_id", "comment": null}, "invoice_product_id": {"type": "text", "index": 3, "name": "invoice_product_id", "comment": null}, "coverage_value": {"type": "numeric", "index": 4, "name": "coverage_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_insurance_plan_items"}, "model.tamanu_source_dbt.invoice_insurance_plans": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_insurance_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "name": {"type": "character varying(255)", "index": 2, "name": "name", "comment": null}, "code": {"type": "character varying(255)", "index": 3, "name": "code", "comment": null}, "default_coverage": {"type": "numeric", "index": 4, "name": "default_coverage", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_insurance_plans"}, "model.tamanu_source_dbt.invoice_items": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_id": {"type": "uuid", "index": 2, "name": "invoice_id", "comment": null}, "date": {"type": "date", "index": 3, "name": "date", "comment": null}, "product_id": {"type": "character varying(255)", "index": 4, "name": "product_id", "comment": null}, "product_code_final": {"type": "character varying(255)", "index": 5, "name": "product_code_final", "comment": null}, "product_name_final": {"type": "character varying(255)", "index": 6, "name": "product_name_final", "comment": null}, "price_final": {"type": "numeric", "index": 7, "name": "price_final", "comment": null}, "manual_entry_price": {"type": "numeric", "index": 8, "name": "manual_entry_price", "comment": null}, "quantity": {"type": "integer", "index": 9, "name": "quantity", "comment": null}, "ordered_by_user_id": {"type": "character varying(255)", "index": 10, "name": "ordered_by_user_id", "comment": null}, "approved": {"type": "boolean", "index": 11, "name": "approved", "comment": null}, "source_record_type": {"type": "character varying(255)", "index": 12, "name": "source_record_type", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 13, "name": "source_record_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_items"}, "model.tamanu_source_dbt.invoice_price_list_items": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_price_list_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "invoice_price_list_id": {"type": "text", "index": 2, "name": "invoice_price_list_id", "comment": null}, "invoice_product_id": {"type": "text", "index": 3, "name": "invoice_product_id", "comment": null}, "price": {"type": "numeric", "index": 4, "name": "price", "comment": null}, "is_hidden": {"type": "boolean", "index": 5, "name": "is_hidden", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_price_list_items"}, "model.tamanu_source_dbt.invoice_price_lists": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_price_lists", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "name": {"type": "character varying(255)", "index": 2, "name": "name", "comment": null}, "code": {"type": "character varying(255)", "index": 3, "name": "code", "comment": null}, "visibility_status": {"type": "text", "index": 4, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_price_lists"}, "model.tamanu_source_dbt.invoice_products": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoice_products", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "insurable": {"type": "boolean", "index": 3, "name": "insurable", "comment": null}, "category": {"type": "character varying(255)", "index": 4, "name": "category", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 5, "name": "source_record_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 6, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoice_products"}, "model.tamanu_source_dbt.invoices": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "invoices", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 3, "name": "datetime", "comment": null}, "status": {"type": "character varying(255)", "index": 4, "name": "status", "comment": null}, "patient_payment_status": {"type": "character varying(255)", "index": 5, "name": "patient_payment_status", "comment": null}, "insurer_payment_status": {"type": "character varying(255)", "index": 6, "name": "insurer_payment_status", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.invoices"}, "model.tamanu_source_dbt.lab-requests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab-requests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Location": {"type": "text", "index": 10, "name": "Location", "comment": null}, "Laboratory": {"type": "text", "index": 11, "name": "Laboratory", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 12, "name": "Request ID", "comment": null}, "Status": {"type": "character varying", "index": 13, "name": "Status", "comment": null}, "Lab request date and time": {"type": "text", "index": 14, "name": "Lab request date and time", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 15, "name": "Requesting clinician", "comment": null}, "Requesting department": {"type": "character varying(255)", "index": 16, "name": "Requesting department", "comment": null}, "Priority": {"type": "text", "index": 17, "name": "Priority", "comment": null}, "Test category": {"type": "text", "index": 18, "name": "Test category", "comment": null}, "Test requested": {"type": "text", "index": 19, "name": "Test requested", "comment": null}, "Sample collection date and time": {"type": "text", "index": 20, "name": "Sample collection date and time", "comment": null}, "Sample collected by": {"type": "character varying(255)", "index": 21, "name": "Sample collected by", "comment": null}, "Specimen type": {"type": "text", "index": 22, "name": "Specimen type", "comment": null}, "Site": {"type": "text", "index": 23, "name": "Site", "comment": null}, "Completed date and time": {"type": "text", "index": 24, "name": "Completed date and time", "comment": null}, "Reason for cancellation": {"type": "character varying", "index": 25, "name": "Reason for cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab-requests-line-list"}, "model.tamanu_source_dbt.lab-requests-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab-requests-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date": {"type": "text", "index": 1, "name": "Date", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 3, "name": "Department", "comment": null}, "Test category": {"type": "text", "index": 4, "name": "Test category", "comment": null}, "Total new requests": {"type": "bigint", "index": 5, "name": "Total new requests", "comment": null}, "Total requests with a status of results pending": {"type": "bigint", "index": 6, "name": "Total requests with a status of results pending", "comment": null}, "Total requests published": {"type": "bigint", "index": 7, "name": "Total requests published", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab-requests-summary"}, "model.tamanu_source_dbt.lab-tests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab-tests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Requesting department": {"type": "character varying(255)", "index": 10, "name": "Requesting department", "comment": null}, "Location": {"type": "text", "index": 11, "name": "Location", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 12, "name": "Request ID", "comment": null}, "Status": {"type": "character varying", "index": 13, "name": "Status", "comment": null}, "Lab test panel": {"type": "character varying(255)", "index": 14, "name": "Lab test panel", "comment": null}, "Test category": {"type": "text", "index": 15, "name": "Test category", "comment": null}, "Lab request date and time": {"type": "text", "index": 16, "name": "Lab request date and time", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 17, "name": "Requesting clinician", "comment": null}, "Lab request published date and time": {"type": "text", "index": 18, "name": "Lab request published date and time", "comment": null}, "Lab test date": {"type": "text", "index": 19, "name": "Lab test date", "comment": null}, "Result": {"type": "text", "index": 20, "name": "Result", "comment": null}, "Verification": {"type": "character varying(255)", "index": 21, "name": "Verification", "comment": null}, "Lab test type": {"type": "character varying(255)", "index": 22, "name": "Lab test type", "comment": null}, "Lab test completed date and time": {"type": "text", "index": 23, "name": "Lab test completed date and time", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab-tests-line-list"}, "model.tamanu_source_dbt.lab_request_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_request_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 4, "name": "lab_request_id", "comment": null}, "status": {"type": "character varying(31)", "index": 5, "name": "status", "comment": null}, "updated_by_id": {"type": "character varying(255)", "index": 6, "name": "updated_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_request_logs"}, "model.tamanu_source_dbt.lab_request_logs_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_request_logs_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_request_logs_metadata"}, "model.tamanu_source_dbt.lab_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}, "display_id": {"type": "character varying(255)", "index": 4, "name": "display_id", "comment": null}, "is_urgent": {"type": "boolean", "index": 5, "name": "is_urgent", "comment": null}, "status": {"type": "character varying(255)", "index": 6, "name": "status", "comment": null}, "requested_datetime": {"type": "timestamp without time zone", "index": 7, "name": "requested_datetime", "comment": null}, "lab_test_priority_id": {"type": "character varying(255)", "index": 8, "name": "lab_test_priority_id", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 9, "name": "lab_test_category_id", "comment": null}, "lab_test_panel_request_id": {"type": "uuid", "index": 10, "name": "lab_test_panel_request_id", "comment": null}, "lab_test_laboratory_id": {"type": "character varying(255)", "index": 11, "name": "lab_test_laboratory_id", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 12, "name": "requested_by_id", "comment": null}, "is_specimen_collected": {"type": "boolean", "index": 13, "name": "is_specimen_collected", "comment": null}, "specimen_type_id": {"type": "character varying(255)", "index": 14, "name": "specimen_type_id", "comment": null}, "lab_sample_site_id": {"type": "character varying(255)", "index": 15, "name": "lab_sample_site_id", "comment": null}, "collected_datetime": {"type": "timestamp without time zone", "index": 16, "name": "collected_datetime", "comment": null}, "collected_by_id": {"type": "character varying(255)", "index": 17, "name": "collected_by_id", "comment": null}, "reason_for_cancellation": {"type": "character varying(31)", "index": 18, "name": "reason_for_cancellation", "comment": null}, "published_datetime": {"type": "timestamp without time zone", "index": 19, "name": "published_datetime", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 20, "name": "encounter_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 21, "name": "department_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_requests"}, "model.tamanu_source_dbt.lab_requests_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_requests_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_requests_metadata"}, "model.tamanu_source_dbt.lab_test_panel_lab_test_types": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_test_panel_lab_test_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 2, "name": "lab_test_panel_id", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 3, "name": "lab_test_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_test_panel_lab_test_types"}, "model.tamanu_source_dbt.lab_test_panel_requests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_test_panel_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 2, "name": "lab_test_panel_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 3, "name": "encounter_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_test_panel_requests"}, "model.tamanu_source_dbt.lab_test_panels": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_test_panels", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "external_code": {"type": "text", "index": 3, "name": "external_code", "comment": null}, "name": {"type": "character varying(255)", "index": 4, "name": "name", "comment": null}, "category_id": {"type": "character varying(255)", "index": 5, "name": "category_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 6, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_test_panels"}, "model.tamanu_source_dbt.lab_test_types": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_test_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "external_code": {"type": "text", "index": 3, "name": "external_code", "comment": null}, "name": {"type": "character varying(255)", "index": 4, "name": "name", "comment": null}, "unit": {"type": "character varying(255)", "index": 5, "name": "unit", "comment": null}, "male_min": {"type": "double precision", "index": 6, "name": "male_min", "comment": null}, "male_max": {"type": "double precision", "index": 7, "name": "male_max", "comment": null}, "female_min": {"type": "double precision", "index": 8, "name": "female_min", "comment": null}, "female_max": {"type": "double precision", "index": 9, "name": "female_max", "comment": null}, "result_type": {"type": "character varying(255)", "index": 10, "name": "result_type", "comment": null}, "options": {"type": "text", "index": 11, "name": "options", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 12, "name": "lab_test_category_id", "comment": null}, "visibility_status": {"type": "text", "index": 13, "name": "visibility_status", "comment": null}, "is_sensitive": {"type": "boolean", "index": 14, "name": "is_sensitive", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_test_types"}, "model.tamanu_source_dbt.lab_tests": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "lab_tests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "date": {"type": "date", "index": 2, "name": "date", "comment": null}, "result": {"type": "text", "index": 3, "name": "result", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 4, "name": "lab_request_id", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 5, "name": "lab_test_type_id", "comment": null}, "lab_test_method_id": {"type": "character varying(255)", "index": 6, "name": "lab_test_method_id", "comment": null}, "laboratory_officer": {"type": "character varying(255)", "index": 7, "name": "laboratory_officer", "comment": null}, "completed_datetime": {"type": "timestamp without time zone", "index": 8, "name": "completed_datetime", "comment": null}, "verification": {"type": "character varying(255)", "index": 9, "name": "verification", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.lab_tests"}, "model.tamanu_source_dbt.location-bookings-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "location-bookings-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Booking start date and time": {"type": "text", "index": 9, "name": "Booking start date and time", "comment": null}, "Booking end date and time": {"type": "text", "index": 10, "name": "Booking end date and time", "comment": null}, "Booking duration": {"type": "text", "index": 11, "name": "Booking duration", "comment": null}, "Area": {"type": "character varying(255)", "index": 12, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 13, "name": "Location", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 14, "name": "Clinician", "comment": null}, "Booking type": {"type": "text", "index": 15, "name": "Booking type", "comment": null}, "Booking status": {"type": "character varying(255)", "index": 16, "name": "Booking status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.location-bookings-line-list"}, "model.tamanu_source_dbt.location_bookings": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "location_bookings", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 2, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 3, "name": "end_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 5, "name": "clinician_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 7, "name": "location_id", "comment": null}, "booking_type_id": {"type": "character varying(255)", "index": 8, "name": "booking_type_id", "comment": null}, "is_high_priority": {"type": "boolean", "index": 9, "name": "is_high_priority", "comment": null}, "status": {"type": "character varying(255)", "index": 10, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.location_bookings"}, "model.tamanu_source_dbt.location_groups": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "location_groups", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.location_groups"}, "model.tamanu_source_dbt.locations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "locations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "max_occupancy": {"type": "integer", "index": 4, "name": "max_occupancy", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 5, "name": "location_group_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 6, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.locations"}, "model.tamanu_source_dbt.medication-dispensed-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "medication-dispensed-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Medication": {"type": "text", "index": 1, "name": "Medication", "comment": null}, "Code": {"type": "character varying(255)", "index": 2, "name": "Code", "comment": null}, "Quantity": {"type": "bigint", "index": 3, "name": "Quantity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.medication-dispensed-summary"}, "model.tamanu_source_dbt.medication_dispenses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "medication_dispenses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "pharmacy_order_prescription_id": {"type": "uuid", "index": 2, "name": "pharmacy_order_prescription_id", "comment": null}, "quantity": {"type": "integer", "index": 3, "name": "quantity", "comment": null}, "dispensed_at": {"type": "timestamp without time zone", "index": 4, "name": "dispensed_at", "comment": null}, "dispensed_by_user_id": {"type": "character varying(255)", "index": 5, "name": "dispensed_by_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.medication_dispenses"}, "model.tamanu_source_dbt.notes": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "notes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "content": {"type": "text", "index": 3, "name": "content", "comment": null}, "note_type_id": {"type": "character varying(255)", "index": 4, "name": "note_type_id", "comment": null}, "note_type": {"type": "text", "index": 5, "name": "note_type", "comment": null}, "record_type": {"type": "character varying(255)", "index": 6, "name": "record_type", "comment": null}, "record_id": {"type": "character varying(255)", "index": 7, "name": "record_id", "comment": null}, "authored_by_id": {"type": "character varying(255)", "index": 8, "name": "authored_by_id", "comment": null}, "on_behalf_of_id": {"type": "character varying(255)", "index": 9, "name": "on_behalf_of_id", "comment": null}, "updated_note_id": {"type": "uuid", "index": 10, "name": "updated_note_id", "comment": null}, "visibility_status": {"type": "text", "index": 11, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.notes"}, "model.tamanu_source_dbt.ongoing-conditions-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "ongoing-conditions-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Ongoing condition": {"type": "text", "index": 8, "name": "Ongoing condition", "comment": null}, "Date recorded": {"type": "text", "index": 9, "name": "Date recorded", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 10, "name": "Clinician", "comment": null}, "Date resolved": {"type": "text", "index": 11, "name": "Date resolved", "comment": null}, "Clinician confirming resolution": {"type": "character varying", "index": 12, "name": "Clinician confirming resolution", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.ongoing-conditions-line-list"}, "model.tamanu_source_dbt.outpatient-appointments-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "outpatient-appointments-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Contact number": {"type": "character varying(255)", "index": 7, "name": "Contact number", "comment": null}, "Village": {"type": "text", "index": 8, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 9, "name": "Billing type", "comment": null}, "Appointment date and time": {"type": "text", "index": 10, "name": "Appointment date and time", "comment": null}, "Appointment end date and time": {"type": "text", "index": 11, "name": "Appointment end date and time", "comment": null}, "Appointment type": {"type": "text", "index": 12, "name": "Appointment type", "comment": null}, "Appointment status": {"type": "character varying(255)", "index": 13, "name": "Appointment status", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 14, "name": "Clinician", "comment": null}, "Area": {"type": "character varying(255)", "index": 15, "name": "Area", "comment": null}, "Priority appointment": {"type": "text", "index": 16, "name": "Priority appointment", "comment": null}, "Repeating appointment": {"type": "text", "index": 17, "name": "Repeating appointment", "comment": null}, "Repeating appointment end date": {"type": "text", "index": 18, "name": "Repeating appointment end date", "comment": null}, "Appointment created by": {"type": "character varying(255)", "index": 19, "name": "Appointment created by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.outpatient-appointments-line-list"}, "model.tamanu_source_dbt.outpatient_appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "outpatient_appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 2, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 3, "name": "end_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 5, "name": "clinician_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "schedule_id": {"type": "uuid", "index": 7, "name": "schedule_id", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 8, "name": "location_group_id", "comment": null}, "appointment_type_id": {"type": "character varying(255)", "index": 9, "name": "appointment_type_id", "comment": null}, "priority": {"type": "text", "index": 10, "name": "priority", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "until_date": {"type": "date", "index": 12, "name": "until_date", "comment": null}, "interval": {"type": "integer", "index": 13, "name": "interval", "comment": null}, "days_of_week": {"type": "character varying(255)[]", "index": 14, "name": "days_of_week", "comment": null}, "frequency": {"type": "character varying(255)", "index": 15, "name": "frequency", "comment": null}, "nth_weekday": {"type": "integer", "index": 16, "name": "nth_weekday", "comment": null}, "occurrence_count": {"type": "integer", "index": 17, "name": "occurrence_count", "comment": null}, "is_fully_generated": {"type": "boolean", "index": 18, "name": "is_fully_generated", "comment": null}, "generated_until_date": {"type": "date_string", "index": 19, "name": "generated_until_date", "comment": null}, "cancelled_at_date": {"type": "date_string", "index": 20, "name": "cancelled_at_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.outpatient_appointments"}, "model.tamanu_source_dbt.outpatient_appointments_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "outpatient_appointments_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"change_id": {"type": "uuid", "index": 1, "name": "change_id", "comment": null}, "appointment_id": {"type": "text", "index": 2, "name": "appointment_id", "comment": null}, "modified_datetime": {"type": "timestamp with time zone", "index": 3, "name": "modified_datetime", "comment": null}, "modified_by_user_id": {"type": "text", "index": 4, "name": "modified_by_user_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 5, "name": "created_by_user_id", "comment": null}, "patient_id": {"type": "text", "index": 6, "name": "patient_id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 7, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 8, "name": "end_datetime", "comment": null}, "clinician_id": {"type": "text", "index": 9, "name": "clinician_id", "comment": null}, "location_group_id": {"type": "text", "index": 10, "name": "location_group_id", "comment": null}, "appointment_type_id": {"type": "text", "index": 11, "name": "appointment_type_id", "comment": null}, "is_high_priority": {"type": "boolean", "index": 12, "name": "is_high_priority", "comment": null}, "status": {"type": "text", "index": 13, "name": "status", "comment": null}, "schedule_id": {"type": "uuid", "index": 14, "name": "schedule_id", "comment": null}, "prev_start_datetime": {"type": "timestamp without time zone", "index": 15, "name": "prev_start_datetime", "comment": null}, "prev_end_datetime": {"type": "timestamp without time zone", "index": 16, "name": "prev_end_datetime", "comment": null}, "prev_clinician_id": {"type": "text", "index": 17, "name": "prev_clinician_id", "comment": null}, "prev_location_group_id": {"type": "text", "index": 18, "name": "prev_location_group_id", "comment": null}, "prev_appointment_type_id": {"type": "text", "index": 19, "name": "prev_appointment_type_id", "comment": null}, "prev_is_high_priority": {"type": "boolean", "index": 20, "name": "prev_is_high_priority", "comment": null}, "prev_status": {"type": "text", "index": 21, "name": "prev_status", "comment": null}, "change_sequence": {"type": "bigint", "index": 22, "name": "change_sequence", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.outpatient_appointments_change_logs"}, "model.tamanu_source_dbt.patient-emergency-encounters-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient-emergency-encounters-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 7, "name": "Facility", "comment": null}, "Number of triage records": {"type": "bigint", "index": 8, "name": "Number of triage records", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient-emergency-encounters-summary"}, "model.tamanu_source_dbt.patient_additional_data": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_additional_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "title": {"type": "character varying(255)", "index": 2, "name": "title", "comment": null}, "marital_status": {"type": "character varying(255)", "index": 3, "name": "marital_status", "comment": null}, "primary_contact_number": {"type": "character varying(255)", "index": 4, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "character varying(255)", "index": 5, "name": "secondary_contact_number", "comment": null}, "emergency_contact_name": {"type": "character varying(255)", "index": 6, "name": "emergency_contact_name", "comment": null}, "emergency_contact_number": {"type": "character varying(255)", "index": 7, "name": "emergency_contact_number", "comment": null}, "social_media": {"type": "character varying(255)", "index": 8, "name": "social_media", "comment": null}, "ethnicity_id": {"type": "character varying(255)", "index": 9, "name": "ethnicity_id", "comment": null}, "religion_id": {"type": "character varying(255)", "index": 10, "name": "religion_id", "comment": null}, "nationality_id": {"type": "character varying(255)", "index": 11, "name": "nationality_id", "comment": null}, "secondary_village_id": {"type": "text", "index": 12, "name": "secondary_village_id", "comment": null}, "country_id": {"type": "character varying(255)", "index": 13, "name": "country_id", "comment": null}, "division_id": {"type": "character varying(255)", "index": 14, "name": "division_id", "comment": null}, "subdivision_id": {"type": "character varying(255)", "index": 15, "name": "subdivision_id", "comment": null}, "medical_area_id": {"type": "character varying(255)", "index": 16, "name": "medical_area_id", "comment": null}, "nursing_zone_id": {"type": "character varying(255)", "index": 17, "name": "nursing_zone_id", "comment": null}, "settlement_id": {"type": "character varying(255)", "index": 18, "name": "settlement_id", "comment": null}, "city_town": {"type": "character varying(255)", "index": 19, "name": "city_town", "comment": null}, "street_village": {"type": "character varying(255)", "index": 20, "name": "street_village", "comment": null}, "country_of_birth_id": {"type": "character varying(255)", "index": 21, "name": "country_of_birth_id", "comment": null}, "place_of_birth": {"type": "character varying(255)", "index": 22, "name": "place_of_birth", "comment": null}, "birth_certificate": {"type": "character varying(255)", "index": 23, "name": "birth_certificate", "comment": null}, "driving_license": {"type": "character varying(255)", "index": 24, "name": "driving_license", "comment": null}, "passport": {"type": "character varying(255)", "index": 25, "name": "passport", "comment": null}, "educational_level": {"type": "character varying(255)", "index": 26, "name": "educational_level", "comment": null}, "occupation_id": {"type": "character varying(255)", "index": 27, "name": "occupation_id", "comment": null}, "blood_type": {"type": "character varying(255)", "index": 28, "name": "blood_type", "comment": null}, "patient_billing_type_id": {"type": "character varying(255)", "index": 29, "name": "patient_billing_type_id", "comment": null}, "health_center_id": {"type": "text", "index": 30, "name": "health_center_id", "comment": null}, "insurer_id": {"type": "character varying(255)", "index": 31, "name": "insurer_id", "comment": null}, "insurer_policy_number": {"type": "character varying(255)", "index": 32, "name": "insurer_policy_number", "comment": null}, "mother_id": {"type": "character varying(255)", "index": 33, "name": "mother_id", "comment": null}, "father_id": {"type": "character varying(255)", "index": 34, "name": "father_id", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 35, "name": "registered_by_id", "comment": null}, "updated_by_field": {"type": "json", "index": 36, "name": "updated_by_field", "comment": null}, "registration_date": {"type": "date", "index": 37, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_additional_data"}, "model.tamanu_source_dbt.patient_additional_data_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_additional_data_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp without time zone", "index": 2, "name": "logged_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 3, "name": "updated_by_user_id", "comment": null}, "patient_id": {"type": "text", "index": 4, "name": "patient_id", "comment": null}, "title": {"type": "text", "index": 5, "name": "title", "comment": null}, "marital_status": {"type": "text", "index": 6, "name": "marital_status", "comment": null}, "primary_contact_number": {"type": "text", "index": 7, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "text", "index": 8, "name": "secondary_contact_number", "comment": null}, "emergency_contact_name": {"type": "text", "index": 9, "name": "emergency_contact_name", "comment": null}, "emergency_contact_number": {"type": "text", "index": 10, "name": "emergency_contact_number", "comment": null}, "social_media": {"type": "text", "index": 11, "name": "social_media", "comment": null}, "ethnicity_id": {"type": "text", "index": 12, "name": "ethnicity_id", "comment": null}, "religion_id": {"type": "text", "index": 13, "name": "religion_id", "comment": null}, "nationality_id": {"type": "text", "index": 14, "name": "nationality_id", "comment": null}, "secondary_village_id": {"type": "text", "index": 15, "name": "secondary_village_id", "comment": null}, "country_id": {"type": "text", "index": 16, "name": "country_id", "comment": null}, "division_id": {"type": "text", "index": 17, "name": "division_id", "comment": null}, "subdivision_id": {"type": "text", "index": 18, "name": "subdivision_id", "comment": null}, "medical_area_id": {"type": "text", "index": 19, "name": "medical_area_id", "comment": null}, "nursing_zone_id": {"type": "text", "index": 20, "name": "nursing_zone_id", "comment": null}, "settlement_id": {"type": "text", "index": 21, "name": "settlement_id", "comment": null}, "city_town": {"type": "text", "index": 22, "name": "city_town", "comment": null}, "street_village": {"type": "text", "index": 23, "name": "street_village", "comment": null}, "country_of_birth_id": {"type": "text", "index": 24, "name": "country_of_birth_id", "comment": null}, "place_of_birth": {"type": "text", "index": 25, "name": "place_of_birth", "comment": null}, "birth_certificate": {"type": "text", "index": 26, "name": "birth_certificate", "comment": null}, "driving_license": {"type": "text", "index": 27, "name": "driving_license", "comment": null}, "passport": {"type": "text", "index": 28, "name": "passport", "comment": null}, "educational_level": {"type": "text", "index": 29, "name": "educational_level", "comment": null}, "occupation_id": {"type": "text", "index": 30, "name": "occupation_id", "comment": null}, "blood_type": {"type": "text", "index": 31, "name": "blood_type", "comment": null}, "patient_billing_type_id": {"type": "text", "index": 32, "name": "patient_billing_type_id", "comment": null}, "health_center_id": {"type": "text", "index": 33, "name": "health_center_id", "comment": null}, "insurer_id": {"type": "text", "index": 34, "name": "insurer_id", "comment": null}, "insurer_policy_number": {"type": "text", "index": 35, "name": "insurer_policy_number", "comment": null}, "mother_id": {"type": "text", "index": 36, "name": "mother_id", "comment": null}, "father_id": {"type": "text", "index": 37, "name": "father_id", "comment": null}, "registered_by_id": {"type": "text", "index": 38, "name": "registered_by_id", "comment": null}, "updated_by_field": {"type": "jsonb", "index": 39, "name": "updated_by_field", "comment": null}, "registration_date": {"type": "date", "index": 40, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_additional_data_change_logs"}, "model.tamanu_source_dbt.patient_allergies": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_allergies", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "allergy_id": {"type": "character varying(255)", "index": 3, "name": "allergy_id", "comment": null}, "recorded_date": {"type": "date", "index": 4, "name": "recorded_date", "comment": null}, "recorded_by": {"type": "character varying(255)", "index": 5, "name": "recorded_by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_allergies"}, "model.tamanu_source_dbt.patient_birth_data": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_birth_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "birth_time": {"type": "time without time zone", "index": 2, "name": "birth_time", "comment": null}, "gestational_age_estimate": {"type": "double precision", "index": 3, "name": "gestational_age_estimate", "comment": null}, "attendant_at_birth": {"type": "character varying(255)", "index": 4, "name": "attendant_at_birth", "comment": null}, "name_of_attendant_at_birth": {"type": "character varying(255)", "index": 5, "name": "name_of_attendant_at_birth", "comment": null}, "birth_type": {"type": "character varying(255)", "index": 6, "name": "birth_type", "comment": null}, "birth_delivery_type": {"type": "character varying(255)", "index": 7, "name": "birth_delivery_type", "comment": null}, "birth_weight": {"type": "numeric", "index": 8, "name": "birth_weight", "comment": null}, "birth_length": {"type": "numeric", "index": 9, "name": "birth_length", "comment": null}, "apgar_score_one_minute": {"type": "integer", "index": 10, "name": "apgar_score_one_minute", "comment": null}, "apgar_score_five_minutes": {"type": "integer", "index": 11, "name": "apgar_score_five_minutes", "comment": null}, "apgar_score_ten_minutes": {"type": "integer", "index": 12, "name": "apgar_score_ten_minutes", "comment": null}, "registered_birth_place": {"type": "character varying(255)", "index": 13, "name": "registered_birth_place", "comment": null}, "birth_facility_id": {"type": "character varying(255)", "index": 14, "name": "birth_facility_id", "comment": null}, "registration_date": {"type": "date", "index": 15, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_birth_data"}, "model.tamanu_source_dbt.patient_care_plans": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_care_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "care_plan_datetime": {"type": "timestamp without time zone", "index": 2, "name": "care_plan_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 4, "name": "clinician_id", "comment": null}, "care_plan_id": {"type": "character varying(255)", "index": 5, "name": "care_plan_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_care_plans"}, "model.tamanu_source_dbt.patient_conditions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "recorded_datetime": {"type": "timestamp without time zone", "index": 2, "name": "recorded_datetime", "comment": null}, "note": {"type": "character varying(255)", "index": 3, "name": "note", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 4, "name": "condition_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 5, "name": "patient_id", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 6, "name": "recorded_by_id", "comment": null}, "is_resolved": {"type": "boolean", "index": 7, "name": "is_resolved", "comment": null}, "resolved_datetime": {"type": "timestamp without time zone", "index": 8, "name": "resolved_datetime", "comment": null}, "resolved_by_id": {"type": "character varying(255)", "index": 9, "name": "resolved_by_id", "comment": null}, "resolution_note": {"type": "text", "index": 10, "name": "resolution_note", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_conditions"}, "model.tamanu_source_dbt.patient_death_contributing_causes": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_death_contributing_causes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "mins_after_onset": {"type": "integer", "index": 2, "name": "mins_after_onset", "comment": null}, "patient_death_data_id": {"type": "character varying(255)", "index": 3, "name": "patient_death_data_id", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 4, "name": "condition_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_death_contributing_causes"}, "model.tamanu_source_dbt.patient_death_data": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_death_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "manner": {"type": "character varying(255)", "index": 2, "name": "manner", "comment": null}, "had_recent_surgery": {"type": "character varying(255)", "index": 3, "name": "had_recent_surgery", "comment": null}, "last_surgery_date": {"type": "date", "index": 4, "name": "last_surgery_date", "comment": null}, "last_surgery_reason_id": {"type": "character varying(255)", "index": 5, "name": "last_surgery_reason_id", "comment": null}, "external_cause_date": {"type": "date", "index": 6, "name": "external_cause_date", "comment": null}, "external_cause_location": {"type": "character varying(255)", "index": 7, "name": "external_cause_location", "comment": null}, "external_cause_notes": {"type": "text", "index": 8, "name": "external_cause_notes", "comment": null}, "was_pregnant": {"type": "character varying(255)", "index": 9, "name": "was_pregnant", "comment": null}, "pregnancy_contributed": {"type": "character varying(255)", "index": 10, "name": "pregnancy_contributed", "comment": null}, "was_fetal_or_infant": {"type": "boolean", "index": 11, "name": "was_fetal_or_infant", "comment": null}, "was_stillborn": {"type": "character varying(255)", "index": 12, "name": "was_stillborn", "comment": null}, "birth_weight": {"type": "integer", "index": 13, "name": "birth_weight", "comment": null}, "was_within_day_of_birth": {"type": "boolean", "index": 14, "name": "was_within_day_of_birth", "comment": null}, "hours_survived_since_birth": {"type": "integer", "index": 15, "name": "hours_survived_since_birth", "comment": null}, "carrier_age": {"type": "integer", "index": 16, "name": "carrier_age", "comment": null}, "carrier_pregnancy_weeks": {"type": "integer", "index": 17, "name": "carrier_pregnancy_weeks", "comment": null}, "was_outside_health_facility": {"type": "boolean", "index": 18, "name": "was_outside_health_facility", "comment": null}, "primary_cause_mins_after_onset": {"type": "integer", "index": 19, "name": "primary_cause_mins_after_onset", "comment": null}, "primary_cause_condition_id": {"type": "character varying(255)", "index": 20, "name": "primary_cause_condition_id", "comment": null}, "antecedent_cause1_mins_after_onset": {"type": "integer", "index": 21, "name": "antecedent_cause1_mins_after_onset", "comment": null}, "antecedent_cause1_condition_id": {"type": "character varying(255)", "index": 22, "name": "antecedent_cause1_condition_id", "comment": null}, "antecedent_cause2_mins_after_onset": {"type": "integer", "index": 23, "name": "antecedent_cause2_mins_after_onset", "comment": null}, "antecedent_cause2_condition_id": {"type": "character varying(255)", "index": 24, "name": "antecedent_cause2_condition_id", "comment": null}, "antecedent_cause3_mins_after_onset": {"type": "integer", "index": 25, "name": "antecedent_cause3_mins_after_onset", "comment": null}, "antecedent_cause3_condition_id": {"type": "character varying(255)", "index": 26, "name": "antecedent_cause3_condition_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 27, "name": "patient_id", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 28, "name": "recorded_by_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 29, "name": "facility_id", "comment": null}, "is_final": {"type": "boolean", "index": 30, "name": "is_final", "comment": null}, "visibility_status": {"type": "text", "index": 31, "name": "visibility_status", "comment": null}, "autopsy_requested": {"type": "character varying(255)", "index": 32, "name": "autopsy_requested", "comment": null}, "autopsy_findings_used": {"type": "character varying(255)", "index": 33, "name": "autopsy_findings_used", "comment": null}, "manner_of_death_description": {"type": "text", "index": 34, "name": "manner_of_death_description", "comment": null}, "pregnancy_moment": {"type": "character varying(255)", "index": 35, "name": "pregnancy_moment", "comment": null}, "multiple_pregnancy": {"type": "character varying(255)", "index": 36, "name": "multiple_pregnancy", "comment": null}, "mother_condition_description": {"type": "text", "index": 37, "name": "mother_condition_description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_death_data"}, "model.tamanu_source_dbt.patient_facilities": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_facilities"}, "model.tamanu_source_dbt.patient_family_histories": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_family_histories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "recorded_datetime": {"type": "timestamp without time zone", "index": 2, "name": "recorded_datetime", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 3, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 4, "name": "clinician_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 5, "name": "diagnosis_id", "comment": null}, "relationship": {"type": "character varying(255)", "index": 6, "name": "relationship", "comment": null}, "note": {"type": "character varying(255)", "index": 7, "name": "note", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_family_histories"}, "model.tamanu_source_dbt.patient_field_values": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_field_values", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "definition_id": {"type": "character varying(255)", "index": 2, "name": "definition_id", "comment": null}, "value": {"type": "text", "index": 3, "name": "value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_field_values"}, "model.tamanu_source_dbt.patient_program_registration_conditions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_program_registration_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "program_registry_condition_id": {"type": "character varying(255)", "index": 3, "name": "program_registry_condition_id", "comment": null}, "patient_program_registration_id": {"type": "text", "index": 4, "name": "patient_program_registration_id", "comment": null}, "program_registry_condition_category_id": {"type": "text", "index": 5, "name": "program_registry_condition_category_id", "comment": null}, "reason_for_change": {"type": "character varying(255)", "index": 6, "name": "reason_for_change", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 7, "name": "recorded_by_id", "comment": null}, "deleted_datetime": {"type": "timestamp without time zone", "index": 8, "name": "deleted_datetime", "comment": null}, "deleted_by_id": {"type": "character varying(255)", "index": 9, "name": "deleted_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_program_registration_conditions"}, "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_program_registration_conditions_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 2, "name": "logged_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 3, "name": "updated_by_user_id", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 5, "name": "datetime", "comment": null}, "program_registry_condition_id": {"type": "text", "index": 6, "name": "program_registry_condition_id", "comment": null}, "patient_program_registration_id": {"type": "text", "index": 7, "name": "patient_program_registration_id", "comment": null}, "program_registry_condition_category_id": {"type": "text", "index": 8, "name": "program_registry_condition_category_id", "comment": null}, "reason_for_change": {"type": "text", "index": 9, "name": "reason_for_change", "comment": null}, "recorded_by_id": {"type": "text", "index": 10, "name": "recorded_by_id", "comment": null}, "deleted_datetime": {"type": "timestamp without time zone", "index": 11, "name": "deleted_datetime", "comment": null}, "deleted_by_id": {"type": "text", "index": 12, "name": "deleted_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_program_registration_conditions_change_logs"}, "model.tamanu_source_dbt.patient_program_registrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_program_registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "registration_status": {"type": "text", "index": 3, "name": "registration_status", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 4, "name": "patient_id", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 5, "name": "program_registry_id", "comment": null}, "clinical_status_id": {"type": "character varying(255)", "index": 6, "name": "clinical_status_id", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 7, "name": "registered_by_id", "comment": null}, "registering_facility_id": {"type": "character varying(255)", "index": 8, "name": "registering_facility_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 9, "name": "facility_id", "comment": null}, "village_id": {"type": "character varying(255)", "index": 10, "name": "village_id", "comment": null}, "deactivated_by_id": {"type": "character varying(255)", "index": 11, "name": "deactivated_by_id", "comment": null}, "deactivated_datetime": {"type": "timestamp without time zone", "index": 12, "name": "deactivated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_program_registrations"}, "model.tamanu_source_dbt.patient_program_registrations_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_program_registrations_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 2, "name": "logged_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 3, "name": "updated_by_user_id", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 5, "name": "datetime", "comment": null}, "registration_status": {"type": "text", "index": 6, "name": "registration_status", "comment": null}, "patient_id": {"type": "text", "index": 7, "name": "patient_id", "comment": null}, "program_registry_id": {"type": "text", "index": 8, "name": "program_registry_id", "comment": null}, "clinical_status_id": {"type": "text", "index": 9, "name": "clinical_status_id", "comment": null}, "registered_by_id": {"type": "text", "index": 10, "name": "registered_by_id", "comment": null}, "registering_facility_id": {"type": "text", "index": 11, "name": "registering_facility_id", "comment": null}, "facility_id": {"type": "text", "index": 12, "name": "facility_id", "comment": null}, "village_id": {"type": "text", "index": 13, "name": "village_id", "comment": null}, "deactivated_by_id": {"type": "text", "index": 14, "name": "deactivated_by_id", "comment": null}, "deactivated_datetime": {"type": "timestamp without time zone", "index": 15, "name": "deactivated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_program_registrations_change_logs"}, "model.tamanu_source_dbt.patient_vaccinations_upcoming": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patient_vaccinations_upcoming", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "vaccine_schedules_id": {"type": "character varying(255)", "index": 2, "name": "vaccine_schedules_id", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 3, "name": "vaccine_category", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 4, "name": "vaccine_id", "comment": null}, "due_date": {"type": "date", "index": 5, "name": "due_date", "comment": null}, "days_till_due": {"type": "integer", "index": 6, "name": "days_till_due", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patient_vaccinations_upcoming"}, "model.tamanu_source_dbt.patients": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}, "display_id": {"type": "character varying(255)", "index": 4, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 5, "name": "first_name", "comment": null}, "middle_name": {"type": "character varying(255)", "index": 6, "name": "middle_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 7, "name": "last_name", "comment": null}, "cultural_name": {"type": "character varying(255)", "index": 8, "name": "cultural_name", "comment": null}, "email": {"type": "character varying(255)", "index": 9, "name": "email", "comment": null}, "sex": {"type": "text", "index": 10, "name": "sex", "comment": null}, "date_of_birth": {"type": "date", "index": 11, "name": "date_of_birth", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 12, "name": "date_of_death", "comment": null}, "village_id": {"type": "character varying(255)", "index": 13, "name": "village_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients"}, "model.tamanu_source_dbt.patients_access_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients_access_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": null}, "patient_id": {"type": "text", "index": 3, "name": "patient_id", "comment": null}, "facility_id": {"type": "text", "index": 4, "name": "facility_id", "comment": null}, "logged_at": {"type": "timestamp without time zone", "index": 5, "name": "logged_at", "comment": null}, "session_id": {"type": "text", "index": 6, "name": "session_id", "comment": null}, "device_id": {"type": "text", "index": 7, "name": "device_id", "comment": null}, "is_mobile": {"type": "boolean", "index": 8, "name": "is_mobile", "comment": null}, "version": {"type": "text", "index": 9, "name": "version", "comment": null}, "front_end_context": {"type": "jsonb", "index": 10, "name": "front_end_context", "comment": null}, "back_end_context": {"type": "jsonb", "index": 11, "name": "back_end_context", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients_access_logs"}, "model.tamanu_source_dbt.patients_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp without time zone", "index": 2, "name": "logged_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 3, "name": "updated_by_user_id", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "display_id": {"type": "text", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "text", "index": 6, "name": "first_name", "comment": null}, "middle_name": {"type": "text", "index": 7, "name": "middle_name", "comment": null}, "last_name": {"type": "text", "index": 8, "name": "last_name", "comment": null}, "cultural_name": {"type": "text", "index": 9, "name": "cultural_name", "comment": null}, "email": {"type": "text", "index": 10, "name": "email", "comment": null}, "sex": {"type": "text", "index": 11, "name": "sex", "comment": null}, "date_of_birth": {"type": "date", "index": 12, "name": "date_of_birth", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 13, "name": "date_of_death", "comment": null}, "village_id": {"type": "text", "index": 14, "name": "village_id", "comment": null}, "registration_date": {"type": "date", "index": 15, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients_change_logs"}, "model.tamanu_source_dbt.patients_merged": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients_merged", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 3, "name": "first_name", "comment": null}, "middle_name": {"type": "character varying(255)", "index": 4, "name": "middle_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 5, "name": "last_name", "comment": null}, "cultural_name": {"type": "character varying(255)", "index": 6, "name": "cultural_name", "comment": null}, "email": {"type": "character varying(255)", "index": 7, "name": "email", "comment": null}, "sex": {"type": "text", "index": 8, "name": "sex", "comment": null}, "date_of_birth": {"type": "date", "index": 9, "name": "date_of_birth", "comment": null}, "date_of_death": {"type": "timestamp without time zone", "index": 10, "name": "date_of_death", "comment": null}, "village_id": {"type": "character varying(255)", "index": 11, "name": "village_id", "comment": null}, "registration_date": {"type": "date", "index": 12, "name": "registration_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients_merged"}, "model.tamanu_source_dbt.patients_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "patients_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.patients_metadata"}, "model.tamanu_source_dbt.pharmacy_order_prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "pharmacy_order_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "pharmacy_order_id": {"type": "uuid", "index": 2, "name": "pharmacy_order_id", "comment": null}, "prescription_id": {"type": "text", "index": 3, "name": "prescription_id", "comment": null}, "ongoing_prescription_id": {"type": "text", "index": 4, "name": "ongoing_prescription_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "quantity": {"type": "integer", "index": 6, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 7, "name": "repeats", "comment": null}, "is_completed": {"type": "boolean", "index": 8, "name": "is_completed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.pharmacy_order_prescriptions"}, "model.tamanu_source_dbt.pharmacy_orders": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "pharmacy_orders", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "text", "index": 2, "name": "encounter_id", "comment": null}, "ordering_clinician_id": {"type": "text", "index": 3, "name": "ordering_clinician_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "is_discharge_prescription": {"type": "boolean", "index": 5, "name": "is_discharge_prescription", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 6, "name": "datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.pharmacy_orders"}, "model.tamanu_source_dbt.prescription-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "prescription-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Prescription date": {"type": "text", "index": 1, "name": "Prescription date", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 2, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 4, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 5, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 8, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 9, "name": "Facility", "comment": null}, "Prescription selected for discharge": {"type": "boolean", "index": 10, "name": "Prescription selected for discharge", "comment": null}, "Code": {"type": "character varying(255)", "index": 11, "name": "Code", "comment": null}, "Medication": {"type": "text", "index": 12, "name": "Medication", "comment": null}, "Route": {"type": "character varying(255)", "index": 13, "name": "Route", "comment": null}, "Quantity": {"type": "integer", "index": 14, "name": "Quantity", "comment": null}, "Repeats": {"type": "integer", "index": 15, "name": "Repeats", "comment": null}, "Is ongoing": {"type": "boolean", "index": 16, "name": "Is ongoing", "comment": null}, "Is PRN": {"type": "boolean", "index": 17, "name": "Is PRN", "comment": null}, "Is variable dose": {"type": "boolean", "index": 18, "name": "Is variable dose", "comment": null}, "Dose amount": {"type": "numeric", "index": 19, "name": "Dose amount", "comment": null}, "Units": {"type": "character varying(255)", "index": 20, "name": "Units", "comment": null}, "Frequency": {"type": "character varying(255)", "index": 21, "name": "Frequency", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.prescription-line-list"}, "model.tamanu_source_dbt.prescriptions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 3, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 4, "name": "end_datetime", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 5, "name": "medication_id", "comment": null}, "prescriber_id": {"type": "character varying(255)", "index": 6, "name": "prescriber_id", "comment": null}, "indication": {"type": "character varying(255)", "index": 7, "name": "indication", "comment": null}, "route": {"type": "character varying(255)", "index": 8, "name": "route", "comment": null}, "quantity": {"type": "integer", "index": 9, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 10, "name": "repeats", "comment": null}, "is_ongoing": {"type": "boolean", "index": 11, "name": "is_ongoing", "comment": null}, "is_prn": {"type": "boolean", "index": 12, "name": "is_prn", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 13, "name": "is_variable_dose", "comment": null}, "dose_amount": {"type": "numeric", "index": 14, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 15, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 16, "name": "frequency", "comment": null}, "duration_value": {"type": "numeric", "index": 17, "name": "duration_value", "comment": null}, "duration_unit": {"type": "character varying(255)", "index": 18, "name": "duration_unit", "comment": null}, "is_phone_order": {"type": "boolean", "index": 19, "name": "is_phone_order", "comment": null}, "ideal_times": {"type": "character varying(255)[]", "index": 20, "name": "ideal_times", "comment": null}, "is_discontinued": {"type": "boolean", "index": 21, "name": "is_discontinued", "comment": null}, "discontinued_by_id": {"type": "character varying(255)", "index": 22, "name": "discontinued_by_id", "comment": null}, "discontinuing_reason": {"type": "character varying(255)", "index": 23, "name": "discontinuing_reason", "comment": null}, "discontinued_datetime": {"type": "timestamp without time zone", "index": 24, "name": "discontinued_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.prescriptions"}, "model.tamanu_source_dbt.procedures": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "procedures", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "date": {"type": "date", "index": 2, "name": "date", "comment": null}, "start_time": {"type": "time without time zone", "index": 3, "name": "start_time", "comment": null}, "end_time": {"type": "time without time zone", "index": 4, "name": "end_time", "comment": null}, "is_completed": {"type": "boolean", "index": 5, "name": "is_completed", "comment": null}, "note": {"type": "text", "index": 6, "name": "note", "comment": null}, "completed_note": {"type": "text", "index": 7, "name": "completed_note", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 8, "name": "encounter_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 9, "name": "location_id", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 10, "name": "procedure_type_id", "comment": null}, "anaesthetic_id": {"type": "character varying(255)", "index": 11, "name": "anaesthetic_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 12, "name": "clinician_id", "comment": null}, "anaesthetist_id": {"type": "character varying(255)", "index": 13, "name": "anaesthetist_id", "comment": null}, "assistant_anaesthetist_id": {"type": "character varying(255)", "index": 14, "name": "assistant_anaesthetist_id", "comment": null}, "time_in": {"type": "time without time zone", "index": 15, "name": "time_in", "comment": null}, "time_out": {"type": "time without time zone", "index": 16, "name": "time_out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.procedures"}, "model.tamanu_source_dbt.procedures-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "procedures-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Nationality": {"type": "text", "index": 7, "name": "Nationality", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Type": {"type": "text", "index": 10, "name": "Type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 11, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 12, "name": "Encounter end date and time", "comment": null}, "Procedure facility": {"type": "character varying(255)", "index": 13, "name": "Procedure facility", "comment": null}, "Procedure area": {"type": "character varying(255)", "index": 14, "name": "Procedure area", "comment": null}, "Procedure location": {"type": "character varying(255)", "index": 15, "name": "Procedure location", "comment": null}, "Procedure": {"type": "text", "index": 16, "name": "Procedure", "comment": null}, "Procedure date": {"type": "text", "index": 17, "name": "Procedure date", "comment": null}, "Procedure start (date and time)": {"type": "text", "index": 18, "name": "Procedure start (date and time)", "comment": null}, "Procedure end (date and time)": {"type": "text", "index": 19, "name": "Procedure end (date and time)", "comment": null}, "Procedure duration": {"type": "text", "index": 20, "name": "Procedure duration", "comment": null}, "Procedure clinician": {"type": "character varying(255)", "index": 21, "name": "Procedure clinician", "comment": null}, "Procedure anaesthetist": {"type": "character varying(255)", "index": 22, "name": "Procedure anaesthetist", "comment": null}, "Procedure assistant anesthetist": {"type": "character varying(255)", "index": 23, "name": "Procedure assistant anesthetist", "comment": null}, "Procedure marked as completed": {"type": "text", "index": 24, "name": "Procedure marked as completed", "comment": null}, "Procedure time in": {"type": "time without time zone", "index": 25, "name": "Procedure time in", "comment": null}, "Procedure time out": {"type": "time without time zone", "index": 26, "name": "Procedure time out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.procedures-line-list"}, "model.tamanu_source_dbt.procedures_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "procedures_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.procedures_metadata"}, "model.tamanu_source_dbt.program-registry-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program-registry-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Registering facility": {"type": "character varying(255)", "index": 7, "name": "Registering facility", "comment": null}, "Sub-division": {"type": "text", "index": 8, "name": "Sub-division", "comment": null}, "Division": {"type": "text", "index": 9, "name": "Division", "comment": null}, "Registered by": {"type": "character varying(255)", "index": 10, "name": "Registered by", "comment": null}, "Currently at": {"type": "character varying", "index": 11, "name": "Currently at", "comment": null}, "Related conditions": {"type": "text", "index": 12, "name": "Related conditions", "comment": null}, "Related condition categories": {"type": "text", "index": 13, "name": "Related condition categories", "comment": null}, "Status": {"type": "text", "index": 14, "name": "Status", "comment": null}, "Date of registration": {"type": "text", "index": 15, "name": "Date of registration", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program-registry-line-list"}, "model.tamanu_source_dbt.program-registry-removed-patients-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program-registry-removed-patients-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Registering facility": {"type": "character varying(255)", "index": 7, "name": "Registering facility", "comment": null}, "Registered by": {"type": "character varying(255)", "index": 8, "name": "Registered by", "comment": null}, "Currently at": {"type": "character varying", "index": 9, "name": "Currently at", "comment": null}, "Related conditions": {"type": "text", "index": 10, "name": "Related conditions", "comment": null}, "Related condition categories": {"type": "text", "index": 11, "name": "Related condition categories", "comment": null}, "Status": {"type": "text", "index": 12, "name": "Status", "comment": null}, "Date of registration": {"type": "text", "index": 13, "name": "Date of registration", "comment": null}, "Date of deactivation": {"type": "text", "index": 14, "name": "Date of deactivation", "comment": null}, "Deactivated by": {"type": "character varying(255)", "index": 15, "name": "Deactivated by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program-registry-removed-patients-line-list"}, "model.tamanu_source_dbt.program_data_elements": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_data_elements", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "type": {"type": "character varying(31)", "index": 4, "name": "type", "comment": null}, "indicator": {"type": "character varying(255)", "index": 5, "name": "indicator", "comment": null}, "default_text": {"type": "character varying(255)", "index": 6, "name": "default_text", "comment": null}, "default_options": {"type": "text", "index": 7, "name": "default_options", "comment": null}, "visualisation_config": {"type": "text", "index": 8, "name": "visualisation_config", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_data_elements"}, "model.tamanu_source_dbt.program_registries": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_registries", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "text", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "currently_at_type": {"type": "text", "index": 4, "name": "currently_at_type", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}, "program_id": {"type": "character varying(255)", "index": 6, "name": "program_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_registries"}, "model.tamanu_source_dbt.program_registry_clinical_statuses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_registry_clinical_statuses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "text", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "color": {"type": "text", "index": 4, "name": "color", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 6, "name": "program_registry_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_registry_clinical_statuses"}, "model.tamanu_source_dbt.program_registry_condition_categories": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_registry_condition_categories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "code": {"type": "text", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 4, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 5, "name": "program_registry_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_registry_condition_categories"}, "model.tamanu_source_dbt.program_registry_conditions": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "program_registry_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "text", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 4, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 5, "name": "program_registry_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.program_registry_conditions"}, "model.tamanu_source_dbt.programs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "programs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.programs"}, "model.tamanu_source_dbt.recent-diagnoses-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "recent-diagnoses-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date & time": {"type": "text", "index": 1, "name": "Date & time", "comment": null}, "Diagnoses": {"type": "text", "index": 2, "name": "Diagnoses", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 4, "name": "Last name", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 5, "name": "Patient ID", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Primary contact number": {"type": "character varying(255)", "index": 8, "name": "Primary contact number", "comment": null}, "Village": {"type": "text", "index": 9, "name": "Village", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 10, "name": "Clinician", "comment": null}, "Department": {"type": "character varying(255)", "index": 11, "name": "Department", "comment": null}, "Certainty": {"type": "text", "index": 12, "name": "Certainty", "comment": null}, "Is primary": {"type": "text", "index": 13, "name": "Is primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.recent-diagnoses-line-list"}, "model.tamanu_source_dbt.reference_data": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "reference_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "type": {"type": "character varying(255)", "index": 4, "name": "type", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.reference_data"}, "model.tamanu_source_dbt.referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "status": {"type": "character varying(255)", "index": 2, "name": "status", "comment": null}, "referred_facility": {"type": "character varying(255)", "index": 3, "name": "referred_facility", "comment": null}, "initiating_encounter_id": {"type": "character varying(255)", "index": 4, "name": "initiating_encounter_id", "comment": null}, "survey_response_id": {"type": "character varying(255)", "index": 5, "name": "survey_response_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.referrals"}, "model.tamanu_source_dbt.refresh_tokens": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "refresh_tokens", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "device_id": {"type": "text", "index": 2, "name": "device_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 3, "name": "user_id", "comment": null}, "expires_at": {"type": "timestamp with time zone", "index": 4, "name": "expires_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.refresh_tokens"}, "model.tamanu_source_dbt.registered-births-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "registered-births-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "text", "index": 1, "name": "Registration date", "comment": null}, "Registered by": {"type": "character varying", "index": 2, "name": "Registered by", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 4, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 5, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 6, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 8, "name": "Ethnicity", "comment": null}, "Nationality": {"type": "text", "index": 9, "name": "Nationality", "comment": null}, "Village": {"type": "text", "index": 10, "name": "Village", "comment": null}, "Mother": {"type": "text", "index": 11, "name": "Mother", "comment": null}, "Father": {"type": "text", "index": 12, "name": "Father", "comment": null}, "Time of birth": {"type": "text", "index": 13, "name": "Time of birth", "comment": null}, "Gestational age (weeks)": {"type": "double precision", "index": 14, "name": "Gestational age (weeks)", "comment": null}, "Place of birth": {"type": "character varying", "index": 15, "name": "Place of birth", "comment": null}, "Name of health facility (if selected)": {"type": "character varying(255)", "index": 16, "name": "Name of health facility (if selected)", "comment": null}, "Attendant at birth": {"type": "character varying", "index": 17, "name": "Attendant at birth", "comment": null}, "Name of attendant": {"type": "character varying(255)", "index": 18, "name": "Name of attendant", "comment": null}, "Delivery type": {"type": "character varying", "index": 19, "name": "Delivery type", "comment": null}, "Single/Plural birth": {"type": "text", "index": 20, "name": "Single/Plural birth", "comment": null}, "Birth weight (kg)": {"type": "numeric", "index": 21, "name": "Birth weight (kg)", "comment": null}, "Birth length (cm)": {"type": "numeric", "index": 22, "name": "Birth length (cm)", "comment": null}, "Apgar score at 1 min": {"type": "integer", "index": 23, "name": "Apgar score at 1 min", "comment": null}, "Apgar score at 5 min": {"type": "integer", "index": 24, "name": "Apgar score at 5 min", "comment": null}, "Apgar score at 10 min": {"type": "integer", "index": 25, "name": "Apgar score at 10 min", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.registered-births-line-list"}, "model.tamanu_source_dbt.registered-patients-by-dob-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "registered-patients-by-dob-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "text", "index": 1, "name": "Registration date", "comment": null}, "Registered by": {"type": "character varying(255)", "index": 2, "name": "Registered by", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Middle name": {"type": "character varying(255)", "index": 4, "name": "Middle name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 5, "name": "Last name", "comment": null}, "Cultural name": {"type": "character varying(255)", "index": 6, "name": "Cultural name", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 7, "name": "Patient ID", "comment": null}, "Sex": {"type": "text", "index": 8, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 9, "name": "Village", "comment": null}, "Date of birth": {"type": "text", "index": 10, "name": "Date of birth", "comment": null}, "Registration type": {"type": "text", "index": 11, "name": "Registration type", "comment": null}, "Birth certificate": {"type": "character varying(255)", "index": 12, "name": "Birth certificate", "comment": null}, "Driving license": {"type": "character varying(255)", "index": 13, "name": "Driving license", "comment": null}, "Passport": {"type": "character varying(255)", "index": 14, "name": "Passport", "comment": null}, "Blood type": {"type": "character varying(255)", "index": 15, "name": "Blood type", "comment": null}, "Title": {"type": "character varying(255)", "index": 16, "name": "Title", "comment": null}, "Marital status": {"type": "character varying(255)", "index": 17, "name": "Marital status", "comment": null}, "Primary contact number": {"type": "character varying(255)", "index": 18, "name": "Primary contact number", "comment": null}, "Secondary contact number": {"type": "character varying(255)", "index": 19, "name": "Secondary contact number", "comment": null}, "Country of birth": {"type": "text", "index": 20, "name": "Country of birth", "comment": null}, "Nationality": {"type": "text", "index": 21, "name": "Nationality", "comment": null}, "Ethnicity": {"type": "text", "index": 22, "name": "Ethnicity", "comment": null}, "Occupation": {"type": "text", "index": 23, "name": "Occupation", "comment": null}, "Religion": {"type": "text", "index": 24, "name": "Religion", "comment": null}, "Billing type": {"type": "text", "index": 25, "name": "Billing type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.registered-patients-by-dob-line-list"}, "model.tamanu_source_dbt.registered-patients-daily-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "registered-patients-daily-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "text", "index": 1, "name": "Registration date", "comment": null}, "Total patients (male)": {"type": "bigint", "index": 2, "name": "Total patients (male)", "comment": null}, "Total patients (female)": {"type": "bigint", "index": 3, "name": "Total patients (female)", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.registered-patients-daily-summary"}, "model.tamanu_source_dbt.registered-patients-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "registered-patients-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "text", "index": 1, "name": "Registration date", "comment": null}, "Registered by": {"type": "character varying(255)", "index": 2, "name": "Registered by", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Middle name": {"type": "character varying(255)", "index": 4, "name": "Middle name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 5, "name": "Last name", "comment": null}, "Cultural name": {"type": "character varying(255)", "index": 6, "name": "Cultural name", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 7, "name": "Patient ID", "comment": null}, "Sex": {"type": "text", "index": 8, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 9, "name": "Village", "comment": null}, "Date of birth": {"type": "text", "index": 10, "name": "Date of birth", "comment": null}, "Birth certificate": {"type": "character varying(255)", "index": 11, "name": "Birth certificate", "comment": null}, "Driving license": {"type": "character varying(255)", "index": 12, "name": "Driving license", "comment": null}, "Passport": {"type": "character varying(255)", "index": 13, "name": "Passport", "comment": null}, "Blood type": {"type": "character varying(255)", "index": 14, "name": "Blood type", "comment": null}, "Title": {"type": "character varying(255)", "index": 15, "name": "Title", "comment": null}, "Marital status": {"type": "character varying(255)", "index": 16, "name": "Marital status", "comment": null}, "Primary contact number": {"type": "character varying(255)", "index": 17, "name": "Primary contact number", "comment": null}, "Secondary contact number": {"type": "character varying(255)", "index": 18, "name": "Secondary contact number", "comment": null}, "Country of birth": {"type": "text", "index": 19, "name": "Country of birth", "comment": null}, "Nationality": {"type": "text", "index": 20, "name": "Nationality", "comment": null}, "Ethnicity": {"type": "text", "index": 21, "name": "Ethnicity", "comment": null}, "Occupation": {"type": "text", "index": 22, "name": "Occupation", "comment": null}, "Religion": {"type": "text", "index": 23, "name": "Religion", "comment": null}, "Billing type": {"type": "text", "index": 24, "name": "Billing type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.registered-patients-line-list"}, "model.tamanu_source_dbt.roles": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "roles", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "character varying(255)", "index": 2, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.roles"}, "model.tamanu_source_dbt.sensitive-admissions-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-admissions-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Admitting clinician": {"type": "character varying", "index": 9, "name": "Admitting clinician", "comment": null}, "Admission date and time": {"type": "text", "index": 10, "name": "Admission date and time", "comment": null}, "Admission status": {"type": "text", "index": 11, "name": "Admission status", "comment": null}, "Discharge date and time": {"type": "text", "index": 12, "name": "Discharge date and time", "comment": null}, "Facility": {"type": "character varying(255)", "index": 13, "name": "Facility", "comment": null}, "Department history": {"type": "text", "index": 14, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 15, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 16, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 17, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 18, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 19, "name": "Location history date and times", "comment": null}, "Primary diagnoses": {"type": "text", "index": 20, "name": "Primary diagnoses", "comment": null}, "Secondary diagnoses": {"type": "text", "index": 21, "name": "Secondary diagnoses", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-admissions-line-list"}, "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-audit-outpatient-appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Change number": {"type": "bigint", "index": 5, "name": "Change number", "comment": null}, "Appointment date and time": {"type": "text", "index": 6, "name": "Appointment date and time", "comment": null}, "Appointment type": {"type": "text", "index": 7, "name": "Appointment type", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 8, "name": "Clinician", "comment": null}, "Area": {"type": "character varying(255)", "index": 9, "name": "Area", "comment": null}, "Priority appointment": {"type": "text", "index": 10, "name": "Priority appointment", "comment": null}, "Repeating appointment": {"type": "text", "index": 11, "name": "Repeating appointment", "comment": null}, "Appointment created by": {"type": "character varying(255)", "index": 12, "name": "Appointment created by", "comment": null}, "Appointment modified by": {"type": "character varying(255)", "index": 13, "name": "Appointment modified by", "comment": null}, "Appointment modified date & time": {"type": "text", "index": 14, "name": "Appointment modified date & time", "comment": null}, "Appointment cancelled": {"type": "text", "index": 15, "name": "Appointment cancelled", "comment": null}, "Previous appointment date & time": {"type": "text", "index": 16, "name": "Previous appointment date & time", "comment": null}, "Previous appointment type": {"type": "text", "index": 17, "name": "Previous appointment type", "comment": null}, "Previous clinician": {"type": "character varying", "index": 18, "name": "Previous clinician", "comment": null}, "Previous area": {"type": "character varying", "index": 19, "name": "Previous area", "comment": null}, "Previous priority appointment": {"type": "text", "index": 20, "name": "Previous priority appointment", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-audit-outpatient-appointments"}, "model.tamanu_source_dbt.sensitive-encounter-diets-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-encounter-diets-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Encounter start date": {"type": "text", "index": 1, "name": "Encounter start date", "comment": null}, "Encounter start time": {"type": "text", "index": 2, "name": "Encounter start time", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "Patient name": {"type": "text", "index": 4, "name": "Patient name", "comment": null}, "Age": {"type": "text", "index": 5, "name": "Age", "comment": null}, "Location": {"type": "text", "index": 6, "name": "Location", "comment": null}, "Diet": {"type": "text", "index": 7, "name": "Diet", "comment": null}, "Allergies": {"type": "text", "index": 8, "name": "Allergies", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-encounter-diets-line-list"}, "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-encounter-summary-by-end-date", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 7, "name": "Ethnicity", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 9, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 10, "name": "Encounter end date and time", "comment": null}, "Length of stay (days)": {"type": "integer", "index": 11, "name": "Length of stay (days)", "comment": null}, "Facility": {"type": "character varying(255)", "index": 12, "name": "Facility", "comment": null}, "Emergency encounter type": {"type": "text", "index": 13, "name": "Emergency encounter type", "comment": null}, "Inpatient encounter type": {"type": "text", "index": 14, "name": "Inpatient encounter type", "comment": null}, "Outpatient encounter type": {"type": "text", "index": 15, "name": "Outpatient encounter type", "comment": null}, "Discharge disposition": {"type": "text", "index": 16, "name": "Discharge disposition", "comment": null}, "Triage category": {"type": "text", "index": 17, "name": "Triage category", "comment": null}, "Arrival mode": {"type": "text", "index": 18, "name": "Arrival mode", "comment": null}, "Time seen following triage/Waiting time (hh:mm:ss)": {"type": "text", "index": 19, "name": "Time seen following triage/Waiting time (hh:mm:ss)", "comment": null}, "Clinician": {"type": "text", "index": 20, "name": "Clinician", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 21, "name": "Supervising clinician", "comment": null}, "Discharging department": {"type": "character varying(255)", "index": 22, "name": "Discharging department", "comment": null}, "Discharge date and time of Discharging department": {"type": "text", "index": 23, "name": "Discharge date and time of Discharging department", "comment": null}, "Discharging area": {"type": "character varying(255)", "index": 24, "name": "Discharging area", "comment": null}, "Discharge date and time of Discharging area": {"type": "text", "index": 25, "name": "Discharge date and time of Discharging area", "comment": null}, "Discharging location": {"type": "character varying(255)", "index": 26, "name": "Discharging location", "comment": null}, "Discharge date and time of Discharging location": {"type": "text", "index": 27, "name": "Discharge date and time of Discharging location", "comment": null}, "Department history": {"type": "text", "index": 28, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 29, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 30, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 31, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 32, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 33, "name": "Location history date and times", "comment": null}, "Reason for encounter": {"type": "text", "index": 34, "name": "Reason for encounter", "comment": null}, "Diagnoses": {"type": "text", "index": 35, "name": "Diagnoses", "comment": null}, "Medications": {"type": "text", "index": 36, "name": "Medications", "comment": null}, "Vaccinations": {"type": "text", "index": 37, "name": "Vaccinations", "comment": null}, "Procedures": {"type": "text", "index": 38, "name": "Procedures", "comment": null}, "Lab requests": {"type": "text", "index": 39, "name": "Lab requests", "comment": null}, "Imaging requests": {"type": "text", "index": 40, "name": "Imaging requests", "comment": null}, "Notes": {"type": "text", "index": 41, "name": "Notes", "comment": null}, "invoiceFinalisedDateTime": {"type": "text", "index": 42, "name": "invoiceFinalisedDateTime", "comment": null}, "invoiceProductCategories": {"type": "text", "index": 43, "name": "invoiceProductCategories", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-encounter-summary-by-end-date"}, "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-encounter-summary-by-start-date", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Ethnicity": {"type": "text", "index": 7, "name": "Ethnicity", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 9, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 10, "name": "Encounter end date and time", "comment": null}, "Length of stay (days)": {"type": "integer", "index": 11, "name": "Length of stay (days)", "comment": null}, "Facility": {"type": "character varying(255)", "index": 12, "name": "Facility", "comment": null}, "Emergency encounter type": {"type": "text", "index": 13, "name": "Emergency encounter type", "comment": null}, "Inpatient encounter type": {"type": "text", "index": 14, "name": "Inpatient encounter type", "comment": null}, "Outpatient encounter type": {"type": "text", "index": 15, "name": "Outpatient encounter type", "comment": null}, "Discharge disposition": {"type": "text", "index": 16, "name": "Discharge disposition", "comment": null}, "Triage category": {"type": "text", "index": 17, "name": "Triage category", "comment": null}, "Arrival mode": {"type": "text", "index": 18, "name": "Arrival mode", "comment": null}, "Time seen following triage/Waiting time (hh:mm:ss)": {"type": "text", "index": 19, "name": "Time seen following triage/Waiting time (hh:mm:ss)", "comment": null}, "Clinician": {"type": "text", "index": 20, "name": "Clinician", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 21, "name": "Supervising clinician", "comment": null}, "Discharging department": {"type": "character varying(255)", "index": 22, "name": "Discharging department", "comment": null}, "Discharge date and time of Discharging department": {"type": "text", "index": 23, "name": "Discharge date and time of Discharging department", "comment": null}, "Discharging area": {"type": "character varying(255)", "index": 24, "name": "Discharging area", "comment": null}, "Discharge date and time of Discharging area": {"type": "text", "index": 25, "name": "Discharge date and time of Discharging area", "comment": null}, "Discharging location": {"type": "character varying(255)", "index": 26, "name": "Discharging location", "comment": null}, "Discharge date and time of Discharging location": {"type": "text", "index": 27, "name": "Discharge date and time of Discharging location", "comment": null}, "Department history": {"type": "text", "index": 28, "name": "Department history", "comment": null}, "Department history date and times": {"type": "text", "index": 29, "name": "Department history date and times", "comment": null}, "Area history": {"type": "text", "index": 30, "name": "Area history", "comment": null}, "Area history date and times": {"type": "text", "index": 31, "name": "Area history date and times", "comment": null}, "Location history": {"type": "text", "index": 32, "name": "Location history", "comment": null}, "Location history date and times": {"type": "text", "index": 33, "name": "Location history date and times", "comment": null}, "Reason for encounter": {"type": "text", "index": 34, "name": "Reason for encounter", "comment": null}, "Diagnoses": {"type": "text", "index": 35, "name": "Diagnoses", "comment": null}, "Medications": {"type": "text", "index": 36, "name": "Medications", "comment": null}, "Vaccinations": {"type": "text", "index": 37, "name": "Vaccinations", "comment": null}, "Procedures": {"type": "text", "index": 38, "name": "Procedures", "comment": null}, "Lab requests": {"type": "text", "index": 39, "name": "Lab requests", "comment": null}, "Imaging requests": {"type": "text", "index": 40, "name": "Imaging requests", "comment": null}, "Notes": {"type": "text", "index": 41, "name": "Notes", "comment": null}, "invoiceFinalisedDateTime": {"type": "text", "index": 42, "name": "invoiceFinalisedDateTime", "comment": null}, "invoiceProductCategories": {"type": "text", "index": 43, "name": "invoiceProductCategories", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-encounter-summary-by-start-date"}, "model.tamanu_source_dbt.sensitive-imaging-requests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-imaging-requests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 10, "name": "Area", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 11, "name": "Request ID", "comment": null}, "Request date and time": {"type": "text", "index": 12, "name": "Request date and time", "comment": null}, "Supervising clinician": {"type": "character varying(255)", "index": 13, "name": "Supervising clinician", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 14, "name": "Requesting clinician", "comment": null}, "Priority": {"type": "character varying", "index": 15, "name": "Priority", "comment": null}, "Imaging type": {"type": "text", "index": 16, "name": "Imaging type", "comment": null}, "Area to be imaged": {"type": "text", "index": 17, "name": "Area to be imaged", "comment": null}, "Status": {"type": "text", "index": 18, "name": "Status", "comment": null}, "Completed date and time": {"type": "text", "index": 19, "name": "Completed date and time", "comment": null}, "Reason for cancellation": {"type": "text", "index": 20, "name": "Reason for cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-imaging-requests-line-list"}, "model.tamanu_source_dbt.sensitive-imaging-requests-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-imaging-requests-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date": {"type": "text", "index": 1, "name": "Date", "comment": null}, "Facility": {"type": "character varying(255)", "index": 2, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 3, "name": "Department", "comment": null}, "Imaging type": {"type": "text", "index": 4, "name": "Imaging type", "comment": null}, "Total new requests": {"type": "bigint", "index": 5, "name": "Total new requests", "comment": null}, "Total requests with a status of pending": {"type": "bigint", "index": 6, "name": "Total requests with a status of pending", "comment": null}, "Total requests completed": {"type": "bigint", "index": 7, "name": "Total requests completed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-imaging-requests-summary"}, "model.tamanu_source_dbt.sensitive-incomplete-referrals": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-incomplete-referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Diagnoses": {"type": "text", "index": 4, "name": "Diagnoses", "comment": null}, "Referral name": {"type": "character varying(255)", "index": 5, "name": "Referral name", "comment": null}, "Referring doctor": {"type": "character varying(255)", "index": 6, "name": "Referring doctor", "comment": null}, "Referral date": {"type": "text", "index": 7, "name": "Referral date", "comment": null}, "Department": {"type": "character varying(255)", "index": 8, "name": "Department", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-incomplete-referrals"}, "model.tamanu_source_dbt.sensitive-lab-requests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-lab-requests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Location": {"type": "text", "index": 10, "name": "Location", "comment": null}, "Laboratory": {"type": "text", "index": 11, "name": "Laboratory", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 12, "name": "Request ID", "comment": null}, "Status": {"type": "character varying", "index": 13, "name": "Status", "comment": null}, "Lab request date and time": {"type": "text", "index": 14, "name": "Lab request date and time", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 15, "name": "Requesting clinician", "comment": null}, "Requesting department": {"type": "character varying(255)", "index": 16, "name": "Requesting department", "comment": null}, "Priority": {"type": "text", "index": 17, "name": "Priority", "comment": null}, "Test category": {"type": "text", "index": 18, "name": "Test category", "comment": null}, "Test requested": {"type": "text", "index": 19, "name": "Test requested", "comment": null}, "Sample collection date and time": {"type": "text", "index": 20, "name": "Sample collection date and time", "comment": null}, "Sample collected by": {"type": "character varying(255)", "index": 21, "name": "Sample collected by", "comment": null}, "Specimen type": {"type": "text", "index": 22, "name": "Specimen type", "comment": null}, "Site": {"type": "text", "index": 23, "name": "Site", "comment": null}, "Completed date and time": {"type": "text", "index": 24, "name": "Completed date and time", "comment": null}, "Reason for cancellation": {"type": "character varying", "index": 25, "name": "Reason for cancellation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-lab-requests-line-list"}, "model.tamanu_source_dbt.sensitive-lab-tests-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-lab-tests-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Requesting department": {"type": "character varying(255)", "index": 10, "name": "Requesting department", "comment": null}, "Location": {"type": "text", "index": 11, "name": "Location", "comment": null}, "Request ID": {"type": "character varying(255)", "index": 12, "name": "Request ID", "comment": null}, "Status": {"type": "character varying", "index": 13, "name": "Status", "comment": null}, "Lab test panel": {"type": "character varying(255)", "index": 14, "name": "Lab test panel", "comment": null}, "Test category": {"type": "text", "index": 15, "name": "Test category", "comment": null}, "Lab request date and time": {"type": "text", "index": 16, "name": "Lab request date and time", "comment": null}, "Requesting clinician": {"type": "character varying(255)", "index": 17, "name": "Requesting clinician", "comment": null}, "Lab request published date and time": {"type": "text", "index": 18, "name": "Lab request published date and time", "comment": null}, "Lab test date": {"type": "text", "index": 19, "name": "Lab test date", "comment": null}, "Result": {"type": "text", "index": 20, "name": "Result", "comment": null}, "Verification": {"type": "character varying(255)", "index": 21, "name": "Verification", "comment": null}, "Lab test type": {"type": "character varying(255)", "index": 22, "name": "Lab test type", "comment": null}, "Lab test completed date and time": {"type": "text", "index": 23, "name": "Lab test completed date and time", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-lab-tests-line-list"}, "model.tamanu_source_dbt.sensitive-location-bookings-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-location-bookings-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 8, "name": "Billing type", "comment": null}, "Booking start date and time": {"type": "text", "index": 9, "name": "Booking start date and time", "comment": null}, "Booking end date and time": {"type": "text", "index": 10, "name": "Booking end date and time", "comment": null}, "Booking duration": {"type": "text", "index": 11, "name": "Booking duration", "comment": null}, "Area": {"type": "character varying(255)", "index": 12, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 13, "name": "Location", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 14, "name": "Clinician", "comment": null}, "Booking type": {"type": "text", "index": 15, "name": "Booking type", "comment": null}, "Booking status": {"type": "character varying(255)", "index": 16, "name": "Booking status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-location-bookings-line-list"}, "model.tamanu_source_dbt.sensitive-medication-dispensed-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-medication-dispensed-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Medication": {"type": "text", "index": 1, "name": "Medication", "comment": null}, "Code": {"type": "character varying(255)", "index": 2, "name": "Code", "comment": null}, "Quantity": {"type": "bigint", "index": 3, "name": "Quantity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-medication-dispensed-summary"}, "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-outpatient-appointments-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Contact number": {"type": "character varying(255)", "index": 7, "name": "Contact number", "comment": null}, "Village": {"type": "text", "index": 8, "name": "Village", "comment": null}, "Billing type": {"type": "text", "index": 9, "name": "Billing type", "comment": null}, "Appointment date and time": {"type": "text", "index": 10, "name": "Appointment date and time", "comment": null}, "Appointment end date and time": {"type": "text", "index": 11, "name": "Appointment end date and time", "comment": null}, "Appointment type": {"type": "text", "index": 12, "name": "Appointment type", "comment": null}, "Appointment status": {"type": "character varying(255)", "index": 13, "name": "Appointment status", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 14, "name": "Clinician", "comment": null}, "Area": {"type": "character varying(255)", "index": 15, "name": "Area", "comment": null}, "Priority appointment": {"type": "text", "index": 16, "name": "Priority appointment", "comment": null}, "Repeating appointment": {"type": "text", "index": 17, "name": "Repeating appointment", "comment": null}, "Repeating appointment end date": {"type": "text", "index": 18, "name": "Repeating appointment end date", "comment": null}, "Appointment created by": {"type": "character varying(255)", "index": 19, "name": "Appointment created by", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-outpatient-appointments-line-list"}, "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-patient-emergency-encounters-summary", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Sex": {"type": "text", "index": 5, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 6, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 7, "name": "Facility", "comment": null}, "Number of triage records": {"type": "bigint", "index": 8, "name": "Number of triage records", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-patient-emergency-encounters-summary"}, "model.tamanu_source_dbt.sensitive-prescription-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-prescription-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Prescription date": {"type": "text", "index": 1, "name": "Prescription date", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 2, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 4, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 5, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 8, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 9, "name": "Facility", "comment": null}, "Prescription selected for discharge": {"type": "boolean", "index": 10, "name": "Prescription selected for discharge", "comment": null}, "Code": {"type": "character varying(255)", "index": 11, "name": "Code", "comment": null}, "Medication": {"type": "text", "index": 12, "name": "Medication", "comment": null}, "Route": {"type": "character varying(255)", "index": 13, "name": "Route", "comment": null}, "Quantity": {"type": "integer", "index": 14, "name": "Quantity", "comment": null}, "Repeats": {"type": "integer", "index": 15, "name": "Repeats", "comment": null}, "Is ongoing": {"type": "boolean", "index": 16, "name": "Is ongoing", "comment": null}, "Is PRN": {"type": "boolean", "index": 17, "name": "Is PRN", "comment": null}, "Is variable dose": {"type": "boolean", "index": 18, "name": "Is variable dose", "comment": null}, "Dose amount": {"type": "numeric", "index": 19, "name": "Dose amount", "comment": null}, "Units": {"type": "character varying(255)", "index": 20, "name": "Units", "comment": null}, "Frequency": {"type": "character varying(255)", "index": 21, "name": "Frequency", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-prescription-line-list"}, "model.tamanu_source_dbt.sensitive-procedures-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-procedures-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Nationality": {"type": "text", "index": 7, "name": "Nationality", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Type": {"type": "text", "index": 10, "name": "Type", "comment": null}, "Encounter start date and time": {"type": "text", "index": 11, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 12, "name": "Encounter end date and time", "comment": null}, "Procedure facility": {"type": "character varying(255)", "index": 13, "name": "Procedure facility", "comment": null}, "Procedure area": {"type": "character varying(255)", "index": 14, "name": "Procedure area", "comment": null}, "Procedure location": {"type": "character varying(255)", "index": 15, "name": "Procedure location", "comment": null}, "Procedure": {"type": "text", "index": 16, "name": "Procedure", "comment": null}, "Procedure date": {"type": "text", "index": 17, "name": "Procedure date", "comment": null}, "Procedure start (date and time)": {"type": "text", "index": 18, "name": "Procedure start (date and time)", "comment": null}, "Procedure end (date and time)": {"type": "text", "index": 19, "name": "Procedure end (date and time)", "comment": null}, "Procedure duration": {"type": "text", "index": 20, "name": "Procedure duration", "comment": null}, "Procedure clinician": {"type": "character varying(255)", "index": 21, "name": "Procedure clinician", "comment": null}, "Procedure anaesthetist": {"type": "character varying(255)", "index": 22, "name": "Procedure anaesthetist", "comment": null}, "Procedure assistant anesthetist": {"type": "character varying(255)", "index": 23, "name": "Procedure assistant anesthetist", "comment": null}, "Procedure marked as completed": {"type": "text", "index": 24, "name": "Procedure marked as completed", "comment": null}, "Procedure time in": {"type": "time without time zone", "index": 25, "name": "Procedure time in", "comment": null}, "Procedure time out": {"type": "time without time zone", "index": 26, "name": "Procedure time out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-procedures-line-list"}, "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-recent-diagnoses-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Date & time": {"type": "text", "index": 1, "name": "Date & time", "comment": null}, "Diagnoses": {"type": "text", "index": 2, "name": "Diagnoses", "comment": null}, "First name": {"type": "character varying(255)", "index": 3, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 4, "name": "Last name", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 5, "name": "Patient ID", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Primary contact number": {"type": "character varying(255)", "index": 8, "name": "Primary contact number", "comment": null}, "Village": {"type": "text", "index": 9, "name": "Village", "comment": null}, "Clinician": {"type": "character varying(255)", "index": 10, "name": "Clinician", "comment": null}, "Department": {"type": "character varying(255)", "index": 11, "name": "Department", "comment": null}, "Certainty": {"type": "text", "index": 12, "name": "Certainty", "comment": null}, "Is primary": {"type": "text", "index": 13, "name": "Is primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-recent-diagnoses-line-list"}, "model.tamanu_source_dbt.sensitive-user-audit-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-user-audit-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"User name": {"type": "character varying(255)", "index": 1, "name": "User name", "comment": null}, "User role": {"type": "character varying(255)", "index": 2, "name": "User role", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "Patient category": {"type": "text", "index": 4, "name": "Patient category", "comment": null}, "Triage category": {"type": "text", "index": 5, "name": "Triage category", "comment": null}, "Facility": {"type": "character varying(255)", "index": 6, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 7, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 8, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 9, "name": "Location", "comment": null}, "Encounter start date and time": {"type": "text", "index": 10, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 11, "name": "Encounter end date and time", "comment": null}, "Notes start date and time": {"type": "text", "index": 12, "name": "Notes start date and time", "comment": null}, "Notes end date and time": {"type": "text", "index": 13, "name": "Notes end date and time", "comment": null}, "Discharges (has the patient been discharged)": {"type": "text", "index": 14, "name": "Discharges (has the patient been discharged)", "comment": null}, "Non-discharge by clinicians": {"type": "text", "index": 15, "name": "Non-discharge by clinicians", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-user-audit-line-list"}, "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-vaccine-audit-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Vaccination date": {"type": "text", "index": 8, "name": "Vaccination date", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 9, "name": "Vaccine name", "comment": null}, "If category of Other, Vaccine brand": {"type": "text", "index": 10, "name": "If category of Other, Vaccine brand", "comment": null}, "If category of Other, Disease": {"type": "text", "index": 11, "name": "If category of Other, Disease", "comment": null}, "Vaccine status": {"type": "text", "index": 12, "name": "Vaccine status", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 13, "name": "Schedule", "comment": null}, "Given by": {"type": "text", "index": 14, "name": "Given by", "comment": null}, "Recorded by": {"type": "character varying", "index": 15, "name": "Recorded by", "comment": null}, "Record modified by": {"type": "character varying", "index": 16, "name": "Record modified by", "comment": null}, "Record modification date": {"type": "text", "index": 17, "name": "Record modification date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-vaccine-audit-line-list"}, "model.tamanu_source_dbt.sensitive-vaccine-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "sensitive-vaccine-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 10, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 11, "name": "Location", "comment": null}, "Vaccination date": {"type": "text", "index": 12, "name": "Vaccination date", "comment": null}, "Vaccine category": {"type": "character varying(255)", "index": 13, "name": "Vaccine category", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 14, "name": "Vaccine name", "comment": null}, "If category of Other, Vaccine brand": {"type": "text", "index": 15, "name": "If category of Other, Vaccine brand", "comment": null}, "If category of Other, Disease": {"type": "text", "index": 16, "name": "If category of Other, Disease", "comment": null}, "Vaccine status": {"type": "text", "index": 17, "name": "Vaccine status", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 18, "name": "Schedule", "comment": null}, "Batch": {"type": "character varying(255)", "index": 19, "name": "Batch", "comment": null}, "Given by": {"type": "text", "index": 20, "name": "Given by", "comment": null}, "Recorded by": {"type": "character varying", "index": 21, "name": "Recorded by", "comment": null}, "If given elsewhere, Circumstances": {"type": "text", "index": 22, "name": "If given elsewhere, Circumstances", "comment": null}, "If given elsewhere, Country": {"type": "text", "index": 23, "name": "If given elsewhere, Country", "comment": null}, "If not given, Supervising clinician": {"type": "text", "index": 24, "name": "If not given, Supervising clinician", "comment": null}, "If not given, Reason not given": {"type": "text", "index": 25, "name": "If not given, Reason not given", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.sensitive-vaccine-line-list"}, "model.tamanu_source_dbt.survey_response_answers": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "survey_response_answers", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "character varying(255)", "index": 2, "name": "name", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "response_id": {"type": "character varying(255)", "index": 4, "name": "response_id", "comment": null}, "data_element_id": {"type": "character varying(255)", "index": 5, "name": "data_element_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.survey_response_answers"}, "model.tamanu_source_dbt.survey_responses": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "survey_responses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "start_datetime": {"type": "timestamp without time zone", "index": 2, "name": "start_datetime", "comment": null}, "end_datetime": {"type": "timestamp without time zone", "index": 3, "name": "end_datetime", "comment": null}, "result_text": {"type": "text", "index": 4, "name": "result_text", "comment": null}, "is_notified": {"type": "boolean", "index": 5, "name": "is_notified", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 6, "name": "survey_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "submitted_by_id": {"type": "character varying(255)", "index": 8, "name": "submitted_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.survey_responses"}, "model.tamanu_source_dbt.survey_screen_components": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "survey_screen_components", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "screen_index": {"type": "integer", "index": 2, "name": "screen_index", "comment": null}, "component_index": {"type": "integer", "index": 3, "name": "component_index", "comment": null}, "text": {"type": "character varying(255)", "index": 4, "name": "text", "comment": null}, "visibility_criteria": {"type": "character varying(255)", "index": 5, "name": "visibility_criteria", "comment": null}, "validation_criteria": {"type": "text", "index": 6, "name": "validation_criteria", "comment": null}, "detail": {"type": "character varying(255)", "index": 7, "name": "detail", "comment": null}, "config": {"type": "character varying(255)", "index": 8, "name": "config", "comment": null}, "options": {"type": "character varying(255)", "index": 9, "name": "options", "comment": null}, "calculation": {"type": "character varying(255)", "index": 10, "name": "calculation", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 11, "name": "survey_id", "comment": null}, "data_element_id": {"type": "character varying(255)", "index": 12, "name": "data_element_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 13, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.survey_screen_components"}, "model.tamanu_source_dbt.surveys": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "surveys", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "code": {"type": "character varying(255)", "index": 2, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 3, "name": "name", "comment": null}, "survey_type": {"type": "character varying(255)", "index": 4, "name": "survey_type", "comment": null}, "is_sensitive": {"type": "boolean", "index": 5, "name": "is_sensitive", "comment": null}, "is_notifiable": {"type": "boolean", "index": 6, "name": "is_notifiable", "comment": null}, "notify_email_addresses": {"type": "character varying(255)[]", "index": 7, "name": "notify_email_addresses", "comment": null}, "program_id": {"type": "character varying(255)", "index": 8, "name": "program_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 9, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.surveys"}, "model.tamanu_source_dbt.translated_strings": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "translated_strings", "database": "app", "comment": null, "owner": "app"}, "columns": {"string_id": {"type": "text", "index": 1, "name": "string_id", "comment": null}, "language": {"type": "text", "index": 2, "name": "language", "comment": null}, "text": {"type": "text", "index": 3, "name": "text", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.translated_strings"}, "model.tamanu_source_dbt.triages": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "triages", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "arrival_datetime": {"type": "timestamp without time zone", "index": 2, "name": "arrival_datetime", "comment": null}, "triage_datetime": {"type": "timestamp without time zone", "index": 3, "name": "triage_datetime", "comment": null}, "closed_datetime": {"type": "timestamp without time zone", "index": 4, "name": "closed_datetime", "comment": null}, "arrival_mode_id": {"type": "character varying(255)", "index": 5, "name": "arrival_mode_id", "comment": null}, "score": {"type": "text", "index": 6, "name": "score", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 8, "name": "clinician_id", "comment": null}, "chief_complaint_id": {"type": "character varying(255)", "index": 9, "name": "chief_complaint_id", "comment": null}, "secondary_complaint_id": {"type": "character varying(255)", "index": 10, "name": "secondary_complaint_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.triages"}, "model.tamanu_source_dbt.upcoming-vaccinations-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "upcoming-vaccinations-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Village": {"type": "text", "index": 5, "name": "Village", "comment": null}, "Age": {"type": "double precision", "index": 6, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 7, "name": "Sex", "comment": null}, "Vaccination due date": {"type": "text", "index": 8, "name": "Vaccination due date", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 9, "name": "Vaccine name", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 10, "name": "Schedule", "comment": null}, "Vaccine status": {"type": "text", "index": 11, "name": "Vaccine status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.upcoming-vaccinations-line-list"}, "model.tamanu_source_dbt.usage-quality-metrics-patient-details": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "usage-quality-metrics-patient-details", "database": "app", "comment": null, "owner": "app"}, "columns": {"Total patients": {"type": "bigint", "index": 1, "name": "Total patients", "comment": null}, "Total patients with incomplete name": {"type": "bigint", "index": 2, "name": "Total patients with incomplete name", "comment": null}, "Total patients with missing date of birth": {"type": "bigint", "index": 3, "name": "Total patients with missing date of birth", "comment": null}, "Total patients with invalid date of birth": {"type": "bigint", "index": 4, "name": "Total patients with invalid date of birth", "comment": null}, "Total patients with missing location": {"type": "bigint", "index": 5, "name": "Total patients with missing location", "comment": null}, "Total patients with missing contact": {"type": "bigint", "index": 6, "name": "Total patients with missing contact", "comment": null}, "Total patients merged": {"type": "bigint", "index": 7, "name": "Total patients merged", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.usage-quality-metrics-patient-details"}, "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "usage-quality-metrics-patient-registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"Registration date": {"type": "timestamp with time zone", "index": 1, "name": "Registration date", "comment": null}, "Total patient registrations": {"type": "bigint", "index": 2, "name": "Total patient registrations", "comment": null}, "Total birth registrations": {"type": "bigint", "index": 3, "name": "Total birth registrations", "comment": null}, "Total incorrect registrations for aged under 6 months": {"type": "bigint", "index": 4, "name": "Total incorrect registrations for aged under 6 months", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.usage-quality-metrics-patient-registrations"}, "model.tamanu_source_dbt.user-audit-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "user-audit-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"User name": {"type": "character varying(255)", "index": 1, "name": "User name", "comment": null}, "User role": {"type": "character varying(255)", "index": 2, "name": "User role", "comment": null}, "Patient ID": {"type": "character varying(255)", "index": 3, "name": "Patient ID", "comment": null}, "Patient category": {"type": "text", "index": 4, "name": "Patient category", "comment": null}, "Triage category": {"type": "text", "index": 5, "name": "Triage category", "comment": null}, "Facility": {"type": "character varying(255)", "index": 6, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 7, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 8, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 9, "name": "Location", "comment": null}, "Encounter start date and time": {"type": "text", "index": 10, "name": "Encounter start date and time", "comment": null}, "Encounter end date and time": {"type": "text", "index": 11, "name": "Encounter end date and time", "comment": null}, "Notes start date and time": {"type": "text", "index": 12, "name": "Notes start date and time", "comment": null}, "Notes end date and time": {"type": "text", "index": 13, "name": "Notes end date and time", "comment": null}, "Discharges (has the patient been discharged)": {"type": "text", "index": 14, "name": "Discharges (has the patient been discharged)", "comment": null}, "Non-discharge by clinicians": {"type": "text", "index": 15, "name": "Non-discharge by clinicians", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.user-audit-line-list"}, "model.tamanu_source_dbt.users": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "users", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "display_name": {"type": "character varying(255)", "index": 3, "name": "display_name", "comment": null}, "email": {"type": "character varying(255)", "index": 4, "name": "email", "comment": null}, "phone_number": {"type": "character varying(255)", "index": 5, "name": "phone_number", "comment": null}, "role": {"type": "character varying(255)", "index": 6, "name": "role", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 7, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.users"}, "model.tamanu_source_dbt.users_metadata": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "users_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_datetime": {"type": "timestamp with time zone", "index": 2, "name": "created_datetime", "comment": null}, "updated_datetime": {"type": "timestamp with time zone", "index": 3, "name": "updated_datetime", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.users_metadata"}, "model.tamanu_source_dbt.vaccine-audit-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine-audit-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Vaccination date": {"type": "text", "index": 8, "name": "Vaccination date", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 9, "name": "Vaccine name", "comment": null}, "If category of Other, Vaccine brand": {"type": "text", "index": 10, "name": "If category of Other, Vaccine brand", "comment": null}, "If category of Other, Disease": {"type": "text", "index": 11, "name": "If category of Other, Disease", "comment": null}, "Vaccine status": {"type": "text", "index": 12, "name": "Vaccine status", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 13, "name": "Schedule", "comment": null}, "Given by": {"type": "text", "index": 14, "name": "Given by", "comment": null}, "Recorded by": {"type": "character varying", "index": 15, "name": "Recorded by", "comment": null}, "Record modified by": {"type": "character varying", "index": 16, "name": "Record modified by", "comment": null}, "Record modification date": {"type": "text", "index": 17, "name": "Record modification date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine-audit-line-list"}, "model.tamanu_source_dbt.vaccine-line-list": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine-line-list", "database": "app", "comment": null, "owner": "app"}, "columns": {"Patient ID": {"type": "character varying(255)", "index": 1, "name": "Patient ID", "comment": null}, "First name": {"type": "character varying(255)", "index": 2, "name": "First name", "comment": null}, "Last name": {"type": "character varying(255)", "index": 3, "name": "Last name", "comment": null}, "Date of birth": {"type": "text", "index": 4, "name": "Date of birth", "comment": null}, "Age": {"type": "double precision", "index": 5, "name": "Age", "comment": null}, "Sex": {"type": "text", "index": 6, "name": "Sex", "comment": null}, "Village": {"type": "text", "index": 7, "name": "Village", "comment": null}, "Facility": {"type": "character varying(255)", "index": 8, "name": "Facility", "comment": null}, "Department": {"type": "character varying(255)", "index": 9, "name": "Department", "comment": null}, "Area": {"type": "character varying(255)", "index": 10, "name": "Area", "comment": null}, "Location": {"type": "character varying(255)", "index": 11, "name": "Location", "comment": null}, "Vaccination date": {"type": "text", "index": 12, "name": "Vaccination date", "comment": null}, "Vaccine category": {"type": "character varying(255)", "index": 13, "name": "Vaccine category", "comment": null}, "Vaccine name": {"type": "character varying(255)", "index": 14, "name": "Vaccine name", "comment": null}, "If category of Other, Vaccine brand": {"type": "text", "index": 15, "name": "If category of Other, Vaccine brand", "comment": null}, "If category of Other, Disease": {"type": "text", "index": 16, "name": "If category of Other, Disease", "comment": null}, "Vaccine status": {"type": "text", "index": 17, "name": "Vaccine status", "comment": null}, "Schedule": {"type": "character varying(255)", "index": 18, "name": "Schedule", "comment": null}, "Batch": {"type": "character varying(255)", "index": 19, "name": "Batch", "comment": null}, "Given by": {"type": "text", "index": 20, "name": "Given by", "comment": null}, "Recorded by": {"type": "character varying", "index": 21, "name": "Recorded by", "comment": null}, "If given elsewhere, Circumstances": {"type": "text", "index": 22, "name": "If given elsewhere, Circumstances", "comment": null}, "If given elsewhere, Country": {"type": "text", "index": 23, "name": "If given elsewhere, Country", "comment": null}, "If not given, Supervising clinician": {"type": "text", "index": 24, "name": "If not given, Supervising clinician", "comment": null}, "If not given, Reason not given": {"type": "text", "index": 25, "name": "If not given, Reason not given", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine-line-list"}, "model.tamanu_source_dbt.vaccine_administrations": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine_administrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 2, "name": "datetime", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 3, "name": "encounter_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 4, "name": "location_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 5, "name": "department_id", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 6, "name": "scheduled_vaccine_id", "comment": null}, "status": {"type": "character varying(255)", "index": 7, "name": "status", "comment": null}, "reason": {"type": "character varying(255)", "index": 8, "name": "reason", "comment": null}, "not_given_reason_id": {"type": "character varying(255)", "index": 9, "name": "not_given_reason_id", "comment": null}, "batch": {"type": "character varying(255)", "index": 10, "name": "batch", "comment": null}, "vaccine_name": {"type": "text", "index": 11, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 12, "name": "vaccine_brand", "comment": null}, "disease": {"type": "text", "index": 13, "name": "disease", "comment": null}, "is_consented": {"type": "boolean", "index": 14, "name": "is_consented", "comment": null}, "consent_given_by": {"type": "text", "index": 15, "name": "consent_given_by", "comment": null}, "injection_site": {"type": "character varying(255)", "index": 16, "name": "injection_site", "comment": null}, "given_by": {"type": "text", "index": 17, "name": "given_by", "comment": null}, "is_given_elsewhere": {"type": "boolean", "index": 18, "name": "is_given_elsewhere", "comment": null}, "circumstance_ids": {"type": "character varying(255)[]", "index": 19, "name": "circumstance_ids", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 20, "name": "recorded_by_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine_administrations"}, "model.tamanu_source_dbt.vaccine_administrations_change_logs": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine_administrations_change_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"changelog_id": {"type": "uuid", "index": 1, "name": "changelog_id", "comment": null}, "logged_at": {"type": "timestamp without time zone", "index": 2, "name": "logged_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 5, "name": "updated_by_user_id", "comment": null}, "id": {"type": "text", "index": 6, "name": "id", "comment": null}, "datetime": {"type": "timestamp without time zone", "index": 7, "name": "datetime", "comment": null}, "batch": {"type": "text", "index": 8, "name": "batch", "comment": null}, "is_consented": {"type": "boolean", "index": 9, "name": "is_consented", "comment": null}, "disease": {"type": "text", "index": 10, "name": "disease", "comment": null}, "given_by": {"type": "text", "index": 11, "name": "given_by", "comment": null}, "is_given_elsewhere": {"type": "boolean", "index": 12, "name": "is_given_elsewhere", "comment": null}, "circumstance_ids": {"type": "text", "index": 13, "name": "circumstance_ids", "comment": null}, "recorded_by_id": {"type": "text", "index": 14, "name": "recorded_by_id", "comment": null}, "encounter_id": {"type": "text", "index": 15, "name": "encounter_id", "comment": null}, "location_id": {"type": "text", "index": 16, "name": "location_id", "comment": null}, "department_id": {"type": "text", "index": 17, "name": "department_id", "comment": null}, "vaccine_name": {"type": "text", "index": 18, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 19, "name": "vaccine_brand", "comment": null}, "injection_site": {"type": "text", "index": 20, "name": "injection_site", "comment": null}, "consent_given_by": {"type": "text", "index": 21, "name": "consent_given_by", "comment": null}, "scheduled_vaccine_id": {"type": "text", "index": 22, "name": "scheduled_vaccine_id", "comment": null}, "status": {"type": "text", "index": 23, "name": "status", "comment": null}, "reason": {"type": "text", "index": 24, "name": "reason", "comment": null}, "not_given_reason_id": {"type": "text", "index": 25, "name": "not_given_reason_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine_administrations_change_logs"}, "model.tamanu_source_dbt.vaccine_schedules": {"metadata": {"type": "VIEW", "schema": "reporting", "name": "vaccine_schedules", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "category": {"type": "character varying(255)", "index": 2, "name": "category", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 3, "name": "vaccine_id", "comment": null}, "label": {"type": "character varying(255)", "index": 4, "name": "label", "comment": null}, "dose_label": {"type": "character varying(255)", "index": 5, "name": "dose_label", "comment": null}, "index": {"type": "integer", "index": 6, "name": "index", "comment": null}, "weeks_from_birth_due": {"type": "integer", "index": 7, "name": "weeks_from_birth_due", "comment": null}, "weeks_from_last_vaccination_due": {"type": "integer", "index": 8, "name": "weeks_from_last_vaccination_due", "comment": null}, "sort_index": {"type": "integer", "index": 9, "name": "sort_index", "comment": null}, "visibility_status": {"type": "text", "index": 10, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tamanu_source_dbt.vaccine_schedules"}}, "sources": {"source.tamanu_source_dbt.logs__tamanu.accesses": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "accesses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "record_id": {"type": "text", "index": 6, "name": "record_id", "comment": null}, "record_type": {"type": "text", "index": 7, "name": "record_type", "comment": null}, "facility_id": {"type": "text", "index": 8, "name": "facility_id", "comment": null}, "session_id": {"type": "text", "index": 9, "name": "session_id", "comment": null}, "device_id": {"type": "text", "index": 10, "name": "device_id", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 11, "name": "logged_at", "comment": null}, "front_end_context": {"type": "jsonb", "index": 12, "name": "front_end_context", "comment": null}, "back_end_context": {"type": "jsonb", "index": 13, "name": "back_end_context", "comment": null}, "is_mobile": {"type": "boolean", "index": 14, "name": "is_mobile", "comment": null}, "version": {"type": "text", "index": 15, "name": "version", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.accesses"}, "source.tamanu_source_dbt.logs__tamanu.changes": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "changes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "table_oid": {"type": "integer", "index": 2, "name": "table_oid", "comment": null}, "table_schema": {"type": "text", "index": 3, "name": "table_schema", "comment": null}, "table_name": {"type": "text", "index": 4, "name": "table_name", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 5, "name": "logged_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_by_user_id": {"type": "text", "index": 9, "name": "updated_by_user_id", "comment": null}, "device_id": {"type": "text", "index": 10, "name": "device_id", "comment": null}, "version": {"type": "text", "index": 11, "name": "version", "comment": null}, "record_id": {"type": "text", "index": 12, "name": "record_id", "comment": null}, "record_created_at": {"type": "timestamp with time zone", "index": 14, "name": "record_created_at", "comment": null}, "record_updated_at": {"type": "timestamp with time zone", "index": 15, "name": "record_updated_at", "comment": null}, "record_deleted_at": {"type": "timestamp with time zone", "index": 16, "name": "record_deleted_at", "comment": null}, "record_data": {"type": "jsonb", "index": 18, "name": "record_data", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 19, "name": "updated_at_sync_tick", "comment": null}, "reason": {"type": "text", "index": 20, "name": "reason", "comment": null}, "migration_context": {"type": "text", "index": 21, "name": "migration_context", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.changes"}, "source.tamanu_source_dbt.logs__tamanu.debug_logs": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "debug_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "type": {"type": "character varying(255)", "index": 2, "name": "type", "comment": null}, "info": {"type": "json", "index": 3, "name": "info", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.debug_logs"}, "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "dhis2_pushes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "report_id": {"type": "text", "index": 5, "name": "report_id", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "message": {"type": "text", "index": 7, "name": "message", "comment": null}, "imported": {"type": "integer", "index": 8, "name": "imported", "comment": null}, "updated": {"type": "integer", "index": 9, "name": "updated", "comment": null}, "ignored": {"type": "integer", "index": 10, "name": "ignored", "comment": null}, "deleted": {"type": "integer", "index": 11, "name": "deleted", "comment": null}, "conflicts": {"type": "json", "index": 12, "name": "conflicts", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.dhis2_pushes"}, "source.tamanu_source_dbt.logs__tamanu.fhir_writes": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "fhir_writes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "verb": {"type": "text", "index": 3, "name": "verb", "comment": null}, "url": {"type": "text", "index": 4, "name": "url", "comment": null}, "body": {"type": "jsonb", "index": 5, "name": "body", "comment": null}, "headers": {"type": "jsonb", "index": 6, "name": "headers", "comment": null}, "user_id": {"type": "character varying(255)", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.fhir_writes"}, "source.tamanu_source_dbt.logs__tamanu.migrations": {"metadata": {"type": "BASE TABLE", "schema": "logs", "name": "migrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "logged_at": {"type": "timestamp with time zone", "index": 2, "name": "logged_at", "comment": null}, "record_sync_tick": {"type": "bigint", "index": 3, "name": "record_sync_tick", "comment": null}, "device_id": {"type": "text", "index": 4, "name": "device_id", "comment": null}, "version": {"type": "text", "index": 5, "name": "version", "comment": null}, "direction": {"type": "text", "index": 6, "name": "direction", "comment": null}, "migrations": {"type": "jsonb", "index": 7, "name": "migrations", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.logs__tamanu.migrations"}, "source.tamanu_source_dbt.tamanu.SequelizeMeta": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "SequelizeMeta", "database": "app", "comment": null, "owner": "app"}, "columns": {"name": {"type": "character varying(255)", "index": 1, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.SequelizeMeta"}, "source.tamanu_source_dbt.tamanu.administered_vaccines": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "administered_vaccines", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "batch": {"type": "character varying(255)", "index": 5, "name": "batch", "comment": null}, "status": {"type": "character varying(255)", "index": 6, "name": "status", "comment": null}, "reason": {"type": "character varying(255)", "index": 7, "name": "reason", "comment": null}, "date": {"type": "date_time_string", "index": 9, "name": "date", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 10, "name": "scheduled_vaccine_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 11, "name": "encounter_id", "comment": null}, "injection_site": {"type": "character varying(255)", "index": 12, "name": "injection_site", "comment": null}, "consent": {"type": "boolean", "index": 13, "name": "consent", "comment": null}, "recorder_id": {"type": "character varying(255)", "index": 15, "name": "recorder_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 16, "name": "location_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 17, "name": "department_id", "comment": null}, "given_by": {"type": "text", "index": 18, "name": "given_by", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 23, "name": "date_legacy", "comment": null}, "not_given_reason_id": {"type": "character varying(255)", "index": 24, "name": "not_given_reason_id", "comment": null}, "given_elsewhere": {"type": "boolean", "index": 25, "name": "given_elsewhere", "comment": null}, "vaccine_name": {"type": "text", "index": 26, "name": "vaccine_name", "comment": null}, "vaccine_brand": {"type": "text", "index": 27, "name": "vaccine_brand", "comment": null}, "disease": {"type": "text", "index": 28, "name": "disease", "comment": null}, "circumstance_ids": {"type": "character varying(255)[]", "index": 29, "name": "circumstance_ids", "comment": null}, "consent_given_by": {"type": "text", "index": 30, "name": "consent_given_by", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 31, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.administered_vaccines"}, "source.tamanu_source_dbt.tamanu.appointment_procedure_types": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "appointment_procedure_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "appointment_id": {"type": "character varying(255)", "index": 2, "name": "appointment_id", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 3, "name": "procedure_type_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.appointment_procedure_types"}, "source.tamanu_source_dbt.tamanu.appointment_schedules": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "appointment_schedules", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "until_date": {"type": "date_string", "index": 2, "name": "until_date", "comment": null}, "interval": {"type": "integer", "index": 3, "name": "interval", "comment": null}, "frequency": {"type": "character varying(255)", "index": 4, "name": "frequency", "comment": null}, "days_of_week": {"type": "character varying(255)[]", "index": 5, "name": "days_of_week", "comment": null}, "nth_weekday": {"type": "integer", "index": 6, "name": "nth_weekday", "comment": null}, "occurrence_count": {"type": "integer", "index": 7, "name": "occurrence_count", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "is_fully_generated": {"type": "boolean", "index": 11, "name": "is_fully_generated", "comment": null}, "generated_until_date": {"type": "date_string", "index": 12, "name": "generated_until_date", "comment": null}, "cancelled_at_date": {"type": "date_string", "index": 13, "name": "cancelled_at_date", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.appointment_schedules"}, "source.tamanu_source_dbt.tamanu.appointments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "appointments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "start_time": {"type": "date_time_string", "index": 5, "name": "start_time", "comment": null}, "end_time": {"type": "date_time_string", "index": 6, "name": "end_time", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 8, "name": "clinician_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 9, "name": "location_id", "comment": null}, "type_legacy": {"type": "character varying(255)", "index": 10, "name": "type_legacy", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "start_time_legacy": {"type": "timestamp with time zone", "index": 12, "name": "start_time_legacy", "comment": null}, "end_time_legacy": {"type": "timestamp with time zone", "index": 13, "name": "end_time_legacy", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 14, "name": "location_group_id", "comment": null}, "booking_type_id": {"type": "character varying(255)", "index": 15, "name": "booking_type_id", "comment": null}, "appointment_type_id": {"type": "character varying(255)", "index": 16, "name": "appointment_type_id", "comment": null}, "is_high_priority": {"type": "boolean", "index": 17, "name": "is_high_priority", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 18, "name": "encounter_id", "comment": null}, "schedule_id": {"type": "uuid", "index": 19, "name": "schedule_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 20, "name": "updated_at_sync_tick", "comment": null}, "additional_clinician_id": {"type": "character varying(255)", "index": 21, "name": "additional_clinician_id", "comment": null}, "link_encounter_id": {"type": "character varying(255)", "index": 22, "name": "link_encounter_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.appointments"}, "source.tamanu_source_dbt.tamanu.assets": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "assets", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 5, "name": "name", "comment": null}, "type": {"type": "character varying(255)", "index": 6, "name": "type", "comment": null}, "data": {"type": "bytea", "index": 7, "name": "data", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 9, "name": "facility_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.assets"}, "source.tamanu_source_dbt.tamanu.attachments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "attachments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "type": {"type": "text", "index": 2, "name": "type", "comment": null}, "size": {"type": "integer", "index": 3, "name": "size", "comment": null}, "data": {"type": "bytea", "index": 4, "name": "data", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.attachments"}, "source.tamanu_source_dbt.tamanu.certifiable_vaccines": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "certifiable_vaccines", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 5, "name": "vaccine_id", "comment": null}, "manufacturer_id": {"type": "character varying(255)", "index": 6, "name": "manufacturer_id", "comment": null}, "icd11_drug_code": {"type": "character varying(255)", "index": 7, "name": "icd11_drug_code", "comment": null}, "icd11_disease_code": {"type": "character varying(255)", "index": 8, "name": "icd11_disease_code", "comment": null}, "vaccine_code": {"type": "character varying(255)", "index": 9, "name": "vaccine_code", "comment": null}, "target_code": {"type": "character varying(255)", "index": 10, "name": "target_code", "comment": null}, "eu_product_code": {"type": "character varying(255)", "index": 11, "name": "eu_product_code", "comment": null}, "maximum_dosage": {"type": "integer", "index": 12, "name": "maximum_dosage", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.certifiable_vaccines"}, "source.tamanu_source_dbt.tamanu.certificate_notifications": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "certificate_notifications", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "type": {"type": "character varying(255)", "index": 5, "name": "type", "comment": null}, "require_signing": {"type": "boolean", "index": 6, "name": "require_signing", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "forward_address": {"type": "character varying(255)", "index": 8, "name": "forward_address", "comment": null}, "lab_test_id": {"type": "character varying(255)", "index": 13, "name": "lab_test_id", "comment": null}, "status": {"type": "character varying(255)", "index": 14, "name": "status", "comment": null}, "error": {"type": "text", "index": 15, "name": "error", "comment": null}, "created_by": {"type": "character varying(255)", "index": 16, "name": "created_by", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 17, "name": "lab_request_id", "comment": null}, "printed_date": {"type": "date_string", "index": 18, "name": "printed_date", "comment": null}, "facility_name": {"type": "character varying(255)", "index": 19, "name": "facility_name", "comment": null}, "language": {"type": "character varying(255)", "index": 20, "name": "language", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 21, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.certificate_notifications"}, "source.tamanu_source_dbt.tamanu.contributing_death_causes": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "contributing_death_causes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "time_after_onset": {"type": "integer", "index": 2, "name": "time_after_onset", "comment": null}, "patient_death_data_id": {"type": "character varying(255)", "index": 3, "name": "patient_death_data_id", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 4, "name": "condition_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 10, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 11, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.contributing_death_causes"}, "source.tamanu_source_dbt.tamanu.death_revert_logs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "death_revert_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "revert_time": {"type": "date_time_string", "index": 5, "name": "revert_time", "comment": null}, "death_data_id": {"type": "character varying(255)", "index": 6, "name": "death_data_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "reverted_by_id": {"type": "character varying(255)", "index": 8, "name": "reverted_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.death_revert_logs"}, "source.tamanu_source_dbt.tamanu.departments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "departments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 7, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 8, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.departments"}, "source.tamanu_source_dbt.tamanu.devices": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "devices", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "last_seen_at": {"type": "timestamp with time zone", "index": 5, "name": "last_seen_at", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 6, "name": "registered_by_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "scopes": {"type": "jsonb", "index": 8, "name": "scopes", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.devices"}, "source.tamanu_source_dbt.tamanu.discharges": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "discharges", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "text", "index": 5, "name": "note", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "discharger_id": {"type": "character varying(255)", "index": 7, "name": "discharger_id", "comment": null}, "disposition_id": {"type": "character varying(255)", "index": 8, "name": "disposition_id", "comment": null}, "facility_name": {"type": "character varying(255)", "index": 9, "name": "facility_name", "comment": null}, "facility_address": {"type": "character varying(255)", "index": 10, "name": "facility_address", "comment": null}, "facility_town": {"type": "character varying(255)", "index": 11, "name": "facility_town", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.discharges"}, "source.tamanu_source_dbt.tamanu.document_metadata": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "document_metadata", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "type": {"type": "text", "index": 3, "name": "type", "comment": null}, "document_created_at": {"type": "date_time_string", "index": 4, "name": "document_created_at", "comment": null}, "document_uploaded_at": {"type": "date_time_string", "index": 5, "name": "document_uploaded_at", "comment": null}, "document_owner": {"type": "text", "index": 6, "name": "document_owner", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 8, "name": "encounter_id", "comment": null}, "attachment_id": {"type": "character varying(255)", "index": 9, "name": "attachment_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 14, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 15, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 16, "name": "deleted_at", "comment": null}, "department_id": {"type": "character varying(255)", "index": 17, "name": "department_id", "comment": null}, "note": {"type": "character varying(255)", "index": 18, "name": "note", "comment": null}, "document_created_at_legacy": {"type": "timestamp with time zone", "index": 19, "name": "document_created_at_legacy", "comment": null}, "document_uploaded_at_legacy": {"type": "timestamp with time zone", "index": 20, "name": "document_uploaded_at_legacy", "comment": null}, "source": {"type": "character varying(255)", "index": 21, "name": "source", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 22, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.document_metadata"}, "source.tamanu_source_dbt.tamanu.encounter_diagnoses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_diagnoses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "certainty": {"type": "character varying(255)", "index": 5, "name": "certainty", "comment": null}, "is_primary": {"type": "boolean", "index": 6, "name": "is_primary", "comment": null}, "date": {"type": "date_time_string", "index": 7, "name": "date", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 8, "name": "encounter_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 9, "name": "diagnosis_id", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 10, "name": "date_legacy", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 11, "name": "clinician_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_diagnoses"}, "source.tamanu_source_dbt.tamanu.encounter_diets": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_diets", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "diet_id": {"type": "character varying(255)", "index": 3, "name": "diet_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_diets"}, "source.tamanu_source_dbt.tamanu.encounter_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_history", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 7, "name": "department_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 8, "name": "location_id", "comment": null}, "examiner_id": {"type": "character varying(255)", "index": 9, "name": "examiner_id", "comment": null}, "encounter_type": {"type": "character varying(255)", "index": 10, "name": "encounter_type", "comment": null}, "actor_id": {"type": "character varying(255)", "index": 11, "name": "actor_id", "comment": null}, "change_type": {"type": "text[]", "index": 12, "name": "change_type", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_history"}, "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_pause_prescription_histories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "encounter_prescription_id": {"type": "uuid", "index": 2, "name": "encounter_prescription_id", "comment": null}, "action": {"type": "character varying(255)", "index": 3, "name": "action", "comment": null}, "action_date": {"type": "date_time_string", "index": 4, "name": "action_date", "comment": null}, "action_user_id": {"type": "character varying(255)", "index": 5, "name": "action_user_id", "comment": null}, "notes": {"type": "text", "index": 6, "name": "notes", "comment": null}, "pause_duration": {"type": "numeric", "index": 7, "name": "pause_duration", "comment": null}, "pause_time_unit": {"type": "character varying(255)", "index": 8, "name": "pause_time_unit", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 10, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 11, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_pause_prescription_histories"}, "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_pause_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "encounter_prescription_id": {"type": "uuid", "index": 2, "name": "encounter_prescription_id", "comment": null}, "pause_duration": {"type": "numeric", "index": 3, "name": "pause_duration", "comment": null}, "pause_time_unit": {"type": "character varying(255)", "index": 4, "name": "pause_time_unit", "comment": null}, "pause_start_date": {"type": "date_time_string", "index": 5, "name": "pause_start_date", "comment": null}, "pause_end_date": {"type": "date_time_string", "index": 6, "name": "pause_end_date", "comment": null}, "notes": {"type": "text", "index": 7, "name": "notes", "comment": null}, "pausing_clinician_id": {"type": "character varying(255)", "index": 8, "name": "pausing_clinician_id", "comment": null}, "created_by": {"type": "character varying(255)", "index": 9, "name": "created_by", "comment": null}, "updated_by": {"type": "character varying(255)", "index": 10, "name": "updated_by", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 11, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 12, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 13, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_pause_prescriptions"}, "source.tamanu_source_dbt.tamanu.encounter_prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounter_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 3, "name": "prescription_id", "comment": null}, "is_selected_for_discharge": {"type": "boolean", "index": 4, "name": "is_selected_for_discharge", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounter_prescriptions"}, "source.tamanu_source_dbt.tamanu.encounters": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "encounters", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "encounter_type": {"type": "character varying(31)", "index": 5, "name": "encounter_type", "comment": null}, "start_date": {"type": "date_time_string", "index": 6, "name": "start_date", "comment": null}, "end_date": {"type": "date_time_string", "index": 7, "name": "end_date", "comment": null}, "reason_for_encounter": {"type": "text", "index": 8, "name": "reason_for_encounter", "comment": null}, "device_id": {"type": "text", "index": 9, "name": "device_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 11, "name": "patient_id", "comment": null}, "examiner_id": {"type": "character varying(255)", "index": 12, "name": "examiner_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 13, "name": "location_id", "comment": null}, "department_id": {"type": "character varying(255)", "index": 14, "name": "department_id", "comment": null}, "patient_billing_type_id": {"type": "character varying(255)", "index": 19, "name": "patient_billing_type_id", "comment": null}, "start_date_legacy": {"type": "timestamp with time zone", "index": 20, "name": "start_date_legacy", "comment": null}, "end_date_legacy": {"type": "timestamp with time zone", "index": 21, "name": "end_date_legacy", "comment": null}, "referral_source_id": {"type": "character varying(255)", "index": 22, "name": "referral_source_id", "comment": null}, "planned_location_id": {"type": "character varying(255)", "index": 23, "name": "planned_location_id", "comment": null}, "planned_location_start_time": {"type": "date_time_string", "index": 24, "name": "planned_location_start_time", "comment": null}, "discharge_draft": {"type": "jsonb", "index": 26, "name": "discharge_draft", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 27, "name": "updated_at_sync_tick", "comment": null}, "estimated_end_date": {"type": "date_string", "index": 28, "name": "estimated_end_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.encounters"}, "source.tamanu_source_dbt.tamanu.facilities": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "division": {"type": "character varying(255)", "index": 7, "name": "division", "comment": null}, "type": {"type": "character varying(255)", "index": 8, "name": "type", "comment": null}, "email": {"type": "character varying(255)", "index": 9, "name": "email", "comment": null}, "contact_number": {"type": "character varying(255)", "index": 10, "name": "contact_number", "comment": null}, "city_town": {"type": "character varying(255)", "index": 11, "name": "city_town", "comment": null}, "street_address": {"type": "character varying(255)", "index": 12, "name": "street_address", "comment": null}, "visibility_status": {"type": "text", "index": 13, "name": "visibility_status", "comment": null}, "catchment_id": {"type": "text", "index": 14, "name": "catchment_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 15, "name": "updated_at_sync_tick", "comment": null}, "is_sensitive": {"type": "boolean", "index": 16, "name": "is_sensitive", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.facilities"}, "source.tamanu_source_dbt.tamanu.imaging_area_external_codes": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_area_external_codes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "visibility_status": {"type": "text", "index": 6, "name": "visibility_status", "comment": null}, "area_id": {"type": "character varying(255)", "index": 7, "name": "area_id", "comment": null}, "code": {"type": "text", "index": 8, "name": "code", "comment": null}, "description": {"type": "text", "index": 9, "name": "description", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_area_external_codes"}, "source.tamanu_source_dbt.tamanu.imaging_request_areas": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_request_areas", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "imaging_request_id": {"type": "character varying", "index": 5, "name": "imaging_request_id", "comment": null}, "area_id": {"type": "character varying(255)", "index": 6, "name": "area_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_request_areas"}, "source.tamanu_source_dbt.tamanu.imaging_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "status": {"type": "character varying(255)", "index": 5, "name": "status", "comment": null}, "requested_date": {"type": "date_time_string", "index": 6, "name": "requested_date", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 8, "name": "requested_by_id", "comment": null}, "legacy_results": {"type": "text", "index": 12, "name": "legacy_results", "comment": null}, "completed_by_id": {"type": "character varying(255)", "index": 13, "name": "completed_by_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 14, "name": "location_id", "comment": null}, "imaging_type": {"type": "character varying(31)", "index": 15, "name": "imaging_type", "comment": null}, "requested_date_legacy": {"type": "timestamp with time zone", "index": 16, "name": "requested_date_legacy", "comment": null}, "priority": {"type": "character varying(255)", "index": 17, "name": "priority", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 18, "name": "location_group_id", "comment": null}, "reason_for_cancellation": {"type": "character varying(1024)", "index": 19, "name": "reason_for_cancellation", "comment": null}, "display_id": {"type": "character varying(255)", "index": 20, "name": "display_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 21, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_requests"}, "source.tamanu_source_dbt.tamanu.imaging_results": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_results", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "visibility_status": {"type": "text", "index": 6, "name": "visibility_status", "comment": null}, "imaging_request_id": {"type": "character varying", "index": 7, "name": "imaging_request_id", "comment": null}, "completed_by_id": {"type": "character varying(255)", "index": 8, "name": "completed_by_id", "comment": null}, "description": {"type": "text", "index": 9, "name": "description", "comment": null}, "external_code": {"type": "text", "index": 10, "name": "external_code", "comment": null}, "completed_at": {"type": "date_time_string", "index": 11, "name": "completed_at", "comment": null}, "result_image_url": {"type": "text", "index": 12, "name": "result_image_url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_results"}, "source.tamanu_source_dbt.tamanu.imaging_type_external_codes": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "imaging_type_external_codes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}, "imaging_type_code": {"type": "text", "index": 6, "name": "imaging_type_code", "comment": null}, "code": {"type": "text", "index": 7, "name": "code", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.imaging_type_external_codes"}, "source.tamanu_source_dbt.tamanu.invoice_discounts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_discounts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_id": {"type": "uuid", "index": 2, "name": "invoice_id", "comment": null}, "percentage": {"type": "numeric", "index": 3, "name": "percentage", "comment": null}, "reason": {"type": "character varying(255)", "index": 4, "name": "reason", "comment": null}, "is_manual": {"type": "boolean", "index": 5, "name": "is_manual", "comment": null}, "applied_by_user_id": {"type": "character varying(255)", "index": 6, "name": "applied_by_user_id", "comment": null}, "applied_time": {"type": "date_time_string", "index": 7, "name": "applied_time", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_discounts"}, "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_insurance_plan_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "invoice_insurance_plan_id": {"type": "text", "index": 6, "name": "invoice_insurance_plan_id", "comment": null}, "invoice_product_id": {"type": "text", "index": 7, "name": "invoice_product_id", "comment": null}, "coverage_value": {"type": "numeric", "index": 8, "name": "coverage_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurance_plan_items"}, "source.tamanu_source_dbt.tamanu.invoice_insurance_plans": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_insurance_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "code": {"type": "character varying(255)", "index": 6, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 7, "name": "name", "comment": null}, "default_coverage": {"type": "numeric", "index": 8, "name": "default_coverage", "comment": null}, "visibility_status": {"type": "text", "index": 9, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurance_plans"}, "source.tamanu_source_dbt.tamanu.invoice_insurer_payments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_insurer_payments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_payment_id": {"type": "uuid", "index": 2, "name": "invoice_payment_id", "comment": null}, "insurer_id": {"type": "character varying(255)", "index": 3, "name": "insurer_id", "comment": null}, "status": {"type": "character varying(255)", "index": 4, "name": "status", "comment": null}, "reason": {"type": "character varying(255)", "index": 5, "name": "reason", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_insurer_payments"}, "source.tamanu_source_dbt.tamanu.invoice_item_discounts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_item_discounts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_item_id": {"type": "uuid", "index": 2, "name": "invoice_item_id", "comment": null}, "amount": {"type": "numeric", "index": 3, "name": "amount", "comment": null}, "reason": {"type": "character varying(255)", "index": 4, "name": "reason", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "type": {"type": "character varying(255)", "index": 8, "name": "type", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_item_discounts"}, "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_item_finalised_insurances", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "invoice_item_id": {"type": "uuid", "index": 6, "name": "invoice_item_id", "comment": null}, "coverage_value_final": {"type": "numeric", "index": 7, "name": "coverage_value_final", "comment": null}, "invoice_insurance_plan_id": {"type": "character varying(255)", "index": 8, "name": "invoice_insurance_plan_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_item_finalised_insurances"}, "source.tamanu_source_dbt.tamanu.invoice_items": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_id": {"type": "uuid", "index": 2, "name": "invoice_id", "comment": null}, "order_date": {"type": "date_string", "index": 3, "name": "order_date", "comment": null}, "product_id": {"type": "character varying(255)", "index": 4, "name": "product_id", "comment": null}, "quantity": {"type": "integer", "index": 5, "name": "quantity", "comment": null}, "product_name_final": {"type": "character varying(255)", "index": 6, "name": "product_name_final", "comment": null}, "manual_entry_price": {"type": "numeric", "index": 7, "name": "manual_entry_price", "comment": null}, "ordered_by_user_id": {"type": "character varying(255)", "index": 8, "name": "ordered_by_user_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 10, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 11, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 12, "name": "deleted_at", "comment": null}, "product_code_final": {"type": "character varying(255)", "index": 13, "name": "product_code_final", "comment": null}, "note": {"type": "character varying(255)", "index": 14, "name": "note", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}, "source_record_type": {"type": "character varying(255)", "index": 17, "name": "source_record_type", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 18, "name": "source_record_id", "comment": null}, "price_final": {"type": "numeric", "index": 19, "name": "price_final", "comment": null}, "approved": {"type": "boolean", "index": 20, "name": "approved", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_items"}, "source.tamanu_source_dbt.tamanu.invoice_patient_payments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_patient_payments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_payment_id": {"type": "uuid", "index": 2, "name": "invoice_payment_id", "comment": null}, "method_id": {"type": "character varying(255)", "index": 3, "name": "method_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "cheque_number": {"type": "character varying(255)", "index": 7, "name": "cheque_number", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_patient_payments"}, "source.tamanu_source_dbt.tamanu.invoice_payments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_payments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "invoice_id": {"type": "uuid", "index": 2, "name": "invoice_id", "comment": null}, "date": {"type": "date_string", "index": 3, "name": "date", "comment": null}, "receipt_number": {"type": "character varying(255)", "index": 4, "name": "receipt_number", "comment": null}, "amount": {"type": "numeric", "index": 5, "name": "amount", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_by_user_id": {"type": "character varying(255)", "index": 9, "name": "updated_by_user_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_payments"}, "source.tamanu_source_dbt.tamanu.invoice_price_list_items": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_price_list_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "invoice_price_list_id": {"type": "text", "index": 6, "name": "invoice_price_list_id", "comment": null}, "invoice_product_id": {"type": "text", "index": 7, "name": "invoice_product_id", "comment": null}, "price": {"type": "numeric", "index": 8, "name": "price", "comment": null}, "is_hidden": {"type": "boolean", "index": 10, "name": "is_hidden", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_price_list_items"}, "source.tamanu_source_dbt.tamanu.invoice_price_lists": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_price_lists", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "code": {"type": "character varying(255)", "index": 6, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 7, "name": "name", "comment": null}, "rules": {"type": "jsonb", "index": 8, "name": "rules", "comment": null}, "visibility_status": {"type": "text", "index": 9, "name": "visibility_status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_price_lists"}, "source.tamanu_source_dbt.tamanu.invoice_products": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoice_products", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 8, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}, "category": {"type": "character varying(255)", "index": 10, "name": "category", "comment": null}, "source_record_type": {"type": "character varying(255)", "index": 11, "name": "source_record_type", "comment": null}, "source_record_id": {"type": "character varying(255)", "index": 12, "name": "source_record_id", "comment": null}, "insurable": {"type": "boolean", "index": 13, "name": "insurable", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoice_products"}, "source.tamanu_source_dbt.tamanu.invoices": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoices", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 2, "name": "display_id", "comment": null}, "date": {"type": "date_time_string", "index": 3, "name": "date", "comment": null}, "status": {"type": "character varying(255)", "index": 4, "name": "status", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "patient_payment_status": {"type": "character varying(255)", "index": 11, "name": "patient_payment_status", "comment": null}, "insurer_payment_status": {"type": "character varying(255)", "index": 12, "name": "insurer_payment_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoices"}, "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "invoices_invoice_insurance_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "invoice_id": {"type": "uuid", "index": 6, "name": "invoice_id", "comment": null}, "invoice_insurance_plan_id": {"type": "character varying(255)", "index": 7, "name": "invoice_insurance_plan_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.invoices_invoice_insurance_plans"}, "source.tamanu_source_dbt.tamanu.ips_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "ips_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 5, "name": "patient_id", "comment": null}, "created_by": {"type": "character varying(255)", "index": 6, "name": "created_by", "comment": null}, "status": {"type": "character varying(255)", "index": 7, "name": "status", "comment": null}, "email": {"type": "character varying(255)", "index": 8, "name": "email", "comment": null}, "error": {"type": "text", "index": 9, "name": "error", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.ips_requests"}, "source.tamanu_source_dbt.tamanu.lab_request_attachments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_request_attachments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "attachment_id": {"type": "character varying(255)", "index": 5, "name": "attachment_id", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 6, "name": "lab_request_id", "comment": null}, "title": {"type": "character varying(255)", "index": 7, "name": "title", "comment": null}, "replaced_by_id": {"type": "character varying(255)", "index": 8, "name": "replaced_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_request_attachments"}, "source.tamanu_source_dbt.tamanu.lab_request_logs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_request_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "status": {"type": "character varying(31)", "index": 5, "name": "status", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 6, "name": "lab_request_id", "comment": null}, "updated_by_id": {"type": "character varying(255)", "index": 7, "name": "updated_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_request_logs"}, "source.tamanu_source_dbt.tamanu.lab_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "sample_time": {"type": "date_time_string", "index": 5, "name": "sample_time", "comment": null}, "requested_date": {"type": "date_time_string", "index": 6, "name": "requested_date", "comment": null}, "urgent": {"type": "boolean", "index": 7, "name": "urgent", "comment": null}, "specimen_attached": {"type": "boolean", "index": 8, "name": "specimen_attached", "comment": null}, "status": {"type": "character varying(255)", "index": 9, "name": "status", "comment": null}, "senaite_id": {"type": "character varying(255)", "index": 10, "name": "senaite_id", "comment": null}, "sample_id": {"type": "character varying(255)", "index": 11, "name": "sample_id", "comment": null}, "requested_by_id": {"type": "character varying(255)", "index": 12, "name": "requested_by_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 13, "name": "encounter_id", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 14, "name": "lab_test_category_id", "comment": null}, "display_id": {"type": "character varying(255)", "index": 16, "name": "display_id", "comment": null}, "lab_test_priority_id": {"type": "character varying(255)", "index": 18, "name": "lab_test_priority_id", "comment": null}, "lab_test_laboratory_id": {"type": "character varying(255)", "index": 19, "name": "lab_test_laboratory_id", "comment": null}, "sample_time_legacy": {"type": "timestamp with time zone", "index": 20, "name": "sample_time_legacy", "comment": null}, "requested_date_legacy": {"type": "timestamp with time zone", "index": 21, "name": "requested_date_legacy", "comment": null}, "reason_for_cancellation": {"type": "character varying(31)", "index": 22, "name": "reason_for_cancellation", "comment": null}, "department_id": {"type": "character varying(255)", "index": 23, "name": "department_id", "comment": null}, "lab_test_panel_request_id": {"type": "uuid", "index": 24, "name": "lab_test_panel_request_id", "comment": null}, "lab_sample_site_id": {"type": "character varying(255)", "index": 25, "name": "lab_sample_site_id", "comment": null}, "published_date": {"type": "date_time_string", "index": 26, "name": "published_date", "comment": null}, "specimen_type_id": {"type": "character varying(255)", "index": 27, "name": "specimen_type_id", "comment": null}, "collected_by_id": {"type": "character varying(255)", "index": 28, "name": "collected_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 29, "name": "updated_at_sync_tick", "comment": null}, "results_interpretation": {"type": "text", "index": 30, "name": "results_interpretation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_requests"}, "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_test_panel_lab_test_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 5, "name": "lab_test_panel_id", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 6, "name": "lab_test_type_id", "comment": null}, "id": {"type": "text", "index": 7, "name": "id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}, "order": {"type": "integer", "index": 9, "name": "order", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panel_lab_test_types"}, "source.tamanu_source_dbt.tamanu.lab_test_panel_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_test_panel_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "lab_test_panel_id": {"type": "character varying(255)", "index": 5, "name": "lab_test_panel_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 6, "name": "encounter_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panel_requests"}, "source.tamanu_source_dbt.tamanu.lab_test_panels": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_test_panels", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 5, "name": "name", "comment": null}, "code": {"type": "character varying(255)", "index": 6, "name": "code", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 7, "name": "visibility_status", "comment": null}, "external_code": {"type": "text", "index": 8, "name": "external_code", "comment": null}, "category_id": {"type": "character varying(255)", "index": 9, "name": "category_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_panels"}, "source.tamanu_source_dbt.tamanu.lab_test_types": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_test_types", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "unit": {"type": "character varying(255)", "index": 7, "name": "unit", "comment": null}, "male_min": {"type": "double precision", "index": 8, "name": "male_min", "comment": null}, "male_max": {"type": "double precision", "index": 9, "name": "male_max", "comment": null}, "female_min": {"type": "double precision", "index": 10, "name": "female_min", "comment": null}, "female_max": {"type": "double precision", "index": 11, "name": "female_max", "comment": null}, "range_text": {"type": "character varying(255)", "index": 12, "name": "range_text", "comment": null}, "result_type": {"type": "character varying(255)", "index": 13, "name": "result_type", "comment": null}, "options": {"type": "text", "index": 14, "name": "options", "comment": null}, "lab_test_category_id": {"type": "character varying(255)", "index": 15, "name": "lab_test_category_id", "comment": null}, "visibility_status": {"type": "text", "index": 16, "name": "visibility_status", "comment": null}, "external_code": {"type": "text", "index": 17, "name": "external_code", "comment": null}, "is_sensitive": {"type": "boolean", "index": 18, "name": "is_sensitive", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 19, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_test_types"}, "source.tamanu_source_dbt.tamanu.lab_tests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "lab_tests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_string", "index": 5, "name": "date", "comment": null}, "result": {"type": "text", "index": 7, "name": "result", "comment": null}, "lab_request_id": {"type": "character varying(255)", "index": 8, "name": "lab_request_id", "comment": null}, "lab_test_type_id": {"type": "character varying(255)", "index": 9, "name": "lab_test_type_id", "comment": null}, "category_id": {"type": "character varying(255)", "index": 10, "name": "category_id", "comment": null}, "lab_test_method_id": {"type": "character varying(255)", "index": 11, "name": "lab_test_method_id", "comment": null}, "laboratory_officer": {"type": "character varying(255)", "index": 12, "name": "laboratory_officer", "comment": null}, "completed_date": {"type": "date_time_string", "index": 13, "name": "completed_date", "comment": null}, "verification": {"type": "character varying(255)", "index": 14, "name": "verification", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 15, "name": "date_legacy", "comment": null}, "completed_date_legacy": {"type": "timestamp with time zone", "index": 16, "name": "completed_date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.lab_tests"}, "source.tamanu_source_dbt.tamanu.local_system_facts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "local_system_facts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "key": {"type": "character varying(255)", "index": 5, "name": "key", "comment": null}, "value": {"type": "text", "index": 6, "name": "value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.local_system_facts"}, "source.tamanu_source_dbt.tamanu.location_assignment_templates": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "location_assignment_templates", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 2, "name": "user_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 3, "name": "location_id", "comment": null}, "date": {"type": "date_string", "index": 4, "name": "date", "comment": null}, "start_time": {"type": "time without time zone", "index": 5, "name": "start_time", "comment": null}, "end_time": {"type": "time without time zone", "index": 6, "name": "end_time", "comment": null}, "repeat_end_date": {"type": "date_string", "index": 7, "name": "repeat_end_date", "comment": null}, "repeat_frequency": {"type": "smallint", "index": 8, "name": "repeat_frequency", "comment": null}, "repeat_unit": {"type": "character varying(255)", "index": 9, "name": "repeat_unit", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 10, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 11, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 12, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.location_assignment_templates"}, "source.tamanu_source_dbt.tamanu.location_assignments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "location_assignments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 2, "name": "user_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 3, "name": "location_id", "comment": null}, "date": {"type": "date_string", "index": 4, "name": "date", "comment": null}, "start_time": {"type": "time without time zone", "index": 5, "name": "start_time", "comment": null}, "end_time": {"type": "time without time zone", "index": 6, "name": "end_time", "comment": null}, "template_id": {"type": "uuid", "index": 7, "name": "template_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 8, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 9, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 10, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.location_assignments"}, "source.tamanu_source_dbt.tamanu.location_groups": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "location_groups", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "visibility_status": {"type": "text", "index": 5, "name": "visibility_status", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "code": {"type": "character varying(255)", "index": 7, "name": "code", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 8, "name": "facility_id", "comment": null}, "is_bookable": {"type": "character varying(255)", "index": 13, "name": "is_bookable", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.location_groups"}, "source.tamanu_source_dbt.tamanu.locations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "locations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 7, "name": "facility_id", "comment": null}, "visibility_status": {"type": "text", "index": 11, "name": "visibility_status", "comment": null}, "location_group_id": {"type": "character varying(255)", "index": 12, "name": "location_group_id", "comment": null}, "max_occupancy": {"type": "integer", "index": 13, "name": "max_occupancy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.locations"}, "source.tamanu_source_dbt.tamanu.medication_administration_record_doses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "medication_administration_record_doses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "dose_amount": {"type": "numeric", "index": 2, "name": "dose_amount", "comment": null}, "given_time": {"type": "date_time_string", "index": 3, "name": "given_time", "comment": null}, "given_by_user_id": {"type": "character varying(255)", "index": 4, "name": "given_by_user_id", "comment": null}, "recorded_by_user_id": {"type": "character varying(255)", "index": 5, "name": "recorded_by_user_id", "comment": null}, "mar_id": {"type": "character varying(255)", "index": 6, "name": "mar_id", "comment": null}, "dose_index": {"type": "integer", "index": 7, "name": "dose_index", "comment": null}, "is_removed": {"type": "boolean", "index": 8, "name": "is_removed", "comment": null}, "reason_for_removal": {"type": "character varying(255)", "index": 9, "name": "reason_for_removal", "comment": null}, "reason_for_change": {"type": "character varying(255)", "index": 10, "name": "reason_for_change", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 11, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 12, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 13, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.medication_administration_record_doses"}, "source.tamanu_source_dbt.tamanu.medication_administration_records": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "medication_administration_records", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "status": {"type": "character varying(255)", "index": 2, "name": "status", "comment": null}, "due_at": {"type": "date_time_string", "index": 3, "name": "due_at", "comment": null}, "recorded_at": {"type": "date_time_string", "index": 4, "name": "recorded_at", "comment": null}, "recorded_by_user_id": {"type": "character varying(255)", "index": 5, "name": "recorded_by_user_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 6, "name": "prescription_id", "comment": null}, "is_auto_generated": {"type": "boolean", "index": 7, "name": "is_auto_generated", "comment": null}, "changing_status_reason": {"type": "text", "index": 8, "name": "changing_status_reason", "comment": null}, "changing_not_given_info_reason": {"type": "character varying(255)", "index": 9, "name": "changing_not_given_info_reason", "comment": null}, "reason_not_given_id": {"type": "character varying(255)", "index": 10, "name": "reason_not_given_id", "comment": null}, "is_error": {"type": "boolean", "index": 11, "name": "is_error", "comment": null}, "error_notes": {"type": "text", "index": 12, "name": "error_notes", "comment": null}, "is_edited": {"type": "boolean", "index": 13, "name": "is_edited", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 14, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 15, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 16, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.medication_administration_records"}, "source.tamanu_source_dbt.tamanu.medication_dispenses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "medication_dispenses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "pharmacy_order_prescription_id": {"type": "uuid", "index": 2, "name": "pharmacy_order_prescription_id", "comment": null}, "quantity": {"type": "integer", "index": 3, "name": "quantity", "comment": null}, "instructions": {"type": "text", "index": 4, "name": "instructions", "comment": null}, "dispensed_by_user_id": {"type": "character varying(255)", "index": 5, "name": "dispensed_by_user_id", "comment": null}, "dispensed_at": {"type": "date_time_string", "index": 6, "name": "dispensed_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 7, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 8, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 9, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.medication_dispenses"}, "source.tamanu_source_dbt.tamanu.note_items": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "note_items", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note_page_id": {"type": "uuid", "index": 5, "name": "note_page_id", "comment": null}, "revised_by_id": {"type": "character varying(255)", "index": 6, "name": "revised_by_id", "comment": null}, "author_id": {"type": "character varying(255)", "index": 7, "name": "author_id", "comment": null}, "on_behalf_of_id": {"type": "character varying(255)", "index": 8, "name": "on_behalf_of_id", "comment": null}, "content": {"type": "text", "index": 9, "name": "content", "comment": null}, "date": {"type": "date_time_string", "index": 10, "name": "date", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 11, "name": "date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.note_items"}, "source.tamanu_source_dbt.tamanu.note_pages": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "note_pages", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note_type": {"type": "character varying(255)", "index": 5, "name": "note_type", "comment": null}, "record_id": {"type": "character varying(255)", "index": 6, "name": "record_id", "comment": null}, "record_type": {"type": "character varying(255)", "index": 7, "name": "record_type", "comment": null}, "date": {"type": "date_time_string", "index": 8, "name": "date", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 9, "name": "date_legacy", "comment": null}, "visibility_status": {"type": "text", "index": 10, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.note_pages"}, "source.tamanu_source_dbt.tamanu.notes": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "notes", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "record_id": {"type": "character varying(255)", "index": 6, "name": "record_id", "comment": null}, "record_type": {"type": "character varying(255)", "index": 7, "name": "record_type", "comment": null}, "date": {"type": "date_time_string", "index": 8, "name": "date", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 9, "name": "date_legacy", "comment": null}, "visibility_status": {"type": "text", "index": 10, "name": "visibility_status", "comment": null}, "author_id": {"type": "character varying(255)", "index": 11, "name": "author_id", "comment": null}, "on_behalf_of_id": {"type": "character varying(255)", "index": 12, "name": "on_behalf_of_id", "comment": null}, "content": {"type": "text", "index": 14, "name": "content", "comment": null}, "revised_by_id": {"type": "uuid", "index": 15, "name": "revised_by_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}, "note_type_id": {"type": "character varying(255)", "index": 17, "name": "note_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.notes"}, "source.tamanu_source_dbt.tamanu.notes_legacy": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "notes_legacy", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "record_id": {"type": "character varying(255)", "index": 5, "name": "record_id", "comment": null}, "record_type": {"type": "character varying(255)", "index": 6, "name": "record_type", "comment": null}, "date": {"type": "timestamp with time zone", "index": 7, "name": "date", "comment": null}, "note_type": {"type": "character varying(255)", "index": 8, "name": "note_type", "comment": null}, "content": {"type": "text", "index": 9, "name": "content", "comment": null}, "author_id": {"type": "character varying(255)", "index": 10, "name": "author_id", "comment": null}, "on_behalf_of_id": {"type": "character varying(255)", "index": 11, "name": "on_behalf_of_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.notes_legacy"}, "source.tamanu_source_dbt.tamanu.notifications": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "notifications", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "type": {"type": "character varying(255)", "index": 2, "name": "type", "comment": null}, "status": {"type": "character varying(255)", "index": 3, "name": "status", "comment": null}, "user_id": {"type": "character varying(255)", "index": 4, "name": "user_id", "comment": null}, "created_time": {"type": "date_time_string", "index": 5, "name": "created_time", "comment": null}, "metadata": {"type": "jsonb", "index": 6, "name": "metadata", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 7, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 8, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 9, "name": "deleted_at", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 10, "name": "patient_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.notifications"}, "source.tamanu_source_dbt.tamanu.one_time_logins": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "one_time_logins", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 2, "name": "user_id", "comment": null}, "token": {"type": "character varying(255)", "index": 3, "name": "token", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "expires_at": {"type": "timestamp with time zone", "index": 7, "name": "expires_at", "comment": null}, "used_at": {"type": "timestamp with time zone", "index": 8, "name": "used_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.one_time_logins"}, "source.tamanu_source_dbt.tamanu.patient_additional_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_additional_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "place_of_birth": {"type": "character varying(255)", "index": 5, "name": "place_of_birth", "comment": null}, "primary_contact_number": {"type": "character varying(255)", "index": 6, "name": "primary_contact_number", "comment": null}, "secondary_contact_number": {"type": "character varying(255)", "index": 7, "name": "secondary_contact_number", "comment": null}, "marital_status": {"type": "character varying(255)", "index": 8, "name": "marital_status", "comment": null}, "city_town": {"type": "character varying(255)", "index": 9, "name": "city_town", "comment": null}, "street_village": {"type": "character varying(255)", "index": 10, "name": "street_village", "comment": null}, "educational_level": {"type": "character varying(255)", "index": 11, "name": "educational_level", "comment": null}, "social_media": {"type": "character varying(255)", "index": 12, "name": "social_media", "comment": null}, "blood_type": {"type": "character varying(255)", "index": 13, "name": "blood_type", "comment": null}, "title": {"type": "character varying(255)", "index": 14, "name": "title", "comment": null}, "ethnicity_id": {"type": "character varying(255)", "index": 15, "name": "ethnicity_id", "comment": null}, "nationality_id": {"type": "character varying(255)", "index": 16, "name": "nationality_id", "comment": null}, "country_id": {"type": "character varying(255)", "index": 17, "name": "country_id", "comment": null}, "division_id": {"type": "character varying(255)", "index": 18, "name": "division_id", "comment": null}, "subdivision_id": {"type": "character varying(255)", "index": 19, "name": "subdivision_id", "comment": null}, "medical_area_id": {"type": "character varying(255)", "index": 20, "name": "medical_area_id", "comment": null}, "nursing_zone_id": {"type": "character varying(255)", "index": 21, "name": "nursing_zone_id", "comment": null}, "settlement_id": {"type": "character varying(255)", "index": 22, "name": "settlement_id", "comment": null}, "occupation_id": {"type": "character varying(255)", "index": 23, "name": "occupation_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 24, "name": "patient_id", "comment": null}, "birth_certificate": {"type": "character varying(255)", "index": 28, "name": "birth_certificate", "comment": null}, "driving_license": {"type": "character varying(255)", "index": 29, "name": "driving_license", "comment": null}, "passport": {"type": "character varying(255)", "index": 30, "name": "passport", "comment": null}, "religion_id": {"type": "character varying(255)", "index": 31, "name": "religion_id", "comment": null}, "patient_billing_type_id": {"type": "character varying(255)", "index": 32, "name": "patient_billing_type_id", "comment": null}, "country_of_birth_id": {"type": "character varying(255)", "index": 33, "name": "country_of_birth_id", "comment": null}, "registered_by_id": {"type": "character varying(255)", "index": 34, "name": "registered_by_id", "comment": null}, "emergency_contact_name": {"type": "character varying(255)", "index": 36, "name": "emergency_contact_name", "comment": null}, "emergency_contact_number": {"type": "character varying(255)", "index": 37, "name": "emergency_contact_number", "comment": null}, "mother_id": {"type": "character varying(255)", "index": 39, "name": "mother_id", "comment": null}, "father_id": {"type": "character varying(255)", "index": 40, "name": "father_id", "comment": null}, "id": {"type": "text", "index": 41, "name": "id", "comment": null}, "updated_at_by_field": {"type": "json", "index": 42, "name": "updated_at_by_field", "comment": null}, "health_center_id": {"type": "text", "index": 43, "name": "health_center_id", "comment": null}, "insurer_id": {"type": "character varying(255)", "index": 44, "name": "insurer_id", "comment": null}, "insurer_policy_number": {"type": "character varying(255)", "index": 45, "name": "insurer_policy_number", "comment": null}, "secondary_village_id": {"type": "text", "index": 46, "name": "secondary_village_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 47, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_additional_data"}, "source.tamanu_source_dbt.tamanu.patient_allergies": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_allergies", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "character varying(255)", "index": 5, "name": "note", "comment": null}, "recorded_date": {"type": "date_time_string", "index": 6, "name": "recorded_date", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "practitioner_id": {"type": "character varying(255)", "index": 8, "name": "practitioner_id", "comment": null}, "allergy_id": {"type": "character varying(255)", "index": 9, "name": "allergy_id", "comment": null}, "recorded_date_legacy": {"type": "timestamp with time zone", "index": 14, "name": "recorded_date_legacy", "comment": null}, "reaction_id": {"type": "character varying(255)", "index": 15, "name": "reaction_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_allergies"}, "source.tamanu_source_dbt.tamanu.patient_birth_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_birth_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 5, "name": "patient_id", "comment": null}, "birth_weight": {"type": "numeric", "index": 6, "name": "birth_weight", "comment": null}, "birth_length": {"type": "numeric", "index": 7, "name": "birth_length", "comment": null}, "birth_delivery_type": {"type": "character varying(255)", "index": 8, "name": "birth_delivery_type", "comment": null}, "gestational_age_estimate": {"type": "double precision", "index": 9, "name": "gestational_age_estimate", "comment": null}, "apgar_score_one_minute": {"type": "integer", "index": 10, "name": "apgar_score_one_minute", "comment": null}, "apgar_score_five_minutes": {"type": "integer", "index": 11, "name": "apgar_score_five_minutes", "comment": null}, "apgar_score_ten_minutes": {"type": "integer", "index": 12, "name": "apgar_score_ten_minutes", "comment": null}, "time_of_birth": {"type": "date_time_string", "index": 13, "name": "time_of_birth", "comment": null}, "birth_type": {"type": "character varying(255)", "index": 15, "name": "birth_type", "comment": null}, "attendant_at_birth": {"type": "character varying(255)", "index": 16, "name": "attendant_at_birth", "comment": null}, "name_of_attendant_at_birth": {"type": "character varying(255)", "index": 17, "name": "name_of_attendant_at_birth", "comment": null}, "birth_facility_id": {"type": "character varying(255)", "index": 18, "name": "birth_facility_id", "comment": null}, "registered_birth_place": {"type": "character varying(255)", "index": 19, "name": "registered_birth_place", "comment": null}, "time_of_birth_legacy": {"type": "character varying(255)", "index": 24, "name": "time_of_birth_legacy", "comment": null}, "id": {"type": "text", "index": 25, "name": "id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 26, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_birth_data"}, "source.tamanu_source_dbt.tamanu.patient_care_plans": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_care_plans", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "examiner_id": {"type": "character varying(255)", "index": 7, "name": "examiner_id", "comment": null}, "care_plan_id": {"type": "character varying(255)", "index": 8, "name": "care_plan_id", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 13, "name": "date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_care_plans"}, "source.tamanu_source_dbt.tamanu.patient_communications": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_communications", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "type": {"type": "text", "index": 5, "name": "type", "comment": null}, "channel": {"type": "text", "index": 6, "name": "channel", "comment": null}, "subject": {"type": "text", "index": 7, "name": "subject", "comment": null}, "content": {"type": "text", "index": 8, "name": "content", "comment": null}, "status": {"type": "enum_patient_communications_status", "index": 9, "name": "status", "comment": null}, "error": {"type": "text", "index": 10, "name": "error", "comment": null}, "retry_count": {"type": "integer", "index": 11, "name": "retry_count", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 12, "name": "patient_id", "comment": null}, "destination": {"type": "character varying(255)", "index": 13, "name": "destination", "comment": null}, "attachment": {"type": "character varying(255)", "index": 14, "name": "attachment", "comment": null}, "hash": {"type": "integer", "index": 15, "name": "hash", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_communications"}, "source.tamanu_source_dbt.tamanu.patient_conditions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "character varying(255)", "index": 5, "name": "note", "comment": null}, "recorded_date": {"type": "date_time_string", "index": 6, "name": "recorded_date", "comment": null}, "resolved": {"type": "boolean", "index": 7, "name": "resolved", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 8, "name": "patient_id", "comment": null}, "examiner_id": {"type": "character varying(255)", "index": 9, "name": "examiner_id", "comment": null}, "condition_id": {"type": "character varying(255)", "index": 10, "name": "condition_id", "comment": null}, "recorded_date_legacy": {"type": "timestamp with time zone", "index": 15, "name": "recorded_date_legacy", "comment": null}, "resolution_date": {"type": "date_time_string", "index": 16, "name": "resolution_date", "comment": null}, "resolution_practitioner_id": {"type": "character varying(255)", "index": 17, "name": "resolution_practitioner_id", "comment": null}, "resolution_note": {"type": "text", "index": 18, "name": "resolution_note", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 19, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_conditions"}, "source.tamanu_source_dbt.tamanu.patient_contacts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_contacts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "method": {"type": "text", "index": 6, "name": "method", "comment": null}, "connection_details": {"type": "jsonb", "index": 7, "name": "connection_details", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 9, "name": "patient_id", "comment": null}, "relationship_id": {"type": "character varying(255)", "index": 10, "name": "relationship_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_contacts"}, "source.tamanu_source_dbt.tamanu.patient_death_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_death_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 3, "name": "clinician_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 4, "name": "facility_id", "comment": null}, "manner": {"type": "character varying(255)", "index": 5, "name": "manner", "comment": null}, "recent_surgery": {"type": "character varying(255)", "index": 6, "name": "recent_surgery", "comment": null}, "last_surgery_date": {"type": "date_string", "index": 7, "name": "last_surgery_date", "comment": null}, "last_surgery_reason_id": {"type": "character varying(255)", "index": 8, "name": "last_surgery_reason_id", "comment": null}, "external_cause_date": {"type": "date_string", "index": 9, "name": "external_cause_date", "comment": null}, "external_cause_location": {"type": "character varying(255)", "index": 10, "name": "external_cause_location", "comment": null}, "external_cause_notes": {"type": "text", "index": 11, "name": "external_cause_notes", "comment": null}, "was_pregnant": {"type": "character varying(255)", "index": 12, "name": "was_pregnant", "comment": null}, "pregnancy_contributed": {"type": "character varying(255)", "index": 13, "name": "pregnancy_contributed", "comment": null}, "fetal_or_infant": {"type": "boolean", "index": 14, "name": "fetal_or_infant", "comment": null}, "stillborn": {"type": "character varying(255)", "index": 15, "name": "stillborn", "comment": null}, "birth_weight": {"type": "integer", "index": 16, "name": "birth_weight", "comment": null}, "within_day_of_birth": {"type": "boolean", "index": 17, "name": "within_day_of_birth", "comment": null}, "hours_survived_since_birth": {"type": "integer", "index": 18, "name": "hours_survived_since_birth", "comment": null}, "carrier_age": {"type": "integer", "index": 19, "name": "carrier_age", "comment": null}, "carrier_pregnancy_weeks": {"type": "integer", "index": 20, "name": "carrier_pregnancy_weeks", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 26, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 27, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 28, "name": "deleted_at", "comment": null}, "outside_health_facility": {"type": "boolean", "index": 32, "name": "outside_health_facility", "comment": null}, "primary_cause_time_after_onset": {"type": "integer", "index": 33, "name": "primary_cause_time_after_onset", "comment": null}, "primary_cause_condition_id": {"type": "character varying(255)", "index": 34, "name": "primary_cause_condition_id", "comment": null}, "antecedent_cause1_time_after_onset": {"type": "integer", "index": 35, "name": "antecedent_cause1_time_after_onset", "comment": null}, "antecedent_cause1_condition_id": {"type": "character varying(255)", "index": 36, "name": "antecedent_cause1_condition_id", "comment": null}, "antecedent_cause2_time_after_onset": {"type": "integer", "index": 37, "name": "antecedent_cause2_time_after_onset", "comment": null}, "antecedent_cause2_condition_id": {"type": "character varying(255)", "index": 38, "name": "antecedent_cause2_condition_id", "comment": null}, "external_cause_date_legacy": {"type": "timestamp with time zone", "index": 39, "name": "external_cause_date_legacy", "comment": null}, "last_surgery_date_legacy": {"type": "timestamp with time zone", "index": 40, "name": "last_surgery_date_legacy", "comment": null}, "is_final": {"type": "boolean", "index": 41, "name": "is_final", "comment": null}, "visibility_status": {"type": "text", "index": 42, "name": "visibility_status", "comment": null}, "antecedent_cause3_time_after_onset": {"type": "integer", "index": 43, "name": "antecedent_cause3_time_after_onset", "comment": null}, "antecedent_cause3_condition_id": {"type": "character varying(255)", "index": 44, "name": "antecedent_cause3_condition_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 45, "name": "updated_at_sync_tick", "comment": null}, "autopsy_requested": {"type": "character varying(255)", "index": 46, "name": "autopsy_requested", "comment": null}, "autopsy_findings_used": {"type": "character varying(255)", "index": 47, "name": "autopsy_findings_used", "comment": null}, "manner_of_death_description": {"type": "text", "index": 48, "name": "manner_of_death_description", "comment": null}, "pregnancy_moment": {"type": "character varying(255)", "index": 49, "name": "pregnancy_moment", "comment": null}, "multiple_pregnancy": {"type": "character varying(255)", "index": 50, "name": "multiple_pregnancy", "comment": null}, "mother_condition_description": {"type": "text", "index": 51, "name": "mother_condition_description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_death_data"}, "source.tamanu_source_dbt.tamanu.patient_facilities": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 5, "name": "facility_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_facilities"}, "source.tamanu_source_dbt.tamanu.patient_family_histories": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_family_histories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "character varying(255)", "index": 5, "name": "note", "comment": null}, "recorded_date": {"type": "date_time_string", "index": 6, "name": "recorded_date", "comment": null}, "relationship": {"type": "character varying(255)", "index": 7, "name": "relationship", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 8, "name": "patient_id", "comment": null}, "practitioner_id": {"type": "character varying(255)", "index": 9, "name": "practitioner_id", "comment": null}, "diagnosis_id": {"type": "character varying(255)", "index": 10, "name": "diagnosis_id", "comment": null}, "recorded_date_legacy": {"type": "timestamp with time zone", "index": 15, "name": "recorded_date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_family_histories"}, "source.tamanu_source_dbt.tamanu.patient_field_definition_categories": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_field_definition_categories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 9, "name": "name", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_definition_categories"}, "source.tamanu_source_dbt.tamanu.patient_field_definitions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_field_definitions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 9, "name": "name", "comment": null}, "field_type": {"type": "character varying(255)", "index": 10, "name": "field_type", "comment": null}, "options": {"type": "character varying(255)[]", "index": 11, "name": "options", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 12, "name": "visibility_status", "comment": null}, "category_id": {"type": "character varying(255)", "index": 13, "name": "category_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_definitions"}, "source.tamanu_source_dbt.tamanu.patient_field_values": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_field_values", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "value": {"type": "text", "index": 9, "name": "value", "comment": null}, "definition_id": {"type": "character varying(255)", "index": 10, "name": "definition_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 11, "name": "patient_id", "comment": null}, "id": {"type": "text", "index": 12, "name": "id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_field_values"}, "source.tamanu_source_dbt.tamanu.patient_issues": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_issues", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "note": {"type": "character varying(255)", "index": 5, "name": "note", "comment": null}, "recorded_date": {"type": "date_time_string", "index": 6, "name": "recorded_date", "comment": null}, "type": {"type": "enum_patient_issues_type", "index": 7, "name": "type", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 8, "name": "patient_id", "comment": null}, "recorded_date_legacy": {"type": "timestamp with time zone", "index": 13, "name": "recorded_date_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_issues"}, "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_ongoing_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 2, "name": "patient_id", "comment": null}, "prescription_id": {"type": "character varying(255)", "index": 3, "name": "prescription_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_ongoing_prescriptions"}, "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_program_registration_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "deletion_date": {"type": "date_time_string", "index": 7, "name": "deletion_date", "comment": null}, "program_registry_condition_id": {"type": "character varying(255)", "index": 10, "name": "program_registry_condition_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 11, "name": "clinician_id", "comment": null}, "deletion_clinician_id": {"type": "character varying(255)", "index": 12, "name": "deletion_clinician_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 14, "name": "updated_at_sync_tick", "comment": null}, "reason_for_change": {"type": "character varying(255)", "index": 15, "name": "reason_for_change", "comment": null}, "patient_program_registration_id": {"type": "text", "index": 17, "name": "patient_program_registration_id", "comment": null}, "program_registry_condition_category_id": {"type": "text", "index": 18, "name": "program_registry_condition_category_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_program_registration_conditions"}, "source.tamanu_source_dbt.tamanu.patient_program_registrations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_program_registrations", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "registration_status": {"type": "text", "index": 6, "name": "registration_status", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 7, "name": "patient_id", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 8, "name": "program_registry_id", "comment": null}, "clinical_status_id": {"type": "character varying(255)", "index": 9, "name": "clinical_status_id", "comment": null}, "clinician_id": {"type": "character varying(255)", "index": 10, "name": "clinician_id", "comment": null}, "registering_facility_id": {"type": "character varying(255)", "index": 11, "name": "registering_facility_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 12, "name": "facility_id", "comment": null}, "village_id": {"type": "character varying(255)", "index": 13, "name": "village_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 15, "name": "updated_at_sync_tick", "comment": null}, "deactivated_clinician_id": {"type": "character varying(255)", "index": 16, "name": "deactivated_clinician_id", "comment": null}, "deactivated_date": {"type": "character varying(255)", "index": 17, "name": "deactivated_date", "comment": null}, "id": {"type": "text", "index": 18, "name": "id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_program_registrations"}, "source.tamanu_source_dbt.tamanu.patient_secondary_ids": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_secondary_ids", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "value": {"type": "character varying(255)", "index": 9, "name": "value", "comment": null}, "visibility_status": {"type": "text", "index": 10, "name": "visibility_status", "comment": null}, "type_id": {"type": "character varying(255)", "index": 11, "name": "type_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 12, "name": "patient_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_secondary_ids"}, "source.tamanu_source_dbt.tamanu.patient_vrs_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patient_vrs_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "id_type": {"type": "character varying(255)", "index": 5, "name": "id_type", "comment": null}, "identifier": {"type": "character varying(255)", "index": 6, "name": "identifier", "comment": null}, "unmatched_village_name": {"type": "character varying(255)", "index": 7, "name": "unmatched_village_name", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 8, "name": "patient_id", "comment": null}, "is_deleted_by_remote": {"type": "boolean", "index": 9, "name": "is_deleted_by_remote", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patient_vrs_data"}, "source.tamanu_source_dbt.tamanu.patients": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "patients", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "display_id": {"type": "character varying(255)", "index": 5, "name": "display_id", "comment": null}, "first_name": {"type": "character varying(255)", "index": 6, "name": "first_name", "comment": null}, "middle_name": {"type": "character varying(255)", "index": 7, "name": "middle_name", "comment": null}, "last_name": {"type": "character varying(255)", "index": 8, "name": "last_name", "comment": null}, "cultural_name": {"type": "character varying(255)", "index": 9, "name": "cultural_name", "comment": null}, "email": {"type": "character varying(255)", "index": 10, "name": "email", "comment": null}, "date_of_birth": {"type": "date_string", "index": 11, "name": "date_of_birth", "comment": null}, "sex": {"type": "enum_patients_sex", "index": 12, "name": "sex", "comment": null}, "village_id": {"type": "character varying(255)", "index": 14, "name": "village_id", "comment": null}, "additional_details": {"type": "text", "index": 24, "name": "additional_details", "comment": null}, "date_of_death": {"type": "date_time_string", "index": 31, "name": "date_of_death", "comment": null}, "merged_into_id": {"type": "character varying(255)", "index": 32, "name": "merged_into_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 33, "name": "visibility_status", "comment": null}, "date_of_birth_legacy": {"type": "timestamp with time zone", "index": 34, "name": "date_of_birth_legacy", "comment": null}, "date_of_death_legacy": {"type": "timestamp with time zone", "index": 35, "name": "date_of_death_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 36, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.patients"}, "source.tamanu_source_dbt.tamanu.permissions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "permissions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "role_id": {"type": "character varying(255)", "index": 5, "name": "role_id", "comment": null}, "noun": {"type": "character varying(255)", "index": 6, "name": "noun", "comment": null}, "verb": {"type": "character varying(255)", "index": 7, "name": "verb", "comment": null}, "object_id": {"type": "character varying(255)", "index": 8, "name": "object_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.permissions"}, "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "pharmacy_order_prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "pharmacy_order_id": {"type": "uuid", "index": 2, "name": "pharmacy_order_id", "comment": null}, "prescription_id": {"type": "text", "index": 3, "name": "prescription_id", "comment": null}, "quantity": {"type": "integer", "index": 4, "name": "quantity", "comment": null}, "repeats": {"type": "integer", "index": 5, "name": "repeats", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}, "display_id": {"type": "character varying(255)", "index": 10, "name": "display_id", "comment": null}, "is_completed": {"type": "boolean", "index": 11, "name": "is_completed", "comment": null}, "ongoing_prescription_id": {"type": "text", "index": 12, "name": "ongoing_prescription_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.pharmacy_order_prescriptions"}, "source.tamanu_source_dbt.tamanu.pharmacy_orders": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "pharmacy_orders", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "ordering_clinician_id": {"type": "text", "index": 2, "name": "ordering_clinician_id", "comment": null}, "encounter_id": {"type": "text", "index": 3, "name": "encounter_id", "comment": null}, "comments": {"type": "text", "index": 4, "name": "comments", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}, "is_discharge_prescription": {"type": "boolean", "index": 9, "name": "is_discharge_prescription", "comment": null}, "date": {"type": "date_time_string", "index": 10, "name": "date", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 11, "name": "facility_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.pharmacy_orders"}, "source.tamanu_source_dbt.tamanu.portal_one_time_tokens": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "portal_one_time_tokens", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "portal_user_id": {"type": "text", "index": 5, "name": "portal_user_id", "comment": null}, "type": {"type": "character varying(255)", "index": 6, "name": "type", "comment": null}, "token": {"type": "character varying(255)", "index": 7, "name": "token", "comment": null}, "expires_at": {"type": "date_time_string", "index": 8, "name": "expires_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.portal_one_time_tokens"}, "source.tamanu_source_dbt.tamanu.portal_survey_assignments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "portal_survey_assignments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "patient_id": {"type": "text", "index": 5, "name": "patient_id", "comment": null}, "survey_id": {"type": "text", "index": 6, "name": "survey_id", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}, "assigned_at": {"type": "date_time_string", "index": 8, "name": "assigned_at", "comment": null}, "assigned_by_id": {"type": "text", "index": 9, "name": "assigned_by_id", "comment": null}, "survey_response_id": {"type": "text", "index": 10, "name": "survey_response_id", "comment": null}, "facility_id": {"type": "text", "index": 11, "name": "facility_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.portal_survey_assignments"}, "source.tamanu_source_dbt.tamanu.portal_users": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "portal_users", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "patient_id": {"type": "text", "index": 5, "name": "patient_id", "comment": null}, "email": {"type": "text", "index": 6, "name": "email", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}, "status": {"type": "text", "index": 8, "name": "status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.portal_users"}, "source.tamanu_source_dbt.tamanu.prescriptions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "prescriptions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "end_date": {"type": "date_time_string", "index": 6, "name": "end_date", "comment": null}, "notes": {"type": "character varying(255)", "index": 8, "name": "notes", "comment": null}, "indication": {"type": "character varying(255)", "index": 9, "name": "indication", "comment": null}, "route": {"type": "character varying(255)", "index": 10, "name": "route", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 16, "name": "medication_id", "comment": null}, "prescriber_id": {"type": "character varying(255)", "index": 17, "name": "prescriber_id", "comment": null}, "quantity": {"type": "integer", "index": 18, "name": "quantity", "comment": null}, "discontinued": {"type": "boolean", "index": 19, "name": "discontinued", "comment": null}, "discontinuing_clinician_id": {"type": "character varying(255)", "index": 20, "name": "discontinuing_clinician_id", "comment": null}, "discontinuing_reason": {"type": "character varying(255)", "index": 21, "name": "discontinuing_reason", "comment": null}, "repeats": {"type": "integer", "index": 22, "name": "repeats", "comment": null}, "discontinued_date": {"type": "character varying(255)", "index": 24, "name": "discontinued_date", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 25, "name": "date_legacy", "comment": null}, "end_date_legacy": {"type": "timestamp with time zone", "index": 26, "name": "end_date_legacy", "comment": null}, "is_ongoing": {"type": "boolean", "index": 27, "name": "is_ongoing", "comment": null}, "is_prn": {"type": "boolean", "index": 28, "name": "is_prn", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 29, "name": "is_variable_dose", "comment": null}, "dose_amount": {"type": "numeric", "index": 30, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 31, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 32, "name": "frequency", "comment": null}, "start_date": {"type": "date_time_string", "index": 33, "name": "start_date", "comment": null}, "duration_value": {"type": "numeric", "index": 34, "name": "duration_value", "comment": null}, "duration_unit": {"type": "character varying(255)", "index": 35, "name": "duration_unit", "comment": null}, "is_phone_order": {"type": "boolean", "index": 36, "name": "is_phone_order", "comment": null}, "ideal_times": {"type": "character varying(255)[]", "index": 37, "name": "ideal_times", "comment": null}, "pharmacy_notes": {"type": "character varying(255)", "index": 38, "name": "pharmacy_notes", "comment": null}, "display_pharmacy_notes_in_mar": {"type": "boolean", "index": 39, "name": "display_pharmacy_notes_in_mar", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 40, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.prescriptions"}, "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "procedure_assistant_clinicians", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "procedure_id": {"type": "character varying(255)", "index": 2, "name": "procedure_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 3, "name": "user_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.procedure_assistant_clinicians"}, "source.tamanu_source_dbt.tamanu.procedure_survey_responses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "procedure_survey_responses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "procedure_id": {"type": "character varying(255)", "index": 2, "name": "procedure_id", "comment": null}, "survey_response_id": {"type": "character varying(255)", "index": 3, "name": "survey_response_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.procedure_survey_responses"}, "source.tamanu_source_dbt.tamanu.procedure_type_surveys": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "procedure_type_surveys", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 2, "name": "procedure_type_id", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 3, "name": "survey_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.procedure_type_surveys"}, "source.tamanu_source_dbt.tamanu.procedures": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "procedures", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "completed": {"type": "boolean", "index": 5, "name": "completed", "comment": null}, "date": {"type": "date_time_string", "index": 6, "name": "date", "comment": null}, "end_time": {"type": "date_time_string", "index": 7, "name": "end_time", "comment": null}, "note": {"type": "text", "index": 8, "name": "note", "comment": null}, "completed_note": {"type": "text", "index": 9, "name": "completed_note", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 10, "name": "encounter_id", "comment": null}, "location_id": {"type": "character varying(255)", "index": 11, "name": "location_id", "comment": null}, "procedure_type_id": {"type": "character varying(255)", "index": 12, "name": "procedure_type_id", "comment": null}, "anaesthetic_id": {"type": "character varying(255)", "index": 13, "name": "anaesthetic_id", "comment": null}, "physician_id": {"type": "character varying(255)", "index": 14, "name": "physician_id", "comment": null}, "anaesthetist_id": {"type": "character varying(255)", "index": 16, "name": "anaesthetist_id", "comment": null}, "start_time": {"type": "date_time_string", "index": 17, "name": "start_time", "comment": null}, "date_legacy": {"type": "timestamp with time zone", "index": 18, "name": "date_legacy", "comment": null}, "start_time_legacy": {"type": "character varying(255)", "index": 19, "name": "start_time_legacy", "comment": null}, "end_time_legacy": {"type": "timestamp with time zone", "index": 20, "name": "end_time_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 21, "name": "updated_at_sync_tick", "comment": null}, "department_id": {"type": "character varying(255)", "index": 22, "name": "department_id", "comment": null}, "assistant_anaesthetist_id": {"type": "character varying(255)", "index": 23, "name": "assistant_anaesthetist_id", "comment": null}, "time_in": {"type": "date_time_string", "index": 24, "name": "time_in", "comment": null}, "time_out": {"type": "date_time_string", "index": 25, "name": "time_out", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.procedures"}, "source.tamanu_source_dbt.tamanu.program_data_elements": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_data_elements", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "indicator": {"type": "character varying(255)", "index": 7, "name": "indicator", "comment": null}, "default_text": {"type": "character varying(255)", "index": 8, "name": "default_text", "comment": null}, "default_options": {"type": "text", "index": 9, "name": "default_options", "comment": null}, "type": {"type": "character varying(31)", "index": 10, "name": "type", "comment": null}, "visualisation_config": {"type": "text", "index": 11, "name": "visualisation_config", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_data_elements"}, "source.tamanu_source_dbt.tamanu.program_registries": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_registries", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "text", "index": 5, "name": "code", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "currently_at_type": {"type": "text", "index": 7, "name": "currently_at_type", "comment": null}, "visibility_status": {"type": "text", "index": 8, "name": "visibility_status", "comment": null}, "program_id": {"type": "character varying(255)", "index": 9, "name": "program_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_registries"}, "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_registry_clinical_statuses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "text", "index": 5, "name": "code", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "color": {"type": "text", "index": 7, "name": "color", "comment": null}, "visibility_status": {"type": "text", "index": 8, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 9, "name": "program_registry_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_clinical_statuses"}, "source.tamanu_source_dbt.tamanu.program_registry_condition_categories": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_registry_condition_categories", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "text", "index": 5, "name": "code", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 8, "name": "program_registry_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_condition_categories"}, "source.tamanu_source_dbt.tamanu.program_registry_conditions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "program_registry_conditions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "text", "index": 5, "name": "code", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 7, "name": "visibility_status", "comment": null}, "program_registry_id": {"type": "character varying(255)", "index": 8, "name": "program_registry_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.program_registry_conditions"}, "source.tamanu_source_dbt.tamanu.programs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "programs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.programs"}, "source.tamanu_source_dbt.tamanu.reference_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_data", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "type": {"type": "character varying(255)", "index": 6, "name": "type", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "visibility_status": {"type": "text", "index": 8, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}, "system_required": {"type": "boolean", "index": 10, "name": "system_required", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_data"}, "source.tamanu_source_dbt.tamanu.reference_data_relations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_data_relations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "reference_data_id": {"type": "text", "index": 5, "name": "reference_data_id", "comment": null}, "reference_data_parent_id": {"type": "text", "index": 6, "name": "reference_data_parent_id", "comment": null}, "type": {"type": "character varying(255)", "index": 7, "name": "type", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_data_relations"}, "source.tamanu_source_dbt.tamanu.reference_drug_facilities": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_drug_facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "reference_drug_id": {"type": "uuid", "index": 2, "name": "reference_drug_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 3, "name": "facility_id", "comment": null}, "quantity": {"type": "integer", "index": 4, "name": "quantity", "comment": null}, "stock_status": {"type": "character varying(255)", "index": 5, "name": "stock_status", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_drug_facilities"}, "source.tamanu_source_dbt.tamanu.reference_drugs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_drugs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "reference_data_id": {"type": "character varying(255)", "index": 2, "name": "reference_data_id", "comment": null}, "route": {"type": "character varying(255)", "index": 3, "name": "route", "comment": null}, "units": {"type": "character varying(255)", "index": 4, "name": "units", "comment": null}, "notes": {"type": "character varying(255)", "index": 5, "name": "notes", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}, "is_sensitive": {"type": "boolean", "index": 10, "name": "is_sensitive", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_drugs"}, "source.tamanu_source_dbt.tamanu.reference_medication_templates": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "reference_medication_templates", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "reference_data_id": {"type": "character varying(255)", "index": 2, "name": "reference_data_id", "comment": null}, "medication_id": {"type": "character varying(255)", "index": 3, "name": "medication_id", "comment": null}, "is_variable_dose": {"type": "boolean", "index": 4, "name": "is_variable_dose", "comment": null}, "is_prn": {"type": "boolean", "index": 5, "name": "is_prn", "comment": null}, "dose_amount": {"type": "numeric", "index": 6, "name": "dose_amount", "comment": null}, "units": {"type": "character varying(255)", "index": 7, "name": "units", "comment": null}, "frequency": {"type": "character varying(255)", "index": 8, "name": "frequency", "comment": null}, "route": {"type": "character varying(255)", "index": 9, "name": "route", "comment": null}, "duration_value": {"type": "numeric", "index": 10, "name": "duration_value", "comment": null}, "duration_unit": {"type": "character varying(255)", "index": 11, "name": "duration_unit", "comment": null}, "notes": {"type": "text", "index": 12, "name": "notes", "comment": null}, "discharge_quantity": {"type": "integer", "index": 13, "name": "discharge_quantity", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 14, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 15, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 16, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}, "is_ongoing": {"type": "boolean", "index": 18, "name": "is_ongoing", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.reference_medication_templates"}, "source.tamanu_source_dbt.tamanu.referrals": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "referrals", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "referred_facility": {"type": "character varying(255)", "index": 15, "name": "referred_facility", "comment": null}, "initiating_encounter_id": {"type": "character varying(255)", "index": 16, "name": "initiating_encounter_id", "comment": null}, "completing_encounter_id": {"type": "character varying(255)", "index": 17, "name": "completing_encounter_id", "comment": null}, "survey_response_id": {"type": "character varying(255)", "index": 18, "name": "survey_response_id", "comment": null}, "status": {"type": "character varying(255)", "index": 19, "name": "status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 20, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.referrals"}, "source.tamanu_source_dbt.tamanu.refresh_tokens": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "refresh_tokens", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "refresh_id": {"type": "text", "index": 2, "name": "refresh_id", "comment": null}, "device_id": {"type": "text", "index": 3, "name": "device_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 4, "name": "user_id", "comment": null}, "expires_at": {"type": "timestamp with time zone", "index": 5, "name": "expires_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 7, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 8, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.refresh_tokens"}, "source.tamanu_source_dbt.tamanu.report_definition_versions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "report_definition_versions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "version_number": {"type": "integer", "index": 9, "name": "version_number", "comment": null}, "notes": {"type": "text", "index": 10, "name": "notes", "comment": null}, "status": {"type": "character varying(255)", "index": 11, "name": "status", "comment": null}, "query": {"type": "text", "index": 12, "name": "query", "comment": null}, "query_options": {"type": "json", "index": 13, "name": "query_options", "comment": null}, "report_definition_id": {"type": "character varying(255)", "index": 14, "name": "report_definition_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 15, "name": "user_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.report_definition_versions"}, "source.tamanu_source_dbt.tamanu.report_definitions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "report_definitions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 9, "name": "name", "comment": null}, "db_schema": {"type": "character varying(255)", "index": 10, "name": "db_schema", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.report_definitions"}, "source.tamanu_source_dbt.tamanu.report_requests": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "report_requests", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "report_type": {"type": "character varying(255)", "index": 5, "name": "report_type", "comment": null}, "recipients": {"type": "text", "index": 6, "name": "recipients", "comment": null}, "parameters": {"type": "text", "index": 7, "name": "parameters", "comment": null}, "status": {"type": "character varying(31)", "index": 8, "name": "status", "comment": null}, "requested_by_user_id": {"type": "character varying(255)", "index": 9, "name": "requested_by_user_id", "comment": null}, "error": {"type": "text", "index": 13, "name": "error", "comment": null}, "process_started_time": {"type": "timestamp with time zone", "index": 14, "name": "process_started_time", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 16, "name": "facility_id", "comment": null}, "export_format": {"type": "character varying(255)", "index": 17, "name": "export_format", "comment": null}, "report_definition_version_id": {"type": "character varying(255)", "index": 18, "name": "report_definition_version_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 19, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.report_requests"}, "source.tamanu_source_dbt.tamanu.roles": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "roles", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 5, "name": "name", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 6, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.roles"}, "source.tamanu_source_dbt.tamanu.scheduled_vaccines": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "scheduled_vaccines", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "category": {"type": "character varying(255)", "index": 5, "name": "category", "comment": null}, "label": {"type": "character varying(255)", "index": 6, "name": "label", "comment": null}, "dose_label": {"type": "character varying(255)", "index": 7, "name": "dose_label", "comment": null}, "weeks_from_birth_due": {"type": "integer", "index": 8, "name": "weeks_from_birth_due", "comment": null}, "index": {"type": "integer", "index": 9, "name": "index", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 10, "name": "vaccine_id", "comment": null}, "weeks_from_last_vaccination_due": {"type": "integer", "index": 11, "name": "weeks_from_last_vaccination_due", "comment": null}, "visibility_status": {"type": "text", "index": 12, "name": "visibility_status", "comment": null}, "hide_from_certificate": {"type": "boolean", "index": 13, "name": "hide_from_certificate", "comment": null}, "sort_index": {"type": "integer", "index": 14, "name": "sort_index", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 15, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.scheduled_vaccines"}, "source.tamanu_source_dbt.tamanu.settings": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "settings", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "key": {"type": "text", "index": 5, "name": "key", "comment": null}, "value": {"type": "jsonb", "index": 6, "name": "value", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 7, "name": "facility_id", "comment": null}, "scope": {"type": "text", "index": 8, "name": "scope", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.settings"}, "source.tamanu_source_dbt.tamanu.signers": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "signers", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "country_code": {"type": "character varying(255)", "index": 5, "name": "country_code", "comment": null}, "private_key": {"type": "bytea", "index": 6, "name": "private_key", "comment": null}, "public_key": {"type": "bytea", "index": 7, "name": "public_key", "comment": null}, "request": {"type": "text", "index": 8, "name": "request", "comment": null}, "certificate": {"type": "text", "index": 9, "name": "certificate", "comment": null}, "validity_period_start": {"type": "timestamp with time zone", "index": 10, "name": "validity_period_start", "comment": null}, "validity_period_end": {"type": "timestamp with time zone", "index": 11, "name": "validity_period_end", "comment": null}, "signatures_issued": {"type": "integer", "index": 12, "name": "signatures_issued", "comment": null}, "request_sent_at": {"type": "timestamp with time zone", "index": 13, "name": "request_sent_at", "comment": null}, "working_period_start": {"type": "timestamp with time zone", "index": 14, "name": "working_period_start", "comment": null}, "working_period_end": {"type": "timestamp with time zone", "index": 15, "name": "working_period_end", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.signers"}, "source.tamanu_source_dbt.tamanu.socket_io_attachments": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "socket_io_attachments", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "payload": {"type": "bytea", "index": 3, "name": "payload", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 4, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.socket_io_attachments"}, "source.tamanu_source_dbt.tamanu.survey_response_answers": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "survey_response_answers", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "name": {"type": "character varying(255)", "index": 5, "name": "name", "comment": null}, "body": {"type": "text", "index": 6, "name": "body", "comment": null}, "response_id": {"type": "character varying(255)", "index": 7, "name": "response_id", "comment": null}, "data_element_id": {"type": "character varying(255)", "index": 8, "name": "data_element_id", "comment": null}, "body_legacy": {"type": "text", "index": 9, "name": "body_legacy", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 10, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.survey_response_answers"}, "source.tamanu_source_dbt.tamanu.survey_responses": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "survey_responses", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "start_time": {"type": "date_time_string", "index": 5, "name": "start_time", "comment": null}, "end_time": {"type": "date_time_string", "index": 6, "name": "end_time", "comment": null}, "result": {"type": "double precision", "index": 7, "name": "result", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 8, "name": "survey_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 9, "name": "encounter_id", "comment": null}, "result_text": {"type": "text", "index": 10, "name": "result_text", "comment": null}, "user_id": {"type": "character varying(255)", "index": 11, "name": "user_id", "comment": null}, "start_time_legacy": {"type": "timestamp with time zone", "index": 12, "name": "start_time_legacy", "comment": null}, "end_time_legacy": {"type": "timestamp with time zone", "index": 13, "name": "end_time_legacy", "comment": null}, "notified": {"type": "boolean", "index": 14, "name": "notified", "comment": null}, "metadata": {"type": "jsonb", "index": 15, "name": "metadata", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 16, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.survey_responses"}, "source.tamanu_source_dbt.tamanu.survey_screen_components": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "survey_screen_components", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "screen_index": {"type": "integer", "index": 5, "name": "screen_index", "comment": null}, "component_index": {"type": "integer", "index": 6, "name": "component_index", "comment": null}, "text": {"type": "character varying(255)", "index": 7, "name": "text", "comment": null}, "visibility_criteria": {"type": "character varying(255)", "index": 8, "name": "visibility_criteria", "comment": null}, "validation_criteria": {"type": "text", "index": 9, "name": "validation_criteria", "comment": null}, "detail": {"type": "character varying(255)", "index": 10, "name": "detail", "comment": null}, "config": {"type": "character varying(255)", "index": 11, "name": "config", "comment": null}, "options": {"type": "character varying(255)", "index": 12, "name": "options", "comment": null}, "calculation": {"type": "character varying(255)", "index": 13, "name": "calculation", "comment": null}, "survey_id": {"type": "character varying(255)", "index": 14, "name": "survey_id", "comment": null}, "data_element_id": {"type": "character varying(255)", "index": 15, "name": "data_element_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 16, "name": "visibility_status", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.survey_screen_components"}, "source.tamanu_source_dbt.tamanu.surveys": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "surveys", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "code": {"type": "character varying(255)", "index": 5, "name": "code", "comment": null}, "name": {"type": "character varying(255)", "index": 6, "name": "name", "comment": null}, "program_id": {"type": "character varying(255)", "index": 7, "name": "program_id", "comment": null}, "survey_type": {"type": "character varying(255)", "index": 8, "name": "survey_type", "comment": null}, "is_sensitive": {"type": "boolean", "index": 9, "name": "is_sensitive", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 10, "name": "visibility_status", "comment": null}, "notifiable": {"type": "boolean", "index": 11, "name": "notifiable", "comment": null}, "notify_email_addresses": {"type": "character varying(255)[]", "index": 12, "name": "notify_email_addresses", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.surveys"}, "source.tamanu_source_dbt.tamanu.sync_device_ticks": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_device_ticks", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "persisted_at_sync_tick": {"type": "bigint", "index": 2, "name": "persisted_at_sync_tick", "comment": null}, "device_id": {"type": "text", "index": 3, "name": "device_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_device_ticks"}, "source.tamanu_source_dbt.tamanu.sync_lookup": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_lookup", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "record_id": {"type": "character varying(255)", "index": 2, "name": "record_id", "comment": null}, "record_type": {"type": "character varying(255)", "index": 3, "name": "record_type", "comment": null}, "data": {"type": "json", "index": 4, "name": "data", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 5, "name": "updated_at_sync_tick", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 7, "name": "encounter_id", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 8, "name": "facility_id", "comment": null}, "is_lab_request": {"type": "boolean", "index": 9, "name": "is_lab_request", "comment": null}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": null}, "updated_at_by_field_sum": {"type": "bigint", "index": 11, "name": "updated_at_by_field_sum", "comment": null}, "pushed_by_device_id": {"type": "text", "index": 12, "name": "pushed_by_device_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_lookup"}, "source.tamanu_source_dbt.tamanu.sync_lookup_ticks": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_lookup_ticks", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "source_start_tick": {"type": "bigint", "index": 2, "name": "source_start_tick", "comment": null}, "lookup_end_tick": {"type": "bigint", "index": 3, "name": "lookup_end_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_lookup_ticks"}, "source.tamanu_source_dbt.tamanu.sync_queued_devices": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_queued_devices", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "last_seen_time": {"type": "timestamp with time zone", "index": 2, "name": "last_seen_time", "comment": null}, "facility_id_legacy": {"type": "text", "index": 3, "name": "facility_id_legacy", "comment": null}, "last_synced_tick": {"type": "bigint", "index": 4, "name": "last_synced_tick", "comment": null}, "urgent": {"type": "boolean", "index": 5, "name": "urgent", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "facility_ids": {"type": "jsonb", "index": 9, "name": "facility_ids", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_queued_devices"}, "source.tamanu_source_dbt.tamanu.sync_sessions": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sync_sessions", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "start_time": {"type": "timestamp with time zone", "index": 5, "name": "start_time", "comment": null}, "last_connection_time": {"type": "timestamp with time zone", "index": 6, "name": "last_connection_time", "comment": null}, "snapshot_completed_at": {"type": "timestamp with time zone", "index": 7, "name": "snapshot_completed_at", "comment": null}, "debug_info": {"type": "json", "index": 9, "name": "debug_info", "comment": null}, "completed_at": {"type": "timestamp with time zone", "index": 10, "name": "completed_at", "comment": null}, "persist_completed_at": {"type": "timestamp with time zone", "index": 11, "name": "persist_completed_at", "comment": null}, "pull_since": {"type": "bigint", "index": 12, "name": "pull_since", "comment": null}, "pull_until": {"type": "bigint", "index": 13, "name": "pull_until", "comment": null}, "started_at_tick": {"type": "bigint", "index": 14, "name": "started_at_tick", "comment": null}, "snapshot_started_at": {"type": "timestamp with time zone", "index": 15, "name": "snapshot_started_at", "comment": null}, "errors": {"type": "text[]", "index": 16, "name": "errors", "comment": null}, "parameters": {"type": "jsonb", "index": 17, "name": "parameters", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.sync_sessions"}, "source.tamanu_source_dbt.tamanu.task_designations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "task_designations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "task_id": {"type": "uuid", "index": 2, "name": "task_id", "comment": null}, "designation_id": {"type": "character varying(255)", "index": 3, "name": "designation_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.task_designations"}, "source.tamanu_source_dbt.tamanu.task_template_designations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "task_template_designations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "task_template_id": {"type": "uuid", "index": 2, "name": "task_template_id", "comment": null}, "designation_id": {"type": "character varying(255)", "index": 3, "name": "designation_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.task_template_designations"}, "source.tamanu_source_dbt.tamanu.task_templates": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "task_templates", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "reference_data_id": {"type": "character varying(255)", "index": 2, "name": "reference_data_id", "comment": null}, "high_priority": {"type": "boolean", "index": 3, "name": "high_priority", "comment": null}, "frequency_value": {"type": "numeric", "index": 4, "name": "frequency_value", "comment": null}, "frequency_unit": {"type": "character varying(255)", "index": 5, "name": "frequency_unit", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 7, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 8, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 9, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.task_templates"}, "source.tamanu_source_dbt.tamanu.tasks": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "tasks", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 2, "name": "encounter_id", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "due_time": {"type": "date_time_string", "index": 4, "name": "due_time", "comment": null}, "end_time": {"type": "date_time_string", "index": 5, "name": "end_time", "comment": null}, "requested_by_user_id": {"type": "character varying(255)", "index": 6, "name": "requested_by_user_id", "comment": null}, "request_time": {"type": "date_time_string", "index": 7, "name": "request_time", "comment": null}, "status": {"type": "character varying(255)", "index": 8, "name": "status", "comment": null}, "note": {"type": "text", "index": 9, "name": "note", "comment": null}, "frequency_value": {"type": "numeric", "index": 10, "name": "frequency_value", "comment": null}, "frequency_unit": {"type": "character varying(255)", "index": 11, "name": "frequency_unit", "comment": null}, "high_priority": {"type": "boolean", "index": 12, "name": "high_priority", "comment": null}, "parent_task_id": {"type": "uuid", "index": 13, "name": "parent_task_id", "comment": null}, "completed_by_user_id": {"type": "character varying(255)", "index": 14, "name": "completed_by_user_id", "comment": null}, "completed_time": {"type": "date_time_string", "index": 15, "name": "completed_time", "comment": null}, "completed_note": {"type": "text", "index": 16, "name": "completed_note", "comment": null}, "not_completed_by_user_id": {"type": "character varying(255)", "index": 17, "name": "not_completed_by_user_id", "comment": null}, "not_completed_time": {"type": "date_time_string", "index": 18, "name": "not_completed_time", "comment": null}, "not_completed_reason_id": {"type": "text", "index": 19, "name": "not_completed_reason_id", "comment": null}, "todo_by_user_id": {"type": "character varying(255)", "index": 20, "name": "todo_by_user_id", "comment": null}, "todo_time": {"type": "date_time_string", "index": 21, "name": "todo_time", "comment": null}, "todo_note": {"type": "text", "index": 22, "name": "todo_note", "comment": null}, "deleted_by_user_id": {"type": "character varying(255)", "index": 23, "name": "deleted_by_user_id", "comment": null}, "deleted_time": {"type": "date_time_string", "index": 24, "name": "deleted_time", "comment": null}, "deleted_reason_id": {"type": "character varying(255)", "index": 25, "name": "deleted_reason_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 26, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 27, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 28, "name": "deleted_at", "comment": null}, "deleted_reason_for_sync_id": {"type": "character varying(255)", "index": 29, "name": "deleted_reason_for_sync_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 30, "name": "updated_at_sync_tick", "comment": null}, "duration_value": {"type": "numeric", "index": 31, "name": "duration_value", "comment": null}, "duration_unit": {"type": "character varying(255)", "index": 32, "name": "duration_unit", "comment": null}, "task_type": {"type": "character varying(255)", "index": 33, "name": "task_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.tasks"}, "source.tamanu_source_dbt.tamanu.templates": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "templates", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 2, "name": "deleted_at", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 3, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 4, "name": "updated_at", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "date_created": {"type": "date_string", "index": 6, "name": "date_created", "comment": null}, "title": {"type": "text", "index": 7, "name": "title", "comment": null}, "body": {"type": "text", "index": 8, "name": "body", "comment": null}, "visibility_status": {"type": "text", "index": 9, "name": "visibility_status", "comment": null}, "created_by_id": {"type": "character varying(255)", "index": 10, "name": "created_by_id", "comment": null}, "type": {"type": "text", "index": 11, "name": "type", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.templates"}, "source.tamanu_source_dbt.tamanu.translated_strings": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "translated_strings", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "string_id": {"type": "text", "index": 2, "name": "string_id", "comment": null}, "language": {"type": "text", "index": 3, "name": "language", "comment": null}, "text": {"type": "text", "index": 4, "name": "text", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 5, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 6, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 7, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.translated_strings"}, "source.tamanu_source_dbt.tamanu.triages": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "triages", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "arrival_time": {"type": "date_time_string", "index": 5, "name": "arrival_time", "comment": null}, "triage_time": {"type": "date_time_string", "index": 6, "name": "triage_time", "comment": null}, "closed_time": {"type": "date_time_string", "index": 7, "name": "closed_time", "comment": null}, "score": {"type": "text", "index": 8, "name": "score", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 9, "name": "encounter_id", "comment": null}, "practitioner_id": {"type": "character varying(255)", "index": 10, "name": "practitioner_id", "comment": null}, "chief_complaint_id": {"type": "character varying(255)", "index": 11, "name": "chief_complaint_id", "comment": null}, "secondary_complaint_id": {"type": "character varying(255)", "index": 12, "name": "secondary_complaint_id", "comment": null}, "arrival_time_legacy": {"type": "timestamp with time zone", "index": 13, "name": "arrival_time_legacy", "comment": null}, "triage_time_legacy": {"type": "timestamp with time zone", "index": 14, "name": "triage_time_legacy", "comment": null}, "closed_time_legacy": {"type": "timestamp with time zone", "index": 15, "name": "closed_time_legacy", "comment": null}, "arrival_mode_id": {"type": "character varying(255)", "index": 16, "name": "arrival_mode_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 17, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.triages"}, "source.tamanu_source_dbt.tamanu.upcoming_vaccinations": {"metadata": {"type": "VIEW", "schema": "public", "name": "upcoming_vaccinations", "database": "app", "comment": null, "owner": "app"}, "columns": {"patient_id": {"type": "character varying(255)", "index": 1, "name": "patient_id", "comment": null}, "scheduled_vaccine_id": {"type": "character varying(255)", "index": 2, "name": "scheduled_vaccine_id", "comment": null}, "vaccine_category": {"type": "character varying(255)", "index": 3, "name": "vaccine_category", "comment": null}, "vaccine_id": {"type": "character varying(255)", "index": 4, "name": "vaccine_id", "comment": null}, "due_date": {"type": "date", "index": 5, "name": "due_date", "comment": null}, "days_till_due": {"type": "integer", "index": 6, "name": "days_till_due", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.upcoming_vaccinations"}, "source.tamanu_source_dbt.tamanu.user_designations": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_designations", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 2, "name": "user_id", "comment": null}, "designation_id": {"type": "character varying(255)", "index": 3, "name": "designation_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 7, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_designations"}, "source.tamanu_source_dbt.tamanu.user_facilities": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_facilities", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 5, "name": "facility_id", "comment": null}, "user_id": {"type": "character varying(255)", "index": 6, "name": "user_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_facilities"}, "source.tamanu_source_dbt.tamanu.user_leaves": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_leaves", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "start_date": {"type": "date_string", "index": 2, "name": "start_date", "comment": null}, "end_date": {"type": "date_string", "index": 3, "name": "end_date", "comment": null}, "user_id": {"type": "character varying(255)", "index": 4, "name": "user_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 10, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 11, "name": "deleted_at", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_leaves"}, "source.tamanu_source_dbt.tamanu.user_localisation_caches": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_localisation_caches", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "localisation": {"type": "text", "index": 2, "name": "localisation", "comment": null}, "user_id": {"type": "character varying(255)", "index": 3, "name": "user_id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 4, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 5, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 6, "name": "deleted_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_localisation_caches"}, "source.tamanu_source_dbt.tamanu.user_login_attempts": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_login_attempts", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "outcome": {"type": "text", "index": 5, "name": "outcome", "comment": null}, "user_id": {"type": "character varying(255)", "index": 6, "name": "user_id", "comment": null}, "device_id": {"type": "text", "index": 7, "name": "device_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 8, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_login_attempts"}, "source.tamanu_source_dbt.tamanu.user_preferences": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_preferences", "database": "app", "comment": null, "owner": "app"}, "columns": {"created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "user_id": {"type": "character varying(255)", "index": 5, "name": "user_id", "comment": null}, "key": {"type": "character varying(255)", "index": 8, "name": "key", "comment": null}, "value": {"type": "jsonb", "index": 9, "name": "value", "comment": null}, "facility_id": {"type": "character varying(255)", "index": 11, "name": "facility_id", "comment": null}, "id": {"type": "text", "index": 12, "name": "id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 13, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_preferences"}, "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_recently_viewed_patients", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "uuid", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "user_id": {"type": "character varying(255)", "index": 5, "name": "user_id", "comment": null}, "patient_id": {"type": "character varying(255)", "index": 6, "name": "patient_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.user_recently_viewed_patients"}, "source.tamanu_source_dbt.tamanu.users": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "users", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "email": {"type": "character varying(255)", "index": 5, "name": "email", "comment": null}, "password": {"type": "character varying(255)", "index": 6, "name": "password", "comment": null}, "display_name": {"type": "character varying(255)", "index": 7, "name": "display_name", "comment": null}, "role": {"type": "character varying(255)", "index": 8, "name": "role", "comment": null}, "display_id": {"type": "character varying(255)", "index": 9, "name": "display_id", "comment": null}, "visibility_status": {"type": "character varying(255)", "index": 10, "name": "visibility_status", "comment": null}, "phone_number": {"type": "character varying(255)", "index": 11, "name": "phone_number", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 12, "name": "updated_at_sync_tick", "comment": null}, "device_registration_quota": {"type": "integer", "index": 13, "name": "device_registration_quota", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.users"}, "source.tamanu_source_dbt.tamanu.vital_logs": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "vital_logs", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date": {"type": "date_time_string", "index": 5, "name": "date", "comment": null}, "previous_value": {"type": "text", "index": 6, "name": "previous_value", "comment": null}, "new_value": {"type": "text", "index": 7, "name": "new_value", "comment": null}, "reason_for_change": {"type": "text", "index": 8, "name": "reason_for_change", "comment": null}, "recorded_by_id": {"type": "character varying(255)", "index": 9, "name": "recorded_by_id", "comment": null}, "answer_id": {"type": "character varying(255)", "index": 10, "name": "answer_id", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 11, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.vital_logs"}, "source.tamanu_source_dbt.tamanu.vitals": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "vitals", "database": "app", "comment": null, "owner": "app"}, "columns": {"id": {"type": "character varying(255)", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "timestamp with time zone", "index": 2, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp with time zone", "index": 3, "name": "updated_at", "comment": null}, "deleted_at": {"type": "timestamp with time zone", "index": 4, "name": "deleted_at", "comment": null}, "date_recorded": {"type": "date_time_string", "index": 5, "name": "date_recorded", "comment": null}, "temperature": {"type": "double precision", "index": 6, "name": "temperature", "comment": null}, "weight": {"type": "double precision", "index": 7, "name": "weight", "comment": null}, "height": {"type": "double precision", "index": 8, "name": "height", "comment": null}, "sbp": {"type": "double precision", "index": 9, "name": "sbp", "comment": null}, "dbp": {"type": "double precision", "index": 10, "name": "dbp", "comment": null}, "heart_rate": {"type": "double precision", "index": 11, "name": "heart_rate", "comment": null}, "respiratory_rate": {"type": "double precision", "index": 12, "name": "respiratory_rate", "comment": null}, "spo2": {"type": "double precision", "index": 13, "name": "spo2", "comment": null}, "avpu": {"type": "enum_vitals_avpu", "index": 14, "name": "avpu", "comment": null}, "encounter_id": {"type": "character varying(255)", "index": 15, "name": "encounter_id", "comment": null}, "gcs": {"type": "double precision", "index": 16, "name": "gcs", "comment": null}, "hemoglobin": {"type": "double precision", "index": 17, "name": "hemoglobin", "comment": null}, "fasting_blood_glucose": {"type": "double precision", "index": 18, "name": "fasting_blood_glucose", "comment": null}, "urine_ph": {"type": "double precision", "index": 19, "name": "urine_ph", "comment": null}, "urine_leukocytes": {"type": "character varying(255)", "index": 20, "name": "urine_leukocytes", "comment": null}, "urine_nitrites": {"type": "character varying(255)", "index": 21, "name": "urine_nitrites", "comment": null}, "urobilinogen": {"type": "double precision", "index": 22, "name": "urobilinogen", "comment": null}, "urine_protein": {"type": "character varying(255)", "index": 23, "name": "urine_protein", "comment": null}, "blood_in_urine": {"type": "character varying(255)", "index": 24, "name": "blood_in_urine", "comment": null}, "urine_specific_gravity": {"type": "double precision", "index": 25, "name": "urine_specific_gravity", "comment": null}, "urine_ketone": {"type": "character varying(255)", "index": 26, "name": "urine_ketone", "comment": null}, "urine_bilirubin": {"type": "character varying(255)", "index": 27, "name": "urine_bilirubin", "comment": null}, "urine_glucose": {"type": "double precision", "index": 28, "name": "urine_glucose", "comment": null}, "date_recorded_legacy": {"type": "timestamp with time zone", "index": 29, "name": "date_recorded_legacy", "comment": null}, "migrated_record": {"type": "character varying(255)", "index": 30, "name": "migrated_record", "comment": null}, "updated_at_sync_tick": {"type": "bigint", "index": 31, "name": "updated_at_sync_tick", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.tamanu_source_dbt.tamanu.vitals"}}, "errors": null} }, r = { project: {}, tree: { project: [], database: [], sources: [] }, files: { manifest: {}, catalog: {} }, loaded: e.defer() }; function i(e, t) { return u.each(t.sources, (function (e, n) { t.nodes[n] = e })), u.each(e.nodes, (function (e, n) { var r = t.nodes[n]; if (r) { var i, o, a, s = u.keys(r.columns), l = e.columns, c = (i = s, o = l, a = {}, u.each(o, (function (e, t) { var n = u.find(i, (function (e) { return e.toLowerCase() == t.toLowerCase() })); n ? a[n] = e : a[t] = e })), a); e.columns = c } })), l(t, e) } function o(e, r) { return e in n && "object" == typeof n[e] ? { label: e, data: n[e] } : t({ method: "GET", url: r }).then((function (t) { return { label: e, data: t.data } }), (function (t) { console.error(t), alert("dbt Docs was unable to load the " + e + " file at path: \n " + r + "\n\nError: " + t.statusText + " (" + t.status + ")\n\nThe dbt Docs site may not work as expected if this file cannot be found.Please try again, and contact support if this error persists.") })) } return r.find_by_id = function (e, t) { r.ready((function () { if (e) { var n = r.node(e); t(n) } })) }, r.node = function (e) { return u.find(r.project.nodes, { unique_id: e }) }, r.loadProject = function () { var t = "?cb=" + (new Date).getTime(), n = [o("manifest", "manifest.json" + t), o("catalog", "catalog.json" + t)]; e.all(n).then((function (e) { u.each(e, (function (e) { e ? r.files[e.label] = e.data : console.error("FILE FAILED TO LOAD!") })), u.each(r.files.manifest.nodes, (function (e) { "model" == e.resource_type && null != e.version ? e.label = e.name + "_v" + e.version : e.label = e.name })), u.each(r.files.manifest.sources, (function (e) { e.label = e.source_name + "." + e.name, r.files.manifest.nodes[e.unique_id] = e })), u.each(r.files.manifest.exposures, (function (e) { e.label || (e.label = e.name), r.files.manifest.nodes[e.unique_id] = e })), u.each(r.files.manifest.metrics, (function (e) { r.files.manifest.nodes[e.unique_id] = e })), u.each(r.files.manifest.semantic_models, (function (e) { r.files.manifest.nodes[e.unique_id] = e, e.label = e.name })), u.each(r.files.manifest.saved_queries, (function (e) { r.files.manifest.nodes[e.unique_id] = e, e.label = e.name })), u.each(r.files.manifest.unit_tests, (function (e) { r.files.manifest.nodes[e.unique_id] = e, e.label = e.name })); var t = r.files.manifest.metadata.adapter_type, n = function (e, t) { var n = e || [], r = {}; u.each(n, (function (e) { r[e.package_name] || (r[e.package_name] = {}), r[e.package_name][e.name] = e })); e = []; return u.each(r, (function (n, r) { if ("dbt" != r && r != "dbt_" + t) { var i = function (e, t) { var n = {}; u.each(e, (function (e) { e.macro_sql.match(/{{\s*adapter_macro\([^)]+\)\s+}}/) && (e.impls = { "Adapter Macro": e.macro_sql }, e.is_adapter_macro = !0, n[e.name] = e) })); var r = ["postgres", "redshift", "bigquery", "snowflake", "spark", "presto", "default"], i = u.values(n), o = u.filter(e, (function (e) { var t = e.name.split("__"), i = t.shift(), o = t.join("__"); return !(r.indexOf(i) >= 0 && n[o]) || (n[o].impls[i] = e.macro_sql, e.is_adapter_macro_impl = !0, !1) })); return i.concat(o) }(n); e = e.concat(i) } })), u.keyBy(e, "unique_id") }(r.files.manifest.macros, t); r.files.manifest.macros = n; var o = i(r.files.manifest, r.files.catalog), a = o.nodes, s = u.keyBy(a, "name"), l = u.filter(o.nodes, { resource_type: "test" }); u.each(l, (function (e) { if (e.hasOwnProperty("test_metadata")) { var t, n = { test_name: t = e.test_metadata.namespace ? e.test_metadata.namespace + "." + e.test_metadata.name : e.test_metadata.name }; if ("not_null" == e.test_metadata.name) n.short = "N", n.label = "Not Null"; else if ("unique" == e.test_metadata.name) n.short = "U", n.label = "Unique"; else if ("relationships" == e.test_metadata.name) { var r = e.refs[0], i = s[r]; i && e.test_metadata.kwargs.field && (n.fk_field = e.test_metadata.kwargs.field, n.fk_model = i), n.short = "F", n.label = "Foreign Key" } else if ("accepted_values" == e.test_metadata.name) { if (Array.isArray(e.test_metadata.kwargs.values)) var a = e.test_metadata.kwargs.values.join(", "); else a = JSON.stringify(e.test_metadata.kwargs.values); n.short = "A", n.label = "Accepted Values: " + a } else { var l = u.omit(e.test_metadata.kwargs, "column_name"); n.short = "+", n.label = t + "(" + JSON.stringify(l) + ")" } var c = e.depends_on.nodes, p = e.column_name || e.test_metadata.kwargs.column_name || e.test_metadata.kwargs.arg; if (c.length && p) { if ("relationships" == e.test_metadata.name) var f = c[c.length - 1]; else f = c[0]; var h = o.nodes[f], g = d(o.metadata), m = u.find(h.columns, (function (e, t) { let n = p; return p.startsWith(g) && p.endsWith(g) && (n = p.substring(1, p.length - 1)), t.toLowerCase() == n.toLowerCase() })); m && (m.tests = m.tests || [], m.tests.push(n)) } } })), r.project = o; var c = u.filter(r.project.macros, (function (e) { return !e.is_adapter_macro_impl })), p = u.filter(r.project.nodes, (function (e) { return u.includes(["model", "source", "seed", "snapshot", "analysis", "exposure", "metric", "semantic_model", "saved_query"], e.resource_type) })); r.project.searchable = u.filter(p.concat(c), (function (e) { return !e.docs || e.docs.show })), r.loaded.resolve() })) }, r.ready = function (e) { r.loaded.promise.then((function () { e(r.project) })) }, r.search = function (e) { if (0 == e.length) return u.map(r.project.searchable, (function (e) { return { model: e, matches: [] } })); var t = []; return u.each(r.project.searchable, (function (n) { var r = function (e, t) { var n = [], r = { name: "string", description: "string", raw_code: "string", columns: "object", column_description: "n/a", tags: "array", arguments: "array", label: "string" }; let i = u.words(e.toLowerCase()); for (var o in r) if ("column_description" === o) for (var a in t.columns) null != t.columns[a].description && i.every(e => -1 != t.columns[a].description.toLowerCase().indexOf(e)) && n.push({ key: o, value: e }); else { if (!t[o]) continue; if ("string" === r[o] && i.every(e => -1 != t[o].toLowerCase().indexOf(e))) n.push({ key: o, value: e }); else if ("object" === r[o]) for (var a in t[o]) null != t[o][a].name && i.every(e => -1 != t[o][a].name.toLowerCase().indexOf(e)) && n.push({ key: o, value: e }); else if ("array" === r[o]) for (var s of t[o]) i.every(e => -1 != JSON.stringify(s).toLowerCase().indexOf(e)) && n.push({ key: o, value: e }) } return n }(e, n); r.length && t.push({ model: n, matches: r }) })), t }, r.getModelTree = function (e, t) { r.loaded.promise.then((function () { var n = u.values(r.project.macros), i = u.filter(r.project.nodes, (function (e) { if ("test" == e.resource_type && !e.hasOwnProperty("test_metadata")) return !0; return u.includes(["snapshot", "source", "seed", "model", "analysis", "exposure", "metric", "semantic_model", "saved_query"], e.resource_type) })); r.tree.database = function (e, t) { var n = {}, r = u.filter(e, (function (e) { return !!u.get(e, ["docs", "show"], !0) && (-1 != u.indexOf(["source", "snapshot", "seed"], e.resource_type) || ("model" == e.resource_type ? "ephemeral" != e.config.materialized : void 0)) })), i = u.sortBy(r, (function (e) { return e.database + "." + e.schema + "." + (e.identifier || e.alias || e.name) })), o = u.groupBy(i, "database"); return u.each(o, (function (e, r) { var i = { type: "database", name: r, active: !1, items: [] }; n[r] = i; var o = u.groupBy(e, "schema"); u.each(o, (function (e, n) { n = { type: "schema", name: n, active: !1, items: [] }; i.items.push(n), u.each(e, (function (e) { var r = e.unique_id == t; r && (i.active = !0, n.active = !0), n.items.push({ type: "table", name: e.identifier || e.alias || e.name, node: e, active: r, unique_id: e.unique_id, node_type: "model" }) })) })) })), n }(i, e), r.tree.groups = function (e, t) { var n = {}; u.each(e, (function (e) { const r = u.get(e, ["docs", "show"], !0); if (!(e.resource_type in ["source", "exposure", "seed", "macro"]) && r && "private" !== e.access) { if ("model" == e.resource_type && null != e.version) var i = e.name + "_v" + e.version; else i = e.name; var o = "protected" === e.access ? i + " (protected)" : i, a = e.group, s = e.unique_id == t; n[a] ? s && (n[a].active = !0) : n[a] = { type: "group", name: a, active: s, items: [] }, n[a].items.push({ type: "file", name: o, node: e, active: s, unique_id: e.unique_id, node_type: "model" }) } })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { e.items = u.sortBy(e.items, "name") })), n }(i, e), r.tree.project = function (e, t, n) { var r = {}; e = e || [], t = t || []; return u.each(e.concat(t), (function (e) { var t = u.get(e, ["docs", "show"], !0); if ("source" != e.resource_type && "exposure" != e.resource_type && "metric" != e.resource_type && "semantic_model" != e.resource_type && "saved_query" != e.resource_type && t) { if (-1 != e.original_file_path.indexOf("\\")) var i = e.original_file_path.split("\\"); else i = e.original_file_path.split("/"); var o = [e.package_name].concat(i), a = e.unique_id == n, s = u.initial(o); if ("macro" == e.resource_type) var l = e.name; else l = u.last(o); if ("model" == e.resource_type && null != e.version) var c = e.name + "_v" + e.version; else c = e.name; var d = r; u.each(s, (function (e) { d[e] ? a && (d[e].active = !0) : d[e] = { type: "folder", name: e, active: a, items: {} }, d = d[e].items })), d[l] = { type: "file", name: c, node: e, active: a, unique_id: e.unique_id, node_type: e.resource_type } } })), function e(t) { var n = [], r = u.values(t); return u.each(r, (function (t) { if (t.items) { var r = e(t.items), i = u.sortBy(r, "name"); t.items = i } n.push(t) })), n }(r) }(i, n, e); var o = u.values(r.project.sources); r.tree.sources = function (e, t) { var n = {}; u.each(e, (function (e) { var r = e.source_name, i = e.name, o = e.unique_id == t; n[r] ? o && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: o, items: [] }, n[r].items.push({ type: "file", name: i, node: e, active: o, unique_id: e.unique_id, node_type: "source" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { e.items = u.sortBy(e.items, "name") })), n }(o, e); var a = u.values(r.project.exposures); r.tree.exposures = function (e, t) { var n = {}; u.each(e, (function (e) { e.name; var r = e.type || "Uncategorized"; r = function (e) { var t = { ml: "ML" }; return t.hasOwnProperty(e) ? t[e] : e.charAt(0).toUpperCase() + e.slice(1) }(r); var i = e.unique_id == t; n[r] ? i && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: i, items: [] }, n[r].items.push({ type: "file", name: e.label, node: e, active: i, unique_id: e.unique_id, node_type: "exposure" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { e.items = u.sortBy(e.items, "name") })), n }(a, e); var s = u.values(r.project.metrics); r.tree.metrics = function (e, t) { var n = {}; u.each(e, (function (e) { e.name; var r = e.package_name, i = e.unique_id == t; n[r] ? i && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: i, items: [] }, n[r].items.push({ type: "file", name: e.label, node: e, active: i, unique_id: e.unique_id, node_type: "metric" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { n.items = u.sortBy(n.items, "name") })), n }(s, e); var l = u.values(r.project.semantic_models); r.tree.semantic_models = function (e, t) { var n = {}; u.each(e, (function (e) { e.name; var r = e.package_name, i = e.unique_id == t; n[r] ? i && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: i, items: [] }, n[r].items.push({ type: "file", name: e.name, node: e, active: i, unique_id: e.unique_id, node_type: "semantic_model" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { n.items = u.sortBy(n.items, "name") })), n }(l, e); var c = u.values(r.project.saved_queries); r.tree.saved_queries = function (e, t) { var n = {}; u.each(e, (function (e) { e.name; var r = e.package_name, i = e.unique_id == t; n[r] ? i && (n[r].active = !0) : n[r] = { type: "folder", name: r, active: i, items: [] }, n[r].items.push({ type: "file", name: e.name, node: e, active: i, unique_id: e.unique_id, node_type: "saved_query" }) })); n = u.sortBy(u.values(n), "name"); return u.each(n, (function (e) { n.items = u.sortBy(n.items, "name") })), n }(c, e), t(r.tree) })) }, r.updateSelectedInTree = function (e, t) { var n = !1; return u.each(t, (function (t) { if (t.node && t.node.unique_id == e) t.active = !0, n = !0; else if (t.node && t.node.unique_id != e) t.active = !1; else { r.updateSelectedInTree(e, t.items) && (t.active = !0, n = !0) } })), n }, r.updateSelected = function (e) { return r.updateSelectedInTree(e, r.tree.project), r.updateSelectedInTree(e, r.tree.database), r.updateSelectedInTree(e, r.tree.groups), r.updateSelectedInTree(e, r.tree.sources), r.updateSelectedInTree(e, r.tree.exposures), r.updateSelectedInTree(e, r.tree.metrics), r.updateSelectedInTree(e, r.tree.semantic_models), r.updateSelectedInTree(e, r.tree.saved_queries), r.tree }, r.caseColumn = function (e) { return "snowflake" == r.project.metadata.adapter_type && e.toUpperCase() == e ? e.toLowerCase() : e }, r.init = function () { r.loadProject() }, r }]) }, function (e, t, n) { const r = n(8); n(209), n(230), n(445), n(459), n(460), n(480), n(481), n(482), r.module("dbt").run(["$rootScope", "$state", "$stateParams", function (e, t, n) { e.$state = t, e.$stateParams = n }]) }, function (e, t) { /** * @license AngularJS v1.8.3 * (c) 2010-2020 Google LLC. http://angularjs.org diff --git a/compiled/v2.50.11/reporting-schema-v2.50.11-standard.sql b/compiled/v2.50.11/reporting-schema-v2.50.11-standard.sql index e20a28c1..f51f2e86 100644 --- a/compiled/v2.50.11/reporting-schema-v2.50.11-standard.sql +++ b/compiled/v2.50.11/reporting-schema-v2.50.11-standard.sql @@ -1556,617 +1556,6 @@ select fc.record_data ->> 'not_given_reason_id' as not_given_reason_id from filtered_changes fc ); -create or replace view "reporting"."ds__births" as ( -select - pbd.registration_date, - case - when left(pbd.registration_date::text, 10) = left(pad.registration_date::text, 10) then u.display_name - end as registered_by, - p.id as patient_id, - p.display_id, - p.first_name, - p.last_name, - p.date_of_birth, - p.sex, - rd_ethnicity.name as ethnicity, - rd_nationality.name as nationality, - p.village_id, - rd_village.name as village, - case - when - p_mother.id is not null - then concat(p_mother.first_name, ' ', p_mother.last_name, ' (', p_mother.display_id, ')') - end as mother, - case - when - p_father.id is not null - then concat(p_father.first_name, ' ', p_father.last_name, ' (', p_father.display_id, ')') - end as father, - pbd.birth_time, - pbd.gestational_age_estimate, - case when pbd.registered_birth_place = 'health_facility' then 'Health facility' - when pbd.registered_birth_place = 'home' then 'Home' - when pbd.registered_birth_place = 'other' then 'Other' - else pbd.registered_birth_place - end as registered_birth_place, - f.id as birth_facility_id, - f.name as birth_facility, - case when pbd.attendant_at_birth = 'doctor' then 'Doctor' - when pbd.attendant_at_birth = 'midwife' then 'Midwife' - when pbd.attendant_at_birth = 'nurse' then 'Nurse' - when pbd.attendant_at_birth = 'traditional_birth_attentdant' then 'Traditional birth attendant' - when pbd.attendant_at_birth = 'other' then 'Other' - else pbd.attendant_at_birth - end as attendant_at_birth, - pbd.name_of_attendant_at_birth, - case - when pbd.birth_delivery_type = 'normal_vaginal_delivery' then 'Normal vaginal delivery' - when pbd.birth_delivery_type = 'breech' then 'Breech' - when pbd.birth_delivery_type = 'emergency_c_section' then 'Emergency C-section' - when pbd.birth_delivery_type = 'elective_c_section' then 'Elective C-section' - when pbd.birth_delivery_type = 'vacuum_extraction' then 'Vacuum extraction' - when pbd.birth_delivery_type = 'forceps' then 'Forceps' - when pbd.birth_delivery_type = 'other' then 'Other' - else pbd.birth_delivery_type - end as birth_delivery_type, - initcap(pbd.birth_type::text) as birth_type, - pbd.birth_weight, - pbd.birth_length, - pbd.apgar_score_one_minute, - pbd.apgar_score_five_minutes, - pbd.apgar_score_ten_minutes -from "reporting"."patient_birth_data" pbd -join "reporting"."patients" p on p.id = pbd.patient_id -left join "reporting"."reference_data" rd_village on rd_village.id = p.village_id -left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id -left join "reporting"."reference_data" rd_nationality on rd_nationality.id = pad.nationality_id -left join "reporting"."reference_data" rd_ethnicity on rd_ethnicity.id = pad.ethnicity_id -left join "reporting"."patients" p_mother on p_mother.id = pad.mother_id -left join "reporting"."patients" p_father on p_father.id = pad.father_id -left join "reporting"."facilities" f on f.id = pbd.birth_facility_id -left join "reporting"."users" u on u.id = pad.registered_by_id -); -create or replace view "reporting"."ds__deaths" as ( -with contributing_death_causes as ( - select - cdc.patient_death_data_id, - array_agg( - cdc.condition_id - order by cdc.time_after_onset - ) as other_conditions - from "reporting"."contributing_death_causes" cdc - group by cdc.patient_death_data_id -), - -encounters_with_death as ( - select distinct on (e.patient_id) - e.patient_id, - e.start_datetime, - e.end_datetime, - e.location_id, - e.department_id, - e.clinician_id - from "reporting"."encounters" e - join "reporting"."patients" p - on p.id = e.patient_id - and p.date_of_death between e.start_datetime and e.end_datetime - order by e.patient_id asc, e.end_datetime desc -) - -select - p.id as patient_id, - p.display_id, - p.first_name, - p.last_name, - p.date_of_birth, - date_part('year', age(p.date_of_death::date, p.date_of_birth::date)) as age, - p.sex, - village.id as village_id, - village.name as village, - nationality.id as nationality_id, - nationality.name as nationality, - case - when pdd.was_outside_health_facility then 'Died outside health facility' - else facility.name - end as place_of_death, - facility.id as facility_id, - department.id as department_id, - department.name as department, - location_group.id as location_group_id, - location_group.name as location_group, - location.id as location_id, - location.name as location, - p.date_of_death, - clinician.id as attending_clinician_id, - clinician.display_name as attending_clinician, - primary_condition.id as primary_cause_condition_id, - primary_condition.name as primary_cause_condition, - case - when pdd.primary_cause_mins_after_onset is null or pdd.primary_cause_mins_after_onset = 0 - then '0 minutes' - when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 365)) = 0 - then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 365), ' years') - when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 30)) = 0 - then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 30), ' months') - when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 7)) = 0 - then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 7), ' weeks') - when mod(pdd.primary_cause_mins_after_onset, (60 * 24)) = 0 - then concat(pdd.primary_cause_mins_after_onset / (60 * 24), ' days') - when mod(pdd.primary_cause_mins_after_onset, 60) = 0 - then concat(pdd.primary_cause_mins_after_onset / 60, ' hours') - else concat(pdd.primary_cause_mins_after_onset, ' minutes') - end as time_between_onset_and_death, - antecedent_condition_1.id as antecedent_cause_1_id, - antecedent_condition_1.name as antecedent_cause_1, - antecedent_condition_2.id as antecedent_cause_2_id, - antecedent_condition_2.name as antecedent_cause_2, - other_condition_1.id as other_condition_1_id, - other_condition_1.name as other_condition_1, - other_condition_2.id as other_condition_2_id, - other_condition_2.name as other_condition_2, - other_condition_3.id as other_condition_3_id, - other_condition_3.name as other_condition_3, - other_condition_4.id as other_condition_4_id, - other_condition_4.name as other_condition_4, - initcap(pdd.had_recent_surgery) as had_recent_surgery, - pdd.last_surgery_date, - surgery_reason.id as reason_for_surgery_id, - surgery_reason.name as reason_for_surgery, - pdd.manner as manner_of_death, - pdd.external_cause_date, - pdd.external_cause_location, - initcap(pdd.was_pregnant) as was_pregnant, - pdd.pregnancy_contributed, - case - when pdd.was_fetal_or_infant then 'Yes' - else 'No' - end as was_fetal_or_infant, - initcap(pdd.was_stillborn) as was_stillborn, - pdd.birth_weight, - pdd.carrier_pregnancy_weeks as completed_weeks_of_pregnancy, - pdd.carrier_age as age_of_mother, - pdd.mother_condition_description as condition_in_mother_affecting_fetus_or_newborn, - case - when pdd.was_within_day_of_birth then 'Yes' - else 'No' - end as death_within_day_of_birth, - pdd.hours_survived_since_birth -from "reporting"."patient_death_data" pdd -join "reporting"."patients" p - on p.id = pdd.patient_id -left join "reporting"."patient_additional_data" pd - on pd.patient_id = p.id -left join "reporting"."reference_data" village - on village.id = p.village_id -left join "reporting"."reference_data" nationality - on nationality.id = pd.nationality_id -left join "reporting"."reference_data" primary_condition - on primary_condition.id = pdd.primary_cause_condition_id -left join "reporting"."reference_data" antecedent_condition_1 - on antecedent_condition_1.id = pdd.antecedent_cause1_condition_id -left join "reporting"."reference_data" antecedent_condition_2 - on antecedent_condition_2.id = pdd.antecedent_cause2_condition_id -left join contributing_death_causes cdc - on cdc.patient_death_data_id = pdd.id -left join "reporting"."reference_data" other_condition_1 - on other_condition_1.id = cdc.other_conditions[1] -left join "reporting"."reference_data" other_condition_2 - on other_condition_2.id = cdc.other_conditions[2] -left join "reporting"."reference_data" other_condition_3 - on other_condition_3.id = cdc.other_conditions[3] -left join "reporting"."reference_data" other_condition_4 - on other_condition_4.id = cdc.other_conditions[4] -left join "reporting"."reference_data" surgery_reason - on surgery_reason.id = pdd.last_surgery_reason_id -left join encounters_with_death ewd - on ewd.patient_id = p.id -left join "reporting"."facilities" facility - on facility.id = pdd.facility_id -left join "reporting"."departments" department - on department.id = ewd.department_id -left join "reporting"."locations" location - on location.id = ewd.location_id -left join "reporting"."location_groups" location_group - on location_group.id = location.location_group_id -left join "reporting"."users" clinician - on clinician.id = pdd.recorded_by_id -where pdd.visibility_status = 'current' - and pdd.is_final -); -create or replace view "reporting"."ds__invoice_products" as ( - - -with price_pivot as ( - select - invoice_product_id - from "reporting"."invoice_price_list_items" - where is_hidden = false - group by invoice_product_id -), - -insurance_pivot as ( - select - invoice_product_id - from "reporting"."invoice_insurance_plan_items" - group by invoice_product_id -) - -select - ip.id, - ip.name, - ip.insurable, - ip.category, - ip.source_record_id, - ip.visibility_status, - coalesce(ltt.external_code, ltp.external_code) as external_code -from "reporting"."invoice_products" ip -left join price_pivot pp on pp.invoice_product_id = ip.id -left join insurance_pivot insurp on insurp.invoice_product_id = ip.id -left join "reporting"."lab_test_types" ltt on ltt.id = ip.source_record_id -left join "reporting"."lab_test_panels" ltp on ltp.id = ip.source_record_id -); -create or replace view "reporting"."ds__ongoing_conditions" as ( -select - p.id as patient_id, - p.display_id, - p.first_name, - p.last_name, - p.date_of_birth, - date_part('year', age(pc.recorded_datetime::date, p.date_of_birth)) as age, - p.sex, - village.name as village, - village.id as village_id, - conditions.name as condition, - conditions.id as condition_id, - pc.recorded_datetime, - clinician.id as clinician_id, - clinician.display_name as clinician, - case when pc.is_resolved then pc.resolved_datetime end as date_resolved, - case when pc.is_resolved then resolving_clinician.display_name end as clinician_resolving -from "reporting"."patient_conditions" pc -join "reporting"."patients" p on p.id = pc.patient_id -join "reporting"."reference_data" conditions on conditions.id = pc.condition_id -left join "reporting"."reference_data" village on village.id = p.village_id -left join "reporting"."users" clinician on clinician.id = pc.recorded_by_id -left join "reporting"."users" resolving_clinician - on resolving_clinician.id = pc.resolved_by_id -); -create or replace view "reporting"."ds__patients" as ( -select - p.created_datetime as registration_date, - u.display_name as registered_by, - p.id as patient_id, - p.first_name, - p.middle_name, - p.last_name, - p.cultural_name, - p.display_id, - p.sex, - p.village_id, - village.name as village, - p.date_of_birth, - p.date_of_death, - pad.birth_certificate, - pad.driving_license, - pad.passport, - pad.blood_type, - pad.title, - pad.marital_status, - pad.primary_contact_number, - pad.secondary_contact_number, - cob.name as country_of_birth, - nationality.name as nationality, - ethnicity.name as ethnicity, - occupation.name as occupation, - religion.name as religion, - billing.name as patient_billing_type, - pad.mother_id, - pad.father_id, - pad.street_village, - case - when pbd.patient_id is null then 'Patient' - else 'Birth' - end as registration_type, - date_part( - 'year', - age( - coalesce(p.date_of_death::date, current_date), - p.date_of_birth - ) - ) as age, - case - when p.date_of_death is not null then 'Deceased' - else 'Alive' - end as status -from "reporting"."patients" p -left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id -left join "reporting"."patient_birth_data" pbd on pbd.patient_id = p.id -left join "reporting"."users" u on u.id = pad.registered_by_id -left join "reporting"."reference_data" village on village.id = p.village_id and village.type = 'village' -left join "reporting"."reference_data" cob on cob.id = pad.country_of_birth_id and cob.type = 'country' -left join "reporting"."reference_data" nationality on nationality.id = pad.nationality_id and nationality.type = 'nationality' -left join "reporting"."reference_data" ethnicity on ethnicity.id = pad.ethnicity_id and ethnicity.type = 'ethnicity' -left join "reporting"."reference_data" occupation on occupation.id = pad.occupation_id and occupation.type = 'occupation' -left join "reporting"."reference_data" religion on religion.id = pad.religion_id and religion.type = 'religion' -left join "reporting"."reference_data" billing on billing.id = pad.patient_billing_type_id and billing.type = 'patientBillingType' -); -create or replace view "reporting"."ds__patients_access_logs" as ( -with grouped_access_logs as ( - select - lap.patient_id, - lap.user_id, - lap.facility_id, - date_trunc('minute', min(lap.logged_at)) as date_time_viewed, - -- Take the first values for fields that might vary within the same minute - lap.is_mobile, - lap.session_id, - lap.device_id - from "reporting"."patients_access_logs" lap - group by - lap.patient_id, - lap.user_id, - lap.facility_id, - lap.is_mobile, - lap.session_id, - lap.device_id -) - -select - gal.patient_id, - p.display_id, - p.first_name, - p.last_name, - p.date_of_birth, - p.sex, - p.village_id, - village.name as village, - gal.user_id as viewed_by_user_id, - u.display_name as viewed_by_user, - u.email as user_email, - u.role as user_role, - f.name as viewed_at_facility, - gal.date_time_viewed, - gal.facility_id, - gal.is_mobile, - gal.session_id, - gal.device_id -from grouped_access_logs gal -join "reporting"."patients" p on p.id = gal.patient_id -left join "reporting"."users" u on u.id = gal.user_id -left join "reporting"."facilities" f on f.id = gal.facility_id -left join "reporting"."reference_data" village on village.id = p.village_id -); -create or replace view "reporting"."ds__patients_change_logs" as ( -with patient_edits as ( - -- Patient details edits - select - lcp.id as patient_id, - lcp.display_id, - lcp.first_name, - lcp.last_name, - lcp.date_of_birth, - lcp.sex, - lcp.village_id, - lcp.updated_by_user_id, - lcp.logged_at - from "reporting"."patients_change_logs" lcp - - union all - - -- Patient additional data edits - select - lcpad.patient_id, - p.display_id, - p.first_name, - p.last_name, - p.date_of_birth, - p.sex, - p.village_id, - lcpad.updated_by_user_id, - lcpad.logged_at - from "reporting"."patient_additional_data_change_logs" lcpad - left join "reporting"."patients" p on p.id = lcpad.patient_id -), - -grouped_edits as ( - select - pe.patient_id, - pe.display_id, - pe.first_name, - pe.last_name, - pe.date_of_birth, - pe.sex, - pe.village_id, - pe.updated_by_user_id, - date_trunc('minute', pe.logged_at) as edited_datetime - from patient_edits pe - group by - pe.patient_id, - pe.display_id, - pe.first_name, - pe.last_name, - pe.date_of_birth, - pe.sex, - pe.village_id, - pe.updated_by_user_id, - date_trunc('minute', pe.logged_at) -) - -select - ge.patient_id, - ge.display_id, - ge.first_name, - ge.last_name, - ge.date_of_birth, - ge.sex, - ge.village_id, - village.name as village, - ge.updated_by_user_id as edited_by_user_id, - u.display_name as edited_by_user, - u.email as user_email, - u.role as user_role, - ge.edited_datetime -from grouped_edits ge -left join "reporting"."users" u on u.id = ge.updated_by_user_id -left join "reporting"."reference_data" village on village.id = ge.village_id -); -create or replace view "reporting"."ds__patient_program_registrations" as ( -with related_conditions as ( - select - ppr.id as patient_program_registration_id, - string_agg( - prc.name, '; ' - order by pprc.datetime - ) as conditions, - array_agg( - pprc.program_registry_condition_id - order by pprc.datetime - ) as condition_ids, - string_agg( - prcc.name, '; ' - order by pprc.datetime - ) as condition_categories, - array_agg( - pprc.program_registry_condition_category_id - order by pprc.datetime - ) as condition_category_ids - from "reporting"."patient_program_registration_conditions" pprc - join "reporting"."patient_program_registrations" ppr on ppr.id = pprc.patient_program_registration_id - left join "reporting"."program_registry_conditions" prc on prc.id = pprc.program_registry_condition_id - left join "reporting"."program_registry_condition_categories" prcc on prcc.id = pprc.program_registry_condition_category_id - group by ppr.id -) - -select - ppr.id as patient_program_registration_id, - p.id as patient_id, - p.display_id, - p.first_name, - p.last_name, - p.date_of_birth, - p.sex, - village.id as village_id, - village.name as village, - registering_facility.id as registering_facility_id, - registering_facility.name as registering_facility, - registered_by.id as registered_by_id, - registered_by.display_name as registered_by, - case - when pr.currently_at_type = 'facility' then currently_at_facility.name - when pr.currently_at_type = 'village' then currently_at_village.name - end as currently_at, - pr.currently_at_type, - c.condition_ids as related_condition_ids, - c.conditions as related_conditions, - c.condition_category_ids as related_condition_category_ids, - c.condition_categories as related_condition_categories, - prcs.id as clinical_status_id, - prcs.name as clinical_status, - ppr.registration_status, - ppr.program_registry_id, - subdivision.id as subdivision_id, - subdivision.name as subdivision, - division.id as division_id, - division.name as division, - ppr.datetime as registration_datetime, - ppr.deactivated_by_id, - deactivated_by.display_name as deactivated_by, - ppr.deactivated_datetime, - pad.primary_contact_number, - pad.secondary_contact_number, - pad.emergency_contact_name, - pad.emergency_contact_number -from "reporting"."patient_program_registrations" ppr -join "reporting"."program_registries" pr on pr.id = ppr.program_registry_id -join "reporting"."patients" p on p.id = ppr.patient_id -left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id -left join "reporting"."facilities" registering_facility on registering_facility.id = ppr.registering_facility_id -left join "reporting"."users" registered_by on registered_by.id = ppr.registered_by_id -left join "reporting"."reference_data" village on village.id = p.village_id -left join "reporting"."facilities" currently_at_facility on currently_at_facility.id = ppr.facility_id -left join "reporting"."reference_data" subdivision on subdivision.id = pad.subdivision_id -left join "reporting"."reference_data" division on division.id = pad.division_id -left join "reporting"."reference_data" currently_at_village on currently_at_village.id = ppr.village_id -left join related_conditions c on c.patient_program_registration_id = ppr.id -left join "reporting"."program_registry_clinical_statuses" prcs on prcs.id = ppr.clinical_status_id -left join "reporting"."users" deactivated_by on deactivated_by.id = ppr.deactivated_by_id -); -create or replace view "reporting"."ds__patient_vaccinations_upcoming" as ( -select - p.display_id, - p.first_name, - p.last_name, - p.id as patient_id, - p.date_of_birth, - date_part('year', age(p.date_of_birth)) as age, - p.sex, - village.id as village_id, - village.name as village, - pvu.due_date, - pvu.vaccine_category, - pvu.vaccine_schedules_id, - sv.label as vaccine_name, - sv.dose_label as vaccine_schedule, - pvu.status as vaccine_status -from "reporting"."patient_vaccinations_upcoming" pvu -join "reporting"."patients" p on p.id = pvu.patient_id -join "reporting"."vaccine_schedules" sv on sv.id = pvu.vaccine_schedules_id -left join "reporting"."reference_data" village on village.id = p.village_id -where p.date_of_death is null -); -create or replace view "reporting"."ds__usage_quality_metrics_patient_details" as ( -with data as ( - select - p.id as patient_id, - pm.id as patient_merged_id, - coalesce(nullif(trim(p.first_name), ''), nullif(trim(pm.first_name), '')) as first_name, - coalesce(nullif(trim(p.last_name), ''), nullif(trim(pm.last_name), '')) as last_name, - coalesce(p.date_of_birth, pm.date_of_birth) as date_of_birth, - coalesce(nullif(trim(p.village_id), ''), nullif(trim(pm.village_id), '')) as village_id, - nullif(trim(pad.nursing_zone_id), '') as nursing_zone_id, - nullif(trim(pad.medical_area_id), '') as medical_area_id, - nullif(trim(pad.subdivision_id), '') as subdivision_id, - nullif(trim(pad.division_id), '') as division_id, - nullif(trim(pad.primary_contact_number), '') as primary_contact_number, - nullif(trim(pad.secondary_contact_number), '') as secondary_contact_number - from "reporting"."patients" p - full join "reporting"."patients_merged" pm - on pm.id = p.id - left join "reporting"."patient_additional_data" pad - on pad.patient_id = coalesce(p.id, pm.id) -) - -select - count(*) as total_patients, - count(*) filter (where first_name is null or last_name is null) as total_patients_with_incomplete_name, - count(*) filter (where date_of_birth is null) as total_patients_with_missing_dob, - count(*) filter (where date_of_birth <= '1900-01-01' or date_of_birth > now()::date) as total_patients_with_invalid_dob, - count(*) filter (where coalesce(village_id, nursing_zone_id, medical_area_id, subdivision_id, division_id) is null) as total_patients_with_missing_location, - count(*) filter (where coalesce(primary_contact_number, secondary_contact_number) is null) as total_patients_with_missing_contact, - count(patient_merged_id) as total_patients_merged -from data -); -create or replace view "reporting"."ds__usage_quality_metrics_patient_registrations" as ( -with data as ( - select - p.created_datetime as registration_date, - p.id as registration_patient_id, - pbd.patient_id as birth_patient_id, - p.date_of_birth, - age(p.created_datetime, p.date_of_birth) < interval '6 months' as age_under_6m_at_registration - from "reporting"."patients" p - left join "reporting"."patient_birth_data" pbd - on pbd.patient_id = p.id -) - -select - registration_date, - count(*) filter (where birth_patient_id is null) as total_patient_registrations, - count(birth_patient_id) as total_birth_registrations, - count(*) filter (where birth_patient_id is null and age_under_6m_at_registration) as total_incorrect_registrations_for_patient_under_6mth -from data -group by registration_date -); create or replace view "reporting"."ds__sensitive_admissions" as ( @@ -3677,6 +3066,223 @@ left join encounter_diagnoses ed on ed.encounter_id = pd.encounter_id +); +create or replace view "reporting"."ds__births" as ( +select + pbd.registration_date, + case + when left(pbd.registration_date::text, 10) = left(pad.registration_date::text, 10) then u.display_name + end as registered_by, + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + rd_ethnicity.name as ethnicity, + rd_nationality.name as nationality, + p.village_id, + rd_village.name as village, + case + when + p_mother.id is not null + then concat(p_mother.first_name, ' ', p_mother.last_name, ' (', p_mother.display_id, ')') + end as mother, + case + when + p_father.id is not null + then concat(p_father.first_name, ' ', p_father.last_name, ' (', p_father.display_id, ')') + end as father, + pbd.birth_time, + pbd.gestational_age_estimate, + case when pbd.registered_birth_place = 'health_facility' then 'Health facility' + when pbd.registered_birth_place = 'home' then 'Home' + when pbd.registered_birth_place = 'other' then 'Other' + else pbd.registered_birth_place + end as registered_birth_place, + f.id as birth_facility_id, + f.name as birth_facility, + case when pbd.attendant_at_birth = 'doctor' then 'Doctor' + when pbd.attendant_at_birth = 'midwife' then 'Midwife' + when pbd.attendant_at_birth = 'nurse' then 'Nurse' + when pbd.attendant_at_birth = 'traditional_birth_attentdant' then 'Traditional birth attendant' + when pbd.attendant_at_birth = 'other' then 'Other' + else pbd.attendant_at_birth + end as attendant_at_birth, + pbd.name_of_attendant_at_birth, + case + when pbd.birth_delivery_type = 'normal_vaginal_delivery' then 'Normal vaginal delivery' + when pbd.birth_delivery_type = 'breech' then 'Breech' + when pbd.birth_delivery_type = 'emergency_c_section' then 'Emergency C-section' + when pbd.birth_delivery_type = 'elective_c_section' then 'Elective C-section' + when pbd.birth_delivery_type = 'vacuum_extraction' then 'Vacuum extraction' + when pbd.birth_delivery_type = 'forceps' then 'Forceps' + when pbd.birth_delivery_type = 'other' then 'Other' + else pbd.birth_delivery_type + end as birth_delivery_type, + initcap(pbd.birth_type::text) as birth_type, + pbd.birth_weight, + pbd.birth_length, + pbd.apgar_score_one_minute, + pbd.apgar_score_five_minutes, + pbd.apgar_score_ten_minutes +from "reporting"."patient_birth_data" pbd +join "reporting"."patients" p on p.id = pbd.patient_id +left join "reporting"."reference_data" rd_village on rd_village.id = p.village_id +left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id +left join "reporting"."reference_data" rd_nationality on rd_nationality.id = pad.nationality_id +left join "reporting"."reference_data" rd_ethnicity on rd_ethnicity.id = pad.ethnicity_id +left join "reporting"."patients" p_mother on p_mother.id = pad.mother_id +left join "reporting"."patients" p_father on p_father.id = pad.father_id +left join "reporting"."facilities" f on f.id = pbd.birth_facility_id +left join "reporting"."users" u on u.id = pad.registered_by_id +); +create or replace view "reporting"."ds__deaths" as ( +with contributing_death_causes as ( + select + cdc.patient_death_data_id, + array_agg( + cdc.condition_id + order by cdc.time_after_onset + ) as other_conditions + from "reporting"."contributing_death_causes" cdc + group by cdc.patient_death_data_id +), + +encounters_with_death as ( + select distinct on (e.patient_id) + e.patient_id, + e.start_datetime, + e.end_datetime, + e.location_id, + e.department_id, + e.clinician_id + from "reporting"."encounters" e + join "reporting"."patients" p + on p.id = e.patient_id + and p.date_of_death between e.start_datetime and e.end_datetime + order by e.patient_id asc, e.end_datetime desc +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(p.date_of_death::date, p.date_of_birth::date)) as age, + p.sex, + village.id as village_id, + village.name as village, + nationality.id as nationality_id, + nationality.name as nationality, + case + when pdd.was_outside_health_facility then 'Died outside health facility' + else facility.name + end as place_of_death, + facility.id as facility_id, + department.id as department_id, + department.name as department, + location_group.id as location_group_id, + location_group.name as location_group, + location.id as location_id, + location.name as location, + p.date_of_death, + clinician.id as attending_clinician_id, + clinician.display_name as attending_clinician, + primary_condition.id as primary_cause_condition_id, + primary_condition.name as primary_cause_condition, + case + when pdd.primary_cause_mins_after_onset is null or pdd.primary_cause_mins_after_onset = 0 + then '0 minutes' + when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 365)) = 0 + then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 365), ' years') + when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 30)) = 0 + then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 30), ' months') + when mod(pdd.primary_cause_mins_after_onset, (60 * 24 * 7)) = 0 + then concat(pdd.primary_cause_mins_after_onset / (60 * 24 * 7), ' weeks') + when mod(pdd.primary_cause_mins_after_onset, (60 * 24)) = 0 + then concat(pdd.primary_cause_mins_after_onset / (60 * 24), ' days') + when mod(pdd.primary_cause_mins_after_onset, 60) = 0 + then concat(pdd.primary_cause_mins_after_onset / 60, ' hours') + else concat(pdd.primary_cause_mins_after_onset, ' minutes') + end as time_between_onset_and_death, + antecedent_condition_1.id as antecedent_cause_1_id, + antecedent_condition_1.name as antecedent_cause_1, + antecedent_condition_2.id as antecedent_cause_2_id, + antecedent_condition_2.name as antecedent_cause_2, + other_condition_1.id as other_condition_1_id, + other_condition_1.name as other_condition_1, + other_condition_2.id as other_condition_2_id, + other_condition_2.name as other_condition_2, + other_condition_3.id as other_condition_3_id, + other_condition_3.name as other_condition_3, + other_condition_4.id as other_condition_4_id, + other_condition_4.name as other_condition_4, + initcap(pdd.had_recent_surgery) as had_recent_surgery, + pdd.last_surgery_date, + surgery_reason.id as reason_for_surgery_id, + surgery_reason.name as reason_for_surgery, + pdd.manner as manner_of_death, + pdd.external_cause_date, + pdd.external_cause_location, + initcap(pdd.was_pregnant) as was_pregnant, + pdd.pregnancy_contributed, + case + when pdd.was_fetal_or_infant then 'Yes' + else 'No' + end as was_fetal_or_infant, + initcap(pdd.was_stillborn) as was_stillborn, + pdd.birth_weight, + pdd.carrier_pregnancy_weeks as completed_weeks_of_pregnancy, + pdd.carrier_age as age_of_mother, + pdd.mother_condition_description as condition_in_mother_affecting_fetus_or_newborn, + case + when pdd.was_within_day_of_birth then 'Yes' + else 'No' + end as death_within_day_of_birth, + pdd.hours_survived_since_birth +from "reporting"."patient_death_data" pdd +join "reporting"."patients" p + on p.id = pdd.patient_id +left join "reporting"."patient_additional_data" pd + on pd.patient_id = p.id +left join "reporting"."reference_data" village + on village.id = p.village_id +left join "reporting"."reference_data" nationality + on nationality.id = pd.nationality_id +left join "reporting"."reference_data" primary_condition + on primary_condition.id = pdd.primary_cause_condition_id +left join "reporting"."reference_data" antecedent_condition_1 + on antecedent_condition_1.id = pdd.antecedent_cause1_condition_id +left join "reporting"."reference_data" antecedent_condition_2 + on antecedent_condition_2.id = pdd.antecedent_cause2_condition_id +left join contributing_death_causes cdc + on cdc.patient_death_data_id = pdd.id +left join "reporting"."reference_data" other_condition_1 + on other_condition_1.id = cdc.other_conditions[1] +left join "reporting"."reference_data" other_condition_2 + on other_condition_2.id = cdc.other_conditions[2] +left join "reporting"."reference_data" other_condition_3 + on other_condition_3.id = cdc.other_conditions[3] +left join "reporting"."reference_data" other_condition_4 + on other_condition_4.id = cdc.other_conditions[4] +left join "reporting"."reference_data" surgery_reason + on surgery_reason.id = pdd.last_surgery_reason_id +left join encounters_with_death ewd + on ewd.patient_id = p.id +left join "reporting"."facilities" facility + on facility.id = pdd.facility_id +left join "reporting"."departments" department + on department.id = ewd.department_id +left join "reporting"."locations" location + on location.id = ewd.location_id +left join "reporting"."location_groups" location_group + on location_group.id = location.location_group_id +left join "reporting"."users" clinician + on clinician.id = pdd.recorded_by_id +where pdd.visibility_status = 'current' + and pdd.is_final ); create or replace view "reporting"."ds__diagnoses" as ( @@ -3984,6 +3590,38 @@ left join "reporting"."reference_data" v on v.id = p.village_id left join results irs on irs.imaging_request_id = ir.id +); +create or replace view "reporting"."ds__invoice_products" as ( + + +with price_pivot as ( + select + invoice_product_id + from "reporting"."invoice_price_list_items" + where is_hidden = false + group by invoice_product_id +), + +insurance_pivot as ( + select + invoice_product_id + from "reporting"."invoice_insurance_plan_items" + group by invoice_product_id +) + +select + ip.id, + ip.name, + ip.insurable, + ip.category, + ip.source_record_id, + ip.visibility_status, + coalesce(ltt.external_code, ltp.external_code) as external_code +from "reporting"."invoice_products" ip +left join price_pivot pp on pp.invoice_product_id = ip.id +left join insurance_pivot insurp on insurp.invoice_product_id = ip.id +left join "reporting"."lab_test_types" ltt on ltt.id = ip.source_record_id +left join "reporting"."lab_test_panels" ltp on ltp.id = ip.source_record_id ); create or replace view "reporting"."ds__lab_requests" as ( @@ -4225,217 +3863,526 @@ join "reporting"."facilities" f ); -create or replace view "reporting"."ds__outpatient_appointments" as ( - - -with appointment_creators as ( +create or replace view "reporting"."ds__ongoing_conditions" as ( +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(pc.recorded_datetime::date, p.date_of_birth)) as age, + p.sex, + village.name as village, + village.id as village_id, + conditions.name as condition, + conditions.id as condition_id, + pc.recorded_datetime, + clinician.id as clinician_id, + clinician.display_name as clinician, + case when pc.is_resolved then pc.resolved_datetime end as date_resolved, + case when pc.is_resolved then resolving_clinician.display_name end as clinician_resolving +from "reporting"."patient_conditions" pc +join "reporting"."patients" p on p.id = pc.patient_id +join "reporting"."reference_data" conditions on conditions.id = pc.condition_id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."users" clinician on clinician.id = pc.recorded_by_id +left join "reporting"."users" resolving_clinician + on resolving_clinician.id = pc.resolved_by_id +); +create or replace view "reporting"."ds__outpatient_appointments" as ( + + +with appointment_creators as ( + select + appointment_id, + created_by_user_id + from "reporting"."outpatient_appointments_change_logs" + where change_sequence = 1 +) + +select + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + date_part('year', age(a.start_datetime, p.date_of_birth)) as age, + p.sex, + coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number, + vil.id as village_id, + vil.name as village, + billing.id as billing_type_id, + billing.name as billing_type, + a.start_datetime as appointment_start_datetime, + a.end_datetime as appointment_end_datetime, + a.appointment_type_id, + apt.name as appointment_type, + a.status as appointment_status, + u.id as clinician_id, + u.display_name as clinician, + lg.id as location_group_id, + lg.name as location_group, + a.priority, + a.schedule_id, + a.until_date, + a.interval, + a.days_of_week, + a.frequency, + a.nth_weekday, + ac.created_by_user_id, + creator.display_name as created_by +from "reporting"."outpatient_appointments" a +join "reporting"."patients" p on p.id = a.patient_id +left join "reporting"."users" u on u.id = a.clinician_id +join "reporting"."location_groups" lg on lg.id = a.location_group_id +join "reporting"."facilities" f on f.id = lg.facility_id + and f.is_sensitive = False +left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id +left join "reporting"."reference_data" billing on billing.id = pd.patient_billing_type_id +left join "reporting"."reference_data" vil on vil.id = p.village_id +left join "reporting"."reference_data" apt on apt.id = a.appointment_type_id +left join appointment_creators ac on ac.appointment_id = a.id +left join "reporting"."users" creator on creator.id = ac.created_by_user_id + + +); +create or replace view "reporting"."ds__outpatient_appointments_audit" as ( + + +-- Outpatient Appointments Audit Dataset +-- This dataset tracks changes/modifications to outpatient appointments +-- Each row represents a modification event (excludes initial creation) +-- +-- Included changes: +-- - Status changed to 'Cancelled' (individual cancellations only) +-- - Changes to: start/end datetime, clinician, location group, appointment type, priority +-- +-- Excluded changes: +-- - Initial appointment creation (change_sequence = 1) +-- - Status-only changes (unless changing to 'Cancelled') +-- - Appointments automatically cancelled when their schedule was cancelled +-- (i.e., bulk cancellations via "cancel this and all future appointments") +-- +-- change_number: starts from 1 for the first modification, increments for subsequent changes +-- +-- Note: schedule_id never changes on existing appointments in Tamanu. +-- When a schedule is modified, old appointments are cancelled and new ones are created. + +with change_evaluation as ( + select + cl.*, + -- Determine if this change has meaningful field modifications + case + -- Status changed to Cancelled + when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true + -- Any non-status fields changed + when ( + cl.prev_start_datetime is distinct from cl.start_datetime + or cl.prev_end_datetime is distinct from cl.end_datetime + or cl.prev_clinician_id is distinct from cl.clinician_id + or cl.prev_location_group_id is distinct from cl.location_group_id + or cl.prev_appointment_type_id is distinct from cl.appointment_type_id + or cl.prev_is_high_priority is distinct from cl.is_high_priority + ) then true + else false + end as is_meaningful_change + from "reporting"."outpatient_appointments_change_logs" cl + left join "public"."appointment_schedules" s on s.id = cl.schedule_id + where + -- Exclude appointments that were automatically cancelled when the schedule was cancelled + -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule) + not ( + cl.status = 'Cancelled' + and s.cancelled_at_date is not null + and cl.start_datetime::date > s.cancelled_at_date::date + ) +), + +numbered_changes as ( + select + ce.*, + -- Assign change number: starts from 1 for first modification + row_number() over ( + partition by ce.appointment_id + order by ce.modified_datetime + ) as change_number + from change_evaluation ce + where ce.is_meaningful_change = true + and ce.change_sequence > 1 -- Exclude initial creation +) + +select + fc.change_id, + fc.appointment_id, + fc.change_number, + -- Patient details + p.id as patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + -- Current appointment details + fc.start_datetime as appointment_start_datetime, + fc.end_datetime as appointment_end_datetime, + apt.name as appointment_type, + fc.appointment_type_id, + clinician.display_name as clinician, + fc.clinician_id, + lg.name as location_group, + fc.location_group_id, + case when fc.is_high_priority then 'Yes' else 'No' end as priority, + fc.schedule_id, + case + when fc.schedule_id is not null then 'Yes' + else 'No' + end as is_repeating, + -- Modification details + creator.display_name as created_by, + fc.created_by_user_id, + modifier.display_name as modified_by, + fc.modified_by_user_id, + fc.modified_datetime, + case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled, + -- Previous appointment details (only shown if different from current) + case + when fc.prev_start_datetime is distinct from fc.start_datetime + then fc.prev_start_datetime + end as prev_start_datetime, + case + when fc.prev_end_datetime is distinct from fc.end_datetime + then fc.prev_end_datetime + end as prev_end_datetime, + case + when fc.prev_appointment_type_id is distinct from fc.appointment_type_id + then prev_apt.name + end as prev_appointment_type, + case + when fc.prev_appointment_type_id is distinct from fc.appointment_type_id + then fc.prev_appointment_type_id + end as prev_appointment_type_id, + case + when fc.prev_clinician_id is distinct from fc.clinician_id + then prev_clinician.display_name + end as prev_clinician, + case + when fc.prev_clinician_id is distinct from fc.clinician_id + then fc.prev_clinician_id + end as prev_clinician_id, + case + when fc.prev_location_group_id is distinct from fc.location_group_id + then prev_lg.name + end as prev_location_group, + case + when fc.prev_location_group_id is distinct from fc.location_group_id + then fc.prev_location_group_id + end as prev_location_group_id, + case + when fc.prev_is_high_priority is not null + and fc.prev_is_high_priority is distinct from fc.is_high_priority + then case when fc.prev_is_high_priority then 'Yes' else 'No' end + end as prev_priority, + -- Facility details for filtering + f.id as facility_id, + f.name as facility +from numbered_changes fc +join "reporting"."patients" p on p.id = fc.patient_id +left join "reporting"."users" clinician on clinician.id = fc.clinician_id +left join "reporting"."users" prev_clinician on prev_clinician.id = fc.prev_clinician_id +left join "reporting"."users" creator on creator.id = fc.created_by_user_id +left join "reporting"."users" modifier on modifier.id = fc.modified_by_user_id +join "reporting"."location_groups" lg on lg.id = fc.location_group_id +left join "reporting"."location_groups" prev_lg on prev_lg.id = fc.prev_location_group_id +left join "reporting"."reference_data" apt on apt.id = fc.appointment_type_id +left join "reporting"."reference_data" prev_apt on prev_apt.id = fc.prev_appointment_type_id +left join "public"."appointment_schedules" s on s.id = fc.schedule_id +-- Join to facility for filtering by sensitivity +join "reporting"."facilities" f on f.id = lg.facility_id + and f.is_sensitive = False + + +); +create or replace view "reporting"."ds__patients" as ( +select + p.created_datetime as registration_date, + u.display_name as registered_by, + p.id as patient_id, + p.first_name, + p.middle_name, + p.last_name, + p.cultural_name, + p.display_id, + p.sex, + p.village_id, + village.name as village, + p.date_of_birth, + p.date_of_death, + pad.birth_certificate, + pad.driving_license, + pad.passport, + pad.blood_type, + pad.title, + pad.marital_status, + pad.primary_contact_number, + pad.secondary_contact_number, + cob.name as country_of_birth, + nationality.name as nationality, + ethnicity.name as ethnicity, + occupation.name as occupation, + religion.name as religion, + billing.name as patient_billing_type, + pad.mother_id, + pad.father_id, + pad.street_village, + case + when pbd.patient_id is null then 'Patient' + else 'Birth' + end as registration_type, + date_part( + 'year', + age( + coalesce(p.date_of_death::date, current_date), + p.date_of_birth + ) + ) as age, + case + when p.date_of_death is not null then 'Deceased' + else 'Alive' + end as status +from "reporting"."patients" p +left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id +left join "reporting"."patient_birth_data" pbd on pbd.patient_id = p.id +left join "reporting"."users" u on u.id = pad.registered_by_id +left join "reporting"."reference_data" village on village.id = p.village_id and village.type = 'village' +left join "reporting"."reference_data" cob on cob.id = pad.country_of_birth_id and cob.type = 'country' +left join "reporting"."reference_data" nationality on nationality.id = pad.nationality_id and nationality.type = 'nationality' +left join "reporting"."reference_data" ethnicity on ethnicity.id = pad.ethnicity_id and ethnicity.type = 'ethnicity' +left join "reporting"."reference_data" occupation on occupation.id = pad.occupation_id and occupation.type = 'occupation' +left join "reporting"."reference_data" religion on religion.id = pad.religion_id and religion.type = 'religion' +left join "reporting"."reference_data" billing on billing.id = pad.patient_billing_type_id and billing.type = 'patientBillingType' +); +create or replace view "reporting"."ds__patients_access_logs" as ( +with grouped_access_logs as ( select - appointment_id, - created_by_user_id - from "reporting"."outpatient_appointments_change_logs" - where change_sequence = 1 + lap.patient_id, + lap.user_id, + lap.facility_id, + date_trunc('minute', min(lap.logged_at)) as date_time_viewed, + -- Take the first values for fields that might vary within the same minute + lap.is_mobile, + lap.session_id, + lap.device_id + from "reporting"."patients_access_logs" lap + group by + lap.patient_id, + lap.user_id, + lap.facility_id, + lap.is_mobile, + lap.session_id, + lap.device_id ) select - p.id as patient_id, + gal.patient_id, p.display_id, p.first_name, p.last_name, p.date_of_birth, - date_part('year', age(a.start_datetime, p.date_of_birth)) as age, p.sex, - coalesce(pd.primary_contact_number, pd.secondary_contact_number) as contact_number, - vil.id as village_id, - vil.name as village, - billing.id as billing_type_id, - billing.name as billing_type, - a.start_datetime as appointment_start_datetime, - a.end_datetime as appointment_end_datetime, - a.appointment_type_id, - apt.name as appointment_type, - a.status as appointment_status, - u.id as clinician_id, - u.display_name as clinician, - lg.id as location_group_id, - lg.name as location_group, - a.priority, - a.schedule_id, - a.until_date, - a.interval, - a.days_of_week, - a.frequency, - a.nth_weekday, - ac.created_by_user_id, - creator.display_name as created_by -from "reporting"."outpatient_appointments" a -join "reporting"."patients" p on p.id = a.patient_id -left join "reporting"."users" u on u.id = a.clinician_id -join "reporting"."location_groups" lg on lg.id = a.location_group_id -join "reporting"."facilities" f on f.id = lg.facility_id - and f.is_sensitive = False -left join "reporting"."patient_additional_data" pd on pd.patient_id = p.id -left join "reporting"."reference_data" billing on billing.id = pd.patient_billing_type_id -left join "reporting"."reference_data" vil on vil.id = p.village_id -left join "reporting"."reference_data" apt on apt.id = a.appointment_type_id -left join appointment_creators ac on ac.appointment_id = a.id -left join "reporting"."users" creator on creator.id = ac.created_by_user_id - - + p.village_id, + village.name as village, + gal.user_id as viewed_by_user_id, + u.display_name as viewed_by_user, + u.email as user_email, + u.role as user_role, + f.name as viewed_at_facility, + gal.date_time_viewed, + gal.facility_id, + gal.is_mobile, + gal.session_id, + gal.device_id +from grouped_access_logs gal +join "reporting"."patients" p on p.id = gal.patient_id +left join "reporting"."users" u on u.id = gal.user_id +left join "reporting"."facilities" f on f.id = gal.facility_id +left join "reporting"."reference_data" village on village.id = p.village_id ); -create or replace view "reporting"."ds__outpatient_appointments_audit" as ( - +create or replace view "reporting"."ds__patients_change_logs" as ( +with patient_edits as ( + -- Patient details edits + select + lcp.id as patient_id, + lcp.display_id, + lcp.first_name, + lcp.last_name, + lcp.date_of_birth, + lcp.sex, + lcp.village_id, + lcp.updated_by_user_id, + lcp.logged_at + from "reporting"."patients_change_logs" lcp --- Outpatient Appointments Audit Dataset --- This dataset tracks changes/modifications to outpatient appointments --- Each row represents a modification event (excludes initial creation) --- --- Included changes: --- - Status changed to 'Cancelled' (individual cancellations only) --- - Changes to: start/end datetime, clinician, location group, appointment type, priority --- --- Excluded changes: --- - Initial appointment creation (change_sequence = 1) --- - Status-only changes (unless changing to 'Cancelled') --- - Appointments automatically cancelled when their schedule was cancelled --- (i.e., bulk cancellations via "cancel this and all future appointments") --- --- change_number: starts from 1 for the first modification, increments for subsequent changes --- --- Note: schedule_id never changes on existing appointments in Tamanu. --- When a schedule is modified, old appointments are cancelled and new ones are created. + union all -with change_evaluation as ( + -- Patient additional data edits select - cl.*, - -- Determine if this change has meaningful field modifications - case - -- Status changed to Cancelled - when cl.status = 'Cancelled' and cl.prev_status is distinct from 'Cancelled' then true - -- Any non-status fields changed - when ( - cl.prev_start_datetime is distinct from cl.start_datetime - or cl.prev_end_datetime is distinct from cl.end_datetime - or cl.prev_clinician_id is distinct from cl.clinician_id - or cl.prev_location_group_id is distinct from cl.location_group_id - or cl.prev_appointment_type_id is distinct from cl.appointment_type_id - or cl.prev_is_high_priority is distinct from cl.is_high_priority - ) then true - else false - end as is_meaningful_change - from "reporting"."outpatient_appointments_change_logs" cl - left join "public"."appointment_schedules" s on s.id = cl.schedule_id - where - -- Exclude appointments that were automatically cancelled when the schedule was cancelled - -- (Keep appointments that were individually cancelled, not bulk-cancelled via schedule) - not ( - cl.status = 'Cancelled' - and s.cancelled_at_date is not null - and cl.start_datetime::date > s.cancelled_at_date::date - ) + lcpad.patient_id, + p.display_id, + p.first_name, + p.last_name, + p.date_of_birth, + p.sex, + p.village_id, + lcpad.updated_by_user_id, + lcpad.logged_at + from "reporting"."patient_additional_data_change_logs" lcpad + left join "reporting"."patients" p on p.id = lcpad.patient_id ), -numbered_changes as ( +grouped_edits as ( + select + pe.patient_id, + pe.display_id, + pe.first_name, + pe.last_name, + pe.date_of_birth, + pe.sex, + pe.village_id, + pe.updated_by_user_id, + date_trunc('minute', pe.logged_at) as edited_datetime + from patient_edits pe + group by + pe.patient_id, + pe.display_id, + pe.first_name, + pe.last_name, + pe.date_of_birth, + pe.sex, + pe.village_id, + pe.updated_by_user_id, + date_trunc('minute', pe.logged_at) +) + +select + ge.patient_id, + ge.display_id, + ge.first_name, + ge.last_name, + ge.date_of_birth, + ge.sex, + ge.village_id, + village.name as village, + ge.updated_by_user_id as edited_by_user_id, + u.display_name as edited_by_user, + u.email as user_email, + u.role as user_role, + ge.edited_datetime +from grouped_edits ge +left join "reporting"."users" u on u.id = ge.updated_by_user_id +left join "reporting"."reference_data" village on village.id = ge.village_id +); +create or replace view "reporting"."ds__patient_program_registrations" as ( +with related_conditions as ( select - ce.*, - -- Assign change number: starts from 1 for first modification - row_number() over ( - partition by ce.appointment_id - order by ce.modified_datetime - ) as change_number - from change_evaluation ce - where ce.is_meaningful_change = true - and ce.change_sequence > 1 -- Exclude initial creation + ppr.id as patient_program_registration_id, + string_agg( + prc.name, '; ' + order by pprc.datetime + ) as conditions, + array_agg( + pprc.program_registry_condition_id + order by pprc.datetime + ) as condition_ids, + string_agg( + prcc.name, '; ' + order by pprc.datetime + ) as condition_categories, + array_agg( + pprc.program_registry_condition_category_id + order by pprc.datetime + ) as condition_category_ids + from "reporting"."patient_program_registration_conditions" pprc + join "reporting"."patient_program_registrations" ppr on ppr.id = pprc.patient_program_registration_id + left join "reporting"."program_registry_conditions" prc on prc.id = pprc.program_registry_condition_id + left join "reporting"."program_registry_condition_categories" prcc on prcc.id = pprc.program_registry_condition_category_id + group by ppr.id ) select - fc.change_id, - fc.appointment_id, - fc.change_number, - -- Patient details + ppr.id as patient_program_registration_id, p.id as patient_id, p.display_id, p.first_name, p.last_name, p.date_of_birth, - -- Current appointment details - fc.start_datetime as appointment_start_datetime, - fc.end_datetime as appointment_end_datetime, - apt.name as appointment_type, - fc.appointment_type_id, - clinician.display_name as clinician, - fc.clinician_id, - lg.name as location_group, - fc.location_group_id, - case when fc.is_high_priority then 'Yes' else 'No' end as priority, - fc.schedule_id, - case - when fc.schedule_id is not null then 'Yes' - else 'No' - end as is_repeating, - -- Modification details - creator.display_name as created_by, - fc.created_by_user_id, - modifier.display_name as modified_by, - fc.modified_by_user_id, - fc.modified_datetime, - case when fc.status = 'Cancelled' then 'Yes' else 'No' end as is_cancelled, - -- Previous appointment details (only shown if different from current) - case - when fc.prev_start_datetime is distinct from fc.start_datetime - then fc.prev_start_datetime - end as prev_start_datetime, - case - when fc.prev_end_datetime is distinct from fc.end_datetime - then fc.prev_end_datetime - end as prev_end_datetime, - case - when fc.prev_appointment_type_id is distinct from fc.appointment_type_id - then prev_apt.name - end as prev_appointment_type, - case - when fc.prev_appointment_type_id is distinct from fc.appointment_type_id - then fc.prev_appointment_type_id - end as prev_appointment_type_id, - case - when fc.prev_clinician_id is distinct from fc.clinician_id - then prev_clinician.display_name - end as prev_clinician, - case - when fc.prev_clinician_id is distinct from fc.clinician_id - then fc.prev_clinician_id - end as prev_clinician_id, - case - when fc.prev_location_group_id is distinct from fc.location_group_id - then prev_lg.name - end as prev_location_group, - case - when fc.prev_location_group_id is distinct from fc.location_group_id - then fc.prev_location_group_id - end as prev_location_group_id, + p.sex, + village.id as village_id, + village.name as village, + registering_facility.id as registering_facility_id, + registering_facility.name as registering_facility, + registered_by.id as registered_by_id, + registered_by.display_name as registered_by, case - when fc.prev_is_high_priority is not null - and fc.prev_is_high_priority is distinct from fc.is_high_priority - then case when fc.prev_is_high_priority then 'Yes' else 'No' end - end as prev_priority, - -- Facility details for filtering - f.id as facility_id, - f.name as facility -from numbered_changes fc -join "reporting"."patients" p on p.id = fc.patient_id -left join "reporting"."users" clinician on clinician.id = fc.clinician_id -left join "reporting"."users" prev_clinician on prev_clinician.id = fc.prev_clinician_id -left join "reporting"."users" creator on creator.id = fc.created_by_user_id -left join "reporting"."users" modifier on modifier.id = fc.modified_by_user_id -join "reporting"."location_groups" lg on lg.id = fc.location_group_id -left join "reporting"."location_groups" prev_lg on prev_lg.id = fc.prev_location_group_id -left join "reporting"."reference_data" apt on apt.id = fc.appointment_type_id -left join "reporting"."reference_data" prev_apt on prev_apt.id = fc.prev_appointment_type_id -left join "public"."appointment_schedules" s on s.id = fc.schedule_id --- Join to facility for filtering by sensitivity -join "reporting"."facilities" f on f.id = lg.facility_id - and f.is_sensitive = False - - + when pr.currently_at_type = 'facility' then currently_at_facility.name + when pr.currently_at_type = 'village' then currently_at_village.name + end as currently_at, + pr.currently_at_type, + c.condition_ids as related_condition_ids, + c.conditions as related_conditions, + c.condition_category_ids as related_condition_category_ids, + c.condition_categories as related_condition_categories, + prcs.id as clinical_status_id, + prcs.name as clinical_status, + ppr.registration_status, + ppr.program_registry_id, + subdivision.id as subdivision_id, + subdivision.name as subdivision, + division.id as division_id, + division.name as division, + ppr.datetime as registration_datetime, + ppr.deactivated_by_id, + deactivated_by.display_name as deactivated_by, + ppr.deactivated_datetime, + pad.primary_contact_number, + pad.secondary_contact_number, + pad.emergency_contact_name, + pad.emergency_contact_number +from "reporting"."patient_program_registrations" ppr +join "reporting"."program_registries" pr on pr.id = ppr.program_registry_id +join "reporting"."patients" p on p.id = ppr.patient_id +left join "reporting"."patient_additional_data" pad on pad.patient_id = p.id +left join "reporting"."facilities" registering_facility on registering_facility.id = ppr.registering_facility_id +left join "reporting"."users" registered_by on registered_by.id = ppr.registered_by_id +left join "reporting"."reference_data" village on village.id = p.village_id +left join "reporting"."facilities" currently_at_facility on currently_at_facility.id = ppr.facility_id +left join "reporting"."reference_data" subdivision on subdivision.id = pad.subdivision_id +left join "reporting"."reference_data" division on division.id = pad.division_id +left join "reporting"."reference_data" currently_at_village on currently_at_village.id = ppr.village_id +left join related_conditions c on c.patient_program_registration_id = ppr.id +left join "reporting"."program_registry_clinical_statuses" prcs on prcs.id = ppr.clinical_status_id +left join "reporting"."users" deactivated_by on deactivated_by.id = ppr.deactivated_by_id +); +create or replace view "reporting"."ds__patient_vaccinations_upcoming" as ( +select + p.display_id, + p.first_name, + p.last_name, + p.id as patient_id, + p.date_of_birth, + date_part('year', age(p.date_of_birth)) as age, + p.sex, + village.id as village_id, + village.name as village, + pvu.due_date, + pvu.vaccine_category, + pvu.vaccine_schedules_id, + sv.label as vaccine_name, + sv.dose_label as vaccine_schedule, + pvu.status as vaccine_status +from "reporting"."patient_vaccinations_upcoming" pvu +join "reporting"."patients" p on p.id = pvu.patient_id +join "reporting"."vaccine_schedules" sv on sv.id = pvu.vaccine_schedules_id +left join "reporting"."reference_data" village on village.id = p.village_id +where p.date_of_death is null ); create or replace view "reporting"."ds__procedures" as ( @@ -4586,6 +4533,59 @@ join "reporting"."departments" d on d.id = e.department_id left join diagnoses ed on ed.encounter_id = rf.initiating_encounter_id +); +create or replace view "reporting"."ds__usage_quality_metrics_patient_details" as ( +with data as ( + select + p.id as patient_id, + pm.id as patient_merged_id, + coalesce(nullif(trim(p.first_name), ''), nullif(trim(pm.first_name), '')) as first_name, + coalesce(nullif(trim(p.last_name), ''), nullif(trim(pm.last_name), '')) as last_name, + coalesce(p.date_of_birth, pm.date_of_birth) as date_of_birth, + coalesce(nullif(trim(p.village_id), ''), nullif(trim(pm.village_id), '')) as village_id, + nullif(trim(pad.nursing_zone_id), '') as nursing_zone_id, + nullif(trim(pad.medical_area_id), '') as medical_area_id, + nullif(trim(pad.subdivision_id), '') as subdivision_id, + nullif(trim(pad.division_id), '') as division_id, + nullif(trim(pad.primary_contact_number), '') as primary_contact_number, + nullif(trim(pad.secondary_contact_number), '') as secondary_contact_number + from "reporting"."patients" p + full join "reporting"."patients_merged" pm + on pm.id = p.id + left join "reporting"."patient_additional_data" pad + on pad.patient_id = coalesce(p.id, pm.id) +) + +select + count(*) as total_patients, + count(*) filter (where first_name is null or last_name is null) as total_patients_with_incomplete_name, + count(*) filter (where date_of_birth is null) as total_patients_with_missing_dob, + count(*) filter (where date_of_birth <= '1900-01-01' or date_of_birth > now()::date) as total_patients_with_invalid_dob, + count(*) filter (where coalesce(village_id, nursing_zone_id, medical_area_id, subdivision_id, division_id) is null) as total_patients_with_missing_location, + count(*) filter (where coalesce(primary_contact_number, secondary_contact_number) is null) as total_patients_with_missing_contact, + count(patient_merged_id) as total_patients_merged +from data +); +create or replace view "reporting"."ds__usage_quality_metrics_patient_registrations" as ( +with data as ( + select + p.created_datetime as registration_date, + p.id as registration_patient_id, + pbd.patient_id as birth_patient_id, + p.date_of_birth, + age(p.created_datetime, p.date_of_birth) < interval '6 months' as age_under_6m_at_registration + from "reporting"."patients" p + left join "reporting"."patient_birth_data" pbd + on pbd.patient_id = p.id +) + +select + registration_date, + count(*) filter (where birth_patient_id is null) as total_patient_registrations, + count(birth_patient_id) as total_birth_registrations, + count(*) filter (where birth_patient_id is null and age_under_6m_at_registration) as total_incorrect_registrations_for_patient_under_6mth +from data +group by registration_date ); create or replace view "reporting"."ds__user_audit" as ( From 540ce138453035ae586d8c18dd0f21101eab5541 Mon Sep 17 00:00:00 2001 From: julianam-w <77252335+julianam-w@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:09:40 +1000 Subject: [PATCH 7/7] feat(reports): gate sensitive reports via has_sensitive_facility var (false) Ports PR #425 to this branch so sensitive (restricted-tagged) reports are not emitted by default. - dbt_project.yml: add `has_sensitive_facility: false` var - report_utils.py: exclude `restricted`-tagged nodes from generate_project_reports() and generate_reporting_schema_script() when the flag is false (read from dbt_project.yml via get_dbt_project_vars()) - README: document the flag Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 10 ++++++++++ dbt_project.yml | 1 + scripts/utils/report_utils.py | 24 +++++++++++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c7dc123..3087a662 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,16 @@ The generated assets are saved in the `compiled/` folder. The documentation is v - Import script: `compiled/reports/importReports.js` - Versioned documentation: `compiled/v{VERSION}/reporting-docs-v{VERSION}-{DEPLOYMENT}.html` +## Sensitive Facility Reporting + +Set `has_sensitive_facility: true` in the `vars` block of `dbt_project.yml` to include models +tagged `restricted` (sensitive-facility dataset views) when generating reports and the reporting +schema script. When `false` (the default), those models are silently excluded from both +`generate_project_reports()` and `generate_reporting_schema_script()`. + +The flag is read at script run-time from `dbt_project.yml` via `get_dbt_project_vars()`, not +from the dbt runtime context, so it must be set in the file before running the build scripts. + ## Generate survey models To automatically generate dbt models and documentation for surveys from database, execute the following command: ``` diff --git a/dbt_project.yml b/dbt_project.yml index 430add80..1a946e11 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -4,6 +4,7 @@ config-version: 2 profile: tamanu_source_dbt vars: + has_sensitive_facility: false language: default timezone: Australia/Sydney date_format: YYYY-MM-DD diff --git a/scripts/utils/report_utils.py b/scripts/utils/report_utils.py index f9404247..b068a557 100644 --- a/scripts/utils/report_utils.py +++ b/scripts/utils/report_utils.py @@ -52,6 +52,9 @@ def compile_report(database, sql_file, config_file, output_file): def generate_project_reports(language): """ Generates reports for the given target by compiling model nodes tagged with "reports". + Nodes tagged "restricted" (i.e. sensitive-facility dataset views) are excluded when + has_sensitive_facility is false. has_sensitive_facility is read from dbt_project.yml via get_dbt_project_vars(), + not from the dbt runtime context. Args: language (str): The language to use for report generation. @@ -62,11 +65,18 @@ def generate_project_reports(language): manifest_path = os.path.join(BASE_DIR, "target", "manifest.json") manifest = read_file(manifest_path, "json") + project_vars = get_dbt_project_vars() + has_sensitive_facility = project_vars.get("has_sensitive_facility", False) + nodes = [ key for key in manifest["nodes"] if key.startswith("model") and "reports" in manifest["nodes"][key].get("tags", []) + and ( + has_sensitive_facility + or "restricted" not in manifest["nodes"][key].get("tags", []) + ) ] if not nodes: @@ -169,7 +179,9 @@ def generate_reporting_schema_script(): The script is generated based on the model nodes that do not have the "reports" tag and are compiled in the project. Dependencies between models are resolved before generating - the views in the schema. + the views in the schema. Nodes tagged "restricted" (i.e. sensitive-facility dataset views) are excluded when + has_sensitive_facility is false. has_sensitive_facility is read from dbt_project.yml via get_dbt_project_vars(), + not from the dbt runtime context. Args: target (str): The target tag to filter models for generating views. @@ -180,11 +192,18 @@ def generate_reporting_schema_script(): manifest_path = os.path.join(BASE_DIR, "target", "manifest.json") manifest = read_file(manifest_path, "json") + project_vars = get_dbt_project_vars() + has_sensitive_facility = project_vars.get("has_sensitive_facility", False) + nodes = [ key for key in manifest["nodes"] if key.startswith("model") and "reports" not in manifest["nodes"][key].get("tags", []) + and ( + has_sensitive_facility + or "restricted" not in manifest["nodes"][key].get("tags", []) + ) ] if not nodes: @@ -194,6 +213,9 @@ def generate_reporting_schema_script(): processed = set() ordered = [] + # Assumes no non-restricted model lists a restricted model in depends_on.nodes. + # Restricted nodes filtered above are never added to `processed`, so any such + # cross-tier dependency would stall this loop and exit with the error below. while len(processed) < len(nodes): current = [ node